Re: [PATCH 1/2] firmware: arm_sdei: Do not signal event 0 to a masked PE

From: YinFengwei

Date: Wed Nov 25 2026 - 19:53:01 EST


On Wed, Nov 25, 2026 at 02:00:40PM +0000, Kiryl Shutsemau (Meta) wrote:
> On Wed, Nov 25, 2026 at 05:50:10PM +0800, YinFengwei wrote:
> > Hi Kirill,
> >
> > On Tue, Nov 24, 2026 at 07:47:04PM +0000, Kiryl Shutsemau (Meta) wrote:
> > > The SDEI NMI backtrace signals event 0 to every other CPU, idle ones
> > <snip>
> > > +static void sdei_block_signal(void)
> > > +{
> > > + struct sdei_pe *pe = this_cpu_ptr(&sdei_pe);
> > > + unsigned long flags;
> > > +
> > > + /*
> > > + * A panic from an SDEI event or a pseudo-NMI may have left the lock
> > > + * held by this CPU. The CPUs that could signal it are stopped by now.
> > > + */
> > > + if (panic_on_this_cpu()) {
> > > + WRITE_ONCE(pe->unmasked, false);
> > If the panic didn't take the lock, should lock be taken
> > just like "else" path?
>
> If another CPU holds it at this point, that CPU was stopped in the
> middle of signalling this one, and it will never drop the lock. The
> panic would hang on it.
>
> If nobody holds it, there is nothing for it to keep out. This runs at
> the end of smp_send_stop(), after the other CPUs have been stopped. A
> sender stopped after it took the lock has either counted its signal,
> which sdei_wait_in_flight() waits for, or never sent one.
Ah. Yes. This is the key point. If it's panic and trying to do
sdei_block_siganl(), it's in smp_send_stop() on panic path. Thanks a
lot for detail explaination.

Reviewed-by: Yin Fengwei <fengwei_yin@xxxxxxxxxxxxxxxxx>


Regards
Yin Fengwei