Skip to contentSkip to conversation

MIPS: tlbex: flush the correct ranges in insn_fixup

PATCH New Jonas Gorski 1 participant 1 message May 9, 2013 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: tlbex: flush the correct ranges in insn_fixup

local_flush_icache_range flushed whereever *stop was pointing to, which might not necessarily be a valid memory address. This caused TLB misses at least on BCM63XX, failing early.

Instead move the local_flush_icache_range into the loop as it was probably intended so it will flush each modified instruction's address.

This breakage was introduced with d532f3d26716a39dfd4b88d687bd344fbe77e390 ("MIPS: Allow ASID size to be determined at boot time.").

---
 arch/mips/mm/tlbex.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/mm/tlbex.c +2 -1
index a188d42..4d46d37 100644
@@ -332,8 +332,9 @@ static void __cpuinit insn_fixup(unsigned int **start, unsigned int **stop,
 			*ip = i_const;
 		}
 #endif
+		local_flush_icache_range((unsigned long)ip,
+					 (unsigned long)ip + sizeof(*ip));
 	}
-	local_flush_icache_range((unsigned long)*p, (unsigned long)((*p) + 1));
 }
 
 #define asid_insn_fixup(section, const)					\
Signature · 1 line
1.7.10.4