[RFC PATCH 31/36] arm64: nmi: Add handling of superpriority interrupts as NMIs

Jinjie Ruan ruanjinjie at huawei.com
Thu Jul 16 02:26:08 PDT 2026



On 7/15/2026 10:08 PM, Vladimir Murzin wrote:
> On 7/15/26 13:07, Jinjie Ruan wrote:
>>> FEAT_NMI
>>>
>>>   We can distinguish between an NMI and an IRQ on exception
>>>   entry. Thus, for an IRQ, we can immediately drop to NOIRQ_CONTEXT
>>>   before passing control to the IRQ handler, allowing NMIs to preempt
>>>   the IRQ handler. This corresponds to case 2 of the pNMI flow above.
>>>
>> I think this is not quite correct. When entering the __el1_irq()
>> function, if only system_uses_nmi() is true, it does not necessarily
>> mean it is NOIRQ_CONTEXT.
>>
>> I believe the unmasking of allint, or NOIRQ_CONTEXT, should be delayed
>> until gic_handle_irq() actually before we processes the interrupt as
>> gic_unmask_pnmis() do it. At this point, it is still NONMI_CONTEXT to
>> keep  hardware NMI masked as isr_el1.IS is not set.
> 
> It looks like your LLM needs the additional context from the
> "[RFC PATCH 36/36] irqchip/gic-v3: Implement FEAT_GICv3_NMI support".

Not LLM, but based on my understanding of Mark's previous code. The last
patch has not been reviewed yet.

> 
> With that context, it should recognise that NMIs and IRQs take
> separate handling paths and use separate hardware state, so they do
> not interfere with each other. As a result, IRQ handling only needs to
> mask IRQs. In other words, there is no need to delay entering
> NOIRQ_CONTEXT until reaching the GIC.

Thank you for the reminder, I will take a closer look.

> 
> Cheers
> Vladimir
> 
> 
> 




More information about the linux-arm-kernel mailing list