[PATCH 3/3] riscv: crash: use NMI to stop the CPU

Radim Krčmář rkrcmar at ventanamicro.com
Tue Oct 28 05:36:20 PDT 2025


2025-10-28T10:42:12+00:00, Conor Dooley <conor at kernel.org>:
> On Mon, Oct 27, 2025 at 09:34:31PM +0800, Yunhui Cui wrote:
>> NMI is more robust than IPI for stopping CPUs during crashes,
>> especially with interrupts disabled. Add SBI_SSE_EVENT_LOCAL_CRASH_NMI
>> eventid to implement NMI for stopping CPUs.
>> 
>> Signed-off-by: Yunhui Cui <cuiyunhui at bytedance.com>
>> ---
>> diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
>> @@ -487,6 +487,7 @@ enum sbi_sse_attr_id {
>>  #define SBI_SSE_EVENT_GLOBAL_LOW_PRIO_RAS	0x00108000
>>  #define SBI_SSE_EVENT_LOCAL_SOFTWARE_INJECTED	0xffff0000
>>  #define SBI_SSE_EVENT_LOCAL_UNKNOWN_NMI		0xffff0001
>> +#define SBI_SSE_EVENT_LOCAL_CRASH_NMI		0xffff0002

This event isn't defined in the SBI pull request.

I assume it's a pure software event that the platform shouldn't inject.
If we want to reserve more events for software use, why not make them
generic, like SBI_SSE_EVENT_LOCAL_SOFTWARE_INJECTED?

Thanks.



More information about the linux-riscv mailing list