OSDN Git Service

KVM: x86: introduce kvm_mmu_invalidate_gva
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Mar 2020 00:42:57 +0000 (20:42 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Apr 2020 21:25:55 +0000 (17:25 -0400)
commit5efac0741ce238e0844d3f7af00198f81e84926a
treea5578f17278650aec112656d4cb7bd8ff3de8d95
parent53b3d8e9d57753295b33065f80b1e2fb4fcb946d
KVM: x86: introduce kvm_mmu_invalidate_gva

Wrap the combination of mmu->invlpg and kvm_x86_ops->tlb_flush_gva
into a new function.  This function also lets us specify the host PGD to
invalidate and also the MMU, both of which will be useful in fixing and
simplifying kvm_inject_emulated_page_fault.

A nested guest's MMU however has g_context->invlpg == NULL.  Instead of
setting it to nonpaging_invlpg, make kvm_mmu_invalidate_gva the only
entry point to mmu->invlpg and make a NULL invlpg pointer equivalent
to nonpaging_invlpg, saving a retpoline.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c