]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86: clear CPUID output of leaf 0xd for Dom0 when xsave is disabled
authorKeir Fraser <keir@xen.org>
Fri, 20 May 2011 12:56:31 +0000 (13:56 +0100)
committerKeir Fraser <keir@xen.org>
Fri, 20 May 2011 12:56:31 +0000 (13:56 +0100)
Linux starting with 2.6.36 uses the XSAVEOPT instruction and has
certain code paths that look only at the feature bit reported through
CPUID leaf 0xd sub-leaf 1 (i.e. without qualifying the check with one
evaluating leaf 4 output). Consequently the hypervisor ought to mimic
actual hardware in clearing leaf 0xd output when not supporting xsave.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23353:a768a10d32b4
xen-unstable date:        Fri May 20 08:54:45 2011 +0100

Make this unconditional for 4.0 (no pv xsave support) and fix for domU
guests as well (this was already okay in 4.1 and later).

Signed-off-by: Keir Fraser <keir@xen.org>
tools/libxc/xc_cpuid_x86.c
xen/arch/x86/traps.c

index ebb0ef6118c1a5cc1d9148f147f5d659dff98d0a..f275b9e9e8cffd31f8d3f6be8cc23d29d99ce2e9 100644 (file)
@@ -345,6 +345,7 @@ static void xc_cpuid_pv_policy(
         clear_bit(X86_FEATURE_NODEID_MSR, regs[2]);
         clear_bit(X86_FEATURE_TOPOEXT, regs[2]);
         break;
+    case 0xd: /* XSAVE */
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
     case 0x8000000a: /* SVM revision and features */
index 53c240c69ef7ac0a5f5082aac6429fb322888e0b..f56b02680f87f1ab82fb7eed7b1cf4e5d1b8367f 100644 (file)
@@ -817,6 +817,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_NODEID_MSR % 32, &c);
         __clear_bit(X86_FEATURE_TOPOEXT % 32, &c);
         break;
+    case 0xd: /* XSAVE */
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
     case 0x8000000a: /* SVM revision and features */