]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/mmu: Bail from fast_page_fault() if SPTE is not shadow-present
authorSean Christopherson <seanjc@google.com>
Thu, 25 Feb 2021 20:47:28 +0000 (12:47 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Feb 2021 13:36:11 +0000 (08:36 -0500)
commitafc7b56a36a7c422c74fc772e92bf9cffd933a89
tree8c97c6c06c0fdb1551f5eb165674ef0afbc75eae
parent6125114d41d7b66a817b1beb387abd00767ef799
KVM: x86/mmu: Bail from fast_page_fault() if SPTE is not shadow-present

Bail from fast_page_fault() if the SPTE is not a shadow-present SPTE.
Functionally, this is not strictly necessary as the !is_access_allowed()
check will eventually reject the fast path, but an early check on
shadow-present skips unnecessary checks and will allow a future patch to
tweak the A/D status auditing to warn if KVM attempts to query A/D bits
without first ensuring the SPTE is a shadow-present SPTE.

Note, is_shadow_present_pte() is quite expensive at this time, i.e. this
might be a net negative in the short term.  A future patch will optimize
is_shadow_present_pte() to a single AND operation and remedy the issue.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210225204749.1512652-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c