[PATCH v2] arm64: sdei: add sdei_nmi.disabled= to keep the GIC NMI path reachable

Prasanna Kumar T S M ptsm at linux.microsoft.com
Sat Nov 28 08:52:02 PST 2026



On 25-11-2026 13:38, Jinjie Ruan wrote:
> While the SDEI cross-CPU NMI provider is active it claims every
> cross-CPU backtrace, so on a platform whose firmware exposes SDEI
> event 0 the irqchip NMI path can never be used.  There is no way to
> opt out.
> 
> Add a boot parameter "sdei_nmi.disabled".
> 
> With sdei_nmi.disabled=1, the SDEI NMI will not be registered, so
> sdei_nmi_available stays false and the hooks decline on their own, which
> lets arch_trigger_cpumask_backtrace() fall through to its IPI path.
> 
> Suggested-by: Kiryl Shutsemau (Meta) <kas at kernel.org>
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
> ---
> v2:
> - Alphabetical order.
> - Simplify the code by return before registering event 0.
> ---
>   Documentation/admin-guide/kernel-parameters.txt |  8 ++++++++
>   drivers/firmware/Kconfig                        |  4 ++++
>   drivers/firmware/arm_sdei_nmi.c                 | 17 +++++++++++++++++
>   3 files changed, 29 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 176648941aec..4f07c771b46b 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -6934,6 +6934,14 @@ Kernel parameters
>   			non-zero "wait" parameter.  See weight_single
>   			and weight_many.
>   
> +	sdei_nmi.disabled= [ARM64,EARLY]
> +			Disable SDEI-based cross-CPU NMI and leave the GIC NMI
> +			path in place. Requires the kernel to be built with
> +			CONFIG_ARM_SDEI_NMI.
> +			Format: { "0" | "1" }
> +			0 -- enable (default).
> +			1 -- disable.
> +
>   	sdw_mclk_divider=[SDW]
>   			Specify the MCLK divider for Intel SoundWire buses in
>   			case the BIOS does not provide the clock rate properly.
> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
> index 43e2e2a64594..4c8b917867dd 100644
> --- a/drivers/firmware/Kconfig
> +++ b/drivers/firmware/Kconfig
> @@ -58,6 +58,10 @@ config ARM_SDEI_NMI
>   	  regardless of the target's PSTATE.DAIF -- forced delivery into a
>   	  CPU wedged with interrupts locally masked.
>   
> +	  This provider takes over every cross-CPU backtrace; set the
> +	  kernel parameter "sdei_nmi.disabled" to 1 to use the irqchip
> +	  NMI path instead.
> +
>   	  If unsure, say N.
>   
>   config EDD
> diff --git a/drivers/firmware/arm_sdei_nmi.c b/drivers/firmware/arm_sdei_nmi.c
> index 038eb79e28ac..0e146e603354 100644
> --- a/drivers/firmware/arm_sdei_nmi.c
> +++ b/drivers/firmware/arm_sdei_nmi.c
> @@ -62,6 +62,18 @@
>   
>   static bool sdei_nmi_available;
>   
> +/*
> + * Mirrors irqchip.gicv3_pseudo_nmi=: the architected NMI path
> + * is preferred when asked for, and SDEI stays out of the way.
> + */
> +static bool sdei_nmi_disabled __initdata;
> +
> +static int __init sdei_nmi_disable_setup(char *str)
> +{
> +	return kstrtobool(str, &sdei_nmi_disabled);
> +}
> +early_param("sdei_nmi.disabled", sdei_nmi_disable_setup);
> +
>   #define SDEI_NMI_EVENT			0
>   
>   /*
> @@ -222,6 +234,11 @@ static int __init sdei_nmi_init(void)
>   	if (!sdei_is_present())
>   		return 0;
>   
> +	if (sdei_nmi_disabled) {
> +		pr_info("SDEI cross-CPU NMI disabled by sdei_nmi.disabled.\n");
> +		return 0;
> +	}
> +
>   	err = sdei_event_register(SDEI_NMI_EVENT, sdei_nmi_handler, NULL);
>   	if (err) {
>   		pr_err("sdei_event_register(%u) failed: %d\n",

Looks good to me.

Reviewed-by: Prasanna Kumar T S M <ptsm at linux.microsoft.com>.



More information about the linux-arm-kernel mailing list