aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2015-04-03 18:25:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-07 19:09:18 -0400
commit27e28e8ec47a5ce335ebf25d34ca356c80635908 (patch)
tree5905c8dc84f9099570b66e4811e90d206151588c /arch/mips/kernel
parentd4f5b088937e2dae7528245c597dcab7e57eb5f3 (diff)
MIPS: Normalise code flow in the CpU exception handler
Changes applied to `do_cpu' over time reduced the use of the SIGILL issued with `force_sig' at the end to a single CU3 case only in the switch statement there. Move that `force_sig' call over to right where required then and toss out the pile of gotos now not needed to skip over the call, replacing them with regular breaks out of the switch. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9683/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/traps.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 2594e4b7c0c3..5e1f28779340 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1312,7 +1312,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1312 status = -1; 1312 status = -1;
1313 1313
1314 if (unlikely(compute_return_epc(regs) < 0)) 1314 if (unlikely(compute_return_epc(regs) < 0))
1315 goto out; 1315 break;
1316 1316
1317 if (get_isa16_mode(regs->cp0_epc)) { 1317 if (get_isa16_mode(regs->cp0_epc)) {
1318 unsigned short mmop[2] = { 0 }; 1318 unsigned short mmop[2] = { 0 };
@@ -1345,7 +1345,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1345 force_sig(status, current); 1345 force_sig(status, current);
1346 } 1346 }
1347 1347
1348 goto out; 1348 break;
1349 1349
1350 case 3: 1350 case 3:
1351 /* 1351 /*
@@ -1361,8 +1361,10 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1361 * erroneously too, so they are covered by this choice 1361 * erroneously too, so they are covered by this choice
1362 * as well. 1362 * as well.
1363 */ 1363 */
1364 if (raw_cpu_has_fpu) 1364 if (raw_cpu_has_fpu) {
1365 force_sig(SIGILL, current);
1365 break; 1366 break;
1367 }
1366 /* Fall through. */ 1368 /* Fall through. */
1367 1369
1368 case 1: 1370 case 1:
@@ -1378,16 +1380,13 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1378 mt_ase_fp_affinity(); 1380 mt_ase_fp_affinity();
1379 } 1381 }
1380 1382
1381 goto out; 1383 break;
1382 1384
1383 case 2: 1385 case 2:
1384 raw_notifier_call_chain(&cu2_chain, CU2_EXCEPTION, regs); 1386 raw_notifier_call_chain(&cu2_chain, CU2_EXCEPTION, regs);
1385 goto out; 1387 break;
1386 } 1388 }
1387 1389
1388 force_sig(SIGILL, current);
1389
1390out:
1391 exception_exit(prev_state); 1390 exception_exit(prev_state);
1392} 1391}
1393 1392