KVM: nVMX: KVM needs to unset "unrestricted guest" VM-execution control in vmcs02...
authorKrish Sadhukhan <krish.sadhukhan@oracle.com>
Mon, 21 Sep 2020 08:10:25 +0000 (08:10 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:18 +0000 (07:57 -0400)
commitbddd82d19e2e580b11e62f7a1d86ee52d8e437b6
tree57e9b8a1de95aa67a3bf696327bfefb8beedf7d2
parentcc5b54dd58d0420c1b1f1e9b29f53327076e9355
KVM: nVMX: KVM needs to unset "unrestricted guest" VM-execution control in vmcs02 if vmcs12 doesn't set it

Currently, prepare_vmcs02_early() does not check if the "unrestricted guest"
VM-execution control in vmcs12 is turned off and leaves the corresponding
bit on in vmcs02. Due to this setting, vmentry checks which are supposed to
render the nested guest state as invalid when this VM-execution control is
not set, are passing in hardware.

This patch turns off the "unrestricted guest" VM-execution control in vmcs02
if vmcs12 has turned it off.

Suggested-by: Jim Mattson <jmattson@google.com>
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Message-Id: <20200921081027.23047-2-krish.sadhukhan@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h