Skip to content

KVM: Support PUD hugepage at stage 2

Punit Agrawal kvmarm linux-arm-kernel lkml 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest8 patches 23 repliesIn review
  2. v89 patches 11 repliesSuperseded
  3. v79 patches 4 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v68 patches4 repliesSuperseded
v5 posting 2/20 of 7 patches1 replySuperseded
v5 posting 1/27 patches12 repliesSuperseded
v47 patches7 repliesSuperseded
v34 patches3 repliesSuperseded
v24 patches8 repliesSuperseded
v14 patches6 repliesSuperseded

Changes in v9 from the cover letter

* Dropped bugfix patch 1 which has been merged

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: arm/arm64: Share common code in user_mem_abort()virt/kvm/arm/mmu.c+30 -196 replies
2/8KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on faultvirt/kvm/arm/mmu.c+15 -134 replies
3/8KVM: arm/arm64: Introduce helpers to manipulate page table entriesarch/arm/include/asm/kvm_mmu.h arch/arm64/include/asm/kvm_mmu.h virt/kvm/arm/mmu.c+18 -63 replies
4/8KVM: arm64: Support dirty page tracking for PUD hugepagesarch/arm/include/asm/kvm_mmu.h arch/arm64/include/asm/kvm_mmu.h virt/kvm/arm/mmu.c+32 -42 replies
5/8KVM: arm64: Support PUD hugepage in stage2_is_exec()arch/arm/include/asm/kvm_mmu.h arch/arm64/include/asm/kvm_mmu.h arch/arm64/include/asm/pgtable-hwdef.h +1 more+61 -54 replies
6/8KVM: arm64: Support handling access faults for PUD hugepagesarch/arm/include/asm/kvm_mmu.h arch/arm64/include/asm/kvm_mmu.h arch/arm64/include/asm/pgtable.h +1 more+33 -112 replies
7/8KVM: arm64: Update age handlers to support PUD hugepagesarch/arm/include/asm/kvm_mmu.h arch/arm64/include/asm/kvm_mmu.h arch/arm64/include/asm/pgtable.h +1 more+32 -191 reply
8/8KVM: arm64: Add support for creating PUD hugepages at stage 2arch/arm/include/asm/kvm_mmu.h arch/arm/include/asm/stage2_pgtable.h arch/arm64/include/asm/kvm_mmu.h +3 more+143 -61 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchSuzuki K PouloseChristoffer Dall
1/8R-b
2/8R-b
3/8R-b A-b
4/8R-b R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

Cover letter [PATCH v9 0/8] KVM: Support PUD hugepage at stage 2

This series is an update to the PUD hugepage support previously posted at [0]. This patchset adds support for PUD hugepages at stage 2 a feature that is useful on cores that have support for large sized TLB mappings (e.g., 1GB for 4K granule).

The patches are based on the latest upstream kernel.

The patches have been tested on AMD Seattle system with the following hugepage sizes - 2M and 1G.

Thanks,
Punit

[0] https://patchwork.kernel.org/cover/10622379/

v8 -> v9

* Dropped bugfix patch 1 which has been merged

v7 -> v8

* Add kvm_stage2_has_pud() helper on arm32
* Rebased to v6 of 52bit dynamic IPA support

v6 -> v7

* Restrict thp check to exclude hugetlbfs pages - Patch 1
* Don't update PUD entry if there's no change - Patch 9
* Add check for PUD level in stage 2 - Patch 9

v5 -> v6

* Split Patch 1 to move out the refactoring of exec permissions on page table entries.
* Patch 4 - Initialise p*dpp pointers in stage2_get_leaf_entry()
* Patch 5 - Trigger a BUG() in kvm_pud_pfn() on arm

v4 -> v5:
* Patch 1 - Drop helper stage2_should_exec() and refactor the condition to decide if a page table entry should be marked executable
* Patch 4-6 - Introduce stage2_get_leaf_entry() and use it in this and latter patches
* Patch 7 - Use stage 2 accessors instead of using the page table helpers directly
* Patch 7 - Add a note to update the PUD hugepage support when number of levels of stage 2 tables differs from stage 1

v3 -> v4:
* Patch 1 and 7 - Don't put down hugepages pte if logging is enabled
* Patch 4-5 - Add PUD hugepage support for exec and access faults
* Patch 6 - PUD hugepage support for aging page table entries

v2 -> v3:
* Update vma_pagesize directly if THP [1/4]. Previsouly this was done indirectly via hugetlb
* Added review tag [4/4]

v1 -> v2:
* Create helper to check if the page should have exec permission [1/4]
* Fix broken condition to detect THP hugepage [1/4]
* Fix in-correct hunk resulting from a rebase [4/4]

Punit Agrawal (8):
KVM: arm/arm64: Share common code in user_mem_abort()
KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault
KVM: arm/arm64: Introduce helpers to manipulate page table entries
KVM: arm64: Support dirty page tracking for PUD hugepages
KVM: arm64: Support PUD hugepage in stage2_is_exec()
KVM: arm64: Support handling access faults for PUD hugepages
KVM: arm64: Update age handlers to support PUD hugepages
KVM: arm64: Add support for creating PUD hugepages at stage 2

 arch/arm/include/asm/kvm_mmu.h         |  61 +++++
 arch/arm/include/asm/stage2_pgtable.h  |   5 +
 arch/arm64/include/asm/kvm_mmu.h       |  48 ++++
 arch/arm64/include/asm/pgtable-hwdef.h |   4 +
 arch/arm64/include/asm/pgtable.h       |   9 +
 virt/kvm/arm/mmu.c                     | 312 ++++++++++++++++++-------
 6 files changed, 360 insertions(+), 79 deletions(-)
Signature · 1 line
2.19.1