[PATCH] kvm: fix detection of BIOS disabling VMX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes the logic used to detect whether BIOS has disabled VMX.

Signed-off-by:  Joseph Cihula <joseph.cihula@xxxxxxxxx>


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)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux