Skip to content

Commit 2cf9637

Browse files
bjdooks-ctpalmer-dabbelt
authored andcommitted
riscv: declare overflow_stack as exported from traps.c
The percpu area overflow_stacks is exported from arch/riscv/kernel/traps.c for use in the entry code, but is not declared anywhere. Add the relevant declaration to arch/riscv/include/asm/stacktrace.h to silence the following sparse warning: arch/riscv/kernel/traps.c:395:1: warning: symbol '__pcpu_scope_overflow_stack' was not declared. Should it be static? We don't add the stackinfo_get_overflow() call as for some of the other architectures as this doesn't seem to be used yet, so just silence the warning. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Fixes: be97d0d ("riscv: VMAP_STACK overflow detection thread-safe") Link: https://lore.kernel.org/r/20231123134214.81481-1-ben.dooks@codethink.co.uk Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent ce68c03 commit 2cf9637

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/riscv/include/asm/stacktrace.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ static inline bool on_thread_stack(void)
2121
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
2222
}
2323

24+
25+
#ifdef CONFIG_VMAP_STACK
26+
DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack);
27+
#endif /* CONFIG_VMAP_STACK */
28+
2429
#endif /* _ASM_RISCV_STACKTRACE_H */

0 commit comments

Comments
 (0)