summaryrefslogtreecommitdiff
path: root/arch/csky
diff options
context:
space:
mode:
authorGuo Ren <ren_guo@c-sky.com>2019-01-31 14:34:37 +0800
committerGuo Ren <ren_guo@c-sky.com>2019-02-13 09:48:14 +0800
commit131aee8b9807bc98379fa5a0270389dbc7dcec90 (patch)
tree7a627f509aec9f17e36bd540b44fd167ef0e0482 /arch/csky
parent76d21d186a65523b08ea5f70302e2c29ee8f6a8d (diff)
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>
Diffstat (limited to 'arch/csky')
-rw-r--r--arch/csky/kernel/dumpstack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/csky/kernel/dumpstack.c b/arch/csky/kernel/dumpstack.c
index 659253e9989c..d67f9777cfd9 100644
--- a/arch/csky/kernel/dumpstack.c
+++ b/arch/csky/kernel/dumpstack.c
@@ -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);