lkml.org 
[lkml]   [2007]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[2.6.20.21 review 09/35] SPARC64: Fix sparc64 task stack traces.
It didn't handle that case at all, and now dump_stack()
can be implemented directly as show_stack(current, NULL)

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/sparc64/kernel/traps.c | 18 +++++++++++-------
arch/sparc64/mm/fault.c | 5 +----
2 files changed, 12 insertions(+), 11 deletions(-)

Index: 2.6/arch/sparc64/kernel/traps.c
===================================================================
--- 2.6.orig/arch/sparc64/kernel/traps.c
+++ 2.6/arch/sparc64/kernel/traps.c
@@ -2146,12 +2146,20 @@ static void user_instruction_dump (unsig
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp, thread_base, ksp;
- void *tp = task_stack_page(tsk);
+ struct thread_info *tp;
struct reg_window *rw;
int count = 0;

ksp = (unsigned long) _ksp;
-
+ if (!tsk)
+ tsk = current;
+ tp = task_thread_info(tsk);
+ if (ksp == 0UL) {
+ if (tsk == current)
+ asm("mov %%fp, %0" : "=r" (ksp));
+ else
+ ksp = tp->ksp;
+ }
if (tp == current_thread_info())
flushw_all();

@@ -2180,11 +2188,7 @@ void show_stack(struct task_struct *tsk,

void dump_stack(void)
{
- unsigned long *ksp;
-
- __asm__ __volatile__("mov %%fp, %0"
- : "=r" (ksp));
- show_stack(current, ksp);
+ show_stack(current, NULL);
}

EXPORT_SYMBOL(dump_stack);
Index: 2.6/arch/sparc64/mm/fault.c
===================================================================
--- 2.6.orig/arch/sparc64/mm/fault.c
+++ 2.6/arch/sparc64/mm/fault.c
@@ -129,15 +129,12 @@ static void __kprobes unhandled_fault(un

static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
{
- unsigned long *ksp;
-
printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler
",
regs->tpc);
printk(KERN_CRIT "OOPS: RPC [%016lx]
", regs->u_regs[15]);
print_symbol("RPC: <%s>
", regs->u_regs[15]);
printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]
", vaddr);
- __asm__("mov %%sp, %0" : "=r" (ksp));
- show_stack(current, ksp);
+ dump_stack();
unhandled_fault(regs->tpc, current, regs);
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-13 16:47    [W:1.090 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site