KVM: nVMX: Invoke ept_save_pdptrs() if and only if PAE paging is enabled
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 15 Apr 2020 20:34:50 +0000 (13:34 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Apr 2020 13:13:06 +0000 (09:13 -0400)
commit9932b49e5abef0218254d15b8278e3dbee5ceea3
tree1fd2a3cae927158f857660b31856e3a9cbaab90f
parent4dcefa312a6c1cc2aa2dd8a9ba76d97d63b3bd17
KVM: nVMX: Invoke ept_save_pdptrs() if and only if PAE paging is enabled

Invoke ept_save_pdptrs() when restoring L1's host state on a "late"
VM-Fail if and only if PAE paging is enabled.  This saves a CALL in the
common case where L1 is a 64-bit host, and avoids incorrectly marking
the PDPTRs as dirty.

WARN if ept_save_pdptrs() is called with PAE disabled now that the
nested usage pre-checks is_pae_paging().  Barring a bug in KVM's MMU,
attempting to read the PDPTRs with PAE disabled is now impossible.

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