All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] TX49 MFC0 bug workaround
@ 2006-02-02 16:34 Atsushi Nemoto
  2006-02-02 16:38 ` Maciej W. Rozycki
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Atsushi Nemoto @ 2006-02-02 16:34 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

If mfc0 $12 follows store and the mfc0 is last instruction of a
page and fetching the next instruction causes TLB miss, the result
of the mfc0 might wrongly contain EXL bit.

ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008

Workaround: mask EXL bit of the result or place a nop before mfc0.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h
index 0da5818..951ee7a 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/interrupt.h
@@ -13,6 +13,7 @@
 
 #include <linux/config.h>
 #include <asm/hazards.h>
+#include <asm/war.h>
 
 __asm__ (
 	"	.macro	local_irq_enable				\n"
@@ -55,8 +56,13 @@ __asm__ (
 	"	di							\n"
 #else
 	"	mfc0	$1,$12						\n"
+#if TX49XX_MFC0_WAR && defined(MODULE)
+	"	ori	$1,3						\n"
+	"	xori	$1,3						\n"
+#else
 	"	ori	$1,1						\n"
 	"	xori	$1,1						\n"
+#endif
 	"	.set	noreorder					\n"
 	"	mtc0	$1,$12						\n"
 #endif
@@ -96,8 +102,13 @@ __asm__ (
 	"	andi	\\result, 1					\n"
 #else
 	"	mfc0	\\result, $12					\n"
+#if TX49XX_MFC0_WAR && defined(MODULE)
+	"	ori	$1, \\result, 3					\n"
+	"	xori	$1, 3						\n"
+#else
 	"	ori	$1, \\result, 1					\n"
 	"	xori	$1, 1						\n"
+#endif
 	"	.set	noreorder					\n"
 	"	mtc0	$1, $12						\n"
 #endif
@@ -136,8 +147,13 @@ __asm__ (
 #else
 	"	mfc0	$1, $12						\n"
 	"	andi	\\flags, 1					\n"
+#if TX49XX_MFC0_WAR && defined(MODULE)
+	"	ori	$1, 3						\n"
+	"	xori	$1, 3						\n"
+#else
 	"	ori	$1, 1						\n"
 	"	xori	$1, 1						\n"
+#endif
 	"	or	\\flags, $1					\n"
 	"	mtc0	\\flags, $12					\n"
 #endif
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index ad374bd..859520a 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -169,6 +169,19 @@
 #endif
 
 /*
+ * If mfc0 $12 follows store and the mfc0 is last instruction of a
+ * page and fetching the next instruction causes TLB miss, the result
+ * of the mfc0 might wrongly contain EXL bit.
+ *
+ * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008
+ *
+ * Workaround: mask EXL bit of the result or place a nop before mfc0.
+ */
+#ifdef CONFIG_CPU_TX49XX
+#define TX49XX_MFC0_WAR 1
+#endif
+
+/*
  * On the RM9000 there is a problem which makes the CreateDirtyExclusive
  * cache operation unusable on SMP systems.
  */
@@ -228,6 +241,9 @@
 #ifndef TX49XX_ICACHE_INDEX_INV_WAR
 #define TX49XX_ICACHE_INDEX_INV_WAR	0
 #endif
+#ifndef TX49XX_MFC0_WAR
+#define TX49XX_MFC0_WAR	0
+#endif
 #ifndef RM9000_CDEX_SMP_WAR
 #define RM9000_CDEX_SMP_WAR		0
 #endif

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

end of thread, other threads:[~2006-02-07 15:23 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 16:34 [PATCH] TX49 MFC0 bug workaround Atsushi Nemoto
2006-02-02 16:38 ` Maciej W. Rozycki
2006-02-02 16:56   ` Ralf Baechle
2006-02-02 17:04     ` Atsushi Nemoto
2006-02-02 17:21       ` Atsushi Nemoto
2006-02-02 17:24       ` Ralf Baechle
2006-02-03  2:10         ` Atsushi Nemoto
2006-02-03 10:17           ` Maciej W. Rozycki
2006-02-03 14:44           ` Ralf Baechle
2006-02-06  9:36             ` Atsushi Nemoto
2006-02-06 23:22               ` Ralf Baechle
2006-02-03  2:26     ` Sergei Shtylylov
2006-02-03  2:50       ` Atsushi Nemoto
2006-02-02 16:46 ` Ralf Baechle
2006-02-02 18:46 ` Sergei Shtylylov
2006-02-02 22:11   ` Ralf Baechle
2006-02-03  1:17   ` Atsushi Nemoto
2006-02-03  2:12     ` Sergei Shtylylov
2006-02-03  2:22       ` Atsushi Nemoto
2006-02-07 15:32         ` Sergei Shtylylov
2006-02-07 15:32           ` Sergei Shtylylov

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.