arm64/mm: Enable 128 bit page table entries
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 3 repliesIn review
Changes in v1 from the cover letter
- Rebased on v7.2-rc5
- Pulled in new standardized pgtable entry print patch
- Added standardized pgtable entry print on arm64 platform
- Added KASAN related pgdp_get() changes missing earlier
- Renamed pxxval_get/set() as ptval_get/set()
- Renamed ptval_cmpxchg_relaxed() and ptval_xchg_relaxed()
- Renamed tlbi_args_t as tlbi_arg_t per Ryan
- Split final D128 enablement patch into four separate ones
- Updated all commit messages as required
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | mm: Add read-write accessors for vm_page_protinclude/ mm/ mm/ +2 more | +19 | 0 replies | |
| 2/17 | arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMDarch/ arch/ arch/ +5 more | +21 | 2 replies | |
| 3/17 | arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUDarch/ arch/ arch/ +5 more | +21 | 0 replies | |
| 4/17 | arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4Darch/ arch/ arch/ +4 more | +14 | 0 replies | |
| 5/17 | arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGDarch/ arch/ arch/ +3 more | +11 | 0 replies | |
| 6/17 | arm64/mm: Route all pgtable reads via ptval_get()arch/ | +32 | 0 replies | |
| 7/17 | arm64/mm: Route all pgtable writes via ptval_set()arch/ arch/ | +8 | 0 replies | |
| 8/17 | arm64/mm: Route all pgtable atomics to central helpersarch/ arch/ | +20 | 0 replies | |
| 9/17 | arm64/mm: Override read-write accessors for vm_page_protarch/ | +12 | 0 replies | |
| 10/17 | arm64/mm: Standardize printing for pgtable entriesarch/ arch/ arch/ +2 more | +90 | 0 replies | |
| 11/17 | arm64/mm: Enable fixmap with 5 level page tablearch/ arch/ | +16 | 0 replies | |
| 12/17 | arm64/mm: Enable pgtable geometry for FEAT_D128arch/ arch/ arch/ | +38 | 0 replies | |
| 13/17 | arm64/mm: Enable pgtable descriptor for FEAT_D128arch/ arch/ arch/ +3 more | +207 | 0 replies | |
| 14/17 | arm64/mm: Enable 128 bit translationarch/ arch/ arch/ +2 more | +49 | 0 replies | |
| 15/17 | arm64/mm: Add an abstraction level for tlbi_oparch/ | +37 | 0 replies | |
| 16/17 | arm64/mm: Enable TLBIP instruction based TLB flusharch/ | +59 | 0 replies | |
| 17/17 | arm64/mm: Make ARM64_D128 selectablearch/ | +15 | 0 replies |
Reviews trailers per patch
2 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Mike Rapoport (Microsoft) | David Hildenbrand (Arm) |
|---|---|---|
| 1/17 | A-b | |
| 2/17 | R-b | |
| 3/17 | ||
| 4/17 | ||
| 5/17 | ||
| 6/17 | ||
| 7/17 | ||
| 8/17 | ||
| 9/17 | ||
| 10/17 | ||
| 11/17 | ||
| 12/17 | ||
| 13/17 | ||
| 14/17 | ||
| 15/17 | ||
| 16/17 | ||
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/17] arm64/mm: Enable 128 bit page table entries
FEAT_D128 is a new arm architecture feature adding support for VMSAv9-128 translation system. FEAT_D128 is an optional feature from ARMV9.3 onwards. arm64 platforms with FEAT_D128 enabled will now have two different memory translation systems i.e VMSAv8-64 and VMSAv9-128.
FEAT_D128 adds 128 bit page table entries, thus supporting larger physical and virtual address range while also expanding available room for more MMU feature bits for both HW and SW usage.
A new config option ARM64_D128 is being added thus enabling users to chose between aforementioned memory translations regimes VMSAv8-64 (aka D64) and VMSAv9-128 (aka D128) during the build time. If the ARM64_D128 built kernel does not detect FEAT_D128 feature on the hardware, then it gets stuck with with a new reason code CPU_STUCK_REASON_NO_D128. So ARM64_D128 built kernel cannot fallback to D64 translation regime on unsupported HW.
READ_ONCE() on page table entries get routed via level specific pxdp_get() helpers which platforms could then override when required. These accessors on arm64 platform help in ensuring page table accesses are performed in an atomic manner while reading 128 bit page table entries.
ARM64_[VA|PA]_BITS combinations for respective CONFIG_ARM64_XXK_PAGES are now supported both on VMSAv8-64 and VMSAv9-128 memory translation regimes. Although FEAT_D128 provided 52 bit VA and PA space along with skip levels features are not supported currently.
Basic page table geometry has also been changed with VMSAv9-128, as there are fewer entries per level as compared to VMSAv8-64. Please refer to the following table for various leaf entry sizes including the cont entries.
------------------------------------------------
| | D64 | D128 |
------------------------------------------------
| PAGE_SIZE | PMD | PUD | PMD | PUD | -----------------------------|-----------------| | 4K | 2M | 1G | 1M | 256M | | 16K | 32M | 64G | 16M | 16G | | 64K | 512M | 4T | 256M | 1T |
------------------------------------------------
--------------------------------------------------------------------
| | D64 | D128 |
--------------------------------------------------------------------
| PAGE_SIZE | CONT_PTE | CONT_PMD | CONT_PTE | CONT_PMD | --------------------------|------------|-------------|-------------- | 4K | 64K | 32M | 64K | 16M | | 16K | 2M | 1G | 1M | 256M | | 64K | 2M | 16G | 1M | 16G |
--------------------------------------------------------------------
Similarly arm64 kernel features such as KVM, KASAN and UNMAP_KERNEL_AT_EL0 are currently not supported as well.
This series applies on v7.2-rc5 but after applying the following patch that standardized printing pgtable entries. There are no apparent problems while running MM kselftests with and without CONFIG_ARM64_D128.
https://lore.kernel.org/all/[email protected]/
Changes in V1:
- Rebased on v7.2-rc5
- Pulled in new standardized pgtable entry print patch
- Added standardized pgtable entry print on arm64 platform
- Added KASAN related pgdp_get() changes missing earlier
- Renamed pxxval_get/set() as ptval_get/set()
- Renamed ptval_cmpxchg_relaxed() and ptval_xchg_relaxed()
- Renamed tlbi_args_t as tlbi_arg_t per Ryan
- Split final D128 enablement patch into four separate ones
- Updated all commit messages as required
Changes in RFC V2:
https://lore.kernel.org/all/[email protected]/
- Dropped some patches that were merged upstream and rebased on v7.1-rc3
- Updated commit message for the 5-level fixmap change per David
- Moved pxdval_t definition inside generic page table header
- Dropped _once from pgprot_read/write() per Mike
- Updated ARM64_CONT_[PTE|PMD]_SHIFT both for 16K and 64K base pages
- Renamed __PRIpte as __PRIpxx per David
- Added abstraction for tlbi_op
- Adopted TLBIP implementation to recent TLB flush changes
- Moved back all helpers back from arch/arm64/mm/mmu.c into the header
- Moved arm64 pgtable header READ_ONCE() replacements later in the series
- Renamed all ptdesc_ instances as pxxval_ instead
- Updated all commit messages as required and suggested
- Restored print format in __print_bad_page_map_pgtable() per Usama
Changes in RFC V1:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
Anshuman Khandual (15):
mm: Add read-write accessors for vm_page_prot arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUD arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4D arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD arm64/mm: Route all pgtable reads via ptval_get() arm64/mm: Route all pgtable writes via ptval_set() arm64/mm: Route all pgtable atomics to central helpers arm64/mm: Override read-write accessors for vm_page_prot arm64/mm: Standardize printing for pgtable entries arm64/mm: Enable fixmap with 5 level page table arm64/mm: Enable pgtable geometry for FEAT_D128 arm64/mm: Enable pgtable descriptor for FEAT_D128 arm64/mm: Enable 128 bit translation
arm64/mm: Make ARM64_D128 selectable
Linu Cherian (2):
arm64/mm: Add an abstraction level for tlbi_op arm64/mm: Enable TLBIP instruction based TLB flush
arch/arm64/Kconfig | 51 ++++++- arch/arm64/Makefile | 4 + arch/arm64/include/asm/assembler.h | 4 +- arch/arm64/include/asm/el2_setup.h | 9 ++ arch/arm64/include/asm/pgtable-hwdef.h | 137 ++++++++++++++++++ arch/arm64/include/asm/pgtable-prot.h | 18 ++- arch/arm64/include/asm/pgtable-types.h | 4 + arch/arm64/include/asm/pgtable.h | 188 +++++++++++++++++++------ arch/arm64/include/asm/smp.h | 1 + arch/arm64/include/asm/tlbflush.h | 138 ++++++++++++------ arch/arm64/kernel/head.S | 12 ++ arch/arm64/mm/fault.c | 31 ++-- arch/arm64/mm/fixmap.c | 24 +++- arch/arm64/mm/hugetlbpage.c | 10 +- arch/arm64/mm/kasan_init.c | 18 +-- arch/arm64/mm/mmu.c | 81 ++++++----- arch/arm64/mm/pageattr.c | 8 +- arch/arm64/mm/proc.S | 25 +++- arch/arm64/mm/trans_pgd.c | 14 +- include/linux/mm_types.h | 40 ++++++ include/linux/pgtable.h | 14 ++ mm/huge_memory.c | 4 +- mm/memory.c | 42 +----- mm/migrate.c | 2 +- mm/mmap.c | 2 +- 25 files changed, 668 insertions(+), 213 deletions(-)
Signature · 1 line
2.43.0