Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: remove CONFIG_VMAP_STACK checks from stacktrace overflow logic

With VMAP_STACK now always enabled on arm64, remove all CONFIG_VMAP_STACK
conditionals from overflow stack handling in stacktrace code.

This change unconditionally defines the per-CPU overflow_stack and
stackinfo_get_overflow() helper in arch/arm64/include/asm/stacktrace.h,
and always includes the overflow stack in the stack_info array in
arch/arm64/kernel/stacktrace.c. Also, drop redundant CONFIG_VMAP_STACK
checks from SDEI stack declarations.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250707-arm64_vmap-v1-6-8de98ca0f91c@debian.org
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Breno Leitao and committed by
Will Deacon
907cb5cd e5692bba

+2 -8
+1 -5
arch/arm64/include/asm/stacktrace.h
··· 59 59 60 60 #define on_thread_stack() (on_task_stack(current, current_stack_pointer, 1)) 61 61 62 - #ifdef CONFIG_VMAP_STACK 63 62 DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack); 64 63 65 64 static inline struct stack_info stackinfo_get_overflow(void) ··· 71 72 .high = high, 72 73 }; 73 74 } 74 - #else 75 - #define stackinfo_get_overflow() stackinfo_get_unknown() 76 - #endif 77 75 78 - #if defined(CONFIG_ARM_SDE_INTERFACE) && defined(CONFIG_VMAP_STACK) 76 + #if defined(CONFIG_ARM_SDE_INTERFACE) 79 77 DECLARE_PER_CPU(unsigned long *, sdei_stack_normal_ptr); 80 78 DECLARE_PER_CPU(unsigned long *, sdei_stack_critical_ptr); 81 79
+1 -3
arch/arm64/kernel/stacktrace.c
··· 332 332 struct stack_info stacks[] = { 333 333 stackinfo_get_task(task), 334 334 STACKINFO_CPU(irq), 335 - #if defined(CONFIG_VMAP_STACK) 336 335 STACKINFO_CPU(overflow), 337 - #endif 338 - #if defined(CONFIG_VMAP_STACK) && defined(CONFIG_ARM_SDE_INTERFACE) 336 + #if defined(CONFIG_ARM_SDE_INTERFACE) 339 337 STACKINFO_SDEI(normal), 340 338 STACKINFO_SDEI(critical), 341 339 #endif