1 From: Matt Redfearn <matt.redfearn@imgtec.com>
2 Date: Mon, 19 Dec 2016 14:20:57 +0000
3 Subject: [PATCH] MIPS: Stack unwinding while on IRQ stack
5 Within unwind stack, check if the stack pointer being unwound is within
6 the CPU's irq_stack and if so use that page rather than the task's stack
9 Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
12 --- a/arch/mips/kernel/process.c
13 +++ b/arch/mips/kernel/process.c
20 #include <asm/pgtable.h>
21 #include <asm/mipsregs.h>
22 @@ -507,7 +508,19 @@ EXPORT_SYMBOL(unwind_stack_by_address);
23 unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
24 unsigned long pc, unsigned long *ra)
26 - unsigned long stack_page = (unsigned long)task_stack_page(task);
27 + unsigned long stack_page = 0;
30 + for_each_possible_cpu(cpu) {
31 + if (on_irq_stack(cpu, *sp)) {
32 + stack_page = (unsigned long)irq_stack[cpu];
38 + stack_page = (unsigned long)task_stack_page(task);
40 return unwind_stack_by_address(stack_page, sp, pc, ra);