In generic_secondary_common_init(), secondary processors on
non SMP kernels branch directly to kexec_wait without copying
their physical CPU ID from r24 into r3.
kexec_wait() assumes r3 contains the physical CPU ID and
passes it along to __secondary_hold at 0x60 once the next
kernel starts. This is bad because secondary processors end up
acknowledging the next kernel with garbage, which can hang
the boot or report the wrong CPU number.
To fix this, copy r24 into r3 before branching to kexec_wait,
matching what the PACA lookup failure path already does.
Fixes: 768d18ad6d5e ("powerpc: Don't search for paca in freed memory")
Cc: [email protected]
Signed-off-by: Bradley Morgan <[email protected]>
---
arch/powerpc/kernel/head_64.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 0077ce148a5a6..6219f474d00bd 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -401,6 +401,7 @@ generic_secondary_common_init:
* which logical id maps to our physical one.
*/
#ifndef CONFIG_SMP
+ mr r3,r24
b kexec_wait /* wait for next kernel if !SMP */
#else
LOAD_REG_ADDR(r8, paca_ptrs) /* Load paca_ptrs pointe */
--
2.53.0