[BOOT-WRAPPER v2 08/10] Simplify spin logic

Mark Rutland mark.rutland at arm.com
Thu Aug 22 02:54:46 PDT 2024


On Wed, Aug 21, 2024 at 05:55:25PM +0100, Andre Przywara wrote:
> On Mon, 12 Aug 2024 11:15:53 +0100
> Mark Rutland <mark.rutland at arm.com> wrote:
> 
> > The logic for initial boot is more complicated than it needs to be,
> > with both first_spin() having a special case for CPU0 that requires an
> > additional argument to be passed to spin().
> > 
> > Simplify this by moving the special-case logic for CPU0 into
> > first_spin(). This removes the need to provide a dummy mailbox for CPU0
> > to spin on, simplfiies callers of first_spin() and spin(), which no
> > longer need to pass a dummy mailbox or 'is_entry' for CPU0.
> 
> Ah, that's a nice one! Indeed this looks much cleaner now. The change
> looks good to me, just some small thing below:
> 
> > Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> > Acked-by: Marc Zyngier <maz at kernel.org>
> > Cc: Akos Denke <akos.denke at arm.com>
> > Cc: Andre Przywara <andre.przywara at arm.com>
> > Cc: Luca Fancellu <luca.fancellu at arm.com>
> > ---
> >  arch/aarch64/spin.S | 11 +----------
> >  common/boot.c       | 20 ++++++++------------
> >  common/psci.c       |  2 +-
> >  include/boot.h      |  2 +-
> >  4 files changed, 11 insertions(+), 24 deletions(-)
> > 
> > diff --git a/arch/aarch64/spin.S b/arch/aarch64/spin.S
> > index 375f732..a7879d4 100644
> > --- a/arch/aarch64/spin.S
> > +++ b/arch/aarch64/spin.S
> > @@ -23,15 +23,6 @@ ASM_FUNC(start_bootmethod)
> >  	 * Primary CPU (x0 = 0) jumps to kernel, the other ones wait for an
> >  	 * address to appear in mbox
> 
> I think this comment is a bit out of place now, either remove it entirely,
> or hint that first_spin will take care of the difference between mbox and
> kernel entrypoint.

I'll delete it.

> Regardless:
> 
> Reviewed-by: Andre Przywara <andre.przywara at arm.com>

Thanks!

Mark.



More information about the linux-arm-kernel mailing list