mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	James Morse <james.morse@arm.com>
Cc: Vladimir Murzin <vladimir.murzin@arm.com>,
	Ada Couprie Diaz <ada.coupriediaz@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Liao Chang <liaochang1@huawei.com>,
	Ashok Raj <ashok.raj@oss.qualcomm.com>,
	Doug Anderson <dianders@chromium.org>,
	Yin Fengwei <fengwei_yin@linux.alibaba.com>,
	Pengjie Zhang <zhangpengjie2@huawei.com>,
	Cong Wang <cwang@multikernel.io>, <kernel-team@meta.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] firmware: arm_sdei: Fix NMI backtrace lockups on idle CPUs
Date: Wed, 25 Nov 2026 10:21:29 +0800	[thread overview]
Message-ID: <e5890cea-2bc8-467a-9cd9-cad5d0820c74@huawei.com> (raw)
In-Reply-To: <20261124194707.1030653-1-kas@kernel.org>



在 2026/11/25 3:47, Kiryl Shutsemau (Meta) 写道:
> The SDEI NMI backtrace signals event 0 to every other CPU, including the
> ones in a power-down idle state, where the kernel has SDEI masked. TF-A
> acknowledges the SGI behind event 0 on a masked PE and never ends it,
> and the PE takes no Non-secure interrupt again. Jinjie hit it on a
> 384-CPU HIP12, where one sysrq-l locked up the machine.
> 
> Patch 1 keeps event 0 away from masked PEs. Patch 2 sends the regular
> backtrace IPI to the CPUs that SDEI refused, which wakes them.
> 
> TF-A v2.13 and later refuse to signal a masked PE, but a PE that masks
> right after the check still takes the SGI. The TF-A fix is under review:
> 
>   https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/55414
> 
> Tested under QEMU TCG with TF-A built without that check, 4 CPUs. One
> CPU masks and unmasks SDEI in a loop, through cpu_pm, the mask calls and
> CPU hotplug, while another signals it; sysrq-l afterwards. Signalling
> with plain SMCs, as the kernel does now, wedges the target. With the
> series every run passed, lockdep included, and a panic in the middle of
> it completes.
> 
> Jinjie ran an earlier version on HIP12 with the power-down state
> enabled: sysrq-l got 384/384 answers every run. The handshake has
> changed since; Jinjie, could you give this one a run as well?

Tested-by: Jinjie Ruan <ruanjinjie@huawei.com>

On HIP12 (SDEI v1.0 firmware), v7.4-rc3 plus the two patches, SDEI
active, acpi_idle with state1 = CorePowerdown enabled: sysrq-l answered
on all 384 CPUs on every run, nine runs total, three of them under load.
 No "still haven't responded", no SDEI_EVENT_SIGNAL failures, no "did
not arrive within 1ms" warnings, no lockups.

State1/usage shows the CPUs really did go through CorePowerdown, so the
handshake and the IPI fallback were exercised.

Thanks,
Jinjie

> 
> Kiryl Shutsemau (Meta) (2):
>   firmware: arm_sdei: Do not signal event 0 to a masked PE
>   firmware: arm_sdei_nmi: Send the backtrace IPI to CPUs with SDEI
>     masked
> 
>  arch/arm64/include/asm/nmi.h    |   7 ++
>  arch/arm64/kernel/smp.c         |   2 +-
>  drivers/firmware/arm_sdei.c     | 130 ++++++++++++++++++++++++++++++--
>  drivers/firmware/arm_sdei_nmi.c |  30 ++++++--
>  include/linux/arm_sdei.h        |   4 +-
>  5 files changed, 157 insertions(+), 16 deletions(-)
> 
> 
> base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f


      parent reply	other threads:[~2026-11-25  2:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 19:47 Kiryl Shutsemau (Meta)
2026-11-24 19:47 ` [PATCH 1/2] firmware: arm_sdei: Do not signal event 0 to a masked PE Kiryl Shutsemau (Meta)
2026-11-24 19:47 ` [PATCH 2/2] firmware: arm_sdei_nmi: Send the backtrace IPI to CPUs with SDEI masked Kiryl Shutsemau (Meta)
2026-11-25  2:21 ` Jinjie Ruan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5890cea-2bc8-467a-9cd9-cad5d0820c74@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=ada.coupriediaz@arm.com \
    --cc=ashok.raj@oss.qualcomm.com \
    --cc=catalin.marinas@arm.com \
    --cc=cwang@multikernel.io \
    --cc=dianders@chromium.org \
    --cc=fengwei_yin@linux.alibaba.com \
    --cc=james.morse@arm.com \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=liaochang1@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=vladimir.murzin@arm.com \
    --cc=will@kernel.org \
    --cc=zhangpengjie2@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®