]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm64: head: Rework PRINT() to work when the string is not withing +/- 1MB
authorJulien Grall <jgrall@amazon.com>
Thu, 29 Jun 2023 19:56:18 +0000 (20:56 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 29 Jun 2023 19:58:09 +0000 (20:58 +0100)
The instruction ADR is able to load an address of a symbol that is
within the range +/- 1 MB of the instruction.

While today Xen is quite small (~1MB), it could grow up to 2MB in the
current setup. So there is no guarantee that the instruction can
load the string address (stored in rodata).

So replace the instruction ADR with the pseudo-instruction ADR_L
which is able to handle symbol within the range +/- 4GB.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/arm/arm64/head.S

index f37133cf7ccd610b4d1424f301f85c027db13e8d..c0e03755bb10c7c765fe25478dfd3dff04324b86 100644 (file)
@@ -90,7 +90,7 @@
  */
 #define PRINT(_s)          \
         mov   x3, lr ;     \
-        adr   x0, 98f ;    \
+        adr_l x0, 98f ;    \
         bl    puts    ;    \
         mov   lr, x3 ;     \
         RODATA_STR(98, _s)