44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
|
# HG changeset patch
|
||
|
# User Keir Fraser <keir@xen.org>
|
||
|
# Date 1291116848 0
|
||
|
# Node ID 8420b82c22c2cad54860ffdbe8bcec21c65c86be
|
||
|
# Parent d281061e6ec06bbbf8e2b0fadbeb9d1a04bc32e2
|
||
|
x86 hvm: Do not overwrite boot-cpu capability data on VMX/SVM startup.
|
||
|
|
||
|
Apparently required back in the earliest days of Xen, we now properly
|
||
|
initialise CPU capabilities early during bootstrap. Re-writing
|
||
|
capability data later now causes problems if specific features have
|
||
|
been deliberately masked out.
|
||
|
|
||
|
Thanks to Weidong Han at Intel for finding such a bug where XSAVE
|
||
|
feature is masked out by default, but then erroneously written back
|
||
|
during VMX initialisation. This would cause memory corruption problems
|
||
|
during boot for XSAVE-capable systems.
|
||
|
|
||
|
Signed-off-by: Keir Fraser <keir@xen.org>
|
||
|
|
||
|
--- a/xen/arch/x86/hvm/svm/svm.c
|
||
|
+++ b/xen/arch/x86/hvm/svm/svm.c
|
||
|
@@ -915,9 +915,6 @@ void start_svm(struct cpuinfo_x86 *c)
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
- /* Xen does not fill x86_capability words except 0. */
|
||
|
- boot_cpu_data.x86_capability[5] = cpuid_ecx(0x80000001);
|
||
|
-
|
||
|
if ( !test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability) )
|
||
|
return;
|
||
|
|
||
|
--- a/xen/arch/x86/hvm/vmx/vmx.c
|
||
|
+++ b/xen/arch/x86/hvm/vmx/vmx.c
|
||
|
@@ -1433,9 +1433,6 @@ void start_vmx(void)
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
- /* Xen does not fill x86_capability words except 0. */
|
||
|
- boot_cpu_data.x86_capability[4] = cpuid_ecx(1);
|
||
|
-
|
||
|
if ( !test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability) )
|
||
|
return;
|
||
|
|