Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64/mm: Reduce PA space to 48 bits when LPA2 is not enabled
Currently, LPA2 kernel support implies support for up to 52 bits of physical addressing, and this is reflected in global definitions such as PHYS_MASK_SHIFT and MAX_PHYSMEM_BITS. This is potentially problematic, given that LPA2 hardware support is modeled as a CPU feature which can be overridden, and with LPA2 hardware support turned off, attempting to map physical regions with address bits [51:48] set (which may exist on LPA2 capable systems booting with arm64.nolva) will result in corrupted mappings with a truncated output address and bogus shareability attributes. This means that the accepted physical address range in the mapping routines should be at most 48 bits wide when LPA2 support is configured but not enabled at runtime. Fixes: 352b039 ("arm64: Enable 52-bit virtual addressing for 4k and 16k granule configs") Cc: [email protected] Reviewed-by: Anshuman Khandual <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
- Loading branch information