All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: to make sure the cores in .Lsecondary_park
@ 2020-01-07  9:16 Greentime Hu
  2020-01-07 10:54   ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Greentime Hu @ 2020-01-07  9:16 UTC (permalink / raw)
  To: green.hu, greentime, paul.walmsley, palmer, linux-riscv, linux-kernel
  Cc: Greentime Hu

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.

Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
---
 arch/riscv/kernel/head.S | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index f8f996916c5b..d8da076fc69e 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: to make sure the cores in .Lsecondary_park
  2020-01-07  9:16 [PATCH] riscv: to make sure the cores in .Lsecondary_park Greentime Hu
@ 2020-01-07 10:54   ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2020-01-07 10:54 UTC (permalink / raw)
  To: Greentime Hu; +Cc: green.hu, greentime, palmer, linux-riscv, linux-kernel

Hi Greentime,

On Tue, 7 Jan 2020, Greentime Hu wrote:

> 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.
> 
> Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
> ---
>  arch/riscv/kernel/head.S | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index f8f996916c5b..d8da076fc69e 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -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

Can the __FINIT be dropped?

> +.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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: to make sure the cores in .Lsecondary_park
@ 2020-01-07 10:54   ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2020-01-07 10:54 UTC (permalink / raw)
  To: Greentime Hu; +Cc: greentime, linux-riscv, palmer, green.hu, linux-kernel

Hi Greentime,

On Tue, 7 Jan 2020, Greentime Hu wrote:

> 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.
> 
> Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
> ---
>  arch/riscv/kernel/head.S | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index f8f996916c5b..d8da076fc69e 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -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

Can the __FINIT be dropped?

> +.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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: to make sure the cores in .Lsecondary_park
  2020-01-07 10:54   ` Paul Walmsley
@ 2020-01-08  2:39     ` Greentime Hu
  -1 siblings, 0 replies; 5+ messages in thread
From: Greentime Hu @ 2020-01-08  2:39 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Gt, greentime, Palmer Dabbelt, linux-riscv, Linux Kernel Mailing List

On Tue, Jan 7, 2020 at 6:54 PM Paul Walmsley <paul.walmsley@sifive.com> wrote:
>
> Hi Greentime,
>
> On Tue, 7 Jan 2020, Greentime Hu wrote:
>
> > 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.
> >
> > Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
> > ---
> >  arch/riscv/kernel/head.S | 13 ++++++++-----
> >  1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> > index f8f996916c5b..d8da076fc69e 100644
> > --- a/arch/riscv/kernel/head.S
> > +++ b/arch/riscv/kernel/head.S
> > @@ -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
>
> Can the __FINIT be dropped?

Yes, Paul.
It can be dropped. I'll send v2.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: to make sure the cores in .Lsecondary_park
@ 2020-01-08  2:39     ` Greentime Hu
  0 siblings, 0 replies; 5+ messages in thread
From: Greentime Hu @ 2020-01-08  2:39 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: greentime, linux-riscv, Palmer Dabbelt, Gt, Linux Kernel Mailing List

On Tue, Jan 7, 2020 at 6:54 PM Paul Walmsley <paul.walmsley@sifive.com> wrote:
>
> Hi Greentime,
>
> On Tue, 7 Jan 2020, Greentime Hu wrote:
>
> > 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.
> >
> > Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
> > ---
> >  arch/riscv/kernel/head.S | 13 ++++++++-----
> >  1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> > index f8f996916c5b..d8da076fc69e 100644
> > --- a/arch/riscv/kernel/head.S
> > +++ b/arch/riscv/kernel/head.S
> > @@ -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
>
> Can the __FINIT be dropped?

Yes, Paul.
It can be dropped. I'll send v2.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-08  2:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  9:16 [PATCH] riscv: to make sure the cores in .Lsecondary_park Greentime Hu
2020-01-07 10:54 ` Paul Walmsley
2020-01-07 10:54   ` Paul Walmsley
2020-01-08  2:39   ` Greentime Hu
2020-01-08  2:39     ` Greentime Hu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.