Skip to content

Commit 2dc0bc1

Browse files
committed
powerpc/64e: Fix secondary thread bringup for ELFv2 kernels
When booting on e6500 with an ELF v2 ABI kernel, the secondary threads do not start correctly: [ 0.051118] smp: Bringing up secondary CPUs ... [ 5.072700] Processor 1 is stuck. This occurs because the startup code is written to use function descriptors when loading the entry point for the secondary threads. When building with ELF v2 ABI there are no function descriptors, and the code loads junk values for the entry point address. Fix it by using ppc_function_entry() in C, and DOTSYM() in asm, both of which work correctly for ELF v2 ABI as well as ELF v1 ABI kernels. Fixes: 8c5fa3b ("powerpc/64: Make ELFv2 the default for big-endian builds") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230801102650.48705-1-mpe@ellerman.id.au
1 parent 41a506e commit 2dc0bc1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

arch/powerpc/kernel/head_64.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ _GLOBAL(generic_secondary_smp_init)
375375
beq 20f
376376

377377
/* start the specified thread */
378-
LOAD_REG_ADDR(r5, fsl_secondary_thread_init)
379-
ld r4, 0(r5)
378+
LOAD_REG_ADDR(r5, DOTSYM(fsl_secondary_thread_init))
380379
bl book3e_start_thread
381380

382381
/* stop the current thread */

arch/powerpc/platforms/85xx/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void wake_hw_thread(void *info)
180180
unsigned long inia;
181181
int cpu = *(const int *)info;
182182

183-
inia = *(unsigned long *)fsl_secondary_thread_init;
183+
inia = ppc_function_entry(fsl_secondary_thread_init);
184184
book3e_start_thread(cpu_thread_in_core(cpu), inia);
185185
}
186186
#endif

0 commit comments

Comments
 (0)