KVM: x86/mmu: Add helper to convert SPTE value to its shadow page
authorSean Christopherson <seanjc@google.com>
Wed, 19 Oct 2022 16:56:16 +0000 (16:56 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 17:31:33 +0000 (12:31 -0500)
commit5e3edd7e8b7e8004c9bb8310fd669a9ca81de207
tree207a5d723daf2bf658d1204dcd832f70794e8caa
parentd25ceb9264364dca0683748b301340097fdab6c7
KVM: x86/mmu: Add helper to convert SPTE value to its shadow page

Add a helper to convert a SPTE to its shadow page to deduplicate a
variety of flows and hopefully avoid future bugs, e.g. if KVM attempts to
get the shadow page for a SPTE without dropping high bits.

Opportunistically add a comment in mmu_free_root_page() documenting why
it treats the root HPA as a SPTE.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221019165618.927057-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/mmu/spte.h
arch/x86/kvm/mmu/tdp_mmu.h