• David Hildenbrand's avatar
    KVM: VMX: drop vmm_exclusive module parameter · fe0e80be
    David Hildenbrand authored
    vmm_exclusive=0 leads to KVM setting X86_CR4_VMXE always and calling
    VMXON only when the vcpu is loaded. X86_CR4_VMXE is used as an
    indication in cpu_emergency_vmxoff() (called on kdump) if VMXOFF has to be
    called. This is obviously not the case if both are used independtly.
    Calling VMXOFF without a previous VMXON will result in an exception.
    
    In addition, X86_CR4_VMXE is used as a mean to test if VMX is already in
    use by another VMM in hardware_enable(). So there can't really be
    co-existance. If the other VMM is prepared for co-existance and does a
    similar check, only one VMM can exist. If the other VMM is not prepared
    and blindly sets/clears X86_CR4_VMXE, we will get inconsistencies with
    X86_CR4_VMXE.
    
    As we also had bug reports related to clearing of vmcs with vmm_exclusive=0
    this seems to be pretty much untested. So let's better drop it.
    
    While at it, directly move setting/clearing X86_CR4_VMXE into
    kvm_cpu_vmxon/off.
    Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    fe0e80be
vmx.c 327 KB