summaryrefslogtreecommitdiff
path: root/arch/mips/mm
diff options
context:
space:
mode:
authorLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>2013-11-14 20:12:30 +0400
committerRalf Baechle <ralf@linux-mips.org>2014-01-22 23:19:00 +0400
commit601cfa7b6fb657cff9e8f77bbcce79f75dd7ab74 (patch)
tree6468ffe9a1b589e715e9157cf21629c4e78b109c /arch/mips/mm
parent198bb4cef13525dd9391623c514557123cc6cc31 (diff)
downloadlinux-601cfa7b6fb657cff9e8f77bbcce79f75dd7ab74.tar.xz
MIPS: mm: Use the TLBINVF instruction to flush the VTLB
The TLBINVF instruction can be used to flush the entire VTLB. This eliminates the need for the TLBWI loop and improves performance. Reviewed-by: Paul Burton <paul.burton@imgtec.com> 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/6138/
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/tlb-r4k.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 363aa0343bbe..427dcacca586 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -83,13 +83,19 @@ void local_flush_tlb_all(void)
entry = read_c0_wired();
/* Blast 'em all away. */
- while (entry < current_cpu_data.tlbsize) {
- /* Make sure all entries differ. */
- write_c0_entryhi(UNIQUE_ENTRYHI(entry));
- write_c0_index(entry);
+ if (cpu_has_tlbinv && current_cpu_data.tlbsize) {
+ write_c0_index(0);
mtc0_tlbw_hazard();
- tlb_write_indexed();
- entry++;
+ tlbinvf(); /* invalidate VTLB */
+ } else {
+ while (entry < current_cpu_data.tlbsize) {
+ /* Make sure all entries differ. */
+ write_c0_entryhi(UNIQUE_ENTRYHI(entry));
+ write_c0_index(entry);
+ mtc0_tlbw_hazard();
+ tlb_write_indexed();
+ entry++;
+ }
}
tlbw_use_hazard();
write_c0_entryhi(old_ctx);