Hi, On Wed, Jun 17, 2026 at 12:20 PM Kiryl Shutsemau <[email protected]> wrote: > > From: "Kiryl Shutsemau (Meta)" <[email protected]> > > A CPU wedged with interrupts masked ignores the stop IPI, and without > pseudo-NMI there is no NMI IPI to escalate to: a reboot proceeds with > the CPU still running, and a kdump misses its registers. > > Add a third rung to smp_send_stop(): once the IPI (and pseudo-NMI IPI, > if enabled) rungs have run, signal SDEI event 0 at whatever stayed > online. Firmware delivers it regardless of the target's DAIF, so it > reaches a CPU a plain IPI cannot; the target acks by going offline, > which the caller already polls for. > > Fold the stop bookkeeping into one arm64_nmi_cpu_stop(regs, > die_on_crash), shared by the stop IPI handlers, panic_smp_self_stop() > and the SDEI handler, replacing the near-duplicate local_cpu_stop() and > ipi_cpu_crash_stop(). @die_on_crash is the only difference: the IPI > handlers pass true and PSCI CPU_OFF the CPU on a crash stop so a capture > kernel can reclaim it; the SDEI handler and self-stop pass false and > park. The SDEI park is required, not conservative -- its handler runs > inside an SDEI event that is never completed (completing it resumes the > wedged context), and a CPU_OFF from that unfinished-event context wedges > EL3 on some firmware (left as a follow-up). The dump is unaffected; only > re-onlining the CPU in an SMP capture kernel is lost. > > Suggested-by: Douglas Anderson <[email protected]> > Signed-off-by: Kiryl Shutsemau (Meta) <[email protected]> > --- > arch/arm64/include/asm/nmi.h | 24 +++++++ > arch/arm64/kernel/smp.c | 113 +++++++++++++++++++++----------- > drivers/firmware/Kconfig | 2 + > drivers/firmware/arm_sdei_nmi.c | 86 ++++++++++++++++++++++++ > 4 files changed, 187 insertions(+), 38 deletions(-)
Reviewed-by: Douglas Anderson <[email protected]>
