Skip to content

KVM: x86/mmu: Use page-track only for... page tracking

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot changearch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/x86.c+4 -93 replies
2/2KVM: x86/mmu: Register page-tracker on first shadow root allocationarch/x86/kvm/mmu/mmu.c+7 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: x86/mmu: Use page-track only for... page tracking

Don't bounce through the page-track notifier when zapping+flushing SPTEs in response to memslot changes as the need to zap+flush isn't strictly limited to page-tracking. With that done, register KVM's notifier on the first allocation of a shadow root, as KVM's ->track_write() hook is used only to react to writes to gPTEs.

Aside from avoiding a RETPOLINE on emulated writes, dropping KVM's internal use will allow removing ->track_flush_slot() altogether once KVM-GT moves to a different hook[*]. Tracking "flushes" of slots is a poor fit for KVM-GT's needs as KVM-GT needs to drop its write-protection only when a memslot change is guaranteed to be committed, whereas the "flush" call is speculative in the sense that KVM may abort a memslot update after flushing the original memslot.

https://lore.kernel.org/all/[email protected]

Sean Christopherson (2):
KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot
change
KVM: x86/mmu: Register page-tracker on first shadow root allocation

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/mmu/mmu.c          | 24 ++++++++----------------
 arch/x86/kvm/x86.c              |  2 ++
 3 files changed, 11 insertions(+), 16 deletions(-)

base-commit: d663b8a285986072428a6a145e5994bc275df994

Signature · 1 line
2.38.1.431.g37b22c650d-goog