Skip to content

Commit

Permalink
csky: Fixup dead loop in show_stack
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guo Ren committed Feb 13, 2019
1 parent 76d21d1 commit 131aee8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/csky/kernel/dumpstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ void show_stack(struct task_struct *task, unsigned long *stack)
if (task)
stack = (unsigned long *)thread_saved_fp(task);
else
#ifdef CONFIG_STACKTRACE
asm volatile("mov %0, r8\n":"=r"(stack)::"memory");
#else
stack = (unsigned long *)&stack;
#endif
}

show_trace(stack);
Expand Down

0 comments on commit 131aee8

Please sign in to comment.