Re: [RFC PATCH 06/36] arm64: irq: introduce a helper for GIC priority initialization
From: Vladimir Murzin <hidden>
Date: 2026-07-14 09:56:48
On 7/10/26 08:29, Jinjie Ruan wrote:
quoted hunk ↗ jump to hunk
On 7/9/2026 8:13 PM, Vladimir Murzin wrote:quoted
From: Ada Couprie Diaz <redacted> 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