From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Ard Biesheuvel <ardb@kernel.org>, Marc Zyngier <maz@kernel.org>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Kees Cook <keescook@chromium.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Mark Brown <broonie@kernel.org>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Richard Henderson <richard.henderson@linaro.org>
Subject: [RFC PATCH 0/7] arm64: Enable LPA2 support for 16k pages
Date: Thu, 17 Nov 2022 14:24:16 +0100 [thread overview]
Message-ID: <20221117132423.1252942-1-ardb@kernel.org> (raw)
Enable support for LPA2 when running with 16k pages. Unlike with 4k
pages, this does not require adding support for 5 level paging, but
beyond that, there is no fundamental difference between LPA2 support on
4k or 16k pages.
There are a few rough edges that make this less straight-forward than it
was to enable LVA on 64k pages: even though also in this case, we can
rely on statically sized root level page tables, we cannot advance the
TTBR1 pointer to the pgdir entry that covers the start of the 48-bit
addressable like we do on LVA, as the resulting address is not 64 byte
aligned, which is a requirement for TTBR registers.
Another slight complication is that the repurposed physical address bits
in the page table descriptors were not RES0 before, and so there is now
a big global switch (called TCR.DS) which controls how all page table
descriptors are interpreted. This requires some extra care in the PTE
conversion helpers, and additional handling in the boot code to ensure
that we set TCR.DS safely if supported (and not overridden)
This series applies onto some of my previous work that is still in
flight, so these patches will not apply in isolation. Complete branch
can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=arm64-16k-lpa2
Tested on QEMU with -cpu max and lpa2 both off and on, as well as using
the arm64.nolva override kernel command line parameter. Note that this
requires a QEMU patch that has not been merged yet:
https://lore.kernel.org/qemu-devel/20221116170316.259695-1-ardb@kernel.org/
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Ard Biesheuvel (7):
arm64: ptdump: Disregard unaddressable VA space
arm64: mm: Disable all 52-bit virtual addressing support with
arm64.nolva
arm64: mm: Wire up TCR.DS bit to PTE shareability fields
arm64: mm: Support use of 52-bit pgdirs on 48-bit/16k systems
arm64: mm: Add LPA2 support to phys<->pte conversion routines
arm64: Enable LPA2 at boot if supported by the system
arm64: Enable 52-bit virtual addressing for 16k granule configs
arch/arm64/Kconfig | 6 +-
arch/arm64/include/asm/assembler.h | 33 ++-----
arch/arm64/include/asm/cpufeature.h | 1 +
arch/arm64/include/asm/mmu.h | 18 ++++
arch/arm64/include/asm/pgtable-hwdef.h | 11 ++-
arch/arm64/include/asm/pgtable-prot.h | 18 +++-
arch/arm64/include/asm/pgtable.h | 5 +-
arch/arm64/kernel/cpufeature.c | 27 ++++-
arch/arm64/kernel/image-vars.h | 3 +
arch/arm64/kernel/pi/idreg-override.c | 26 +++++
arch/arm64/kernel/pi/map_kernel.c | 103 +++++++++++++++++++-
arch/arm64/mm/mmap.c | 4 +
arch/arm64/mm/mmu.c | 2 +
arch/arm64/mm/proc.S | 13 +++
arch/arm64/mm/ptdump.c | 4 +-
15 files changed, 229 insertions(+), 45 deletions(-)
--
2.35.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:[~2022-11-17 13:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 13:24 Ard Biesheuvel [this message]
2022-11-17 13:24 ` [RFC PATCH 1/7] arm64: ptdump: Disregard unaddressable VA space Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 2/7] arm64: mm: Disable all 52-bit virtual addressing support with arm64.nolva Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 3/7] arm64: mm: Wire up TCR.DS bit to PTE shareability fields Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 4/7] arm64: mm: Support use of 52-bit pgdirs on 48-bit/16k systems Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 5/7] arm64: mm: Add LPA2 support to phys<->pte conversion routines Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 6/7] arm64: Enable LPA2 at boot if supported by the system Ard Biesheuvel
2022-11-17 13:24 ` [RFC PATCH 7/7] arm64: Enable 52-bit virtual addressing for 16k granule configs Ard Biesheuvel
2022-11-18 10:38 ` [RFC PATCH 0/7] arm64: Enable LPA2 support for 16k pages Catalin Marinas
2022-11-18 10:50 ` Ard Biesheuvel
2022-11-18 11:04 ` Ryan Roberts
2022-11-18 11:53 ` Anshuman Khandual
2022-11-18 11:18 ` Anshuman Khandual
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=20221117132423.1252942-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=anshuman.khandual@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=richard.henderson@linaro.org \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox