]> git.hungrycats.org Git - linux/commit
KVM: x86: use again the flush argument of __link_shadow_page()
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 3 May 2026 21:09:17 +0000 (23:09 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 May 2026 21:12:31 +0000 (23:12 +0200)
commit6b72d0578ca6f77b835d773d7c77c2f872d3e924
tree174003cc8729440860a05cfb8a6706cc1e93994a
parent87c810160ed738cd983e4a65ebe9709927c702c9
KVM: x86: use again the flush argument of __link_shadow_page()

Except in the case of parentless nested-TDP pages, mmu_page_zap_pte()
clears the SPTE but leaves the invalid_list empty.  In this case, using
kvm_flush_remote_tlbs() as kvm_mmu_remote_flush_or_zap() does is overkill.
Avoid flushing the entirety of the remote TLBs unless the invalid_list
was populated: instead, use a more efficient gfn-targeting flush (if
available) and skip it altogether if the caller guarantees that a TLB
flush is not necessary.

Based-on: <20260503201029.106481-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20260503210917.121840-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c