aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-13 20:17:52 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-13 20:20:04 -0400
commit6f63e781eaf6a741fc65f773017154b20ed4ce3b (patch)
treea7ab148968539b4543162c233f26b46ef95ae306
parent4f70f7a91bffdcc39f088748dc678953eb9a3fbd (diff)
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: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/kstack.h38
-rw-r--r--arch/sparc64/kernel/stacktrace.c3
2 files changed, 21 insertions, 20 deletions
diff --git a/arch/sparc64/kernel/kstack.h b/arch/sparc64/kernel/kstack.h
index 43909d5680ea..4248d969272f 100644
--- a/arch/sparc64/kernel/kstack.h
+++ b/arch/sparc64/kernel/kstack.h
@@ -15,15 +15,16 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
15 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) 15 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
16 return true; 16 return true;
17 17
18 base = (unsigned long) hardirq_stack[tp->cpu]; 18 if (hardirq_stack[tp->cpu]) {
19 if (sp >= base && 19 base = (unsigned long) hardirq_stack[tp->cpu];
20 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) 20 if (sp >= base &&
21 return true; 21 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
22 base = (unsigned long) softirq_stack[tp->cpu]; 22 return true;
23 if (sp >= base && 23 base = (unsigned long) softirq_stack[tp->cpu];
24 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) 24 if (sp >= base &&
25 return true; 25 sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
26 26 return true;
27 }
27 return false; 28 return false;
28} 29}
29 30
@@ -37,15 +38,16 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *
37 addr <= (base + THREAD_SIZE - sizeof(*regs))) 38 addr <= (base + THREAD_SIZE - sizeof(*regs)))
38 goto check_magic; 39 goto check_magic;
39 40
40 base = (unsigned long) hardirq_stack[tp->cpu]; 41 if (hardirq_stack[tp->cpu]) {
41 if (addr >= base && 42 base = (unsigned long) hardirq_stack[tp->cpu];
42 addr <= (base + THREAD_SIZE - sizeof(*regs))) 43 if (addr >= base &&
43 goto check_magic; 44 addr <= (base + THREAD_SIZE - sizeof(*regs)))
44 base = (unsigned long) softirq_stack[tp->cpu]; 45 goto check_magic;
45 if (addr >= base && 46 base = (unsigned long) softirq_stack[tp->cpu];
46 addr <= (base + THREAD_SIZE - sizeof(*regs))) 47 if (addr >= base &&
47 goto check_magic; 48 addr <= (base + THREAD_SIZE - sizeof(*regs)))
48 49 goto check_magic;
50 }
49 return false; 51 return false;
50 52
51check_magic: 53check_magic:
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c
index 237e7f8a40ac..4e21d4a57d3b 100644
--- a/arch/sparc64/kernel/stacktrace.c
+++ b/arch/sparc64/kernel/stacktrace.c
@@ -9,8 +9,8 @@
9 9
10void save_stack_trace(struct stack_trace *trace) 10void save_stack_trace(struct stack_trace *trace)
11{ 11{
12 unsigned long ksp, fp, thread_base;
13 struct thread_info *tp = task_thread_info(current); 12 struct thread_info *tp = task_thread_info(current);
13 unsigned long ksp, fp;
14 14
15 stack_trace_flush(); 15 stack_trace_flush();
16 16
@@ -20,7 +20,6 @@ void save_stack_trace(struct stack_trace *trace)
20 ); 20 );
21 21
22 fp = ksp + STACK_BIAS; 22 fp = ksp + STACK_BIAS;
23 thread_base = (unsigned long) tp;
24 do { 23 do {
25 struct sparc_stackf *sf; 24 struct sparc_stackf *sf;
26 struct pt_regs *regs; 25 struct pt_regs *regs;