KVM: nVMX: WARN on attempt to switch the currently loaded VMCS
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 18:44:52 +0000 (11:44 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:49 +0000 (07:57 -0400)
commit138534a810aa6aa3a6f27ac36ac52c0c685859a1
treea86f0f6bda7b2fbdf0c8d397cd37732420c8807d
parentebec153a056108ca7818caad549d3ad7c0f2369d
KVM: nVMX: WARN on attempt to switch the currently loaded VMCS

WARN if KVM attempts to switch to the currently loaded VMCS.  Now that
nested_vmx_free_vcpu() doesn't blindly call vmx_switch_vmcs(), all paths
that lead to vmx_switch_vmcs() are implicitly guarded by guest vs. host
mode, e.g. KVM should never emulate VMX instructions when guest mode is
active, and nested_vmx_vmexit() should never be called when host mode is
active.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923184452.980-8-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c