[PATCH] arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()
Prundeanu, Cristian
cpru at amazon.com
Mon Jul 21 14:42:23 PDT 2025
On Fri, Jul 18, 2025 at 03:28:14PM +0100, Ada Couprie Diaz wrote:
> Completely mask DAIF in `cpu_switch_to()` and restore it when returning.
> Do the same in `call_on_irq_stack()`, but restore and mask around
> the branch.
> Mask DAIF even if CONFIG_SHADOW_CALL_STACK is not enabled for consistency
> of behaviour between all configurations.
>
> Introduce and use an assembly macro for saving and masking DAIF,
> as the existing one saves but only masks IF.
>
> Signed-off-by: Ada Couprie Diaz <ada.coupriediaz at arm.com>
> Reported-by: Cristian Prundeanu <cpru at amazon.com>
> Fixes: 59b37fe52f49955791a460752c37145f1afdcad1 ("arm64: Stash shadow stack pointer in the task struct on interrupt")
Confirming this fixes the spontaneous reboot previously observed when
enabling both pseudo-NMI (irqchip.gicv3_pseudo_nmi=1) and shadow call
stack (CONFIG_SHADOW_CALL_STACK=y). Tested both on kernel 6.16-rc7 and
legacy kernel 6.8 where the issue was initially observed.
Tested-by: Cristian Prundeanu <cpru at amazon.com>
-Cristian
More information about the linux-arm-kernel
mailing list