Mailing List Archive

Prevent new potential features from being exposed to the
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID c9929c7c63f6b100223fd8185b0534de747fdf8c
# Parent 25d0ba51338eb8dd6446cc2083ee34d89a6f6fcf
Prevent new potential features from being exposed to the
guests when not virtualized properly. Guests can attempt to set the
control registers, etc. (and get #GP and panic) if they are aware of the
new feature and the cpuid says it's available.

Signed-off-by: <jun.nakajima@intel.com>

diff -r 25d0ba51338e -r c9929c7c63f6 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c Wed Dec 14 12:52:02 2005
+++ b/xen/arch/x86/vmx.c Wed Dec 14 18:35:38 2005
@@ -503,6 +503,8 @@
__vm_clear_bit(EXCEPTION_BITMAP, EXCEPTION_BITMAP_NM);
}

+/* Reserved bits: [31:15], [12:11], [9], [6], [2:1] */
+#define VMX_VCPU_CPUID_L1_RESERVED 0xffff9a46

static void vmx_vmexit_do_cpuid(unsigned long input, struct cpu_user_regs *regs)
{
@@ -537,6 +539,7 @@
}

/* Unsupportable for virtualised CPUs. */
+ ecx &= ~VMX_VCPU_CPUID_L1_RESERVED; /* mask off reserved bits */
clear_bit(X86_FEATURE_VMXE & 31, &ecx);
clear_bit(X86_FEATURE_MWAIT & 31, &ecx);
}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog