Skip to content

52-bit kernel + user VAs

Steve Capper linux-arm-kernel linux-renesas-soc 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 15 repliesIn review
  2. v411 patches 23 repliesSuperseded
  3. v310 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v212 patches15 repliesSuperseded
v19 patches19 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12arm64: mm: Remove bit-masking optimisations for PAGE_OFFSET and VMEMMAP_STARTarch/arm64/include/asm/memory.h+5 -60 replies
2/12arm64: mm: Flip kernel VA spacearch/arm64/Makefile arch/arm64/include/asm/memory.h arch/arm64/include/asm/pgtable.h +5 more+16 -221 reply
3/12arm64: kasan: Switch to using KASAN_SHADOW_OFFSETDocumentation/arm64/kasan-offsets.sh arch/arm64/Kconfig arch/arm64/Makefile +2 more+51 -1811 replies
4/12arm64: dump: De-constify VA_START and KASAN_SHADOW_STARTarch/arm64/mm/dump.c+16 -30 replies
5/12arm64: mm: Introduce VA_BITS_MINarch/arm64/include/asm/efi.h arch/arm64/include/asm/memory.h arch/arm64/include/asm/processor.h +3 more+17 -91 reply
6/12arm64: mm: Introduce vabits_actualarch/arm64/include/asm/kasan.h arch/arm64/include/asm/memory.h arch/arm64/include/asm/mmu_context.h +5 more+31 -171 reply
7/12arm64: mm: Logic to make offset_ttbr1 conditionalarch/arm64/include/asm/assembler.h arch/arm64/kernel/head.S arch/arm64/kernel/hibernate-asm.S +1 more+18 -100 replies
8/12arm64: mm: Separate out vmemmaparch/arm64/include/asm/pgtable.h arch/arm64/mm/init.c+7 -20 replies
9/12arm64: mm: Modify calculation of VMEMMAP_SIZEarch/arm64/include/asm/memory.h+8 -10 replies
10/12arm64: mm: Introduce 52-bit Kernel VAsarch/arm64/Kconfig arch/arm64/include/asm/assembler.h arch/arm64/include/asm/memory.h +5 more+39 -220 replies
11/12arm64: mm: Remove vabits_userarch/arm64/include/asm/memory.h arch/arm64/include/asm/pointer_auth.h arch/arm64/include/asm/processor.h +4 more+5 -161 reply
12/12docs: arm64: Add layout and 52-bit info to memory documentDocumentation/arm64/memory.rst+95 -280 replies

Reviews trailers per patch

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

PatchCatalin MarinasGeert UytterhoevenSteve CapperAndrey RyabininBhupesh Sharma
SeriesT-b
1/12R-b
2/12R-b
3/12R-b T-b R-b T-b A-b T-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12R-b
12/12R-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 5 reviewers.

Read the v5 thread

Cover letter [PATCH V5 00/12] 52-bit kernel + user VAs

This patch series adds support for 52-bit kernel VAs using some of the machinery already introduced by the 52-bit userspace VA code in 5.0.

As 52-bit virtual address support is an optional hardware feature, software support for 52-bit kernel VAs needs to be deduced at early boot time. If HW support is not available, the kernel falls back to 48-bit.

A significant proportion of this series focuses on "de-constifying" VA_BITS related constants.

In order to allow for a KASAN shadow that changes size at boot time, one must fix the KASAN_SHADOW_END for both 48 & 52-bit VAs and "grow" the start address. Also, it is highly desirable to maintain the same function addresses in the kernel .text between VA sizes. Both of these requirements necessitate us to flip the kernel address space halves s.t. the direct linear map occupies the lower addresses.

In V5 of this series the, now redundant, vabits_user was removed by an extra patch.

In V4 of this series, an extra documentation patch is added to explain both the layout of the memory and the implementation of 52-bit support. Also added is a guard region after VMEMMAP to avoid ambiguity with IS_ERR style pointers. Finally the bitmask optimisations for VMEMMAP and PAGE_OFFSET are replaced with addition/subtraction in a new first patch for the series.

In V3 of this series, the 52-bit user/48-bit kernel option is removed and we are left with a single 52-bit VA option instead. The offset_ttbr1 conditional logic has been re-worked to directly read a system register rather than rely on the alternative framework (I couldn't actually see a hotpath calling offset_ttbr1 and some parts of the early boot relied on offset_ttbr1 before the alternatives framework was called). Also some spurious de-constifying changes have been removed.

In V2 of this series (apologies for the long delay from V1), the major change is that PAGE_OFFSET is retained as a constant. This allows for much faster virt_to_page computations. This is achieved by expanding the size of the VMEMMAP region to accommodate a disjoint 52-bit/48-bit direct linear map. This has been found to work well in my testing, but I would appreciate any feedback on this if it needs changing. To aid with git bisect, this logic is broken down into a few smaller patches

Steve Capper (12):
arm64: mm: Remove bit-masking optimisations for PAGE_OFFSET and
VMEMMAP_START
arm64: mm: Flip kernel VA space
arm64: kasan: Switch to using KASAN_SHADOW_OFFSET
arm64: dump: De-constify VA_START and KASAN_SHADOW_START
arm64: mm: Introduce VA_BITS_MIN
arm64: mm: Introduce vabits_actual
arm64: mm: Logic to make offset_ttbr1 conditional
arm64: mm: Separate out vmemmap
arm64: mm: Modify calculation of VMEMMAP_SIZE
arm64: mm: Introduce 52-bit Kernel VAs
arm64: mm: Remove vabits_user
docs: arm64: Add layout and 52-bit info to memory document

 Documentation/arm64/kasan-offsets.sh   |  27 ++++++
 Documentation/arm64/memory.rst         | 123 +++++++++++++++++++------
 arch/arm64/Kconfig                     |  31 +++++--
 arch/arm64/Makefile                    |   8 --
 arch/arm64/include/asm/assembler.h     |  17 +++-
 arch/arm64/include/asm/efi.h           |   4 +-
 arch/arm64/include/asm/kasan.h         |  11 +--
 arch/arm64/include/asm/memory.h        |  58 +++++++-----
 arch/arm64/include/asm/mmu_context.h   |   4 +-
 arch/arm64/include/asm/pgtable-hwdef.h |   2 +-
 arch/arm64/include/asm/pgtable.h       |   6 +-
 arch/arm64/include/asm/pointer_auth.h  |   2 +-
 arch/arm64/include/asm/processor.h     |   4 +-
 arch/arm64/kernel/head.S               |  12 +--
 arch/arm64/kernel/hibernate-asm.S      |   8 +-
 arch/arm64/kernel/hibernate.c          |   2 +-
 arch/arm64/kernel/kaslr.c              |   6 +-
 arch/arm64/kvm/va_layout.c             |  14 +--
 arch/arm64/mm/dump.c                   |  22 ++++-
 arch/arm64/mm/fault.c                  |   5 +-
 arch/arm64/mm/init.c                   |  29 ++++--
 arch/arm64/mm/kasan_init.c             |   9 +-
 arch/arm64/mm/mmu.c                    |   9 +-
 arch/arm64/mm/proc.S                   |  11 ++-
 24 files changed, 289 insertions(+), 135 deletions(-)
 create mode 100644 Documentation/arm64/kasan-offsets.sh
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel