Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1487161

[PATCH v2 2/6] MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF

From Matt Redfearn <matt.redfearn@imgtec.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/6] MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF
Date 2016-09-20 10:50 +0200
Message-ID <sjoUy-Bu-35@gated-at.bofh.it> (permalink)
References <sjoUy-Bu-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When adding a wired entry to the TLB via add_wired_entry, the tlb is
flushed with local_flush_tlb_all, which on CPUs with TLBINV results in
the new wired entry being flushed again.

Behavior of the TLBINV instruction applies to all applicable TLB entries
and is unaffected by the setting of the Wired register. Therefore if
the TLB has any wired entries, fall back to iterating over the entries
rather than blasting them all using TLBINVF.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
---

Changes in v2: None

 arch/mips/mm/tlb-r4k.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index e8b335c16295..4953c1a8cdfd 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -67,8 +67,11 @@ void local_flush_tlb_all(void)
 
 	entry = read_c0_wired();
 
-	/* Blast 'em all away. */
-	if (cpu_has_tlbinv) {
+	/*
+	 * Blast 'em all away.
+	 * If there are any wired entries, fall back to iterating
+	 */
+	if (cpu_has_tlbinv && !entry) {
 		if (current_cpu_data.tlbsizevtlb) {
 			write_c0_index(0);
 			mtc0_tlbw_hazard();
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] MIPS: Remote processor driver Matt Redfearn <matt.redfearn@imgtec.com> - 2016-09-20 10:50 +0200
  [PATCH v2 2/6] MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF Matt Redfearn <matt.redfearn@imgtec.com> - 2016-09-20 10:50 +0200
    Re: [PATCH v2 2/6] MIPS: tlb-r4k: If there are wired entries, don't  use TLBINVF Ralf Baechle <ralf@linux-mips.org> - 2016-09-22 14:20 +0200
  [PATCH v2 1/6] irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC Matt Redfearn <matt.redfearn@imgtec.com> - 2016-09-20 10:50 +0200
    Re: [PATCH v2 1/6] irqchip: mips-gic: Add context saving for  MIPS_REMOTEPROC Thomas Gleixner <tglx@linutronix.de> - 2016-09-20 11:50 +0200

csiph-web