Skip to contentSkip to conversation

xen/arm32: head: Don't set r12 and update the documentation

PATCH In review Julien Grall 3 participants 3 messages Feb 28, 2022 – Mar 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen/arm32: head: Don't set r12 and update the documentation

From: Julien Grall <[email protected]>

Since commit 54c4ae18d158 ("xen/arm32: head: Rework and document launch()"), the boot code is setting r12 but not read it.

So remove the two instructions setting r12 and update the documentation to show r12 has no specific purpose.

---
Changes in v2:
- Don't set r12.

---
 xen/arch/arm/arm32/head.S | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
xen/arch/arm/arm32/head.S +1 -5
index 13cfc837d39c..7a906167efca 100644
@@ -79,7 +79,7 @@
  *   r9  - paddr(start)
  *   r10 - phys offset
  *   r11 - UART address
- *   r12 - is_secondary_cpu
+ *   r12 -
  *   r13 - SP
  *   r14 - LR
  *   r15 - PC
@@ -166,8 +166,6 @@ past_zImage:
 #endif
         PRINT("- Boot CPU booting -\r\n")
 
-        mov   r12, #0                /* r12 := is_secondary_cpu */
-
         bl    check_cpu_mode
         bl    cpu_init
         bl    create_page_tables
@@ -206,8 +204,6 @@ GLOBAL(init_secondary)
         adr   r9, start              /* r9  := paddr (start) */
         sub   r10, r9, r0            /* r10 := phys-offset */
 
-        mov   r12, #1                /* r12 := is_secondary_cpu */
-
         mrc   CP32(r1, MPIDR)
         bic   r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */
 
Signature · 1 line
2.32.0
Reviewed-by on v2 1/1
#1 lore raw

Hi Julien,

Quoted 8 lines · Julien Grall

From: Julien Grall <[email protected]>

Since commit 54c4ae18d158 ("xen/arm32: head: Rework and document launch()"), the boot code is setting r12 but not read it.

So remove the two instructions setting r12 and update the documentation to show r12 has no specific purpose.

Quoted 6 lines

---
Changes in v2:
- Don't set r12.
---

Cheers,
Michal

Reviewed-by on v2 1/1
#2 lore raw
In reply to Julien Grall

Hi Julien,

Quoted 11 lines · Julien Grall

From: Julien Grall <[email protected]>

Since commit 54c4ae18d158 ("xen/arm32: head: Rework and document launch()"), the boot code is setting r12 but not read it.

So remove the two instructions setting r12 and update the documentation to show r12 has no specific purpose.

Cheers
Bertrand

Quoted 43 lines

---
Changes in v2:
- Don't set r12.
---
xen/arch/arm/arm32/head.S | 6 +-----

1 file changed, 1 insertion(+), 5 deletions(-)
xen/arch/arm/arm32/head.S +1 -5
index 13cfc837d39c..7a906167efca 100644
@@ -79,7 +79,7 @@
 *   r9  - paddr(start)
 *   r10 - phys offset
 *   r11 - UART address
- *   r12 - is_secondary_cpu
+ *   r12 -
 *   r13 - SP
 *   r14 - LR
 *   r15 - PC
@@ -166,8 +166,6 @@ past_zImage:
 #endif
        PRINT("- Boot CPU booting -\r\n")
 
-        mov   r12, #0                /* r12 := is_secondary_cpu */
-
        bl    check_cpu_mode
        bl    cpu_init
        bl    create_page_tables
@@ -206,8 +204,6 @@ GLOBAL(init_secondary)
        adr   r9, start              /* r9  := paddr (start) */
        sub   r10, r9, r0            /* r10 := phys-offset */
 
-        mov   r12, #1                /* r12 := is_secondary_cpu */
-
        mrc   CP32(r1, MPIDR)
        bic   r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */
 
Signature · 1 line
2.32.0