aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/asm-sparc64/ptrace.h21
-rw-r--r--include/asm-sparc64/smp.h5
2 files changed, 25 insertions, 1 deletions
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index 90972a5ada59..d8a56cddf7f2 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -126,6 +126,17 @@ struct sparc_trapf {
126#define TRACEREG32_SZ sizeof(struct pt_regs32) 126#define TRACEREG32_SZ sizeof(struct pt_regs32)
127#define STACKFRAME32_SZ sizeof(struct sparc_stackf32) 127#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
128 128
129struct global_reg_snapshot {
130 unsigned long tstate;
131 unsigned long tpc;
132 unsigned long tnpc;
133 unsigned long o7;
134 unsigned long i7;
135 struct thread_info *thread;
136 unsigned long pad1;
137 unsigned long pad2;
138};
139
129#ifdef __KERNEL__ 140#ifdef __KERNEL__
130 141
131#define __ARCH_WANT_COMPAT_SYS_PTRACE 142#define __ARCH_WANT_COMPAT_SYS_PTRACE
@@ -295,6 +306,16 @@ extern void __show_regs(struct pt_regs *);
295#define SF_XARG5 0x58 306#define SF_XARG5 0x58
296#define SF_XXARG 0x5c 307#define SF_XXARG 0x5c
297 308
309/* global_reg_snapshot offsets */
310#define GR_SNAP_TSTATE 0x00
311#define GR_SNAP_TPC 0x08
312#define GR_SNAP_TNPC 0x10
313#define GR_SNAP_O7 0x18
314#define GR_SNAP_I7 0x20
315#define GR_SNAP_THREAD 0x28
316#define GR_SNAP_PAD1 0x30
317#define GR_SNAP_PAD2 0x38
318
298/* Stuff for the ptrace system call */ 319/* Stuff for the ptrace system call */
299#define PTRACE_SPARC_DETACH 11 320#define PTRACE_SPARC_DETACH 11
300#define PTRACE_GETREGS 12 321#define PTRACE_GETREGS 12
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index 1c1c5ea5cea5..cd0311b2e19d 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -1,6 +1,6 @@
1/* smp.h: Sparc64 specific SMP stuff. 1/* smp.h: Sparc64 specific SMP stuff.
2 * 2 *
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996, 2008 David S. Miller (davem@davemloft.net)
4 */ 4 */
5 5
6#ifndef _SPARC64_SMP_H 6#ifndef _SPARC64_SMP_H
@@ -44,6 +44,8 @@ extern int hard_smp_processor_id(void);
44extern void smp_fill_in_sib_core_maps(void); 44extern void smp_fill_in_sib_core_maps(void);
45extern void cpu_play_dead(void); 45extern void cpu_play_dead(void);
46 46
47extern void smp_fetch_global_regs(void);
48
47#ifdef CONFIG_HOTPLUG_CPU 49#ifdef CONFIG_HOTPLUG_CPU
48extern int __cpu_disable(void); 50extern int __cpu_disable(void);
49extern void __cpu_die(unsigned int cpu); 51extern void __cpu_die(unsigned int cpu);
@@ -55,6 +57,7 @@ extern void __cpu_die(unsigned int cpu);
55 57
56#define hard_smp_processor_id() 0 58#define hard_smp_processor_id() 0
57#define smp_fill_in_sib_core_maps() do { } while (0) 59#define smp_fill_in_sib_core_maps() do { } while (0)
60#define smp_fetch_global_regs() do { } while (0)
58 61
59#endif /* !(CONFIG_SMP) */ 62#endif /* !(CONFIG_SMP) */
60 63