mirror-linux/arch/arm64/kernel/pi
Ard Biesheuvel 62cffa496a arm64/mm: Override PARange for !LPA2 and use it consistently
When FEAT_LPA{,2} are not implemented, the ID_AA64MMFR0_EL1.PARange and
TCR.IPS values corresponding with 52-bit physical addressing are
reserved.

Setting the TCR.IPS field to 0b110 (52-bit physical addressing) has side
effects, such as how the TTBRn_ELx.BADDR fields are interpreted, and so
it is important that disabling FEAT_LPA2 (by overriding the
ID_AA64MMFR0.TGran fields) also presents a PARange field consistent with
that.

So limit the field to 48 bits unless LPA2 is enabled, and update
existing references to use the override consistently.

Fixes: 352b0395b5 ("arm64: Enable 52-bit virtual addressing for 4k and 16k granule configs")
Cc: stable@vger.kernel.org
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241212081841.2168124-10-ardb+git@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-12-19 17:23:52 +00:00
..
.gitignore arm64: gitignore: ignore relacheck 2024-02-22 21:57:52 +00:00
Makefile Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
idreg-override.c arm64/mm: Override PARange for !LPA2 and use it consistently 2024-12-19 17:23:52 +00:00
kaslr_early.c arm64: head: Move early kernel mapping routines into C code 2024-02-16 12:42:33 +00:00
map_kernel.c arm64/mm: Override PARange for !LPA2 and use it consistently 2024-12-19 17:23:52 +00:00
map_range.c arm64/mm: Change protval as 'pteval_t' in map_range() 2024-11-12 14:46:17 +00:00
patch-scs.c arm64/scs: Deal with 64-bit relative offsets in FDE frames 2024-11-08 16:37:55 +00:00
pi.h arm64: Enable LPA2 at boot if supported by the system 2024-02-16 12:42:40 +00:00
relacheck.c arm64: kernel: Manage absolute relocations in code built under pi/ 2024-02-16 12:42:28 +00:00
relocate.c arm64: head: Move early kernel mapping routines into C code 2024-02-16 12:42:33 +00:00