summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/traps.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2012-03-29 21:23:54 +0200
committerChris Metcalf <cmetcalf@tilera.com>2012-04-02 18:12:52 +0200
commita714ffff36a581756ec3b001f47e8e5e96a9fa0e (patch)
tree73f84f87b09b30f9621f50748b897303bb1d3b6a /arch/tile/kernel/traps.c
parentarch/tile: work around a hardware issue with the return-address stack (diff)
downloadlinux-a714ffff36a581756ec3b001f47e8e5e96a9fa0e.tar.xz
linux-a714ffff36a581756ec3b001f47e8e5e96a9fa0e.zip
arch/tile: fix up some minor trap handling issues
We now respond to MEM_ERROR traps (e.g. an atomic instruction to non-cacheable memory) with a SIGBUS. We also no longer generate a console crash message if a user process die due to a SIGTRAP. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/traps.c')
-rw-r--r--arch/tile/kernel/traps.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/tile/kernel/traps.c b/arch/tile/kernel/traps.c
index 32acfd9e23d0..73cff814ac57 100644
--- a/arch/tile/kernel/traps.c
+++ b/arch/tile/kernel/traps.c
@@ -200,7 +200,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
{
siginfo_t info = { 0 };
int signo, code;
- unsigned long address;
+ unsigned long address = 0;
bundle_bits instr;
/* Re-enable interrupts. */
@@ -223,6 +223,10 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
}
switch (fault_num) {
+ case INT_MEM_ERROR:
+ signo = SIGBUS;
+ code = BUS_OBJERR;
+ break;
case INT_ILL:
if (copy_from_user(&instr, (void __user *)regs->pc,
sizeof(instr))) {
@@ -312,7 +316,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
info.si_addr = (void __user *)address;
if (signo == SIGILL)
info.si_trapno = fault_num;
- trace_unhandled_signal("trap", regs, address, signo);
+ if (signo != SIGTRAP)
+ trace_unhandled_signal("trap", regs, address, signo);
force_sig_info(signo, &info, current);
}