Commit e693d71b authored by Eli Collins's avatar Eli Collins Committed by Avi Kivity

KVM: VMX: Clear CR4.VMXE in hardware_disable

Clear CR4.VMXE in hardware_disable. There's no reason to leave it set
after doing a VMXOFF.

VMware Workstation 6.5 checks CR4.VMXE as a proxy for whether the CPU is
in VMX mode, so leaving VMXE set means we'll refuse to power on. With this
change the user can power on after unloading the kvm-intel module. I
tested on kvm-67 and kvm-69.
Signed-off-by: default avatarEli Collins <ecollins@vmware.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 2f599714
...@@ -1036,6 +1036,7 @@ static void hardware_enable(void *garbage) ...@@ -1036,6 +1036,7 @@ static void hardware_enable(void *garbage)
static void hardware_disable(void *garbage) static void hardware_disable(void *garbage)
{ {
asm volatile (ASM_VMX_VMXOFF : : : "cc"); 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, static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment