Bug 887906
| Summary: | Guest panic when booting rhel6 guest with -cpu Haswell on non-Haswell host | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | FuXiangChun <xfu> | ||||
| Component: | qemu-kvm | Assignee: | Eduardo Habkost <ehabkost> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 6.4 | CC: | acathrow, areis, bsarathy, dyasny, juzhang, michen, mkenneth, shuang, virt-maint | ||||
| Target Milestone: | rc | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-12-18 12:48:46 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
FuXiangChun
2012-12-17 15:19:06 UTC
Created attachment 664929 [details]
guest panic snapshot
(In reply to comment #0) > Description of problem: > Boot rhel6 guest with '-cpu Haswell' on SandyBridge or AMD host, guest will > panic. windows guest can boot successful. I attached a guest snapshot. guest > serial console don't print any useful infomation. "-cpu Haswell" is not supported on SandyBridge hosts. libvirt should even refuse to start using that configuration because of missing host CPU features. qemu-kvm should also refuse to start it if using the "enforce" option. > > Version-Release number of selected component (if applicable): > # uname -r > 2.6.32-347.el6.x86_64 > qemu-kvm-rhev-0.12.1.2-2.346.el6.x86_64 > > How reproducible: > 100% > > Steps to Reproduce: > 1.boot rhel6.4 guest on SandyBridge host > /usr/libexec/qemu-kvm -name 'vm1' -nodefaults -monitor stdio -device > ich9-usb-uhci1,id=usb1,bus=pci.0,addr=0x4 -drive > file=/home/RHEL-Server-6.4-64-virtio.qcow2,index=0,if=none,id=drive-virtio- > disk1,media=disk,cache=none,boot=off,snapshot=off,format=qcow2,aio=native > -device virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1 -m 500G -smp > 48,cores=4,threads=4,sockets=3 -cpu Opteron_G4 Why "-cpu Opteron_G4" above? > -rtc > base=localtime,clock=host,driftfix=slew -M rhel6.4.0 -boot > order=cdn,once=d,menu=off -enable-kvm -netdev > tap,id=hostnet0,script=/etc/qemu-ifup,vhost=on -device > e1000,netdev=hostnet0,id=virtio-net-pci0,mac=00:24:21:7F:94:AD -device sga > -chardev socket,id=serial0,path=/var/test1,server,nowait -device > isa-serial,chardev=serial0 -spice disable-ticketing,port=5912 -vga qxl > > 2. > 3. > > Actual results: > guest panic > > Expected results: > > > Additional info: Eduardo,
My wrong, it should '-cpu Haswell' not 'Opteron_G4' in command line. since windows guest don't hit this issue. and qemu should haven't any warning message or prevent rhel6 guest from booting without enforce option. shouldn't lead to guest panic. so I reopen it with low and low.
Windows guests work only by luck, with this configuration. You can easily get a warning by using the "check" option, but I recommend using "enforce" instead, to make sure you never get an invalid CPUID configuration as result. I agree it is a usability problem, but qemu-kvm is a low-level tool and it's libvirt that should make sure an invalid configuration like this one is never used. I tested two scenarios about this issue with libvirt 1. Boot guest with SandyBridge cpu model on Sandybridge host. Guest boot successfully. 2. Boot guest with Haswell cpu model on Sandybridge host as well. Guest boot fail.(error message: Unable to complete install:'unsupported configuration:guest and host CPU are not compatible: Host Cpu does not provide required features:rtm,invpcid,erms,bmi2,smep,avx2,hle,bmi1,fsgsbase,movbe,fma') For scenario 2, There is a question, I don't find 'enforce' option from the command line in the background when using libvirt to boot guest. Do libvirt call 'enforce' option?, If not, How does it prevent guest booting? (In reply to comment #6) > I tested two scenarios about this issue with libvirt > > 1. Boot guest with SandyBridge cpu model on Sandybridge host. > Guest boot successfully. > > 2. Boot guest with Haswell cpu model on Sandybridge host as well. > Guest boot fail.(error message: Unable to complete install:'unsupported > configuration:guest and host CPU are not compatible: Host Cpu does not > provide required > features:rtm,invpcid,erms,bmi2,smep,avx2,hle,bmi1,fsgsbase,movbe,fma') > > For scenario 2, There is a question, I don't find 'enforce' option from the > command line in the background when using libvirt to boot guest. Do libvirt > call 'enforce' option?, If not, How does it prevent guest booting? /usr/src/debug/libvirt-0.10.2/src/qemu/qemu_command.c cmp = cpuGuestData(host, cpu, &data, &compare_msg); switch (cmp) { case VIR_CPU_COMPARE_INCOMPATIBLE: if (compare_msg) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("guest and host CPU are not compatible: %s"), compare_msg); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("guest CPU is not compatible with host CPU")); } libvirt doesn't use the "enforce" option, but it has its own CPUID-checking code (shown above in comment #7). In the future it should use "enforce" as the current method of CPUID feature checking isn't enough for some cases. But the necessary interfaces to allow libvirt to do that while keeping CPUID-check error reporting accurate are still in development in upstream QEMU. |