提交 63c95654 编写于 作者: S Steven Rostedt (Red Hat) 提交者: Linus Torvalds

x86: Fix dumpstack_64 irq stack handling

Commit 2223f6f6 "x86: Clean up dumpstack_64.c code" changed
the irq_stack processing a little from what it was before.
The irq_stack_end variable needed to be cleared after its first
use. By setting irq_stack to the per cpu irq_stack and passing
that to analyze_stack(), and then clearing it after it is processed,
we can get back the original behavior.
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1aabc599
...@@ -116,9 +116,9 @@ enum stack_type { ...@@ -116,9 +116,9 @@ enum stack_type {
static enum stack_type static enum stack_type
analyze_stack(int cpu, struct task_struct *task, unsigned long *stack, analyze_stack(int cpu, struct task_struct *task, unsigned long *stack,
unsigned long **stack_end, unsigned *used, char **id) unsigned long **stack_end, unsigned long *irq_stack,
unsigned *used, char **id)
{ {
unsigned long *irq_stack;
unsigned long addr; unsigned long addr;
addr = ((unsigned long)stack & (~(THREAD_SIZE - 1))); addr = ((unsigned long)stack & (~(THREAD_SIZE - 1)));
...@@ -130,11 +130,11 @@ analyze_stack(int cpu, struct task_struct *task, unsigned long *stack, ...@@ -130,11 +130,11 @@ analyze_stack(int cpu, struct task_struct *task, unsigned long *stack,
if (*stack_end) if (*stack_end)
return STACK_IS_EXCEPTION; return STACK_IS_EXCEPTION;
*stack_end = (unsigned long *)per_cpu(irq_stack_ptr, cpu); if (!irq_stack)
if (!*stack_end) return STACK_IS_NORMAL;
return STACK_IS_UNKNOWN;
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)) if (in_irq_stack(stack, irq_stack, *stack_end))
return STACK_IS_IRQ; return STACK_IS_IRQ;
...@@ -155,7 +155,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, ...@@ -155,7 +155,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
{ {
const unsigned cpu = get_cpu(); const unsigned cpu = get_cpu();
struct thread_info *tinfo; struct thread_info *tinfo;
unsigned long *irq_stack; unsigned long *irq_stack = (unsigned long *)per_cpu(irq_stack_ptr, cpu);
unsigned long dummy; unsigned long dummy;
unsigned used = 0; unsigned used = 0;
int graph = 0; int graph = 0;
...@@ -186,7 +186,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, ...@@ -186,7 +186,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
enum stack_type stype; enum stack_type stype;
char *id; char *id;
stype = analyze_stack(cpu, task, stack, &stack_end, &used, &id); stype = analyze_stack(cpu, task, stack, &stack_end,
irq_stack, &used, &id);
/* Default finish unless specified to continue */ /* Default finish unless specified to continue */
done = 1; done = 1;
...@@ -226,7 +227,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, ...@@ -226,7 +227,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
* pointer (index -1 to end) in the IRQ stack: * pointer (index -1 to end) in the IRQ stack:
*/ */
stack = (unsigned long *) (stack_end[-1]); stack = (unsigned long *) (stack_end[-1]);
irq_stack = stack_end - irq_stack_size; irq_stack = NULL;
ops->stack(data, "EOI"); ops->stack(data, "EOI");
done = 0; done = 0;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册