All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Avoid an FPE exception in FCSR mask probing
@ 2015-06-02 16:50 Maciej W. Rozycki
  2015-06-02 20:36 ` Joshua Kinard
  2015-06-03  7:50 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2015-06-02 16:50 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Joshua Kinard, linux-mips

Use the default FCSR value in mask probing, avoiding an FPE exception 
where reset has left any exception enable and their corresponding cause 
bits set and the register is then rewritten with these bits active.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
linux-mips-fcsr-mask-fix.diff
Index: linux-org-test/arch/mips/kernel/cpu-probe.c
===================================================================
--- linux-org-test.orig/arch/mips/kernel/cpu-probe.c	2015-06-01 00:43:32.000000000 +0100
+++ linux-org-test/arch/mips/kernel/cpu-probe.c	2015-06-02 12:14:10.088786000 +0100
@@ -74,13 +74,12 @@ static inline void cpu_set_fpu_fcsr_mask
 {
 	unsigned long sr, mask, fcsr, fcsr0, fcsr1;
 
+	fcsr = c->fpu_csr31;
 	mask = FPU_CSR_ALL_X | FPU_CSR_ALL_E | FPU_CSR_ALL_S | FPU_CSR_RM;
 
 	sr = read_c0_status();
 	__enable_fpu(FPU_AS_IS);
 
-	fcsr = read_32bit_cp1_register(CP1_STATUS);
-
 	fcsr0 = fcsr & mask;
 	write_32bit_cp1_register(CP1_STATUS, fcsr0);
 	fcsr0 = read_32bit_cp1_register(CP1_STATUS);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-03  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 16:50 [PATCH] MIPS: Avoid an FPE exception in FCSR mask probing Maciej W. Rozycki
2015-06-02 20:36 ` Joshua Kinard
2015-06-03  7:50 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.