[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/arm: head: Do not pass physical offset to start_xen



commit 394c9d88858cd99fcb5a189dbabe2af34dbabfd3
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Wed Aug 14 11:43:03 2024 +0200
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Aug 22 11:35:05 2024 +0100

    xen/arm: head: Do not pass physical offset to start_xen
    
    Given no further use in C world of boot_phys_offset, drop it from the
    argument list of start_xen() and do the necessary changes in the startup
    code head.S (most notably modifying launch not to expect 2 arguments to
    pass to C entry point).
    
    Both on arm64 and arm32, phys offset (stored in x20 or r10 respectively)
    is still needed, so that it can be used in e.g. create_table_entry,
    therefore keep it on the list of common register usage.
    
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/arm32/head.S | 12 +++++-------
 xen/arch/arm/arm64/head.S | 12 +++++-------
 xen/arch/arm/setup.c      |  3 +--
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index b488a21a71..a96d5d3503 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -101,9 +101,8 @@ primary_switched:
         bl    zero_bss
         PRINT("- Ready -\r\n")
         /* Setup the arguments for start_xen and jump to C world */
-        mov   r0, r10                /* r0 := Physical offset */
-        mov   r1, r8                 /* r1 := paddr(FDT) */
-        mov_w r2, start_xen
+        mov   r0, r8                 /* r0 := paddr(FDT) */
+        mov_w r1, start_xen
         b     launch
 ENDPROC(start)
 
@@ -141,7 +140,7 @@ GLOBAL(init_secondary)
 secondary_switched:
         PRINT("- Ready -\r\n")
         /* Jump to C world */
-        mov_w r2, start_secondary
+        mov_w r1, start_secondary
         b     launch
 ENDPROC(init_secondary)
 
@@ -243,8 +242,7 @@ ENDPROC(cpu_init)
  *
  * Inputs:
  *   r0 : Argument 0 of the C function to call
- *   r1 : Argument 1 of the C function to call
- *   r2 : C entry point
+ *   r1 : C entry point
  *
  * Clobbers r3
  */
@@ -256,7 +254,7 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 
         /* Jump to C world */
-       bx    r2
+       bx    r1
 ENDPROC(launch)
 
 /* Fail-stop */
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 2fa07dc3a0..14c3720d80 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -260,9 +260,8 @@ primary_switched:
         bl    zero_bss
         PRINT("- Ready -\r\n")
         /* Setup the arguments for start_xen and jump to C world */
-        mov   x0, x20                /* x0 := Physical offset */
-        mov   x1, x21                /* x1 := paddr(FDT) */
-        ldr   x2, =start_xen
+        mov   x0, x21                /* x0 := paddr(FDT) */
+        ldr   x1, =start_xen
         b     launch
 END(real_start)
 
@@ -303,7 +302,7 @@ FUNC(init_secondary)
 secondary_switched:
         PRINT("- Ready -\r\n")
         /* Jump to C world */
-        ldr   x2, =start_secondary
+        ldr   x1, =start_secondary
         b     launch
 END(init_secondary)
 
@@ -407,8 +406,7 @@ END(cpu_init)
  *
  * Inputs:
  *   x0 : Argument 0 of the C function to call
- *   x1 : Argument 1 of the C function to call
- *   x2 : C entry point
+ *   x1 : C entry point
  *
  * Clobbers x3
  */
@@ -421,7 +419,7 @@ FUNC_LOCAL(launch)
         mov   sp, x3
 
         /* Jump to C world */
-        br    x2
+        br    x1
 END(launch)
 
 /* Fail-stop */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cfe19e15b0..961d3ea670 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -287,8 +287,7 @@ void __init init_pdx(void)
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
-void asmlinkage __init start_xen(unsigned long boot_phys_offset,
-                                 unsigned long fdt_paddr)
+void asmlinkage __init start_xen(unsigned long fdt_paddr)
 {
     size_t fdt_size;
     const char *cmdline;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.