aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/mm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-20 02:46:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-20 03:33:45 -0400
commit93dae5b70e7c1c8e927d22e1c20a941ca376906a (patch)
treef255087706b9d176455b17e4384f4632f59f4cde /arch/sparc64/mm
parent88278ca27a43ae503572b52ea2c171fbf45db5a2 (diff)
sparc64: Add global register dumping facility.
When a cpu really is stuck in the kernel, it can be often impossible to figure out which cpu is stuck where. The worst case is when the stuck cpu has interrupts disabled. Therefore, implement a global cpu state capture that uses SMP message interrupts which are not disabled by the normal IRQ enable/disable APIs of the kernel. As long as we can get a sysrq 'y' to the kernel, we can get a dump. Even if the console interrupt cpu is wedged, we can trigger it from userspace using /proc/sysrq-trigger The output is made compact so that this facility is more useful on high cpu count systems, which is where this facility will likely find itself the most useful :) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r--arch/sparc64/mm/ultra.S29
1 files changed, 28 insertions, 1 deletions
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index 15d124963f68..9bb2d90a9df6 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -1,7 +1,7 @@
1/* 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
520xcall_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