diff options
Diffstat (limited to 'arch/sparc64')
39 files changed, 225 insertions, 58 deletions
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile index 9cb75c852b45..4b8f2b084c21 100644 --- a/arch/sparc64/Makefile +++ b/arch/sparc64/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | # $Id: Makefile,v 1.52 2002/02/09 19:49:31 davem Exp $ | ||
2 | # sparc64/Makefile | 1 | # sparc64/Makefile |
3 | # | 2 | # |
4 | # Makefile for the architecture dependent flags and dependencies on the | 3 | # Makefile for the architecture dependent flags and dependencies on the |
diff --git a/arch/sparc64/boot/Makefile b/arch/sparc64/boot/Makefile index 6968a6da57da..0458b5244f09 100644 --- a/arch/sparc64/boot/Makefile +++ b/arch/sparc64/boot/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | # $Id: Makefile,v 1.4 1997/12/15 20:08:56 ecd Exp $ | ||
2 | # Makefile for the Sparc64 boot stuff. | 1 | # Makefile for the Sparc64 boot stuff. |
3 | # | 2 | # |
4 | # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | 3 | # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/boot/piggyback.c b/arch/sparc64/boot/piggyback.c index 36f907408c60..de364bfed0bb 100644 --- a/arch/sparc64/boot/piggyback.c +++ b/arch/sparc64/boot/piggyback.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: piggyback.c,v 1.2 2000/09/19 14:34:39 anton Exp $ | 1 | /* |
2 | Simple utility to make a single-image install kernel with initial ramdisk | 2 | Simple utility to make a single-image install kernel with initial ramdisk |
3 | for Sparc64 tftpbooting without need to set up nfs. | 3 | for Sparc64 tftpbooting without need to set up nfs. |
4 | 4 | ||
diff --git a/arch/sparc64/kernel/dtlb_prot.S b/arch/sparc64/kernel/dtlb_prot.S index e0a920162604..b2c2c5be281c 100644 --- a/arch/sparc64/kernel/dtlb_prot.S +++ b/arch/sparc64/kernel/dtlb_prot.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: dtlb_prot.S,v 1.22 2001/04/11 23:40:32 davem Exp $ | 1 | /* |
2 | * dtlb_prot.S: DTLB protection trap strategy. | 2 | * dtlb_prot.S: DTLB protection trap strategy. |
3 | * This is included directly into the trap table. | 3 | * This is included directly into the trap table. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index bc2632274840..c49d0388b793 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: ebus.c,v 1.64 2001/11/08 04:41:33 davem Exp $ | 1 | /* |
2 | * ebus.c: PCI to EBus bridge device. | 2 | * ebus.c: PCI to EBus bridge device. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) | 4 | * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) |
diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S index f25e1da3fd03..29ce489bc188 100644 --- a/arch/sparc64/kernel/etrap.S +++ b/arch/sparc64/kernel/etrap.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: etrap.S,v 1.46 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * etrap.S: Preparing for entry into the kernel on Sparc V9. | 2 | * etrap.S: Preparing for entry into the kernel on Sparc V9. |
3 | * | 3 | * |
4 | * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/idprom.c b/arch/sparc64/kernel/idprom.c index 3b6789e09a72..5b45a808c621 100644 --- a/arch/sparc64/kernel/idprom.c +++ b/arch/sparc64/kernel/idprom.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: idprom.c,v 1.3 1999/08/31 06:54:53 davem Exp $ | 1 | /* |
2 | * idprom.c: Routines to load the idprom into kernel addresses and | 2 | * idprom.c: Routines to load the idprom into kernel addresses and |
3 | * interpret the data contained within. | 3 | * interpret the data contained within. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index 4129c0449856..2084f81a76e1 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* arch/sparc64/kernel/process.c | 1 | /* arch/sparc64/kernel/process.c |
2 | * | 2 | * |
3 | * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) | 3 | * Copyright (C) 1995, 1996, 2008 David S. Miller (davem@davemloft.net) |
4 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) | 4 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) |
5 | * Copyright (C) 1997, 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 5 | * Copyright (C) 1997, 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
6 | */ | 6 | */ |
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/cpu.h> | 31 | #include <linux/cpu.h> |
32 | #include <linux/elfcore.h> | 32 | #include <linux/elfcore.h> |
33 | #include <linux/sysrq.h> | ||
33 | 34 | ||
34 | #include <asm/oplib.h> | 35 | #include <asm/oplib.h> |
35 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
@@ -49,6 +50,8 @@ | |||
49 | #include <asm/sstate.h> | 50 | #include <asm/sstate.h> |
50 | #include <asm/reboot.h> | 51 | #include <asm/reboot.h> |
51 | #include <asm/syscalls.h> | 52 | #include <asm/syscalls.h> |
53 | #include <asm/irq_regs.h> | ||
54 | #include <asm/smp.h> | ||
52 | 55 | ||
53 | /* #define VERBOSE_SHOWREGS */ | 56 | /* #define VERBOSE_SHOWREGS */ |
54 | 57 | ||
@@ -298,6 +301,118 @@ void show_regs(struct pt_regs *regs) | |||
298 | #endif | 301 | #endif |
299 | } | 302 | } |
300 | 303 | ||
304 | #ifdef CONFIG_MAGIC_SYSRQ | ||
305 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; | ||
306 | static DEFINE_SPINLOCK(global_reg_snapshot_lock); | ||
307 | |||
308 | static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs, | ||
309 | int this_cpu) | ||
310 | { | ||
311 | flushw_all(); | ||
312 | |||
313 | global_reg_snapshot[this_cpu].tstate = regs->tstate; | ||
314 | global_reg_snapshot[this_cpu].tpc = regs->tpc; | ||
315 | global_reg_snapshot[this_cpu].tnpc = regs->tnpc; | ||
316 | global_reg_snapshot[this_cpu].o7 = regs->u_regs[UREG_I7]; | ||
317 | |||
318 | if (regs->tstate & TSTATE_PRIV) { | ||
319 | struct reg_window *rw; | ||
320 | |||
321 | rw = (struct reg_window *) | ||
322 | (regs->u_regs[UREG_FP] + STACK_BIAS); | ||
323 | global_reg_snapshot[this_cpu].i7 = rw->ins[6]; | ||
324 | } else | ||
325 | global_reg_snapshot[this_cpu].i7 = 0; | ||
326 | |||
327 | global_reg_snapshot[this_cpu].thread = tp; | ||
328 | } | ||
329 | |||
330 | /* In order to avoid hangs we do not try to synchronize with the | ||
331 | * global register dump client cpus. The last store they make is to | ||
332 | * the thread pointer, so do a short poll waiting for that to become | ||
333 | * non-NULL. | ||
334 | */ | ||
335 | static void __global_reg_poll(struct global_reg_snapshot *gp) | ||
336 | { | ||
337 | int limit = 0; | ||
338 | |||
339 | while (!gp->thread && ++limit < 100) { | ||
340 | barrier(); | ||
341 | udelay(1); | ||
342 | } | ||
343 | } | ||
344 | |||
345 | static void sysrq_handle_globreg(int key, struct tty_struct *tty) | ||
346 | { | ||
347 | struct thread_info *tp = current_thread_info(); | ||
348 | struct pt_regs *regs = get_irq_regs(); | ||
349 | #ifdef CONFIG_KALLSYMS | ||
350 | char buffer[KSYM_SYMBOL_LEN]; | ||
351 | #endif | ||
352 | unsigned long flags; | ||
353 | int this_cpu, cpu; | ||
354 | |||
355 | if (!regs) | ||
356 | regs = tp->kregs; | ||
357 | |||
358 | spin_lock_irqsave(&global_reg_snapshot_lock, flags); | ||
359 | |||
360 | memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot)); | ||
361 | |||
362 | this_cpu = raw_smp_processor_id(); | ||
363 | |||
364 | __global_reg_self(tp, regs, this_cpu); | ||
365 | |||
366 | smp_fetch_global_regs(); | ||
367 | |||
368 | for_each_online_cpu(cpu) { | ||
369 | struct global_reg_snapshot *gp = &global_reg_snapshot[cpu]; | ||
370 | struct thread_info *tp; | ||
371 | |||
372 | __global_reg_poll(gp); | ||
373 | |||
374 | tp = gp->thread; | ||
375 | printk("%c CPU[%3d]: TSTATE[%016lx] TPC[%016lx] TNPC[%016lx] TASK[%s:%d]\n", | ||
376 | (cpu == this_cpu ? '*' : ' '), cpu, | ||
377 | gp->tstate, gp->tpc, gp->tnpc, | ||
378 | ((tp && tp->task) ? tp->task->comm : "NULL"), | ||
379 | ((tp && tp->task) ? tp->task->pid : -1)); | ||
380 | #ifdef CONFIG_KALLSYMS | ||
381 | if (gp->tstate & TSTATE_PRIV) { | ||
382 | sprint_symbol(buffer, gp->tpc); | ||
383 | printk(" TPC[%s] ", buffer); | ||
384 | sprint_symbol(buffer, gp->o7); | ||
385 | printk("O7[%s] ", buffer); | ||
386 | sprint_symbol(buffer, gp->i7); | ||
387 | printk("I7[%s]\n", buffer); | ||
388 | } else | ||
389 | #endif | ||
390 | { | ||
391 | printk(" TPC[%lx] O7[%lx] I7[%lx]\n", | ||
392 | gp->tpc, gp->o7, gp->i7); | ||
393 | } | ||
394 | } | ||
395 | |||
396 | memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot)); | ||
397 | |||
398 | spin_unlock_irqrestore(&global_reg_snapshot_lock, flags); | ||
399 | } | ||
400 | |||
401 | static struct sysrq_key_op sparc_globalreg_op = { | ||
402 | .handler = sysrq_handle_globreg, | ||
403 | .help_msg = "Globalregs", | ||
404 | .action_msg = "Show Global CPU Regs", | ||
405 | }; | ||
406 | |||
407 | static int __init sparc_globreg_init(void) | ||
408 | { | ||
409 | return register_sysrq_key('y', &sparc_globalreg_op); | ||
410 | } | ||
411 | |||
412 | core_initcall(sparc_globreg_init); | ||
413 | |||
414 | #endif | ||
415 | |||
301 | unsigned long thread_saved_pc(struct task_struct *tsk) | 416 | unsigned long thread_saved_pc(struct task_struct *tsk) |
302 | { | 417 | { |
303 | struct thread_info *ti = task_thread_info(tsk); | 418 | struct thread_info *ti = task_thread_info(tsk); |
@@ -542,20 +657,39 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
542 | struct task_struct *p, struct pt_regs *regs) | 657 | struct task_struct *p, struct pt_regs *regs) |
543 | { | 658 | { |
544 | struct thread_info *t = task_thread_info(p); | 659 | struct thread_info *t = task_thread_info(p); |
660 | struct sparc_stackf *parent_sf; | ||
661 | unsigned long child_stack_sz; | ||
545 | char *child_trap_frame; | 662 | char *child_trap_frame; |
663 | int kernel_thread; | ||
546 | 664 | ||
547 | /* Calculate offset to stack_frame & pt_regs */ | 665 | kernel_thread = (regs->tstate & TSTATE_PRIV) ? 1 : 0; |
548 | child_trap_frame = task_stack_page(p) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ)); | 666 | parent_sf = ((struct sparc_stackf *) regs) - 1; |
549 | memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); | ||
550 | 667 | ||
551 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | | 668 | /* Calculate offset to stack_frame & pt_regs */ |
669 | child_stack_sz = ((STACKFRAME_SZ + TRACEREG_SZ) + | ||
670 | (kernel_thread ? STACKFRAME_SZ : 0)); | ||
671 | child_trap_frame = (task_stack_page(p) + | ||
672 | (THREAD_SIZE - child_stack_sz)); | ||
673 | memcpy(child_trap_frame, parent_sf, child_stack_sz); | ||
674 | |||
675 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | | ||
676 | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | | ||
552 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); | 677 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); |
553 | t->new_child = 1; | 678 | t->new_child = 1; |
554 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; | 679 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; |
555 | t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); | 680 | t->kregs = (struct pt_regs *) (child_trap_frame + |
681 | sizeof(struct sparc_stackf)); | ||
556 | t->fpsaved[0] = 0; | 682 | t->fpsaved[0] = 0; |
557 | 683 | ||
558 | if (regs->tstate & TSTATE_PRIV) { | 684 | if (kernel_thread) { |
685 | struct sparc_stackf *child_sf = (struct sparc_stackf *) | ||
686 | (child_trap_frame + (STACKFRAME_SZ + TRACEREG_SZ)); | ||
687 | |||
688 | /* Zero terminate the stack backtrace. */ | ||
689 | child_sf->fp = NULL; | ||
690 | t->kregs->u_regs[UREG_FP] = | ||
691 | ((unsigned long) child_sf) - STACK_BIAS; | ||
692 | |||
559 | /* Special case, if we are spawning a kernel thread from | 693 | /* Special case, if we are spawning a kernel thread from |
560 | * a userspace task (via KMOD, NFS, or similar) we must | 694 | * a userspace task (via KMOD, NFS, or similar) we must |
561 | * disable performance counters in the child because the | 695 | * disable performance counters in the child because the |
@@ -566,12 +700,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
566 | t->pcr_reg = 0; | 700 | t->pcr_reg = 0; |
567 | t->flags &= ~_TIF_PERFCTR; | 701 | t->flags &= ~_TIF_PERFCTR; |
568 | } | 702 | } |
569 | t->kregs->u_regs[UREG_FP] = t->ksp; | ||
570 | t->flags |= ((long)ASI_P << TI_FLAG_CURRENT_DS_SHIFT); | 703 | t->flags |= ((long)ASI_P << TI_FLAG_CURRENT_DS_SHIFT); |
571 | flush_register_windows(); | ||
572 | memcpy((void *)(t->ksp + STACK_BIAS), | ||
573 | (void *)(regs->u_regs[UREG_FP] + STACK_BIAS), | ||
574 | sizeof(struct sparc_stackf)); | ||
575 | t->kregs->u_regs[UREG_G6] = (unsigned long) t; | 704 | t->kregs->u_regs[UREG_G6] = (unsigned long) t; |
576 | t->kregs->u_regs[UREG_G4] = (unsigned long) t->task; | 705 | t->kregs->u_regs[UREG_G4] = (unsigned long) t->task; |
577 | } else { | 706 | } else { |
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index 16689b2930db..c6fc695fe1fe 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: rtrap.S,v 1.61 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * rtrap.S: Preparing for return from trap on Sparc V9. | 2 | * rtrap.S: Preparing for return from trap on Sparc V9. |
3 | * | 3 | * |
4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
@@ -363,6 +363,7 @@ kern_rtt: rdpr %canrestore, %g1 | |||
363 | brz,pn %g1, kern_rtt_fill | 363 | brz,pn %g1, kern_rtt_fill |
364 | nop | 364 | nop |
365 | kern_rtt_restore: | 365 | kern_rtt_restore: |
366 | stw %g0, [%sp + PTREGS_OFF + PT_V9_MAGIC] | ||
366 | restore | 367 | restore |
367 | retry | 368 | retry |
368 | 369 | ||
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index fa2827c4a3ad..e33a8a660e9e 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: sbus.c,v 1.19 2002/01/23 11:27:32 davem Exp $ | 1 | /* |
2 | * sbus.c: UltraSparc SBUS controller support. | 2 | * sbus.c: UltraSparc SBUS controller support. |
3 | * | 3 | * |
4 | * Copyright (C) 1999 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1999 David S. Miller (davem@redhat.com) |
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index da5e6ee0c661..c8b03a4f68bf 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: setup.c,v 1.72 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * linux/arch/sparc64/kernel/setup.c | 2 | * linux/arch/sparc64/kernel/setup.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 6e4dc67d16af..9667e96fd513 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: signal.c,v 1.60 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * arch/sparc64/kernel/signal.c | 2 | * arch/sparc64/kernel/signal.c |
3 | * | 3 | * |
4 | * Copyright (C) 1991, 1992 Linus Torvalds | 4 | * Copyright (C) 1991, 1992 Linus Torvalds |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 0d6403a630ac..fa63c68a1819 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -900,6 +900,9 @@ extern unsigned long xcall_flush_tlb_mm; | |||
900 | extern unsigned long xcall_flush_tlb_pending; | 900 | extern unsigned long xcall_flush_tlb_pending; |
901 | extern unsigned long xcall_flush_tlb_kernel_range; | 901 | extern unsigned long xcall_flush_tlb_kernel_range; |
902 | extern unsigned long xcall_report_regs; | 902 | extern unsigned long xcall_report_regs; |
903 | #ifdef CONFIG_MAGIC_SYSRQ | ||
904 | extern unsigned long xcall_fetch_glob_regs; | ||
905 | #endif | ||
903 | extern unsigned long xcall_receive_signal; | 906 | extern unsigned long xcall_receive_signal; |
904 | extern unsigned long xcall_new_mmu_context_version; | 907 | extern unsigned long xcall_new_mmu_context_version; |
905 | #ifdef CONFIG_KGDB | 908 | #ifdef CONFIG_KGDB |
@@ -1080,6 +1083,13 @@ void smp_report_regs(void) | |||
1080 | smp_cross_call(&xcall_report_regs, 0, 0, 0); | 1083 | smp_cross_call(&xcall_report_regs, 0, 0, 0); |
1081 | } | 1084 | } |
1082 | 1085 | ||
1086 | #ifdef CONFIG_MAGIC_SYSRQ | ||
1087 | void smp_fetch_global_regs(void) | ||
1088 | { | ||
1089 | smp_cross_call(&xcall_fetch_glob_regs, 0, 0, 0); | ||
1090 | } | ||
1091 | #endif | ||
1092 | |||
1083 | /* We know that the window frames of the user have been flushed | 1093 | /* We know that the window frames of the user have been flushed |
1084 | * to the stack before we get here because all callers of us | 1094 | * to the stack before we get here because all callers of us |
1085 | * are flush_tlb_*() routines, and these run after flush_cache_*() | 1095 | * are flush_tlb_*() routines, and these run after flush_cache_*() |
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c index 01b52f561af4..c73ce3f4197e 100644 --- a/arch/sparc64/kernel/stacktrace.c +++ b/arch/sparc64/kernel/stacktrace.c | |||
@@ -19,7 +19,7 @@ void save_stack_trace(struct stack_trace *trace) | |||
19 | fp = ksp + STACK_BIAS; | 19 | fp = ksp + STACK_BIAS; |
20 | thread_base = (unsigned long) tp; | 20 | thread_base = (unsigned long) tp; |
21 | do { | 21 | do { |
22 | struct reg_window *rw; | 22 | struct sparc_stackf *sf; |
23 | struct pt_regs *regs; | 23 | struct pt_regs *regs; |
24 | unsigned long pc; | 24 | unsigned long pc; |
25 | 25 | ||
@@ -28,15 +28,17 @@ void save_stack_trace(struct stack_trace *trace) | |||
28 | fp >= (thread_base + THREAD_SIZE)) | 28 | fp >= (thread_base + THREAD_SIZE)) |
29 | break; | 29 | break; |
30 | 30 | ||
31 | rw = (struct reg_window *) fp; | 31 | sf = (struct sparc_stackf *) fp; |
32 | regs = (struct pt_regs *) (rw + 1); | 32 | regs = (struct pt_regs *) (sf + 1); |
33 | 33 | ||
34 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 34 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { |
35 | if (!(regs->tstate & TSTATE_PRIV)) | ||
36 | break; | ||
35 | pc = regs->tpc; | 37 | pc = regs->tpc; |
36 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; | 38 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; |
37 | } else { | 39 | } else { |
38 | pc = rw->ins[7]; | 40 | pc = sf->callers_pc; |
39 | fp = rw->ins[6] + STACK_BIAS; | 41 | fp = (unsigned long)sf->fp + STACK_BIAS; |
40 | } | 42 | } |
41 | 43 | ||
42 | if (trace->skip > 0) | 44 | if (trace->skip > 0) |
diff --git a/arch/sparc64/kernel/starfire.c b/arch/sparc64/kernel/starfire.c index b930fee7708a..7461581b3bb9 100644 --- a/arch/sparc64/kernel/starfire.c +++ b/arch/sparc64/kernel/starfire.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: starfire.c,v 1.10 2001/04/14 21:13:45 davem Exp $ | 1 | /* |
2 | * starfire.c: Starfire/E10000 support. | 2 | * starfire.c: Starfire/E10000 support. |
3 | * | 3 | * |
4 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) |
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index 010a737908ee..ade18ba0c686 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: sys32.S,v 1.12 2000/03/24 04:17:37 davem Exp $ | 1 | /* |
2 | * sys32.S: I-cache tricks for 32-bit compatibility layer simple | 2 | * sys32.S: I-cache tricks for 32-bit compatibility layer simple |
3 | * conversions. | 3 | * conversions. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S index 56ff55211341..704a3afcfd06 100644 --- a/arch/sparc64/kernel/trampoline.S +++ b/arch/sparc64/kernel/trampoline.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: trampoline.S,v 1.26 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * trampoline.S: Jump start slave processors on sparc64. | 2 | * trampoline.S: Jump start slave processors on sparc64. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index d9b8d46707d1..369749262653 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2116,7 +2116,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2116 | printk("\n"); | 2116 | printk("\n"); |
2117 | #endif | 2117 | #endif |
2118 | do { | 2118 | do { |
2119 | struct reg_window *rw; | 2119 | struct sparc_stackf *sf; |
2120 | struct pt_regs *regs; | 2120 | struct pt_regs *regs; |
2121 | unsigned long pc; | 2121 | unsigned long pc; |
2122 | 2122 | ||
@@ -2124,15 +2124,17 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2124 | if (fp < (thread_base + sizeof(struct thread_info)) || | 2124 | if (fp < (thread_base + sizeof(struct thread_info)) || |
2125 | fp >= (thread_base + THREAD_SIZE)) | 2125 | fp >= (thread_base + THREAD_SIZE)) |
2126 | break; | 2126 | break; |
2127 | rw = (struct reg_window *)fp; | 2127 | sf = (struct sparc_stackf *) fp; |
2128 | regs = (struct pt_regs *) (rw + 1); | 2128 | regs = (struct pt_regs *) (sf + 1); |
2129 | 2129 | ||
2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { |
2131 | if (!(regs->tstate & TSTATE_PRIV)) | ||
2132 | break; | ||
2131 | pc = regs->tpc; | 2133 | pc = regs->tpc; |
2132 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; | 2134 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; |
2133 | } else { | 2135 | } else { |
2134 | pc = rw->ins[7]; | 2136 | pc = sf->callers_pc; |
2135 | fp = rw->ins[6] + STACK_BIAS; | 2137 | fp = (unsigned long)sf->fp + STACK_BIAS; |
2136 | } | 2138 | } |
2137 | 2139 | ||
2138 | printk(" [%016lx] ", pc); | 2140 | printk(" [%016lx] ", pc); |
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 1a511e9f0d3e..afa7fc4f5193 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: unaligned.c,v 1.24 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * unaligned.c: Unaligned load/store trap handling with special | 2 | * unaligned.c: Unaligned load/store trap handling with special |
3 | * cases for the kernel to do them more quickly. | 3 | * cases for the kernel to do them more quickly. |
4 | * | 4 | * |
diff --git a/arch/sparc64/lib/PeeCeeI.c b/arch/sparc64/lib/PeeCeeI.c index 3c6cfbb20360..8b313f11bc8d 100644 --- a/arch/sparc64/lib/PeeCeeI.c +++ b/arch/sparc64/lib/PeeCeeI.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: PeeCeeI.c,v 1.4 1999/09/06 01:17:35 davem Exp $ | 1 | /* |
2 | * PeeCeeI.c: The emerging standard... | 2 | * PeeCeeI.c: The emerging standard... |
3 | * | 3 | * |
4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/lib/VISsave.S b/arch/sparc64/lib/VISsave.S index a0ded5c5aa5c..b320ae9e2e2e 100644 --- a/arch/sparc64/lib/VISsave.S +++ b/arch/sparc64/lib/VISsave.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: VISsave.S,v 1.6 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * VISsave.S: Code for saving FPU register state for | 2 | * VISsave.S: Code for saving FPU register state for |
3 | * VIS routines. One should not call this directly, | 3 | * VIS routines. One should not call this directly, |
4 | * but use macros provided in <asm/visasm.h>. | 4 | * but use macros provided in <asm/visasm.h>. |
diff --git a/arch/sparc64/lib/memcmp.S b/arch/sparc64/lib/memcmp.S index c90ad96c51b9..d3fdaa898566 100644 --- a/arch/sparc64/lib/memcmp.S +++ b/arch/sparc64/lib/memcmp.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: memcmp.S,v 1.3 2000/03/23 07:51:08 davem Exp $ | 1 | /* |
2 | * Sparc64 optimized memcmp code. | 2 | * Sparc64 optimized memcmp code. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
diff --git a/arch/sparc64/lib/memscan.S b/arch/sparc64/lib/memscan.S index 5e72d4911417..5686dfa5dc15 100644 --- a/arch/sparc64/lib/memscan.S +++ b/arch/sparc64/lib/memscan.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: memscan.S,v 1.3 2000/01/31 04:59:10 davem Exp $ | 1 | /* |
2 | * memscan.S: Optimized memscan for Sparc64. | 2 | * memscan.S: Optimized memscan for Sparc64. |
3 | * | 3 | * |
4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) | 4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) |
diff --git a/arch/sparc64/lib/strncmp.S b/arch/sparc64/lib/strncmp.S index 6f14f53dbabe..980e83751556 100644 --- a/arch/sparc64/lib/strncmp.S +++ b/arch/sparc64/lib/strncmp.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: strncmp.S,v 1.2 1997/03/11 17:51:44 jj Exp $ | 1 | /* |
2 | * Sparc64 optimized strncmp code. | 2 | * Sparc64 optimized strncmp code. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
diff --git a/arch/sparc64/lib/strncpy_from_user.S b/arch/sparc64/lib/strncpy_from_user.S index b2f499f79427..511c8f136f95 100644 --- a/arch/sparc64/lib/strncpy_from_user.S +++ b/arch/sparc64/lib/strncpy_from_user.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: strncpy_from_user.S,v 1.6 1999/05/25 16:53:05 jj Exp $ | 1 | /* |
2 | * strncpy_from_user.S: Sparc64 strncpy from userspace. | 2 | * strncpy_from_user.S: Sparc64 strncpy from userspace. |
3 | * | 3 | * |
4 | * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) | 4 | * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) |
diff --git a/arch/sparc64/math-emu/math.c b/arch/sparc64/math-emu/math.c index 6ee496c2864a..add053e0f3b3 100644 --- a/arch/sparc64/math-emu/math.c +++ b/arch/sparc64/math-emu/math.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: math.c,v 1.11 1999/12/20 05:02:25 davem Exp $ | 1 | /* |
2 | * arch/sparc64/math-emu/math.c | 2 | * arch/sparc64/math-emu/math.c |
3 | * | 3 | * |
4 | * Copyright (C) 1997,1999 Jakub Jelinek (jj@ultra.linux.cz) | 4 | * Copyright (C) 1997,1999 Jakub Jelinek (jj@ultra.linux.cz) |
diff --git a/arch/sparc64/math-emu/sfp-util.h b/arch/sparc64/math-emu/sfp-util.h index 31e474738cf6..425d3cf01af4 100644 --- a/arch/sparc64/math-emu/sfp-util.h +++ b/arch/sparc64/math-emu/sfp-util.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: sfp-util.h,v 1.5 2001/06/10 06:48:46 davem Exp $ | 1 | /* |
2 | * arch/sparc64/math-emu/sfp-util.h | 2 | * arch/sparc64/math-emu/sfp-util.h |
3 | * | 3 | * |
4 | * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) | 4 | * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) |
diff --git a/arch/sparc64/mm/Makefile b/arch/sparc64/mm/Makefile index e415bf942bcd..68d04c0370f4 100644 --- a/arch/sparc64/mm/Makefile +++ b/arch/sparc64/mm/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | # $Id: Makefile,v 1.8 2000/12/14 22:57:25 davem Exp $ | ||
2 | # Makefile for the linux Sparc64-specific parts of the memory manager. | 1 | # Makefile for the linux Sparc64-specific parts of the memory manager. |
3 | # | 2 | # |
4 | 3 | ||
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index 2650d0d33ac2..236f4d228d2b 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: fault.c,v 1.59 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc. | 2 | * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc. |
3 | * | 3 | * |
4 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index af9d81db0b38..f362c2037013 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: generic.c,v 1.18 2001/12/21 04:56:15 davem Exp $ | 1 | /* |
2 | * generic.c: Generic Sparc mm routines that are not dependent upon | 2 | * generic.c: Generic Sparc mm routines that are not dependent upon |
3 | * MMU type but are Sparc specific. | 3 | * MMU type but are Sparc specific. |
4 | * | 4 | * |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 3c7b9471eafb..84898c44dd4d 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: init.c,v 1.209 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * arch/sparc64/mm/init.c | 2 | * arch/sparc64/mm/init.c |
3 | * | 3 | * |
4 | * Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S index 796e005dad8b..9bb2d90a9df6 100644 --- a/arch/sparc64/mm/ultra.S +++ b/arch/sparc64/mm/ultra.S | |||
@@ -1,7 +1,7 @@ | |||
1 | /* $Id: ultra.S,v 1.72 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * ultra.S: Don't expand these all over the place... | 2 | * ultra.S: Don't expand these all over the place... |
3 | * | 3 | * |
4 | * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1997, 2000, 2008 David S. Miller (davem@davemloft.net) |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <asm/asi.h> | 7 | #include <asm/asi.h> |
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/thread_info.h> | 15 | #include <asm/thread_info.h> |
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | #include <asm/hypervisor.h> | 17 | #include <asm/hypervisor.h> |
18 | #include <asm/cpudata.h> | ||
18 | 19 | ||
19 | /* Basically, most of the Spitfire vs. Cheetah madness | 20 | /* Basically, most of the Spitfire vs. Cheetah madness |
20 | * has to do with the fact that Cheetah does not support | 21 | * has to do with the fact that Cheetah does not support |
@@ -514,6 +515,32 @@ xcall_report_regs: | |||
514 | b rtrap_xcall | 515 | b rtrap_xcall |
515 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 | 516 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 |
516 | 517 | ||
518 | #ifdef CONFIG_MAGIC_SYSRQ | ||
519 | .globl xcall_fetch_glob_regs | ||
520 | xcall_fetch_glob_regs: | ||
521 | sethi %hi(global_reg_snapshot), %g1 | ||
522 | or %g1, %lo(global_reg_snapshot), %g1 | ||
523 | __GET_CPUID(%g2) | ||
524 | sllx %g2, 6, %g3 | ||
525 | add %g1, %g3, %g1 | ||
526 | rdpr %tstate, %g7 | ||
527 | stx %g7, [%g1 + GR_SNAP_TSTATE] | ||
528 | rdpr %tpc, %g7 | ||
529 | stx %g7, [%g1 + GR_SNAP_TPC] | ||
530 | rdpr %tnpc, %g7 | ||
531 | stx %g7, [%g1 + GR_SNAP_TNPC] | ||
532 | stx %o7, [%g1 + GR_SNAP_O7] | ||
533 | stx %i7, [%g1 + GR_SNAP_I7] | ||
534 | sethi %hi(trap_block), %g7 | ||
535 | or %g7, %lo(trap_block), %g7 | ||
536 | sllx %g2, TRAP_BLOCK_SZ_SHIFT, %g2 | ||
537 | add %g7, %g2, %g7 | ||
538 | ldx [%g7 + TRAP_PER_CPU_THREAD], %g3 | ||
539 | membar #StoreStore | ||
540 | stx %g3, [%g1 + GR_SNAP_THREAD] | ||
541 | retry | ||
542 | #endif /* CONFIG_MAGIC_SYSRQ */ | ||
543 | |||
517 | #ifdef DCACHE_ALIASING_POSSIBLE | 544 | #ifdef DCACHE_ALIASING_POSSIBLE |
518 | .align 32 | 545 | .align 32 |
519 | .globl xcall_flush_dcache_page_cheetah | 546 | .globl xcall_flush_dcache_page_cheetah |
diff --git a/arch/sparc64/prom/Makefile b/arch/sparc64/prom/Makefile index 3d33ed27bc27..8c94483ca54d 100644 --- a/arch/sparc64/prom/Makefile +++ b/arch/sparc64/prom/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | # $Id: Makefile,v 1.7 2000/12/14 22:57:25 davem Exp $ | ||
2 | # Makefile for the Sun Boot PROM interface library under | 1 | # Makefile for the Sun Boot PROM interface library under |
3 | # Linux. | 2 | # Linux. |
4 | # | 3 | # |
diff --git a/arch/sparc64/prom/bootstr.c b/arch/sparc64/prom/bootstr.c index a7278614e99d..ab9ccc63b388 100644 --- a/arch/sparc64/prom/bootstr.c +++ b/arch/sparc64/prom/bootstr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: bootstr.c,v 1.6 1999/08/31 06:55:01 davem Exp $ | 1 | /* |
2 | * bootstr.c: Boot string/argument acquisition from the PROM. | 2 | * bootstr.c: Boot string/argument acquisition from the PROM. |
3 | * | 3 | * |
4 | * Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/prom/devops.c b/arch/sparc64/prom/devops.c index 4641839eb39a..9dbd803e46e1 100644 --- a/arch/sparc64/prom/devops.c +++ b/arch/sparc64/prom/devops.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: devops.c,v 1.3 1997/10/29 07:43:28 ecd Exp $ | 1 | /* |
2 | * devops.c: Device operations using the PROM. | 2 | * devops.c: Device operations using the PROM. |
3 | * | 3 | * |
4 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/prom/init.c b/arch/sparc64/prom/init.c index 87e7c7ea0ee6..7b00f89490a4 100644 --- a/arch/sparc64/prom/init.c +++ b/arch/sparc64/prom/init.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: init.c,v 1.10 1999/09/21 14:35:59 davem Exp $ | 1 | /* |
2 | * init.c: Initialize internal variables used by the PROM | 2 | * init.c: Initialize internal variables used by the PROM |
3 | * library functions. | 3 | * library functions. |
4 | * | 4 | * |
diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c index 47a877a15abd..9b0c0760901e 100644 --- a/arch/sparc64/prom/misc.c +++ b/arch/sparc64/prom/misc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: misc.c,v 1.20 2001/09/21 03:17:07 kanoj Exp $ | 1 | /* |
2 | * misc.c: Miscellaneous prom functions that don't belong | 2 | * misc.c: Miscellaneous prom functions that don't belong |
3 | * anywhere else. | 3 | * anywhere else. |
4 | * | 4 | * |
diff --git a/arch/sparc64/prom/p1275.c b/arch/sparc64/prom/p1275.c index 7fcccc0e19cf..4b7c937bba61 100644 --- a/arch/sparc64/prom/p1275.c +++ b/arch/sparc64/prom/p1275.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: p1275.c,v 1.22 2001/10/18 09:40:00 davem Exp $ | 1 | /* |
2 | * p1275.c: Sun IEEE 1275 PROM low level interface routines | 2 | * p1275.c: Sun IEEE 1275 PROM low level interface routines |
3 | * | 3 | * |
4 | * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 4 | * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
diff --git a/arch/sparc64/prom/tree.c b/arch/sparc64/prom/tree.c index a99ccd7fb1b0..281aea44790b 100644 --- a/arch/sparc64/prom/tree.c +++ b/arch/sparc64/prom/tree.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: tree.c,v 1.10 1998/01/10 22:39:00 ecd Exp $ | 1 | /* |
2 | * tree.c: Basic device tree traversal/scanning for the Linux | 2 | * tree.c: Basic device tree traversal/scanning for the Linux |
3 | * prom library. | 3 | * prom library. |
4 | * | 4 | * |