Skip to content

KVM: x86: Use "standard" mmu_notifier hook for APIC page

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-x86 vmx, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 15 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: VMX: Retry APIC-access page reload if invalidation is in-progressarch/x86/kvm/vmx/vmx.c+45 -511 replies
2/3KVM: x86: Use standard mmu_notifier invalidate hooks for APIC access pagearch/x86/kvm/mmu/mmu.c arch/x86/kvm/x86.c include/linux/kvm_host.h +1 more+3 -351 reply
3/3KVM: x86/mmu: Trigger APIC-access page reload iff vendor code caresarch/x86/kvm/mmu/mmu.c+2 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo BonziniAlistair Popple
SeriesR-b
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] KVM: x86: Use "standard" mmu_notifier hook for APIC page

Convert VMX's handling of mmu_notifier invalidations of the APIC-access page from invalidate_range() to KVM's standard invalidate_range_{start,end}().

KVM (ab)uses invalidate_range() to fudge around not stalling vCPUs until relevant in-flight invalidations complete. Abusing invalidate_range() works, but it requires one-off code in KVM, sets a bad precedent in KVM, and is blocking improvements to mmu_notifier's definition of invalidate_range() due to KVM's usage diverging wildly from the original intent of notifying IOMMUs of changes to shared page tables.

Clean up the mess by hooking x86's implementation of kvm_unmap_gfn_range() and stalling vCPUs by re-requesting KVM_REQ_APIC_PAGE_RELOAD until the invalidation completes.

Sean Christopherson (3):
KVM: VMX: Retry APIC-access page reload if invalidation is in-progress
KVM: x86: Use standard mmu_notifier invalidate hooks for APIC access
page
KVM: x86/mmu: Trigger APIC-access page reload iff vendor code cares

 arch/x86/kvm/mmu/mmu.c   |  4 ++++
 arch/x86/kvm/vmx/vmx.c   | 50 ++++++++++++++++++++++++++++++++++++----
 arch/x86/kvm/x86.c       | 14 -----------
 include/linux/kvm_host.h |  3 ---
 virt/kvm/kvm_main.c      | 18 ---------------
 5 files changed, 49 insertions(+), 40 deletions(-)

base-commit: 39428f6ea9eace95011681628717062ff7f5eb5f

Signature · 1 line
2.41.0.rc2.161.g9c6817b8e7-goog