diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-12-05 09:10:17 +0100 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2022-12-07 19:50:44 +0100 |
commit | a37dac5c5dcfe0f1fd58513c16cdbc280a47f628 (patch) | |
tree | ecce8a5149a40a52f75d3a446877f0611faf9d0b /arch/arm64/include/asm/efi.h | |
parent | Merge tag 'v6.1-rc8' into efi/next (diff) | |
download | linux-a37dac5c5dcfe0f1fd58513c16cdbc280a47f628.tar.xz linux-a37dac5c5dcfe0f1fd58513c16cdbc280a47f628.zip |
arm64: efi: Limit allocations to 48-bit addressable physical region
The UEFI spec does not mention or reason about the configured size of
the virtual address space at all, but it does mention that all memory
should be identity mapped using a page size of 4 KiB.
This means that a LPA2 capable system that has any system memory outside
of the 48-bit addressable physical range and follows the spec to the
letter may serve page allocation requests from regions of memory that
the kernel cannot access unless it was built with LPA2 support and
enables it at runtime.
So let's ensure that all page allocations are limited to the 48-bit
range.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/efi.h')
-rw-r--r-- | arch/arm64/include/asm/efi.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 108b115dbf5b..7c12e01c2b31 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -92,6 +92,7 @@ static inline unsigned long efi_get_kimg_min_align(void) } #define EFI_ALLOC_ALIGN SZ_64K +#define EFI_ALLOC_LIMIT ((1UL << 48) - 1) /* * On ARM systems, virtually remapped UEFI runtime services are set up in two |