[RFC PATCH 06/36] arm64: irq: introduce a helper for GIC priority initialization

Vladimir Murzin vladimir.murzin at arm.com
Tue Jul 14 02:56:35 PDT 2026


On 7/10/26 08:29, Jinjie Ruan wrote:
> 
> On 7/9/2026 8:13 PM, Vladimir Murzin wrote:
>> From: Ada Couprie Diaz <ada.coupriediaz at arm.com>
>>
>> Arm64's `init_IRQ()` calls `local_daif_restore()` to synchronize
>> interrupt masking via DAIF and switch to masking via PMR.  This
>> depends on a very specific behaviour of `local_daif_restore()` which
>> will clear DAIF if masking interrupts via PMR, which will get removed
>> in the future.
>>
>> As `setup_arch()` cleared DA only earlier, introduce a dedicated
>> helper that explicitly initializes the PMR to mask interrupts and
>> clears DAIF, switching to IRQ priority masking.
> I believe that the `local_daif_restore(DAIF_PROCCTX_NOIRQ)` inside
> `setup_arch()` should be directly replaced with the following code.
> Otherwise, since the pseudo NMI has not yet taken effect at this point,
> it could lead to ambiguity.
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index 23c05dc7a8f2..35c5310783f4 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -311,7 +311,8 @@ void __init __no_sanitize_address setup_arch(char
> **cmdline_p)
>          * IRQ and FIQ will be unmasked after the root irqchip has been
>          * detected and initialized.
>          */
> -       local_daif_restore(DAIF_PROCCTX_NOIRQ);
> +       write_sysreg(DAIF_PROCCTX_NOIRQ, daif);
> +       trace_hardirqs_off();

That's what follow up patches do, no?

Thanks
Vladimir




More information about the linux-arm-kernel mailing list