linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Joey Gouly <joey.gouly@arm.com>
Subject: [PATCH 0/3] arm64: mm: Model LVA support as a CPU feature
Date: Tue, 15 Nov 2022 15:38:21 +0100	[thread overview]
Message-ID: <20221115143824.2798908-1-ardb@kernel.org> (raw)

Treat LVA support (52-bit virtual addressing) as a CPU feature so we can
rely on code patching, reporting and overrides as usual.

Currently, we enable LVA really early, and have special treatment of it
in the boot paths. However, given that both the ID map and the TTBR1
mapping of the kernel image are guarenteed to require 48 bits at most,
we can boot with 48-bit virtual addressing initially, and switch to
52-bit addressing once we are running from C code and have parsed the
command line to look for CPU feature overrides.

Patch #1 is a drive-by cleanup that can be applied independently.

Patch #2 creates the LVA CPU feature and wires it up.

Patch #3 introduces the MMFR2 CPU feature override, as well as a
arm64.nolva command line option to force 48-bit virtual addressing even
if the CPU supports LVA. While at it, E0PD is wired up as an override as
well, given that it sits in MMFR2 as well, and that its value is taken
into account very early too.

Note that this applies onto my series that further refactors the boot
code [0], after a previous refactor landed in v6.0.

[0] https://lore.kernel.org/all/20221111171201.2088501-1-ardb@kernel.org/

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Joey Gouly <joey.gouly@arm.com> 

Ard Biesheuvel (3):
  arm64: mm: get rid of kimage_vaddr global variable
  arm64: mm: Handle LVA support as a CPU feature
  arm64: mm: Add feature override support for LVA and E0PD

 arch/arm64/include/asm/assembler.h    | 17 +++++++------
 arch/arm64/include/asm/cpufeature.h   |  1 +
 arch/arm64/include/asm/memory.h       | 10 ++++----
 arch/arm64/kernel/cpufeature.c        | 19 +++++++++++++-
 arch/arm64/kernel/head.S              | 26 +++-----------------
 arch/arm64/kernel/image-vars.h        |  1 +
 arch/arm64/kernel/pi/idreg-override.c |  8 +++++-
 arch/arm64/kernel/pi/map_kernel.c     | 16 ++++++++++++
 arch/arm64/kernel/sleep.S             |  3 ---
 arch/arm64/mm/mmu.c                   |  8 ------
 arch/arm64/mm/proc.S                  | 16 ++++++------
 arch/arm64/tools/cpucaps              |  1 +
 12 files changed, 70 insertions(+), 56 deletions(-)

-- 
2.35.1


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

             reply	other threads:[~2022-11-15 14:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 14:38 Ard Biesheuvel [this message]
2022-11-15 14:38 ` [PATCH 1/3] arm64: mm: get rid of kimage_vaddr global variable Ard Biesheuvel
2022-11-30 14:50   ` Catalin Marinas
2022-11-15 14:38 ` [PATCH 2/3] arm64: mm: Handle LVA support as a CPU feature Ard Biesheuvel
2022-11-30 14:50   ` Catalin Marinas
2022-11-30 14:56     ` Ard Biesheuvel
2022-11-30 16:28       ` Catalin Marinas
2022-11-30 16:29         ` Ard Biesheuvel
2022-11-30 16:40           ` Catalin Marinas
2022-12-01 11:13             ` Mark Rutland
2022-12-01 11:22               ` Ard Biesheuvel
2022-12-01 11:48                 ` Mark Rutland
2022-11-15 14:38 ` [PATCH 3/3] arm64: mm: Add feature override support for LVA and E0PD Ard Biesheuvel
2022-11-18 14:47   ` Will Deacon
2022-11-18 14:50     ` Ard Biesheuvel

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=20221115143824.2798908-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --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;
as well as URLs for NNTP newsgroup(s).