Re: [PATCH RFC] arm64: entry: PSTATE_I_SET is leaking on pseudo NMI mode
From: Vladimir Murzin
Date: Mon Aug 10 2026 - 09:25:30 EST
On 8/10/26 13:44, Jinjie Ruan wrote:
>> Agreed on the need for a clearer explanation.
>>
>> Perhaps local_irq_disable() isn't the right API here, and we should
>> use local_daif_restore(DAIF_PROCCTX_NOIRQ) instead?
> The local_irq_disable() here is pair with the local_irq_enable() in
> preempt_schedule_irq(). So I think it is not correct to replace them
> separately.
>
> The pseudo NMI does not consider how to do local_irq_disable() /enable()
> when the interrupt is masked by the DAIF.I bit as I reported before.
Unless I missed anything local_daif_restore(DAIF_PROCCTX_NOIRQ) would
clear DAIF.{IF} and set PMR to GIC_PRIO_IRQOFF which is the state we
expect from local_irq_disable() so we can do local_irq_{en,dis}able()
later on.
Cheers
Vladimir