Skip to content

Commit

Permalink
sparc64: Handle stack trace attempts before irqstacks are setup.
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 14, 2008
1 parent 4f70f7a commit 6f63e78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
38 changes: 20 additions & 18 deletions arch/sparc64/kernel/kstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;

base = (unsigned long) hardirq_stack[tp->cpu];
if (sp >= base &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;
base = (unsigned long) softirq_stack[tp->cpu];
if (sp >= base &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;

if (hardirq_stack[tp->cpu]) {
base = (unsigned long) hardirq_stack[tp->cpu];
if (sp >= base &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;
base = (unsigned long) softirq_stack[tp->cpu];
if (sp >= base &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;
}
return false;
}

Expand All @@ -37,15 +38,16 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *
addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;

base = (unsigned long) hardirq_stack[tp->cpu];
if (addr >= base &&
addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;
base = (unsigned long) softirq_stack[tp->cpu];
if (addr >= base &&
addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;

if (hardirq_stack[tp->cpu]) {
base = (unsigned long) hardirq_stack[tp->cpu];
if (addr >= base &&
addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;
base = (unsigned long) softirq_stack[tp->cpu];
if (addr >= base &&
addr <= (base + THREAD_SIZE - sizeof(*regs)))
goto check_magic;
}
return false;

check_magic:
Expand Down
3 changes: 1 addition & 2 deletions arch/sparc64/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

void save_stack_trace(struct stack_trace *trace)
{
unsigned long ksp, fp, thread_base;
struct thread_info *tp = task_thread_info(current);
unsigned long ksp, fp;

stack_trace_flush();

Expand All @@ -20,7 +20,6 @@ void save_stack_trace(struct stack_trace *trace)
);

fp = ksp + STACK_BIAS;
thread_base = (unsigned long) tp;
do {
struct sparc_stackf *sf;
struct pt_regs *regs;
Expand Down

0 comments on commit 6f63e78

Please sign in to comment.