Commit 6f63e781 authored by David S. Miller's avatar David S. Miller

sparc64: Handle stack trace attempts before irqstacks are setup.

Things like lockdep can try to do stack backtraces before
the irqstack blocks have been setup.  So don't try to match
their ranges so early on.

Also, remove unused variable in save_stack_trace().
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f70f7a9
...@@ -15,15 +15,16 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp) ...@@ -15,15 +15,16 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true; return true;
base = (unsigned long) hardirq_stack[tp->cpu]; if (hardirq_stack[tp->cpu]) {
if (sp >= base && base = (unsigned long) hardirq_stack[tp->cpu];
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) if (sp >= base &&
return true; sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
base = (unsigned long) softirq_stack[tp->cpu]; return true;
if (sp >= base && base = (unsigned long) softirq_stack[tp->cpu];
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) if (sp >= base &&
return true; sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;
}
return false; return false;
} }
...@@ -37,15 +38,16 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs * ...@@ -37,15 +38,16 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *
addr <= (base + THREAD_SIZE - sizeof(*regs))) addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic; goto check_magic;
base = (unsigned long) hardirq_stack[tp->cpu]; if (hardirq_stack[tp->cpu]) {
if (addr >= base && base = (unsigned long) hardirq_stack[tp->cpu];
addr <= (base + THREAD_SIZE - sizeof(*regs))) if (addr >= base &&
goto check_magic; addr <= (base + THREAD_SIZE - sizeof(*regs)))
base = (unsigned long) softirq_stack[tp->cpu]; goto check_magic;
if (addr >= base && base = (unsigned long) softirq_stack[tp->cpu];
addr <= (base + THREAD_SIZE - sizeof(*regs))) if (addr >= base &&
goto check_magic; addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;
}
return false; return false;
check_magic: check_magic:
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
void save_stack_trace(struct stack_trace *trace) void save_stack_trace(struct stack_trace *trace)
{ {
unsigned long ksp, fp, thread_base;
struct thread_info *tp = task_thread_info(current); struct thread_info *tp = task_thread_info(current);
unsigned long ksp, fp;
stack_trace_flush(); stack_trace_flush();
...@@ -20,7 +20,6 @@ void save_stack_trace(struct stack_trace *trace) ...@@ -20,7 +20,6 @@ void save_stack_trace(struct stack_trace *trace)
); );
fp = ksp + STACK_BIAS; fp = ksp + STACK_BIAS;
thread_base = (unsigned long) tp;
do { do {
struct sparc_stackf *sf; struct sparc_stackf *sf;
struct pt_regs *regs; struct pt_regs *regs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment