Re: [PATCH 01/24] alpha: fix arch_irqs_disabled_flags() to treat any raised IPL as disabled
From: Magnus Lindholm
Date: Tue Sep 01 2026 - 19:22:55 EST
Hi, Matt
On Tue, Sep 1, 2026 at 5:50 PM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> arch_irqs_disabled_flags() only reported interrupts as disabled at
> IPL_MAX, but the kernel is not the only thing that sets the IPL. PALcode
> raises PS.IPL to the level of the interrupt being delivered before
> entering the handler, so a handler entered for a device interrupt runs at
> IPL_DEV0 or IPL_DEV1, and the timer at IPL_TIMER. Interrupts at and
> below that level are blocked, but arch_irqs_disabled() answered that
> interrupts were enabled.
>
> Treat any IPL above IPL_MIN, the level arch_local_irq_enable() restores,
> as interrupts disabled. This matters as soon as lockdep is asked to
> track hardirq state, where irqs_disabled() is expected to be true inside
> an interrupt handler.
>
Hi Matt,
Thanks for the explanation, but I still do not think that treating every
raised IPL as "IRQs disabled" is correct.
The Alpha Architecture Reference Manual, Section 19.1.2, says that an
interrupt is delivered when its IPL is greater than the IPL in the
current PS. Table 19-1 in Section 19.2 documents the OSF PAL IPL range
from 0 to 7. An intermediate IPL therefore masks only interrupts at or
below that priority; higher-priority interrupts remain enabled. Only
IPL 7 masks all OS-visible interrupt levels.
The 21164 Hardware Reference Manual, Section 4.15.3, states the same
rule: an interrupt is enabled when the current IPL is less than the
interrupt's target IPL.
Thus, IPL_MIN means interrupts are enabled, an intermediate IPL is only
a partial mask, and IPL_MAX masks all interrupt levels.
I therefore think arch_irqs_disabled_flags() should retain the meaning
of fully disabled local IRQs:
return (flags & 7) == IPL_MAX;
If lockdep or generic entry requires IRQs to be disabled on entry, I
think the entry code should first raise the live IPL to IPL_MAX, rather
than report an intermediate IPL as fully disabled.
Regards,
Magnus