From: Steve Capper <steve.capper@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: crecklin@redhat.com, ard.biesheuvel@linaro.org,
marc.zyngier@arm.com, catalin.marinas@arm.com,
bhsharma@redhat.com, will.deacon@arm.com
Subject: [PATCH v3 00/10] 52-bit kernel + user VAs
Date: Wed, 12 Jun 2019 18:26:48 +0100 [thread overview]
Message-ID: <20190612172658.28522-1-steve.capper@arm.com> (raw)
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 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.
I am happy to add an extra set of patches to this series to document the
52-bit logic and export the relevant vmcoreinfo information (is
something like "vmcoreinfo_append_str(VA_BITS_ACTUAL)" enough?) or
post a separate series in future with this information in.
Cheers,
--
Steve
Steve Capper (10):
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: Tweak PAGE_OFFSET logic
arm64: mm: Introduce 52-bit Kernel VAs
Documentation/arm64/kasan-offsets.sh | 27 ++++++++++++++++
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 | 45 ++++++++++++++++++--------
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 | 25 ++++++++++----
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 +++---
22 files changed, 196 insertions(+), 94 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
next reply other threads:[~2019-06-12 17:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 17:26 Steve Capper [this message]
2019-06-12 17:26 ` [PATCH v3 01/10] arm64: mm: Flip kernel VA space Steve Capper
2019-06-14 12:17 ` Anshuman Khandual
2019-06-17 16:09 ` Steve Capper
2019-06-26 10:56 ` Catalin Marinas
2019-06-14 13:00 ` Anshuman Khandual
2019-06-17 16:08 ` Steve Capper
2019-06-12 17:26 ` [PATCH v3 02/10] arm64: kasan: Switch to using KASAN_SHADOW_OFFSET Steve Capper
2019-06-12 17:26 ` [PATCH v3 03/10] arm64: dump: De-constify VA_START and KASAN_SHADOW_START Steve Capper
2019-06-12 17:26 ` [PATCH v3 04/10] arm64: mm: Introduce VA_BITS_MIN Steve Capper
2019-06-12 17:26 ` [PATCH v3 05/10] arm64: mm: Introduce VA_BITS_ACTUAL Steve Capper
2019-06-12 17:26 ` [PATCH v3 06/10] arm64: mm: Logic to make offset_ttbr1 conditional Steve Capper
2019-06-12 17:26 ` [PATCH v3 07/10] arm64: mm: Separate out vmemmap Steve Capper
2019-06-12 17:26 ` [PATCH v3 08/10] arm64: mm: Modify calculation of VMEMMAP_SIZE Steve Capper
2019-06-12 17:26 ` [PATCH v3 09/10] arm64: mm: Tweak PAGE_OFFSET logic Steve Capper
2019-06-12 17:26 ` [PATCH v3 10/10] arm64: mm: Introduce 52-bit Kernel VAs Steve Capper
2019-06-26 11:08 ` [PATCH v3 00/10] 52-bit kernel + user VAs Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190612172658.28522-1-steve.capper@arm.com \
--to=steve.capper@arm.com \
--cc=ard.biesheuvel@linaro.org \
--cc=bhsharma@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=crecklin@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.