aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2015-01-30 07:09:34 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-03-27 14:42:45 -0400
commit091be550a70a086c3b4420c6155e733dc410f190 (patch)
tree8695bacab15ffcce06acc58f724472ea5e7a2252 /arch
parente1bebbab1eaecac77d77033010b5e0f51b737e64 (diff)
MIPS: clear MSACSR cause bits when handling MSA FP exception
Much like for traditional scalar FP exceptions, the cause bits in the MSACSR register need to be cleared following an MSA FP exception. Without doing so the exception will simply be raised again whenever the kernel restores MSACSR from a tasks saved context, leading to undesirable spurious exceptions. Clear the cause bits from the handle_msa_fpe function, mirroring the way handle_fpe clears the cause bits in FCSR. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9164/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kernel/genex.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 2ebaabe3af15..86e22422d08c 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -368,6 +368,15 @@ NESTED(nmi_handler, PT_SIZE, sp)
368 STI 368 STI
369 .endm 369 .endm
370 370
371 .macro __build_clear_msa_fpe
372 _cfcmsa a1, MSA_CSR
373 li a2, ~(0x3f << 12)
374 and a1, a1, a2
375 _ctcmsa MSA_CSR, a1
376 TRACE_IRQS_ON
377 STI
378 .endm
379
371 .macro __build_clear_ade 380 .macro __build_clear_ade
372 MFC0 t0, CP0_BADVADDR 381 MFC0 t0, CP0_BADVADDR
373 PTR_S t0, PT_BVADDR(sp) 382 PTR_S t0, PT_BVADDR(sp)
@@ -426,7 +435,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
426 BUILD_HANDLER cpu cpu sti silent /* #11 */ 435 BUILD_HANDLER cpu cpu sti silent /* #11 */
427 BUILD_HANDLER ov ov sti silent /* #12 */ 436 BUILD_HANDLER ov ov sti silent /* #12 */
428 BUILD_HANDLER tr tr sti silent /* #13 */ 437 BUILD_HANDLER tr tr sti silent /* #13 */
429 BUILD_HANDLER msa_fpe msa_fpe sti silent /* #14 */ 438 BUILD_HANDLER msa_fpe msa_fpe msa_fpe silent /* #14 */
430 BUILD_HANDLER fpe fpe fpe silent /* #15 */ 439 BUILD_HANDLER fpe fpe fpe silent /* #15 */
431 BUILD_HANDLER ftlb ftlb none silent /* #16 */ 440 BUILD_HANDLER ftlb ftlb none silent /* #16 */
432 BUILD_HANDLER msa msa sti silent /* #21 */ 441 BUILD_HANDLER msa msa sti silent /* #21 */