linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: mm: Model LVA support as a CPU feature
@ 2022-11-15 14:38 Ard Biesheuvel
  2022-11-15 14:38 ` [PATCH 1/3] arm64: mm: get rid of kimage_vaddr global variable Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2022-11-15 14:38 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Ard Biesheuvel, Catalin Marinas, Will Deacon, Mark Rutland,
	Anshuman Khandual, Joey Gouly

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

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

end of thread, other threads:[~2022-12-01 11:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 14:38 [PATCH 0/3] arm64: mm: Model LVA support as a CPU feature Ard Biesheuvel
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

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).