summaryrefslogtreecommitdiffstats
path: root/arch/csky/kernel/process.c
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-05-13 15:15:25 +0800
committerGuo Ren <guoren@linux.alibaba.com>2020-05-13 17:55:06 +0800
commit18c07d23da5a48525b2955aa269b8bb108c19300 (patch)
tree450a798836c2658ff1a2b7fce73bbc5bd59df9af /arch/csky/kernel/process.c
parent229a0ddee1108a3f82a873e6cbbe35c92c540444 (diff)
downloadlinux-stable-18c07d23da5a48525b2955aa269b8bb108c19300.tar.gz
linux-stable-18c07d23da5a48525b2955aa269b8bb108c19300.tar.bz2
linux-stable-18c07d23da5a48525b2955aa269b8bb108c19300.zip
csky: Fixup calltrace panic
The implementation of show_stack will panic with wrong fp: addr = *fp++; because the fp isn't checked properly. The current implementations of show_stack, wchan and stack_trace haven't been designed properly, so just deprecate them. This patch is a reference to riscv's way, all codes are modified from arm's. The patch is passed with: - cat /proc/<pid>/stack - cat /proc/<pid>/wchan - echo c > /proc/sysrq-trigger Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Diffstat (limited to 'arch/csky/kernel/process.c')
-rw-r--r--arch/csky/kernel/process.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/csky/kernel/process.c b/arch/csky/kernel/process.c
index f7b231ca269a..4ad6db56c3cd 100644
--- a/arch/csky/kernel/process.c
+++ b/arch/csky/kernel/process.c
@@ -98,37 +98,6 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *pr_regs)
return 1;
}
-unsigned long get_wchan(struct task_struct *p)
-{
- unsigned long lr;
- unsigned long *fp, *stack_start, *stack_end;
- int count = 0;
-
- if (!p || p == current || p->state == TASK_RUNNING)
- return 0;
-
- stack_start = (unsigned long *)end_of_stack(p);
- stack_end = (unsigned long *)(task_stack_page(p) + THREAD_SIZE);
-
- fp = (unsigned long *) thread_saved_fp(p);
- do {
- if (fp < stack_start || fp > stack_end)
- return 0;
-#ifdef CONFIG_STACKTRACE
- lr = fp[1];
- fp = (unsigned long *)fp[0];
-#else
- lr = *fp++;
-#endif
- if (!in_sched_functions(lr) &&
- __kernel_text_address(lr))
- return lr;
- } while (count++ < 16);
-
- return 0;
-}
-EXPORT_SYMBOL(get_wchan);
-
#ifndef CONFIG_CPU_PM_NONE
void arch_cpu_idle(void)
{