aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2012-03-29 15:23:54 -0400
committerChris Metcalf <cmetcalf@tilera.com>2012-04-02 12:12:52 -0400
commita714ffff36a581756ec3b001f47e8e5e96a9fa0e (patch)
tree73f84f87b09b30f9621f50748b897303bb1d3b6a /arch
parente17235382dbb05f70146e141e4b780fd069050dc (diff)
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')
-rw-r--r--arch/tile/kernel/intvec_64.S2
-rw-r--r--arch/tile/kernel/traps.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S
index 2c181c864ef7..005535d108c1 100644
--- a/arch/tile/kernel/intvec_64.S
+++ b/arch/tile/kernel/intvec_64.S
@@ -1178,7 +1178,7 @@ STD_ENTRY(fill_ra_stack)
1178#define do_hardwall_trap bad_intr 1178#define do_hardwall_trap bad_intr
1179#endif 1179#endif
1180 1180
1181 int_hand INT_MEM_ERROR, MEM_ERROR, bad_intr 1181 int_hand INT_MEM_ERROR, MEM_ERROR, do_trap
1182 int_hand INT_SINGLE_STEP_3, SINGLE_STEP_3, bad_intr 1182 int_hand INT_SINGLE_STEP_3, SINGLE_STEP_3, bad_intr
1183#if CONFIG_KERNEL_PL == 2 1183#if CONFIG_KERNEL_PL == 2
1184 int_hand INT_SINGLE_STEP_2, SINGLE_STEP_2, gx_singlestep_handle 1184 int_hand INT_SINGLE_STEP_2, SINGLE_STEP_2, gx_singlestep_handle
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,
200{ 200{
201 siginfo_t info = { 0 }; 201 siginfo_t info = { 0 };
202 int signo, code; 202 int signo, code;
203 unsigned long address; 203 unsigned long address = 0;
204 bundle_bits instr; 204 bundle_bits instr;
205 205
206 /* Re-enable interrupts. */ 206 /* Re-enable interrupts. */
@@ -223,6 +223,10 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
223 } 223 }
224 224
225 switch (fault_num) { 225 switch (fault_num) {
226 case INT_MEM_ERROR:
227 signo = SIGBUS;
228 code = BUS_OBJERR;
229 break;
226 case INT_ILL: 230 case INT_ILL:
227 if (copy_from_user(&instr, (void __user *)regs->pc, 231 if (copy_from_user(&instr, (void __user *)regs->pc,
228 sizeof(instr))) { 232 sizeof(instr))) {
@@ -312,7 +316,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
312 info.si_addr = (void __user *)address; 316 info.si_addr = (void __user *)address;
313 if (signo == SIGILL) 317 if (signo == SIGILL)
314 info.si_trapno = fault_num; 318 info.si_trapno = fault_num;
315 trace_unhandled_signal("trap", regs, address, signo); 319 if (signo != SIGTRAP)
320 trace_unhandled_signal("trap", regs, address, signo);
316 force_sig_info(signo, &info, current); 321 force_sig_info(signo, &info, current);
317} 322}
318 323