Re: [PATCH 1/2] firmware: arm_sdei: Do not signal event 0 to a masked PE
From: YinFengwei
Date: Wed Nov 25 2026 - 04:50:24 EST
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?
> + } else {
> + raw_spin_lock_irqsave(&pe->lock, flags);
> + WRITE_ONCE(pe->unmasked, false);
> + raw_spin_unlock_irqrestore(&pe->lock, flags);
> + }
> +
> + sdei_wait_in_flight(pe);
> +}
> +
> static int sdei_pm_notifier(struct notifier_block *nb, unsigned long action,
> void *data)
> {
> + struct sdei_pe *pe = this_cpu_ptr(&sdei_pe);
> int rv;
>
> WARN_ON_ONCE(preemptible());
>
> switch (action) {
> case CPU_PM_ENTER:
> + /*
> + * Leave alone a PE that is masked already: before
> + * sdei_cpuhp_up(), or after sdei_cpuhp_down(), as cpuidle runs
> + * until CPU_OFF. CPU_PM_EXIT must not unmask it.
> + */
> + if (!pe->unmasked)
I am wondering whether READ_ONCE() should be used here?
Regards
Yin, Fengwei