All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4 00/11] 52-bit kernel + user VAs
@ 2019-07-29 16:21 Steve Capper
  2019-07-29 16:21 ` [PATCH V4 01/11] arm64: mm: Remove bit-masking optimisations for PAGE_OFFSET and VMEMMAP_START Steve Capper
                   ` (10 more replies)
  0 siblings, 11 replies; 35+ messages in thread
From: Steve Capper @ 2019-07-29 16:21 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: crecklin, ard.biesheuvel, catalin.marinas, bhsharma,
	Steve Capper, maz, will

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 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 (11):
  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 VA_BITS_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
  docs: arm64: Add layout and 52-bit info to memory document

 Documentation/arm64/kasan-offsets.sh   |  27 ++++
 Documentation/arm64/memory.rst         | 177 ++++++++++++++++++++++---
 arch/arm64/Kconfig                     |  36 ++++-
 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        |  56 +++++---
 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/processor.h     |   2 +-
 arch/arm64/kernel/head.S               |  13 +-
 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                   |  24 +++-
 arch/arm64/mm/fault.c                  |   4 +-
 arch/arm64/mm/init.c                   |  29 ++--
 arch/arm64/mm/kasan_init.c             |  11 +-
 arch/arm64/mm/mmu.c                    |   7 +-
 arch/arm64/mm/proc.S                   |   9 +-
 23 files changed, 361 insertions(+), 116 deletions(-)
 create mode 100644 Documentation/arm64/kasan-offsets.sh

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2019-08-07 15:59 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 16:21 [PATCH V4 00/11] 52-bit kernel + user VAs Steve Capper
2019-07-29 16:21 ` [PATCH V4 01/11] arm64: mm: Remove bit-masking optimisations for PAGE_OFFSET and VMEMMAP_START Steve Capper
2019-08-05 11:07   ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 02/11] arm64: mm: Flip kernel VA space Steve Capper
2019-08-05 11:29   ` Catalin Marinas
2019-08-05 11:50     ` Steve Capper
2019-07-29 16:21 ` [PATCH V4 03/11] arm64: kasan: Switch to using KASAN_SHADOW_OFFSET Steve Capper
2019-08-05 16:37   ` Catalin Marinas
2019-08-06  9:05     ` Steve Capper
2019-07-29 16:21 ` [PATCH V4 04/11] arm64: dump: De-constify VA_START and KASAN_SHADOW_START Steve Capper
2019-08-05 16:38   ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 05/11] arm64: mm: Introduce VA_BITS_MIN Steve Capper
2019-08-05 17:17   ` Catalin Marinas
2019-08-05 17:20   ` Catalin Marinas
2019-08-06  9:11     ` Steve Capper
2019-07-29 16:21 ` [PATCH V4 06/11] arm64: mm: Introduce VA_BITS_ACTUAL Steve Capper
2019-08-05 17:26   ` Catalin Marinas
2019-08-06 11:32     ` Steve Capper
2019-08-06 14:48       ` Catalin Marinas
2019-08-07 13:27         ` Steve Capper
2019-07-29 16:21 ` [PATCH V4 07/11] arm64: mm: Logic to make offset_ttbr1 conditional Steve Capper
2019-08-05 17:06   ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 08/11] arm64: mm: Separate out vmemmap Steve Capper
2019-08-05 17:07   ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 09/11] arm64: mm: Modify calculation of VMEMMAP_SIZE Steve Capper
2019-08-05 17:10   ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 10/11] arm64: mm: Introduce 52-bit Kernel VAs Steve Capper
2019-08-05 17:27   ` Catalin Marinas
2019-08-06 14:55   ` Catalin Marinas
2019-08-06 14:58     ` Catalin Marinas
2019-07-29 16:21 ` [PATCH V4 11/11] docs: arm64: Add layout and 52-bit info to memory document Steve Capper
2019-08-06 15:27   ` Catalin Marinas
2019-08-07 13:29     ` Steve Capper
2019-08-07 14:55       ` Will Deacon
2019-08-07 15:57         ` Steve Capper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.