arm64: mm: Add feature override support for LVA
authorArd Biesheuvel <ardb@kernel.org>
Wed, 14 Feb 2024 12:29:12 +0000 (13:29 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 16 Feb 2024 12:42:36 +0000 (12:42 +0000)
commit68aec33f8f5a87b0450159e5e141d2d6c9d76850
tree843df4cd63f61c422fef4013e184d8748c62f9a3
parent9cce9c6c2c3b7d46698d9bb693389d37740fec28
arm64: mm: Add feature override support for LVA

Add support for overriding the VARange field of the MMFR2 CPU ID
register. This permits the associated LVA feature to be overridden early
enough for the boot code that creates the kernel mapping to take it into
account.

Given that LPA2 implies LVA, disabling the latter should disable the
former as well. So override the ID_AA64MMFR0.TGran field of the current
page size as well if it advertises support for 52-bit addressing.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240214122845.2033971-71-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/image-vars.h
arch/arm64/kernel/pi/idreg-override.c