Re: [PATCH 05/11] MIPS: clear MSACSR cause bits when handling MSA FP exception

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 9/24/2014 1:45 PM, Paul Burton wrote:

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@xxxxxxxxxx>
---
  arch/mips/kernel/genex.S | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index ac35e12..ae84496 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -367,6 +367,15 @@ NESTED(nmi_handler, PT_SIZE, sp)
  	STI
  	.endm

+	.macro	__build_clear_msa_fpe
+	_cfcmsa	a1, MSA_CSR
+	li	a2, ~(0x3f << 12)
+	and	a2, a1
+	_ctcmsa	MSA_CSR, a1

   Not a2?

+	TRACE_IRQS_ON
+	STI
+	.endm
+
  	.macro	__build_clear_ade
  	MFC0	t0, CP0_BADVADDR
  	PTR_S	t0, PT_BVADDR(sp)

WBR, Sergei






[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux