Skip to contentSkip to conversation

kvm: fix detection of BIOS disabling VMX

PATCH Applied Joseph Cihula 2 participants 4 messages Feb 8, 2011 – Feb 20, 2011 KVM

lore
Share & tools
lore
#0 lore raw

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)

Applied
#1 lore raw
Quoted 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
#2 lore raw
Quoted 8 lines

From: Avi Kivity [mailto:[email protected]]
Sent: Thursday, February 10, 2011 2:02 AM

Quoted 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

#3 lore raw
Quoted 11 lines · Joseph
Quoted 8 lines

From: Avi Kivity [mailto:[email protected]]
Sent: Thursday, February 10, 2011 2:02 AM

Quoted 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