чт, 5 окт. 2023 г., 22:17 Mark Kettenis <mark.kette...@xs4all.nl>:

> > > Really, if those secondary CPUs don't come up, your system is beyond
> > > repair.  You need to do some low-level debugging at that point and DDB
> > > isn't going to help you.  So no, let's keep this code as simple as we
> > > can.
> > >
> >
> > This cores are starting and working properly,
> > but something messes with order
> > (maybe related to shared caches per 2 cores cluster, I'm not so
> > hardware-good ).
> > So 7th core will answer that it booted after 6th core.
> > But with 'while' loop we never got to 6th core.
>
> That suggests that the interrupt that we think we're sending to the
> 6th core is actually going to the 7th core and vice-versa.  Feels like
> a firmware bug to me.  What hardware is this on?
>

This is different Baikal-M (arm64, cortex-a57) based boards with more
or less same firmware of different versions.
I can attach dtb and decompiled dts from one of it, if it can help.



> > > > Index: sys/arch/arm64//arm64/cpu.c
> > > > ===================================================================
> > > > RCS file: /cvs/src/sys/arch/arm64/arm64/cpu.c,v
> > > > retrieving revision 1.98
> > > > diff -u -p -r1.98 cpu.c
> > > > --- sys/arch/arm64//arm64/cpu.c       10 Aug 2023 19:29:32 -0000      
> > > > 1.98
> > > > +++ sys/arch/arm64//arm64/cpu.c       25 Sep 2023 13:24:39 -0000
> > > > @@ -1096,6 +1096,8 @@ cpu_start_secondary(struct cpu_info *ci,
> > > >  void
> > > >  cpu_boot_secondary(struct cpu_info *ci)
> > > >  {
> > > > +     int i;
> > > > +
> > > >       atomic_setbits_int(&ci->ci_flags, CPUF_GO);
> > > >       __asm volatile("dsb sy; sev" ::: "memory");
> > > >
> > > > @@ -1105,8 +1107,16 @@ cpu_boot_secondary(struct cpu_info *ci)
> > > >        */
> > > >       arm_send_ipi(ci, ARM_IPI_NOP);
> > > >
> > > > -     while ((ci->ci_flags & CPUF_RUNNING) == 0)
> > > > +     for (i = 1000; (!(ci->ci_flags & CPUF_RUNNING)) && i>0;i--) {
> > > >               __asm volatile("wfe");
> > > > +     }
> > > > +     if (! (ci->ci_flags & CPUF_RUNNING)) {
> > > > +             printf("cpu %d failed to start\n", ci->ci_cpuid);
> > > > +#if defined(MPDEBUG) && defined(DDB)
> > > > +             printf("dropping into debugger; continue from here to 
> > > > resume boot\n");
> > > > +             db_enter();
> > > > +#endif
> > > > +     }
> > > >  }
> > > >
> > > >  void
> > > >
> > > >
> >

Attachment: bober.patched.dts
Description: audio/vnd.dts

Attachment: bober.patched.dtb
Description: Binary data

Reply via email to