Skip to content

Commit 131aee8

Browse files
committed
csky: Fixup dead loop in show_stack
When STACKTRACE is enabled, we must pass fp as stack for unwind, otherwise random value in stack will casue a dead loop. Signed-off-by: Guo Ren <ren_guo@c-sky.com> Reported-by: Lu Baoquan <lu.baoquan@intellif.com>
1 parent 76d21d1 commit 131aee8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/csky/kernel/dumpstack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ void show_stack(struct task_struct *task, unsigned long *stack)
3838
if (task)
3939
stack = (unsigned long *)thread_saved_fp(task);
4040
else
41+
#ifdef CONFIG_STACKTRACE
42+
asm volatile("mov %0, r8\n":"=r"(stack)::"memory");
43+
#else
4144
stack = (unsigned long *)&stack;
45+
#endif
4246
}
4347

4448
show_trace(stack);

0 commit comments

Comments
 (0)