Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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-kvmAssignee: Eduardo Habkost <ehabkost>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.4CC: acathrow, areis, bsarathy, dyasny, juzhang, michen, mkenneth, shuang, virt-maint
Target Milestone: rcKeywords: 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 Flags
guest panic snapshot none

Description FuXiangChun 2012-12-17 15:19:06 UTC
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. 

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 -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:

Comment 1 FuXiangChun 2012-12-17 15:21:29 UTC
Created attachment 664929 [details]
guest panic snapshot

Comment 3 Eduardo Habkost 2012-12-18 02:59:21 UTC
(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:

Comment 4 FuXiangChun 2012-12-18 03:38:07 UTC
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.

Comment 5 Eduardo Habkost 2012-12-18 12:48:46 UTC
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.

Comment 6 FuXiangChun 2012-12-19 07:43:24 UTC
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?

Comment 7 Suqin Huang 2012-12-19 08:29:26 UTC
(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"));
            }

Comment 8 Eduardo Habkost 2012-12-19 18:30:51 UTC
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.