Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking
From: Mark Rutland
Date: Tue Mar 24 2026 - 07:08:17 EST
On Tue, Mar 24, 2026 at 11:14:28AM +0800, Jinjie Ruan wrote:
> On 2026/3/20 19:30, Mark Rutland wrote:
> > On arm64, involuntary kernel preemption has been subtly broken since the
> > move to the generic irq entry code. When preemption occurs, the new task
> > may run with SError and Debug exceptions masked unexpectedly, leading to
> > a loss of RAS events, breakpoints, watchpoints, and single-step
> > exceptions.
>
> We can also add a check in arch_irqentry_exit_need_resched to prevent
> schedule-out when the DA bit is set.
That *might* be good enough for a backport to stable, but that's not the
right fix going forwards.
Checking the DAIF.DA bits will prevent preemption from anything other
than real interrupts, and Thomas said we should preempt wherever
possible:
https://lore.kernel.org/linux-arm-kernel/87h5qak2uv.ffs@tglx/
The interrupt handling path is also inconsistent w.r.t. masking DAIF
upon return, and with that cleaned up it'll look the same as other
exceptions, and we can't rely on DAIF.DA.
I think there are alternative options here; I have a half-written reply
to Thomas's other message:
https://lore.kernel.org/linux-arm-kernel/87fr5six4d.ffs@tglx/
... and I'll try to finish that up and get it out shortly.
Mark.