Skip to content

KVM: Remove kvm_is_transparent_hugepage() and friends

Marc Zyngier kvm kvmarm linux-arm-kernel linux-mm 2 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 7 repliesApplied
  2. v15 patches 12 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6KVM: arm64: Introduce helper to retrieve a PTE and its levelarch/arm64/include/asm/kvm_pgtable.h arch/arm64/kvm/hyp/pgtable.c+58 -03 replies
2/6KVM: arm64: Walk userspace page tables to compute the THP mapping sizearch/arm64/kvm/mmu.c+30 -41 reply
3/6KVM: arm64: Avoid mapping size adjustment on permission faultarch/arm64/kvm/mmu.c+8 -31 reply
4/6KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap()include/linux/page-flags.h virt/kvm/kvm_main.c+0 -470 replies
5/6KVM: arm64: Use get_page() instead of kvm_get_pfn()arch/arm64/kvm/mmu.c+1 -11 reply
6/6KVM: Get rid of kvm_get_pfn()include/linux/kvm_host.h virt/kvm/kvm_main.c+1 -90 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniQuentin PerretAlexandru Elisei
1/6R-b R-b
2/6R-b
3/6R-b
4/6A-b
5/6
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/6] KVM: Remove kvm_is_transparent_hugepage() and friends

A while ago, Willy and Sean pointed out[0] that arm64 is the last user of kvm_is_transparent_hugepage(), and that there would actually be some benefit in looking at the userspace mapping directly instead.

This small series does exactly that, although it doesn't try to support more than a PMD-sized mapping yet for THPs. We could probably look into unifying this with the huge PUD code, and there is still some potential use of the contiguous hint.

As a consequence, it removes kvm_is_transparent_hugepage(), PageTransCompoundMap() and kvm_get_pfn(), all of which have no user left after this rework.

This has been lightly tested on an Altra box (VHE) and on a SC2A11 system (nVHE). Although nothing caught fire, it requires some careful reviewing on the arm64 side.

* From v1 [1]:

- Move the PT helper into its own function, as both Quentin and I need it for other developments
- Fixed stupid bug introduced by a bad conflict resolution, spotted by Alexandru
- Collected Acks from Paolo, with thanks

[0] https://lore.kernel.org/r/[email protected]
[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (6):
KVM: arm64: Introduce helper to retrieve a PTE and its level
KVM: arm64: Walk userspace page tables to compute the THP mapping size
KVM: arm64: Avoid mapping size adjustment on permission fault
KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap()
KVM: arm64: Use get_page() instead of kvm_get_pfn()
KVM: Get rid of kvm_get_pfn()

 arch/arm64/include/asm/kvm_pgtable.h | 19 ++++++++++++
 arch/arm64/kvm/hyp/pgtable.c         | 39 ++++++++++++++++++++++++
 arch/arm64/kvm/mmu.c                 | 45 +++++++++++++++++++++++-----
 include/linux/kvm_host.h             |  1 -
 include/linux/page-flags.h           | 37 -----------------------
 virt/kvm/kvm_main.c                  | 19 +-----------
 6 files changed, 97 insertions(+), 63 deletions(-)
Signature · 1 line
2.30.2