aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-06-22 15:27:07 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-24 04:51:59 -0400
commit0cd8dc739833080aa0813cbd94d907a93e3a14c3 (patch)
treefb572c83818487c93a6f30d64e52fea4ff909bef /virt/kvm
parentKVM: x86/mmu: Zap collapsible SPTEs in shadow MMU at all possible levels (diff)
downloadlinux-dev-0cd8dc739833080aa0813cbd94d907a93e3a14c3.tar.xz
linux-dev-0cd8dc739833080aa0813cbd94d907a93e3a14c3.zip
KVM: x86/mmu: pull call to drop_large_spte() into __link_shadow_page()
Before allocating a child shadow page table, all callers check whether the parent already points to a huge page and, if so, they drop that SPTE. This is done by drop_large_spte(). However, dropping the large SPTE is really only necessary before the sp is installed. While the sp is returned by kvm_mmu_get_child_sp(), installing it happens later in __link_shadow_page(). Move the call there instead of having it in each and every caller. To ensure that the shadow page is not linked twice if it was present, do _not_ opportunistically make kvm_mmu_get_child_sp() idempotent: instead, return an error value if the shadow page already existed. This is a bit more verbose, but clearer than NULL. Finally, now that the drop_large_spte() name is not taken anymore, remove the two underscores in front of __drop_large_spte(). Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm')
0 files changed, 0 insertions, 0 deletions