diff options
Diffstat (limited to 'arch/x86/kernel/dumpstack_64.c')
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 346b1df2412e..1abcb50b48ae 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -115,27 +115,26 @@ enum stack_type { }; static enum stack_type -analyze_stack(int cpu, struct task_struct *task, - unsigned long *stack, unsigned long **stack_end, char **id) +analyze_stack(int cpu, struct task_struct *task, unsigned long *stack, + unsigned long **stack_end, unsigned long *irq_stack, + unsigned *used, char **id) { - unsigned long *irq_stack; unsigned long addr; - unsigned used = 0; addr = ((unsigned long)stack & (~(THREAD_SIZE - 1))); if ((unsigned long)task_stack_page(task) == addr) return STACK_IS_NORMAL; *stack_end = in_exception_stack(cpu, (unsigned long)stack, - &used, id); + used, id); if (*stack_end) return STACK_IS_EXCEPTION; - *stack_end = (unsigned long *)per_cpu(irq_stack_ptr, cpu); - if (!*stack_end) - return STACK_IS_UNKNOWN; + if (!irq_stack) + return STACK_IS_NORMAL; - irq_stack = *stack_end - irq_stack_size; + *stack_end = irq_stack; + irq_stack = irq_stack - irq_stack_size; if (in_irq_stack(stack, irq_stack, *stack_end)) return STACK_IS_IRQ; @@ -156,8 +155,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, { const unsigned cpu = get_cpu(); struct thread_info *tinfo; - unsigned long *irq_stack; + unsigned long *irq_stack = (unsigned long *)per_cpu(irq_stack_ptr, cpu); unsigned long dummy; + unsigned used = 0; int graph = 0; int done = 0; @@ -186,7 +186,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, enum stack_type stype; char *id; - stype = analyze_stack(cpu, task, stack, &stack_end, &id); + stype = analyze_stack(cpu, task, stack, &stack_end, + irq_stack, &used, &id); /* Default finish unless specified to continue */ done = 1; @@ -226,7 +227,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, * pointer (index -1 to end) in the IRQ stack: */ stack = (unsigned long *) (stack_end[-1]); - irq_stack = stack_end - irq_stack_size; + irq_stack = NULL; ops->stack(data, "EOI"); done = 0; break; |