riscv: to make sure the cores in .Lsecondary_park
PATCH 1/1 riscv: to make sure the cores in .Lsecondary_park
The code in secondary_park is currently placed in the .init section. The kernel reclaims and clears this code when it finishes booting. That causes the cores parked in it to go to somewhere unpredictable, so we move this function out of init to make sure the cores stay looping there.
--- arch/riscv/kernel/head.S | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
arch/riscv/kernel/head.S +8 -5
@@ -217,11 +217,6 @@ relocate: tail smp_callin #endif -.align 2 -.Lsecondary_park: - /* We lack SMP support or have too many harts, so park this hart */ - wfi - j .Lsecondary_park END(_start) #ifdef CONFIG_RISCV_M_MODE
@@ -303,6 +298,14 @@ ENTRY(reset_regs) END(reset_regs) #endif /* CONFIG_RISCV_M_MODE */ +__FINIT +.section ".text", "ax",@progbits +.align 2 +.Lsecondary_park: + /* We lack SMP support or have too many harts, so park this hart */ + wfi + j .Lsecondary_park + __PAGE_ALIGNED_BSS /* Empty zero page */ .balign PAGE_SIZE
Signature · 1 line
2.17.1
Hi Greentime,
Quoted 27 lines · Greentime Hu
The code in
secondary_parkis currently placed in the .init section. The kernel reclaims and clears this code when it finishes booting. That causes the cores parked in it to go to somewhere unpredictable, so we move this function out of init to make sure the cores stay looping there.Signed-off-by Greentime Hu <[email protected]>--- arch/riscv/kernel/head.S | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)arch/riscv/kernel/head.S +0
-5@@ -217,11 +217,6 @@ relocate: tail smp_callin #endif -.align 2 -.Lsecondary_park: - /* We lack SMP support or have too many harts, so park this hart */ - wfi - j .Lsecondary_park END(_start) #ifdef CONFIG_RISCV_M_MODE
arch/riscv/kernel/head.S ENTRY(reset_regs) · line 302
Quoted 5 lines
arch/riscv/kernel/head.S +2
-0@@ -303,6 +298,14 @@ ENTRY(reset_regs) END(reset_regs) #endif /* CONFIG_RISCV_M_MODE */ +__FINIT +.section ".text", "ax",@progbits
Can the __FINIT be dropped?
arch/riscv/kernel/head.S ENTRY(reset_regs) · line 311
Quoted 9 lines
arch/riscv/kernel/head.S +6
-0+.align 2 +.Lsecondary_park: + /* We lack SMP support or have too many harts, so park this hart */ + wfi + j .Lsecondary_park + __PAGE_ALIGNED_BSS /* Empty zero page */ .balign PAGE_SIZE
- Paul
Quoted 35 lines · Paul Walmsley
Hi Greentime,
Quoted 30 lines · Greentime Hu
The code in
secondary_parkis currently placed in the .init section. The kernel reclaims and clears this code when it finishes booting. That causes the cores parked in it to go to somewhere unpredictable, so we move this function out of init to make sure the cores stay looping there.Signed-off-by Greentime Hu <[email protected]>--- arch/riscv/kernel/head.S | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)arch/riscv/kernel/head.S +0
-5@@ -217,11 +217,6 @@ relocate: tail smp_callin #endif -.align 2 -.Lsecondary_park: - /* We lack SMP support or have too many harts, so park this hart */ - wfi - j .Lsecondary_park END(_start) #ifdef CONFIG_RISCV_M_MODE@@ -303,6 +298,14 @@ ENTRY(reset_regs) END(reset_regs) #endif /* CONFIG_RISCV_M_MODE */
Quoted 4 lines
arch/riscv/kernel/head.S ENTRY(reset_regs) · line 302
Quoted 2 lines
arch/riscv/kernel/head.S +2
-0+__FINIT +.section ".text", "ax",@progbitsCan the
__FINITbe dropped?
Yes, Paul.
It can be dropped. I'll send v2.