Skip to content

Commit fde1c38

Browse files
sean-jcgregkh
authored andcommitted
KVM: x86/mmu: Directly "destroy" PTE list when recycling rmaps
[ Upstream commit a42989e ] Use pte_list_destroy() directly when recycling rmaps instead of bouncing through kvm_unmap_rmapp() and kvm_zap_rmapp(). Calling kvm_unmap_rmapp() is unnecessary and odd as it requires passing dummy parameters; passing NULL for @slot when __rmap_add() already has a valid slot is especially weird and confusing. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220715224226.3749507-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Stable-dep-of: 2abd528 ("KVM: x86: Check for invalid/obsolete root *after* making MMU pages available") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kenta Akagi <k@mgml.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b5093d5 commit fde1c38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/x86/kvm/mmu/mmu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ static void rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)
16391639
rmap_count = pte_list_add(vcpu, spte, rmap_head);
16401640

16411641
if (rmap_count > RMAP_RECYCLE_THRESHOLD) {
1642-
kvm_unmap_rmapp(vcpu->kvm, rmap_head, NULL, gfn, sp->role.level, __pte(0));
1642+
pte_list_destroy(vcpu->kvm, rmap_head);
16431643
kvm_flush_remote_tlbs_with_address(
16441644
vcpu->kvm, sp->gfn, KVM_PAGES_PER_HPAGE(sp->role.level));
16451645
}

0 commit comments

Comments
 (0)