]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86: Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allow
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 17 Mar 2009 14:50:26 +0000 (14:50 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 17 Mar 2009 14:50:26 +0000 (14:50 +0000)
guests to use it (by setting cr4.OSXSAVE).

This prevents crashes in pvops kernels, as new versions of Linux
try to use this feature.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   19288:9ed53e60211954c2a04dfdcae207819276b2cca0
xen-unstable date:        Mon Mar 09 08:54:19 2009 +0000

tools/libxc/xc_cpufeature.h
tools/libxc/xc_cpuid_x86.c
xen/arch/x86/traps.c
xen/include/asm-x86/cpufeature.h

index 047a6c9fc797d1d960ece597da45a3f8dca9a4f1..b5ab901c6846fcba508492d4c87cee497a868074 100644 (file)
@@ -83,6 +83,7 @@
 #define X86_FEATURE_SSE4_1     (4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2     (4*32+20) /* Streaming SIMD Extensions 4.2 */
 #define X86_FEATURE_POPCNT     (4*32+23) /* POPCNT instruction */
+#define X86_FEATURE_XSAVE      (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
 #define X86_FEATURE_HYPERVISOR (4*32+31) /* Running under some hypervisor */
 
 /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
index 304a414505ffa11dff3d201674cacf4d58645ca3..f4ceddbab6f9eab2b677b52ad04152705173527d 100644 (file)
@@ -285,6 +285,7 @@ static void xc_cpuid_pv_policy(
         clear_bit(X86_FEATURE_XTPR, regs[2]);
         clear_bit(X86_FEATURE_PDCM, regs[2]);
         clear_bit(X86_FEATURE_DCA, regs[2]);
+        clear_bit(X86_FEATURE_XSAVE, regs[2]);
         set_bit(X86_FEATURE_HYPERVISOR, regs[2]);
         break;
     case 0x80000001:
index e2722eb6a4e5a4f3771cb322c68256e589ea9e8f..854b55d3a5b08607187a3705a44bcc30f3458a57 100644 (file)
@@ -742,6 +742,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_XTPR % 32, &c);
         __clear_bit(X86_FEATURE_PDCM % 32, &c);
         __clear_bit(X86_FEATURE_DCA % 32, &c);
+        __clear_bit(X86_FEATURE_XSAVE % 32, &c);
         __set_bit(X86_FEATURE_HYPERVISOR % 32, &c);
         break;
     case 0x80000001:
index 481236c833b8a7b38ab1e37f2ab69877e5e364e8..5e2acab7d8e7fd795cb73a324eb51ea176307bfc 100644 (file)
@@ -94,6 +94,7 @@
 #define X86_FEATURE_SSE4_2     (4*32+20) /* Streaming SIMD Extensions 4.2 */
 #define X86_FEATURE_X2APIC     (4*32+21) /* Extended xAPIC */
 #define X86_FEATURE_POPCNT     (4*32+23) /* POPCNT instruction */
+#define X86_FEATURE_XSAVE      (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
 #define X86_FEATURE_HYPERVISOR (4*32+31) /* Running under some hypervisor */
 
 /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */