diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2011-05-16 14:23:44 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2011-05-19 22:55:59 -0400 |
commit | 571d76acdab95876aeff869ab6449f826c23aa43 (patch) | |
tree | b52ceacfa83b1ab4c5a6950007ce8be03cec192e /arch/tile/mm/fault.c | |
parent | 8aaf1dda42576b0f8dffb004065baa806f4df9b6 (diff) |
arch/tile: support signal "exception-trace" hook
This change adds support for /proc/sys/debug/exception-trace to tile.
Like x86 and sparc, by default it is set to "1", generating a one-line
printk whenever a user process crashes. By setting it to "2", we get
a much more complete userspace diagnostic at crash time, including
a user-space backtrace, register dump, and memory dump around the
address of the crash.
Some vestiges of the Tilera-internal version of this support are
removed with this patch (the show_crashinfo variable and the
arch_coredump_signal function). We retain a "crashinfo" boot parameter
which allows you to set the boot-time value of exception-trace.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/mm/fault.c')
-rw-r--r-- | arch/tile/mm/fault.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index 24ca54a0703b..25b7b90fd620 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c | |||
@@ -43,8 +43,11 @@ | |||
43 | 43 | ||
44 | #include <arch/interrupts.h> | 44 | #include <arch/interrupts.h> |
45 | 45 | ||
46 | static noinline void force_sig_info_fault(int si_signo, int si_code, | 46 | static noinline void force_sig_info_fault(const char *type, int si_signo, |
47 | unsigned long address, int fault_num, struct task_struct *tsk) | 47 | int si_code, unsigned long address, |
48 | int fault_num, | ||
49 | struct task_struct *tsk, | ||
50 | struct pt_regs *regs) | ||
48 | { | 51 | { |
49 | siginfo_t info; | 52 | siginfo_t info; |
50 | 53 | ||
@@ -59,6 +62,7 @@ static noinline void force_sig_info_fault(int si_signo, int si_code, | |||
59 | info.si_code = si_code; | 62 | info.si_code = si_code; |
60 | info.si_addr = (void __user *)address; | 63 | info.si_addr = (void __user *)address; |
61 | info.si_trapno = fault_num; | 64 | info.si_trapno = fault_num; |
65 | trace_unhandled_signal(type, regs, address, si_signo); | ||
62 | force_sig_info(si_signo, &info, tsk); | 66 | force_sig_info(si_signo, &info, tsk); |
63 | } | 67 | } |
64 | 68 | ||
@@ -71,11 +75,12 @@ SYSCALL_DEFINE2(cmpxchg_badaddr, unsigned long, address, | |||
71 | struct pt_regs *, regs) | 75 | struct pt_regs *, regs) |
72 | { | 76 | { |
73 | if (address >= PAGE_OFFSET) | 77 | if (address >= PAGE_OFFSET) |
74 | force_sig_info_fault(SIGSEGV, SEGV_MAPERR, address, | 78 | force_sig_info_fault("atomic segfault", SIGSEGV, SEGV_MAPERR, |
75 | INT_DTLB_MISS, current); | 79 | address, INT_DTLB_MISS, current, regs); |
76 | else | 80 | else |
77 | force_sig_info_fault(SIGBUS, BUS_ADRALN, address, | 81 | force_sig_info_fault("atomic alignment fault", SIGBUS, |
78 | INT_UNALIGN_DATA, current); | 82 | BUS_ADRALN, address, |
83 | INT_UNALIGN_DATA, current, regs); | ||
79 | 84 | ||
80 | /* | 85 | /* |
81 | * Adjust pc to point at the actual instruction, which is unusual | 86 | * Adjust pc to point at the actual instruction, which is unusual |
@@ -471,8 +476,8 @@ bad_area_nosemaphore: | |||
471 | */ | 476 | */ |
472 | local_irq_enable(); | 477 | local_irq_enable(); |
473 | 478 | ||
474 | force_sig_info_fault(SIGSEGV, si_code, address, | 479 | force_sig_info_fault("segfault", SIGSEGV, si_code, address, |
475 | fault_num, tsk); | 480 | fault_num, tsk, regs); |
476 | return 0; | 481 | return 0; |
477 | } | 482 | } |
478 | 483 | ||
@@ -547,7 +552,8 @@ do_sigbus: | |||
547 | if (is_kernel_mode) | 552 | if (is_kernel_mode) |
548 | goto no_context; | 553 | goto no_context; |
549 | 554 | ||
550 | force_sig_info_fault(SIGBUS, BUS_ADRERR, address, fault_num, tsk); | 555 | force_sig_info_fault("bus error", SIGBUS, BUS_ADRERR, address, |
556 | fault_num, tsk, regs); | ||
551 | return 0; | 557 | return 0; |
552 | } | 558 | } |
553 | 559 | ||