All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Add missing hazard barrier in TLB load handler.
@ 2013-06-20  5:57 Steven J. Hill
  2013-06-20 11:07 ` Ralf Baechle
  2013-06-20 11:13 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Steven J. Hill @ 2013-06-20  5:57 UTC (permalink / raw)
  To: linux-mips; +Cc: Leonid Yegoshin, ralf

From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>

MIPS R2 documents state that an execution hazard barrier is needed
after a TLBR before reading EntryLo.

Change-Id: Idef3b6abbb63a1bbd5e153c6110a979fa7bd5896
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
---
 arch/mips/mm/tlbex.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index d9969d2..5ef426c 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -1922,6 +1922,11 @@ static void build_r4000_tlb_load_handler(void)
 		uasm_i_nop(&p);
 
 		uasm_i_tlbr(&p);
+#if !defined(CONFIG_CPU_CAVIUM_OCTEON)
+		/* hazard barrier after TLBR but before read EntryLo */
+		if (cpu_has_mips_r2)
+			uasm_i_ehb(&p);
+#endif
 		/* Examine  entrylo 0 or 1 based on ptr. */
 		if (use_bbit_insns()) {
 			uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
@@ -1976,6 +1981,11 @@ static void build_r4000_tlb_load_handler(void)
 		uasm_i_nop(&p);
 
 		uasm_i_tlbr(&p);
+#if !defined(CONFIG_CPU_CAVIUM_OCTEON)
+		/* hazard barrier after TLBR but before read EntryLo */
+		if (cpu_has_mips_r2)
+			uasm_i_ehb(&p);
+#endif
 		/* Examine  entrylo 0 or 1 based on ptr. */
 		if (use_bbit_insns()) {
 			uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
-- 
1.7.2.5

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

end of thread, other threads:[~2013-06-20 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  5:57 [PATCH] MIPS: Add missing hazard barrier in TLB load handler Steven J. Hill
2013-06-20 11:07 ` Ralf Baechle
2013-06-20 11:13 ` Sergei Shtylyov
2013-06-20 13:32   ` 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.