All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] MIPS: Prevent "BUG: using smp_processor_id() in preemptible..." errors
@ 2015-04-22 17:24 Paul Martin
  2015-04-23  7:59   ` Markos Chandras
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Martin @ 2015-04-22 17:24 UTC (permalink / raw)
  To: linux-mips

Commit 9b26616c8d9dae53fbac7f7cb2c6dd1308102976 "MIPS: Respect the ISA
level in FCSR handling" added references to current_cpu_data, which is
a macro expanding to cpu_data[smp_processor_id()].  Change these to
raw_current_cpu_data.

These changes may or may not be a good idea.

There may also be a need for a similar change in
arch/mips/kernel/ptrace.c which I haven't made.

---
 arch/mips/include/asm/elf.h | 4 ++--
 arch/mips/math-emu/cp1emu.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index a594d8e..63f3bbc 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -304,7 +304,7 @@ do {									\
 									\
 	current->thread.abi = &mips_abi;				\
 									\
-	current->thread.fpu.fcr31 = current_cpu_data.fpu_csr31;		\
+	current->thread.fpu.fcr31 = raw_current_cpu_data.fpu_csr31;	\
 } while (0)
 
 #endif /* CONFIG_32BIT */
@@ -366,7 +366,7 @@ do {									\
 	else								\
 		current->thread.abi = &mips_abi;			\
 									\
-	current->thread.fpu.fcr31 = current_cpu_data.fpu_csr31;		\
+	current->thread.fpu.fcr31 = raw_current_cpu_data.fpu_csr31;	\
 									\
 	p = personality(current->personality);				\
 	if (p != PER_LINUX32 && p != PER_LINUX)				\
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index d31c537..52ea70c 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -921,7 +921,7 @@ static inline void cop1_ctc(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 			 (void *)xcp->cp0_epc, MIPSInst_RT(ir), value);
 
 		/* Preserve read-only bits.  */
-		mask = current_cpu_data.fpu_msk31;
+		mask = raw_current_cpu_data.fpu_msk31;
 		fcr31 = (value & ~mask) | (fcr31 & mask);
 		break;
 
-- 
2.1.4



-- 
Paul Martin                                  http://www.codethink.co.uk/
Senior Software Developer, Codethink Ltd.

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

end of thread, other threads:[~2015-04-23 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22 17:24 [RFC] MIPS: Prevent "BUG: using smp_processor_id() in preemptible..." errors Paul Martin
2015-04-23  7:59 ` Markos Chandras
2015-04-23  7:59   ` Markos Chandras
2015-04-23 21:21   ` Maciej W. Rozycki

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.