]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/arm64: head: only use the macro load_paddr() in the MMU code
authorJulien Grall <julien@xen.org>
Tue, 17 Oct 2023 12:52:19 +0000 (13:52 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 16 Nov 2023 14:03:19 +0000 (14:03 +0000)
The macro load_paddr() requires to know the offset between the
physical location of Xen and the virtual location.

When using the MPU, x20 will always be 0. Rather than wasting
a register for a compile-time constant value, it would be best if
we can avoid using load_paddr() altogether in the common head.S code.

The current use of load_paddr() are equivalent to adr_l() because
the MMU is off.

All the use of load_paddr() in arm64/head.S are now replaced with
adr_l(). With that, load_paddr() can now be moved in arm64/mmu/head.S.

For now, x20 is still unconditionally set. But this could change
in the future if needed.

Signed-off-by: Julien Grall <julien@xen.org>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
xen/arch/arm/arm64/head.S
xen/arch/arm/arm64/mmu/head.S
xen/arch/arm/include/asm/arm64/macros.h

index 4ad85dcf58d2feaee04acf8f4b90ac70d01147a4..8dbd3300d89fc39345dce0ac3ea2f3b1e940de77 100644 (file)
@@ -259,7 +259,7 @@ real_start_efi:
 
         /* Using the DTB in the .dtb section? */
 .ifnes CONFIG_DTB_FILE,""
-        load_paddr x21, _sdtb
+        adr_l x21, _sdtb
 .endif
 
         /* Initialize the UART if earlyprintk has been enabled. */
@@ -301,7 +301,7 @@ GLOBAL(init_secondary)
         bic   x24, x0, x13           /* Mask out flags to get CPU ID */
 
         /* Wait here until __cpu_up is ready to handle the CPU */
-        load_paddr x0, smp_up_cpu
+        adr_l x0, smp_up_cpu
         dsb   sy
 2:      ldr   x1, [x0]
         cmp   x1, x24
index 88075ef083345a544c84cc6a1b41b484a3e729d9..412b28e649a464ab903e8d6adf0bc2c98baccf34 100644 (file)
 #define XEN_FIRST_SLOT      first_table_offset(XEN_VIRT_START)
 #define XEN_SECOND_SLOT     second_table_offset(XEN_VIRT_START)
 
+/* Load the physical address of a symbol into xb */
+.macro load_paddr xb, sym
+        ldr \xb, =\sym
+        add \xb, \xb, x20
+.endm
+
 /*
  * Flush local TLBs
  *
index 99c401fcafa9f6c55b456d76bafce94463c21cdb..fb9a0602494df44b3008a81d0501c88c93fff7d8 100644 (file)
         add  \dst, \dst, :lo12:\sym
 .endm
 
-/* Load the physical address of a symbol into xb */
-.macro load_paddr xb, sym
-        ldr \xb, =\sym
-        add \xb, \xb, x20
-.endm
-
 /*
  * Register aliases.
  */