[PATCH 36/38] genirq: Trust local irqchip when considering IRQ for NMI

Jinjie Ruan ruanjinjie at huawei.com
Thu Sep 17 05:06:29 PDT 2026



在 2026/9/14 18:21, Vladimir Murzin 写道:
> Generic IRQ code sanitises whether an IRQ can be considered for NMI
> use. Currently, it only considers IRQs managed by the root irqchip.
> 
> GICv5 IPIs belong to a logical domain built on top of the LPI domain.
> Consequently, generic IRQ code rejects these IPIs for NMI use, even
> though their hardware state is managed by the root LPI domain.
> 
> One way to allow GICv5 IPIs to be used as NMIs would be to adjust the
> sanitisation logic to account for this domain hierarchy. However, the
> generic IRQ code can instead trust the local irqchip.
> 
> Remove the root irqchip check and use the local irqchip when
> considering an IRQ for NMI use.
> 
> Suggested-by: Marc Zyngier <maz at kernel.org>
> Signed-off-by: Vladimir Murzin <vladimir.murzin at arm.com>
> ---
>  include/linux/irq.h | 2 +-
>  kernel/irq/manage.c | 5 -----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index f485369b1b4f..92d3ad639ae8 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -563,7 +563,7 @@ struct irq_chip {
>   * IRQCHIP_ONESHOT_SAFE:              One shot does not require mask/unmask
>   * IRQCHIP_EOI_THREADED:              Chip requires eoi() on unmask in threaded mode
>   * IRQCHIP_SUPPORTS_LEVEL_MSI:        Chip can provide two doorbells for Level MSIs
> - * IRQCHIP_SUPPORTS_NMI:              Chip can deliver NMIs, only for root irqchips
> + * IRQCHIP_SUPPORTS_NMI:              Chip can deliver NMIs
>   * IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND:  Invokes __enable_irq()/__disable_irq() for wake irqs
>   *                                    in the suspend path if they are in disabled state
>   * IRQCHIP_AFFINITY_PRE_STARTUP:      Default affinity update before startup
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 57eff26fa646..c9ad79743ef6 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1370,11 +1370,6 @@ static bool irq_supports_nmi(struct irq_desc *desc)
>  {
>  	struct irq_data *d = irq_desc_get_irq_data(desc);
>  
> -#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
> -	/* Only IRQs directly managed by the root irqchip can be set as NMI */
> -	if (d->parent_data)
> -		return false;
> -#endif

Reviewed-by: Jinjie Ruan <ruanjinjie at huawei.com>

>  	/* Don't support NMIs for chips behind a slow bus */
>  	if (d->chip->irq_bus_lock || d->chip->irq_bus_sync_unlock)
>  		return false;

-- 
Best regards,
Jinjie




More information about the linux-arm-kernel mailing list