Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking
From: Thomas Gleixner
Date: Tue Mar 24 2026 - 08:24:42 EST
On Sun, Mar 22 2026 at 00:25, Thomas Gleixner wrote:
> On Fri, Mar 20 2026 at 17:31, Mark Rutland wrote:
> Looking at those details made me also look at this magic
> arch_irqentry_exit_need_resched() inline function.
>
> /*
> * DAIF.DA are cleared at the start of IRQ/FIQ handling, and when GIC
> * priority masking is used the GIC irqchip driver will clear DAIF.IF
> * using gic_arch_enable_irqs() for normal IRQs. If anything is set in
> * DAIF we must have handled an NMI, so skip preemption.
> */
> if (system_uses_irq_prio_masking() && read_sysreg(daif))
> return false;
>
> Why is this using irqentry_enter/exit() in the first place?
Ah. The entry point does
if (regs_irqs_disabled(regs))
do_nmi();
else
do_irq();
So you end up in do_irq() and eventually in the preemption path and need
that check to prevent scheduling. So that should be fine and obviously
won't hit the code path I outlined.
Thanks,
tglx