[PATCH] arm64: booting: Require placement within 48-bit addressable memory

Ard Biesheuvel ardb at kernel.org
Mon Nov 14 03:58:10 PST 2022


Some configurations (i.e., 64k + LVA/LPA) can tolerate a physical
placement of the kernel image outside of the 48-bit addressable region,
but given that the loader has no way of knowing whether or not the image
in question supports LVA/LPA, it currently has no choice but to place it
below the 48-bit mark.

Once we add support for LPA2, which allows 52-bit physical and virtual
addressing when using 4k or 16k pages, but in way that relies on
increasing the number of paging levels, there will be more variety in
the configurations that may or may not support this.

So repaint bit #3 in the Image header as 'must be placed within 48-bit
addressable memory', as this is the current de facto meaning, and add
bits that we may set later to allow placement outside of that.

Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
---
 Documentation/arm64/booting.rst | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/arm64/booting.rst b/Documentation/arm64/booting.rst
index 8c324ad638de2b27..9919e1a107add655 100644
--- a/Documentation/arm64/booting.rst
+++ b/Documentation/arm64/booting.rst
@@ -114,16 +114,21 @@ Header notes:
 			* 1 - 4K
 			* 2 - 16K
 			* 3 - 64K
-  Bit 3		Kernel physical placement
+  Bit 3-4	Kernel physical placement
 
 			0
 			  2MB aligned base should be as close as possible
 			  to the base of DRAM, since memory below it is not
 			  accessible via the linear mapping
 			1
+			  2MB aligned base such that base plus image_size is
+			  entirely within the 48-bit addressable range
+			2
+			  Reserved
+			3
 			  2MB aligned base may be anywhere in physical
 			  memory
-  Bits 4-63	Reserved.
+  Bits 5-63	Reserved.
   ============= ===============================================================
 
 - When image_size is zero, a bootloader should attempt to keep as much
-- 
2.35.1




More information about the linux-arm-kernel mailing list