Skip to contentSkip to conversation

csky: fixup dead loop in show_stack

PATCH New [email protected] 1 participant 1 message Jan 31, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 csky: fixup dead loop in show_stack

From: Guo Ren <[email protected]>

When STACKTRACE is enabled, we must pass fp as stack for unwind, otherwise random value in stack will casue a dead loop.

---
 arch/csky/kernel/dumpstack.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/csky/kernel/dumpstack.c +4 -0
index 659253e..d67f977 100644
@@ -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);
Signature · 1 line
2.7.4