Browse Source

MIPS: tlb: Set the EHINV bit for TLBINVF cores when invalidating the TLB

For MIPS32R3 supported cores, the EHINV bit needs to be set when
invalidating the TLB. This is necessary because the legacy software
method of representing an invalid TLB entry using an unmapped address
value is not guaranteed to work.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6132/
Leonid Yegoshin 11 years ago
parent
commit
6e7f8b8e47
1 changed files with 3 additions and 1 deletions
  1. 3 1
      arch/mips/include/asm/tlb.h

+ 3 - 1
arch/mips/include/asm/tlb.h

@@ -18,7 +18,9 @@
  */
  */
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 
 
-#define UNIQUE_ENTRYHI(idx)	(CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+#define UNIQUE_ENTRYHI(idx)						\
+		((CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) |		\
+		 (cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))
 
 
 #include <asm-generic/tlb.h>
 #include <asm-generic/tlb.h>