KVM: x86/mmu: Trigger APIC-access page reload iff vendor code cares
authorSean Christopherson <seanjc@google.com>
Fri, 2 Jun 2023 01:15:18 +0000 (18:15 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 6 Jun 2023 22:07:05 +0000 (15:07 -0700)
commit0a3869e14d4a5e1016aad6bc6c5b70f82bc0dbbe
tree869b2d4be6c610de4999f91bdfc0675c7078d48b
parent0a8a5f2c8c266e9d94fb45f76a26cff135d0051c
KVM: x86/mmu: Trigger APIC-access page reload iff vendor code cares

Request an APIC-access page reload when the backing page is migrated (or
unmapped) if and only if vendor code actually plugs the backing pfn into
structures that reside outside of KVM's MMU.  This avoids kicking all
vCPUs in the (hopefully infrequent) scenario where the backing page is
migrated/invalidated.

Unlike VMX's APICv, SVM's AVIC doesn't plug the backing pfn directly into
the VMCB and so doesn't need a hook to invalidate an out-of-MMU "mapping".

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20230602011518.787006-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/mmu.c