:: commit 656468bc0b059e4d6c6ae92b5d4c77a6c8f22653

xvanc <xvancm@gmail.com> — 2023-08-10 17:27

parents: 0ec37e7e5b

smp/riscv: don't report completion to BSP before actually completed

diff --git a/common/sys/smp_trampoline.asm_riscv64 b/common/sys/smp_trampoline.asm_riscv64
index 9430e893..58fed1e7 100644
--- a/common/sys/smp_trampoline.asm_riscv64
+++ b/common/sys/smp_trampoline.asm_riscv64
@@ -19,11 +19,6 @@ smp_trampoline_start:
         ld      a0, smp_tpl_info_struct(a1)
         ld      t1, smp_tpl_hhdm_offset(a1)
 
-        // Tell the BSP we've started.
-        li      t0, 1
-        fence   rw, w
-        sd      t0, (a1)
-
         // Set `stvec` so we page fault into the higher half after loading `satp`.
         lla     t0, 0f
         add     t0, t1, t0
@@ -33,8 +28,14 @@ smp_trampoline_start:
         sfence.vma
         unimp
 0:
-        // Relocate the info struct to the higher half.
+        // Relocate the smp_info and passed_info pointers to the higher half.
         add     a0, t1, a0
+        add     a1, t1, a1
+
+        // Tell the BSP we've started.
+        li      t0, 1
+        fence   rw, w
+        sd      t0, (a1)
 
         // Zero all the things.
         // Preserve a0
tab: 248 wrap: offon