From: "Radim Krčmář" <rkrcmar@ventanamicro.com>
To: "yunhui cui" <cuiyunhui@bytedance.com>
Cc: <conor@kernel.org>, <paul.walmsley@sifive.com>,
<palmer@dabbelt.com>, <aou@eecs.berkeley.edu>, <alex@ghiti.fr>,
<luxu.kernel@bytedance.com>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <jassisinghbrar@gmail.com>,
<conor.dooley@microchip.com>,
<valentina.fernandezalanis@microchip.com>,
<catalin.marinas@arm.com>, <will@kernel.org>, <maz@kernel.org>,
<timothy.hayes@arm.com>, <lpieralisi@kernel.org>, <arnd@arndb.de>,
<kees@kernel.org>, <tglx@linutronix.de>,
<viresh.kumar@linaro.org>, <boqun.feng@gmail.com>,
<linux-arm-kernel@lists.infradead.org>, <cleger@rivosinc.com>,
<atishp@rivosinc.com>, <ajones@ventanamicro.com>,
"linux-riscv" <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [External] Re: [PATCH v3 5/8] riscv: smp: use NMI for CPU stop
Date: Thu, 04 Dec 2025 22:16:24 +0900 [thread overview]
Message-ID: <DEPGLFUVHA0O.XSZVD2T1ENLD@ventanamicro.com> (raw)
In-Reply-To: <CAEEQ3wmAn=9w=fR=OMTMF17_tAcEnsdJWL_w8fw-3wA-Bfi6xw@mail.gmail.com>
2025-12-04T13:28:45+08:00, yunhui cui <cuiyunhui@bytedance.com>:
> Hi Radim,
>
> On Thu, Dec 4, 2025 at 12:07 PM Radim Krčmář <rkrcmar@ventanamicro.com> wrote:
>>
>> 2025-11-27T20:53:02+08:00, Yunhui Cui <cuiyunhui@bytedance.com>:
>> > Use NMI instead of IPI for CPU stop if RISC-V SSE NMI is supported.
>> >
>> > Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
>> > ---
>> > diff --git a/drivers/firmware/riscv/riscv_sse_nmi.c b/drivers/firmware/riscv/riscv_sse_nmi.c
>> > @@ -58,6 +58,7 @@ static int local_nmi_handler(u32 evt, void *arg, struct pt_regs *regs)
>> > type = atomic_read(this_cpu_ptr(&local_nmi));
>> >
>> > NMI_HANDLE(LOCAL_NMI_CRASH, cpu_crash_stop, cpu, regs);
>> > + NMI_HANDLE(LOCAL_NMI_STOP, cpu_stop);
>>
>> Please document the intended preemption design for all SSE events,
>> because it will be a nightmare if we forget some assumptions in the
>> coming years. (That includes the relative priorities of RAS/PMU/...)
>
> Actually, LOCAL_NMI_CRASH, LOCAL_NMI_STOP, LOCAL_NMI_BACKTRACE,
> LOCAL_NMI_KGDB, ... are all implemented via the single SSE event
> SBI_SSE_EVENT_LOCAL_SOFTWARE_INJECTED. Per the SSE design, no
> preemption will occur among CRASH, STOP, BACKTRACE, and KGDB events.
That is how it is. I don't understand why it must be like that.
For example: PMU_OVERFLOW has lower event_id than SOFTWARE_INJECTED, so
it will currently interrupt NMI_CRASH as they both have priority 0,
although NMI_CRASH probably shouldn't be masked by anything, and should
preempt everything.
NMI_BACKTRACE, on the other hand, probably shouldn't have that high
priority as there seem more important events (e.g. RAS and NMI_CRASH).
The issues can be avoided by event priorities, masking, or deemed as
non-issue, but I think it would be beneficial to provide some reasoning
behind the design, as the choices don't seem obvious to me.
Thanks.
next prev parent reply other threads:[~2025-12-04 13:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 12:52 [PATCH v3 0/8] Add NMI Support to RISC-V via SSE Yunhui Cui
2025-11-27 12:52 ` [PATCH v3 1/8] drivers: firmware: riscv: add SSE NMI support Yunhui Cui
2025-11-27 12:52 ` [PATCH v3 2/8] riscv: smp: move ipi_cpu_crash_stop() declaration to smp.h Yunhui Cui
2025-11-27 12:53 ` [PATCH v3 3/8] smp: move num_other_online_cpus() into smp.h Yunhui Cui
2025-11-27 12:53 ` [PATCH v3 4/8] riscv: smp: use NMI for crash stop Yunhui Cui
2025-11-27 12:53 ` [PATCH v3 5/8] riscv: smp: use NMI for CPU stop Yunhui Cui
2025-12-04 4:07 ` Radim Krčmář
2025-12-04 5:28 ` [External] " yunhui cui
2025-12-04 13:16 ` Radim Krčmář [this message]
2025-12-08 11:40 ` yunhui cui
2025-12-10 14:22 ` Radim Krčmář
2025-12-12 3:09 ` yunhui cui
2025-11-27 12:53 ` [PATCH v3 6/8] riscv: smp: use NMI for backtrace Yunhui Cui
2025-11-27 12:53 ` [PATCH v3 7/8] riscv: smp: kgdb: use NMI for CPU roundup Yunhui Cui
2025-11-27 12:53 ` [PATCH v3 8/8] drivers: firmware: riscv: add unknown nmi support Yunhui Cui
2025-12-04 4:11 ` Radim Krčmář
2025-12-04 5:18 ` [External] " yunhui cui
2025-12-04 13:26 ` Radim Krčmář
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=DEPGLFUVHA0O.XSZVD2T1ENLD@ventanamicro.com \
--to=rkrcmar@ventanamicro.com \
--cc=ajones@ventanamicro.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=atishp@rivosinc.com \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=cleger@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=cuiyunhui@bytedance.com \
--cc=jassisinghbrar@gmail.com \
--cc=kees@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv-bounces@lists.infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=luxu.kernel@bytedance.com \
--cc=maz@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
--cc=timothy.hayes@arm.com \
--cc=valentina.fernandezalanis@microchip.com \
--cc=viresh.kumar@linaro.org \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).