[PATCH] KVM: VMX: Clear CR4.VMXE in hardware_disable

Eli Collins ecollins at vmware.com
Thu Sep 11 00:43:08 UTC 2008


Hey guys. I was wondering if you would accept a patch for 8.04. It's a KVM 
fix that allows users to power on VMs with VMware 
Workstation/Player/Server after unloading the kvm-intel module. It's a 
one-liner and was accpeted into 2.6.26.

Thanks,
Eli

http://www.mail-archive.com/kvm-commits@vger.kernel.org/msg00083.html

http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.26

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e693d71b46e64536581bf4884434fc1b8797e96f

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 26c4f02..7403707 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1036,6 +1036,7 @@ static void hardware_enable(void *garbage)
 static void hardware_disable(void *garbage)
 {
        asm volatile (ASM_VMX_VMXOFF : : : "cc");
+       write_cr4(read_cr4() & ~X86_CR4_VMXE);
 }
 
 static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,





More information about the kernel-team mailing list