Skip to content

KVM: Scalable memslots implementation additional patches

Maciej S. Szmigiero kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: x86: Avoid overflowing nr_mmu_pages in kvm_arch_commit_memory_region()arch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+2 -31 reply
2/3KVM: Use atomic_long_cmpxchg() instead of an open-coded variantvirt/kvm/kvm_main.c+6 -21 reply
3/3KVM: Make kvm_for_each_memslot_in_gfn_range() strict and use iteratorsarch/x86/kvm/mmu/mmu.c include/linux/kvm_host.h virt/kvm/kvm_main.c+75 -570 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchSean Christopherson
1/3R-b
2/3
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: Scalable memslots implementation additional patches

From: "Maciej S. Szmigiero" <[email protected]>

While the last "5.5" version of KVM scalable memslots implementation was merged to kvm/queue some changes from its review round are still pending.

This series contains these changes which still apply to the final form of the code.

The changes include switching kvm_for_each_memslot_in_gfn_range() to use iterators.
However, I've dropped kvm_for_each_memslot_in_hva_range() rework to use dedicated iterators since the existing implementation was already returning only strictly overlapping memslots and it was already using interval tree iterators.
The code there is also self-contained and very simple.

The code was tested on x86 with KASAN on and booted various guests successfully (including nested ones; with TDP MMU both enabled and disabled).

There were some VMX APICv warnings during these tests but these look related to the latest VMX PI changes rather than memslots handling code.

 arch/x86/include/asm/kvm_host.h |   2 +-
 arch/x86/kvm/mmu/mmu.c          |  11 ++--
 arch/x86/kvm/x86.c              |   3 +-
 include/linux/kvm_host.h        | 104 ++++++++++++++++++++------------
 virt/kvm/kvm_main.c             |  25 +++-----
 5 files changed, 83 insertions(+), 62 deletions(-)