Skip to content

KVM: x86/MMU: Factor rmap operations out of mmu.c

Ben Gardon kvm lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7KVM: x86/MMU: Move pte_list operations to rmap.carch/x86/kvm/Makefile arch/x86/kvm/debugfs.c arch/x86/kvm/mmu/mmu.c +3 more+179 -1524 replies
2/7KVM: x86/MMU: Move rmap_iterator to rmap.harch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/rmap.c arch/x86/kvm/mmu/rmap.h+79 -765 replies
3/7KVM: x86/MMU: Move gfn_to_rmap() to rmap.carch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/rmap.c arch/x86/kvm/mmu/rmap.h+10 -91 reply
4/7KVM: x86/MMU: Move rmap_can_add() and rmap_remove() to rmap.carch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/rmap.c +1 more+37 -330 replies
5/7KVM: x86/MMU: Move the rmap walk iterator out of mmu.carch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/rmap.c arch/x86/kvm/mmu/rmap.h+79 -730 replies
6/7KVM: x86/MMU: Move rmap zap operations to rmap.carch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/rmap.c +1 more+59 -521 reply
7/7KVM: x86/MMU: Move rmap_add() to rmap.carch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/rmap.c +1 more+54 -421 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/7] KVM: x86/MMU: Factor rmap operations out of mmu.c

Move the basic operations for manipulating an rmap out of mmu.c, into their own files.

This is the first step in a series of series to split the Shadow MMU out of mmu.c. Splitting the shadow MMU out results in about a 50% reduction in line count of mmu.c, from ~7K to ~3.5K. The rmap operations only represent about 10% of the Shadow MMU but are split out first becase the are relatively self-contained.

This split may also help facilitate the addition of kUnit tests for rmap manipulation, especially the fiddly bit flag which diferentiates a direct pointer from a pte_list_desc.

This effort is complimentary to David Matlack's proposal to refactor the TDP MMU into an arch-neutral implementation because it further clarifies the distinction between the Shadow MMU and TDP MMU within x86.

This series contains no functional changes. It's just a direct movement of code from one file to another.

Whether this rmap code should stay in its own file or get merged with the rest of the shadow MMU code as it is factored out is open for debate.

Ben Gardon (7):
KVM: x86/MMU: Move pte_list operations to rmap.c
KVM: x86/MMU: Move rmap_iterator to rmap.h
KVM: x86/MMU: Move gfn_to_rmap() to rmap.c
KVM: x86/MMU: Move rmap_can_add() and rmap_remove() to rmap.c
KVM: x86/MMU: Move the rmap walk iterator out of mmu.c
KVM: x86/MMU: Move rmap zap operations to rmap.c
KVM: x86/MMU: Move rmap_add() to rmap.c

 arch/x86/kvm/Makefile           |   2 +-
 arch/x86/kvm/debugfs.c          |   1 +
 arch/x86/kvm/mmu/mmu.c          | 438 +-------------------------------
 arch/x86/kvm/mmu/mmu_internal.h |   9 +-
 arch/x86/kvm/mmu/rmap.c         | 368 +++++++++++++++++++++++++++
 arch/x86/kvm/mmu/rmap.h         | 106 ++++++++
 6 files changed, 492 insertions(+), 432 deletions(-)
 create mode 100644 arch/x86/kvm/mmu/rmap.c
 create mode 100644 arch/x86/kvm/mmu/rmap.h
Signature · 1 line
2.39.0.rc0.267.gcb52ba06e7-goog