RE: [PATCH 1/2] arm: traps: move declaration for irq_stack_ptr to irq.h
From: Maninder Singh
Date: Mon Jun 08 2026 - 05:20:11 EST
Hi Linus Walleij,
> Hi Maninder,
>
> thanks for your patch!
>
> On Mon, Apr 27, 2026 at 7:52 AM Maninder Singh <maninder1.s@xxxxxxxxxxx> wrote:
>
> > Moving declaration for irq_stack_ptr to irq.h,
> > because next patch will use it for IRQ STACK checking.
>
> OK
>
> > Also irq_stack_ptr is defined as READ_MOSTLY, so declaration
> > should also be the same.
>
> But is that even right in the first place?
>
> AFAIU a stack pointer is usually read exactly as much as it
> is written.
>
I checked for ARM64 as well, and it was "not" defined as READ_MOSTLY.
But instead of changing it, I kept it same.
Because I thought it is written during system boot only, and after that
it is read only. That might be the reason ARM has kept it as READ_MOSTLY?
arch/arm/kernel/irq.c
static void __init init_irq_stacks(void)
{
..
per_cpu(irq_stack_ptr, cpu) = &stack[THREAD_SIZE];
...
}
There is no other write to this after that I think.
stack can be read and write , but this pointer is read mostly after initial setup.
Thanks and Regards,
Maninder Singh