]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Check for a REMOVED leaf SPTE before making the SPTE
authorSean Christopherson <seanjc@google.com>
Sat, 26 Feb 2022 00:15:41 +0000 (00:15 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 15:59:09 +0000 (10:59 -0500)
commit3c5adabb2b118672e43f246ebefd37eeb7c87ca6
treeeb453b5dafdba942b205b5df8b8fce07ee8fdb37
parentfc058c7bd076d8c000d75376eda306d21dd985a9
KVM: x86/mmu: Check for a REMOVED leaf SPTE before making the SPTE

Explicitly check for a REMOVED leaf SPTE prior to attempting to map
the final SPTE when handling a TDP MMU fault.  Functionally, this is a
nop as tdp_mmu_set_spte_atomic() will eventually detect the frozen SPTE.
Pre-checking for a REMOVED SPTE is a minor optmization, but the real goal
is to allow tdp_mmu_set_spte_atomic() to have an invariant that the "old"
SPTE is never a REMOVED SPTE.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Message-Id: <20220226001546.360188-24-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c