Re: [PATCH 24/24] alpha: add TRACE_IRQFLAGS_SUPPORT

From: Magnus Lindholm

Date: Thu Sep 03 2026 - 18:59:00 EST


Hi Matt,

On Tue, Sep 1, 2026 at 5:52 PM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> Instrument the entry/exit assembly to track hardirq state for lockdep.
>
> TRACE_IRQS_OFF is called after SAVE_ALL at each exception/interrupt
> entry point and at syscall entry. TRACE_IRQS_ON is called at
> restore_all before returning to userspace, where PAL_rti will restore
> the user IPL (re-enabling interrupts).
>
> The function call clobbers caller-saved registers, so the
> TRACE_IRQS_OFF macro reloads $0 and $16-$18 from the pt_regs frame.
> $8 (current_thread_info) is preserved because it is declared as a
> global register variable.
>
> Together with the previously added STACKTRACE_SUPPORT and
> LOCKDEP_SUPPORT, this enables LOCK_DEBUGGING_SUPPORT on Alpha.
>
> Assisted-by: Claude:claude-opus-4-6
> Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>

I think this patch needs to be rebased on top of Alpha GENERIC_ENTRY
v5. Both patches are based on entry.S blob 9f2608de2544 and modify the
same entry and return paths, so they cannot currently be applied in
either order.

With GENERIC_ENTRY, the syscall IRQ-state transitions are already
handled by syscall_enter_from_user_mode_randomize_stack() and
syscall_exit_to_user_mode(). Non-syscall user returns go through
exit_to_user_mode(), which also performs the final hardirqs-on
transition.

The interrupt path already calls raw_local_irq_disable() and updates
the lockdep state in do_entInt(), while kernel-mode PAL returns retain
the Alpha-specific lockdep_on_restore() handling.

Adding TRACE_IRQS_OFF to entSys and TRACE_IRQS_ON to restore_all would
therefore duplicate the generic-entry transitions. I think the patch
should instead be rebased and limited to any entry paths which remain
uncovered after GENERIC_ENTRY v5 is applied.

Keeping these transitions in the generic C entry helpers where
possible would also avoid additional register-save and restore logic
in entry.S.

Regards,
Magnus