]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: remove CONFIG_VMAP_STACK checks from stacktrace overflow logic
authorBreno Leitao <leitao@debian.org>
Mon, 7 Jul 2025 16:01:06 +0000 (09:01 -0700)
committerWill Deacon <will@kernel.org>
Tue, 8 Jul 2025 12:41:09 +0000 (13:41 +0100)
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>
arch/arm64/include/asm/stacktrace.h
arch/arm64/kernel/stacktrace.c

index 66ec8caa6ac07fa0d70865e40b594bdd7079d585..6d3280932bf5cd1316f823aee2f8bb60360d0dc6 100644 (file)
@@ -59,7 +59,6 @@ static inline bool on_task_stack(const struct task_struct *tsk,
 
 #define on_thread_stack()      (on_task_stack(current, current_stack_pointer, 1))
 
-#ifdef CONFIG_VMAP_STACK
 DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack);
 
 static inline struct stack_info stackinfo_get_overflow(void)
@@ -72,11 +71,8 @@ static inline struct stack_info stackinfo_get_overflow(void)
                .high = high,
        };
 }
-#else
-#define stackinfo_get_overflow()       stackinfo_get_unknown()
-#endif
 
-#if defined(CONFIG_ARM_SDE_INTERFACE) && defined(CONFIG_VMAP_STACK)
+#if defined(CONFIG_ARM_SDE_INTERFACE)
 DECLARE_PER_CPU(unsigned long *, sdei_stack_normal_ptr);
 DECLARE_PER_CPU(unsigned long *, sdei_stack_critical_ptr);
 
index 1d9d51d7627fd48257fe7d7be00093d884041055..e823320fe0312fadd42e328d6af42eb4c27c37f3 100644 (file)
@@ -332,10 +332,8 @@ kunwind_stack_walk(kunwind_consume_fn consume_state,
        struct stack_info stacks[] = {
                stackinfo_get_task(task),
                STACKINFO_CPU(irq),
-#if defined(CONFIG_VMAP_STACK)
                STACKINFO_CPU(overflow),
-#endif
-#if defined(CONFIG_VMAP_STACK) && defined(CONFIG_ARM_SDE_INTERFACE)
+#if defined(CONFIG_ARM_SDE_INTERFACE)
                STACKINFO_SDEI(normal),
                STACKINFO_SDEI(critical),
 #endif