kvm: fix detection of BIOS disabling VMX
PATCH 1/1 kvm: fix detection of BIOS disabling VMX
This patch fixes the logic used to detect whether BIOS has disabled VMX.
diff -uprN linux-2.6.38-rc3/arch/x86/kvm/vmx.c linux-2.6.38-rc3-patched/arch/x86/kvm/vmx.c
--- linux-2.6.38-rc3/arch/x86/kvm/vmx.c 2011-01-31 19:05:49.000000000 -0800
+++ linux-2.6.38-rc3-patched/arch/x86/kvm/vmx.c 2011-02-08
09:21:22.639995662 -0800
@@ -1333,19 +1333,25 @@ static __init int vmx_disabled_by_bios(v
rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
if (msr & FEATURE_CONTROL_LOCKED) {
+ /* launched w/ TXT and VMX disabled */
if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
&& tboot_enabled())
return 1;
+ /* launched w/o TXT and VMX only enabled w/ TXT */
if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
+ && (msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
&& !tboot_enabled()) { printk(KERN_WARNING "kvm: disable TXT in the BIOS or "
- " activate TXT before enabling KVM\n");
+ "activate TXT before enabling KVM\n");
return 1;
}
+ /* launched w/o TXT and VMX disabled */
+ if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
+ && !tboot_enabled())
+ return 1;
}
return 0;
- /* locked but not enabled */
}
static void kvm_cpu_vmxon(u64 addr)
Avi Kivity
AppliedQuoted 2 lines · Joseph Cihula
This patch fixes the logic used to detect whether BIOS has disabled VMX.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 8 lines
From: Avi Kivity [mailto:[email protected]]
Sent: Thursday, February 10, 2011 2:02 AMQuoted 2 lines · Joseph Cihula
This patch fixes the logic used to detect whether BIOS has disabled VMX.
Applied, thanks.
Will you request this be taken by the -stable kernel?
Joe
Quoted 11 lines · Joseph
Quoted 8 lines
From: Avi Kivity [mailto:[email protected]]
Sent: Thursday, February 10, 2011 2:02 AMQuoted 2 lines · Joseph Cihula
This patch fixes the logic used to detect whether BIOS has disabled VMX.
Applied, thanks.
Will you request this be taken by the -stable kernel?
Depends. What circumstances are required for this to trigger?
Signature · 1 line
error compiling committee.c: too many arguments to function