Skip to content

Huge page related cleanups

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4KVM: x86/mmu: Don't require refcounted "struct page" to create huge SPTEsarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/tdp_mmu.c+7 -261 reply
2/4KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level()arch/x86/kvm/mmu/mmu.c+35 -73 replies
3/4KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEsarch/x86/kvm/mmu/tdp_iter.c arch/x86/kvm/mmu/tdp_iter.h arch/x86/kvm/mmu/tdp_mmu.c+27 -400 replies
4/4KVM: selftests: Add an option to run vCPUs while disabling dirty loggingtools/testing/selftests/kvm/dirty_log_perf_test.c+27 -30 replies

Reviews trailers per patch

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

PatchMingwei Zhang
1/4R-b
2/4
3/4
4/4

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/4] Huge page related cleanups

Simplify (hopefully it's simpler) zapping collapsible SPTEs by first simplifying retrieving the host mapping level. KVM currently requires memory be backed by a refcounted struct page in order to be mapped as a huge page. This requires KVM to acquire the pfn that corresponds to the gfn/hva before checking whether or not the gfn/hva can be mapped huge.

Dropping that requirement allow the "zap collapsible" path to detect that a shadow page can be zapped without having to first bottom out on leaf entries. This could theoretically be a minor performance win, e.g. then KVM doesn't need to walk all not-present leaf SPTEs to find out that a shadow page has no children. In basic testing I didn't see any meaningful difference (the actual zapping dominates).

There are also potential use cases for allow any mappings to be huge, e.g. GPU buffers (IIUC). Dropping the struct page requirement makes KVM play nice with those.

This is most definitely post-5.20 material.

Sean Christopherson (4):
KVM: x86/mmu: Don't require refcounted "struct page" to create huge
SPTEs
KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level()
KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEs
KVM: selftests: Add an option to run vCPUs while disabling dirty
logging

 arch/x86/kvm/mmu/mmu.c                        | 65 ++++++++++++-------
 arch/x86/kvm/mmu/mmu_internal.h               |  2 +-
 arch/x86/kvm/mmu/tdp_iter.c                   |  9 ---
 arch/x86/kvm/mmu/tdp_iter.h                   |  1 -
 arch/x86/kvm/mmu/tdp_mmu.c                    | 61 ++++++++---------
 .../selftests/kvm/dirty_log_perf_test.c       | 30 ++++++++-
 6 files changed, 94 insertions(+), 74 deletions(-)

base-commit: 8031d87aa9953ddeb047a5356ebd0b240c30f233

Signature · 1 line
2.37.0.170.g444d1eabd0-goog