Bug 745717
Summary: | SEP flag is not exposed to guest, but is defined on CPU model config | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Chao Yang <chayang> |
Component: | qemu-kvm | Assignee: | Eduardo Habkost <ehabkost> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | CC: | acathrow, areis, juzhang, michen, mkenneth, shuang, virt-maint, xfu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-0.12.1.2-2.320.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 07:31:22 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 833129 |
Description
Chao Yang
2011-10-13 07:48:58 UTC
#define X86_FEATURE_SEP (0*32+11) /* SYSENTER/SYSEXIT */ the cpuid of SEP is located in 0x00000001 EDX[11] guest : eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80a02001 edx = 178bf3fd host : eax in: 0x00000001, eax = 00600f10 ebx = 07080800 ecx = 1e98220b edx = 178bfbff Tested on same host with G2 and G1 by: -cpu Opteron_G2/G1,check -smp 8,cores=2,sockets=2,threads=2: ---> for G2: output of x86info in guest: eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80202001 edx = 178bf3fd eax in: 0x80000001, eax = 00000f61 ebx = 00000000 ecx = 00000003 edx = 2193fbfd Feature flags: fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflsh mmx fxsr sse sse2 ht sse3 cmpxchg16b [1:ecx:21] [1:ecx:31] Extended feature flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 nx mmx fxsr lm lahf/sahf CmpLegacy feature_edx: 178bf3fd ^ 078bfbfd -> 10000e00(10000000 for ht) feature_ecx: 80202001 ^ 00202001 -> 80000000(80000000 for hypervisor), this one is good. extfeature_edx: 2193fbfd ^ 2993fbfd -> 08000000 extfeature_ecx: 00000003 ^ 00000005 -> 00000006(00000002 for cmp_legacy) ---> for G1: output of x86info in guest: eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80200001 edx = 178bf3fd eax in: 0x80000001, eax = 00000f61 ebx = 00000000 ecx = 00000002 edx = 2193fbfd Feature flags: fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflsh mmx fxsr sse sse2 ht sse3 [1:ecx:21] [1:ecx:31] Extended feature flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 nx mmx fxsr lm CmpLegacy feature_edx: 178bf3fd ^ 078bfbfd -> 10000e00(10000000 for ht) feature_ecx: 80200001 ^ 00200001 -> 80000000(80000000 for hypervisor), this one is good. extfeature_edx: 2193fbfd ^ 2193fbfd -> 00000000 , this one is good. extfeature_ecx: 00000002 ^ 00000000 -> 00000002(00000002 for cmp_legacy), this one is good. verify this issue with qemu-kvm-0.12.1.2-2.331.el6.x86_64 and kernel 2.6.32-337.el6.x86_64 SEP flag is still not exposed to guest. check result inside guest 1. not find it from cpuinfo 2. register bit is 0 (location, Function01,EDX[11]) eax in: 0x00000001, eax = 00000f61 ebx = 01020800 ecx = 80a02001 edx = 178bf3fd so, this bug is not fixed. additional: Bug 821741 will re-enable this flag. The bug is fixed in the other side of the equation. Not exposing the flag while it is in the CPU model config (or in the CPU model definition in the C code) is wrong, because it risks breaking migration. This bug just changes the CPU model to _not_ include the SEP flag anymore (so migration keeps working even after SEP support is enabled in the host kernel. So verification of this bug consists of: - Checking if all CPU models in target-i386/cpuid.c lack the SEP flag - Making sure the SEP flag doesn't change when migrating from a host without SEP to a host with SEP. verify this issue with qemu-kvm-0.12.1.2-2.331.el6.x86_64 verify to steps: 1. check source code in target-i386/cpuid.c result: SEP flag is defined in this. does it work as design? static const char *feature_name[] = { "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, NULL, "ds" /* Intel dts */, "acpi", "mmx", "fxsr", "sse", "sse2", "ss", "ht" /* Intel htt */, "tm", "ia64", "pbe", }; 2.do migration from without SEP to a host with SEP one host kernel 2.6.32-310.el6.x86_64(not support sep flag), another host kernel 2.6.32-337.el6.x86_64(support sep flag) cli /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 2G -smp 8,sockets=2,cores=2,threads=2,maxcpus=10 -usb -device usb-tablet,id=input0 -name openvsiwtch -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive file=/root/openvswitch/mnt/rhel-6.4-2.qcow2,if=none,id=drive-scsi0-0-0,if=none,media=disk,cache=none,format=qcow2,werror=stop,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -device scsi-hd,ver=mike,bus=scsi0.0,drive=drive-scsi0-0-0,id=scsi1 -spice port=5912,disable-ticketing -vga qxl -monitor stdio 2. do migration migration is successful, and host and guest work well. (In reply to comment #14) > verify this issue with qemu-kvm-0.12.1.2-2.331.el6.x86_64 > > verify to steps: > 1. check source code in target-i386/cpuid.c > result: SEP flag is defined in this. does it work as design? > > static const char *feature_name[] = { > "fpu", "vme", "de", "pse", > "tsc", "msr", "pae", "mce", > "cx8", "apic", NULL, "sep", > "mtrr", "pge", "mca", "cmov", > "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, > NULL, "ds" /* Intel dts */, "acpi", "mmx", > "fxsr", "sse", "sse2", "ss", > "ht" /* Intel htt */, "tm", "ia64", "pbe", > }; Its name is defined, but CPUID_SEP should not be present on the models on the builtin_x86_defs array. > > 2.do migration from without SEP to a host with SEP > one host kernel 2.6.32-310.el6.x86_64(not support sep flag), another host > kernel 2.6.32-337.el6.x86_64(support sep flag) > cli > /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 2G -smp > 8,sockets=2,cores=2,threads=2,maxcpus=10 -usb -device usb-tablet,id=input0 > -name openvsiwtch -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive > file=/root/openvswitch/mnt/rhel-6.4-2.qcow2,if=none,id=drive-scsi0-0-0, > if=none,media=disk,cache=none,format=qcow2,werror=stop,aio=native -device > virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -device > scsi-hd,ver=mike,bus=scsi0.0,drive=drive-scsi0-0-0,id=scsi1 -spice > port=5912,disable-ticketing -vga qxl -monitor stdio > > 2. do migration > migration is successful, and host and guest work well. Thanks. It looks good. Please also check if the SEP flag is _not_ present on x86info before and after migration. eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80a02001 edx = 178bf3fd eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80a02001 edx = 178bf3fd(In reply to comment #15) > (In reply to comment #14) > > verify this issue with qemu-kvm-0.12.1.2-2.331.el6.x86_64 > > > > verify to steps: > > 1. check source code in target-i386/cpuid.c > > result: SEP flag is defined in this. does it work as design? > > > > static const char *feature_name[] = { > > "fpu", "vme", "de", "pse", > > "tsc", "msr", "pae", "mce", > > "cx8", "apic", NULL, "sep", > > "mtrr", "pge", "mca", "cmov", > > "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, > > NULL, "ds" /* Intel dts */, "acpi", "mmx", > > "fxsr", "sse", "sse2", "ss", > > "ht" /* Intel htt */, "tm", "ia64", "pbe", > > }; > > Its name is defined, but CPUID_SEP should not be present on the models on > the builtin_x86_defs array. Yes,CPUID_SEP don't present on the Opteron_G3 models. > > > > > > 2.do migration from without SEP to a host with SEP > > one host kernel 2.6.32-310.el6.x86_64(not support sep flag), another host > > kernel 2.6.32-337.el6.x86_64(support sep flag) > > cli > > /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 2G -smp > > 8,sockets=2,cores=2,threads=2,maxcpus=10 -usb -device usb-tablet,id=input0 > > -name openvsiwtch -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive > > file=/root/openvswitch/mnt/rhel-6.4-2.qcow2,if=none,id=drive-scsi0-0-0, > > if=none,media=disk,cache=none,format=qcow2,werror=stop,aio=native -device > > virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -device > > scsi-hd,ver=mike,bus=scsi0.0,drive=drive-scsi0-0-0,id=scsi1 -spice > > port=5912,disable-ticketing -vga qxl -monitor stdio > > > > 2. do migration > > migration is successful, and host and guest work well. > > Thanks. It looks good. Please also check if the SEP flag is _not_ present on > x86info before and after migration. Will get the same result before and after migration inside guest 1.x86info -a -f eax in: 0x00000001, eax = 00000f61 ebx = 00040800 ecx = 80a02001 edx = 178bf3fd Extended feature flags: fpu de pse tsc msr pae mce cx8 apic sep ..... 2. not find SEP flag in /proc/cpuinfo Summary. 1.register bit is 0 (location, Function01,EDX[11]) and not find SEP flag /proc/cpuinfo inside guest. 2. can find SEP flag in Extended feature flags via x86info tool(I think x86info tool maybe inaccurate) (In reply to comment #16) > eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80a02001 edx = > 178bf3fd > > eax in: 0x00000001, eax = 00000f61 ebx = 07040800 ecx = 80a02001 edx = > 178bf3fd(In reply to comment #15) > > (In reply to comment #14) > > > verify this issue with qemu-kvm-0.12.1.2-2.331.el6.x86_64 > > > > > > verify to steps: > > > 1. check source code in target-i386/cpuid.c > > > result: SEP flag is defined in this. does it work as design? > > > > > > static const char *feature_name[] = { > > > "fpu", "vme", "de", "pse", > > > "tsc", "msr", "pae", "mce", > > > "cx8", "apic", NULL, "sep", > > > "mtrr", "pge", "mca", "cmov", > > > "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, > > > NULL, "ds" /* Intel dts */, "acpi", "mmx", > > > "fxsr", "sse", "sse2", "ss", > > > "ht" /* Intel htt */, "tm", "ia64", "pbe", > > > }; > > > > Its name is defined, but CPUID_SEP should not be present on the models on > > the builtin_x86_defs array. > > Yes,CPUID_SEP don't present on the Opteron_G3 models. Good. > > > > > > > > > > 2.do migration from without SEP to a host with SEP > > > one host kernel 2.6.32-310.el6.x86_64(not support sep flag), another host > > > kernel 2.6.32-337.el6.x86_64(support sep flag) > > > cli > > > /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 2G -smp > > > 8,sockets=2,cores=2,threads=2,maxcpus=10 -usb -device usb-tablet,id=input0 > > > -name openvsiwtch -uuid 9ed5a909-5c33-4bc0-960c-29ecfc61a502 -drive > > > file=/root/openvswitch/mnt/rhel-6.4-2.qcow2,if=none,id=drive-scsi0-0-0, > > > if=none,media=disk,cache=none,format=qcow2,werror=stop,aio=native -device > > > virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -device > > > scsi-hd,ver=mike,bus=scsi0.0,drive=drive-scsi0-0-0,id=scsi1 -spice > > > port=5912,disable-ticketing -vga qxl -monitor stdio > > > > > > 2. do migration > > > migration is successful, and host and guest work well. > > > > Thanks. It looks good. Please also check if the SEP flag is _not_ present on > > x86info before and after migration. > > Will get the same result before and after migration inside guest > 1.x86info -a -f > eax in: 0x00000001, eax = 00000f61 ebx = 00040800 ecx = 80a02001 edx = > 178bf3fd That's good. SEP is really disabled, then. > > Extended feature flags: > fpu de pse tsc msr pae mce cx8 apic sep ..... > > 2. not find SEP flag in /proc/cpuinfo > > Summary. > 1.register bit is 0 (location, Function01,EDX[11]) and not find SEP flag > /proc/cpuinfo inside guest. True. That's the expected result. > > 2. can find SEP flag in Extended feature flags via x86info tool(I think > x86info tool maybe inaccurate) That's really weird. I had to check the x86info source code to understand it. It is on the "extended feature flags" section, that's for CPUID leaf 0x80000001. The actual flag on 0x80000001.EDX[11] is "SysCallSysRet" (and it was supposed to be enabled), but x86info displays it as "sep". So it's a x86info bug. According to comment 12 ~comment 17, I think this bug is fixed. Eduardo, Just tested Opteron_G5 on Seoul host, I found CPUID_SEP flag is defined on Opteron_G5 model in target-i386/cpuid.c, and it can be exposed to guest. I'am not sure if SEP flag should be defined and exposed to guest for G5? Since Bug 821741( will re-enable this flag) is still new status. (In reply to comment #19) > Eduardo, > Just tested Opteron_G5 on Seoul host, I found CPUID_SEP flag is defined > on Opteron_G5 model in target-i386/cpuid.c, and it can be exposed to guest. > I'am not sure if SEP flag should be defined and exposed to guest for G5? > Since Bug 821741( will re-enable this flag) is still new status. Good catch, thanks for spotting it! I was going to say this is a real bug. But: as bug 821463 is now fixed in the kernel (so SEP can be enabled) and there's no Opteron_G5 on RHEL-6.3, there are no RHEL-6.3<->RHEL-6.4 compatibility issues to be taken care of, on Opteron_G5, so we can safely enable SEP on Opteron_G5 since the beginning. So, please also check if the SEP flag is enabled on guest when using Opteron_G5 (before and after migration), but only using the rhel6.4.0 machine-type. Boot rhel6.4 guest with Opteron_G5 and rhel6.4.0 machine-type, then do migration. result: The SEP flag is always enabled on guest(before and after migration). Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0527.html |