Commit b850841a authored by Dmytro Maluka's avatar Dmytro Maluka Committed by Sean Christopherson
Browse files

KVM: x86/mmu: Skip MMIO SPTE invalidation if enable_mmio_caching=0



If MMIO caching is disabled, there are no MMIO SPTEs to invalidate, so
the costly zapping of all pages is unnecessary even in the unlikely case
when the MMIO generation number has wrapped.

Signed-off-by: default avatarDmytro Maluka <dmaluka@chromium.org>
Link: https://lore.kernel.org/r/20250926135139.1597781-1-dmaluka@chromium.org


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 3a866087
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7364,6 +7364,9 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm, u64 gen)
{
	WARN_ON_ONCE(gen & KVM_MEMSLOT_GEN_UPDATE_IN_PROGRESS);

	if (!enable_mmio_caching)
		return;

	gen &= MMIO_SPTE_GEN_MASK;

	/*