aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-05-27 12:29:37 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-11-02 06:00:01 -0500
commitd30cecbcbe149a36a354757cea835c1bb28689cf (patch)
tree695c69480dfa8e083cf567aad02bef2a5a35cfca
parent22242681cff52bfb7cba5d2a37b91802be7a4e4c (diff)
MIPS: Don't write ones to reserved entryhi bits.
We've silently been relying on the hardware chopping off excess, reserved ASID bits for no better reason that it saving an instruction. Because we already have: #define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK) in <asm/mmu_context.h>. We can use a cleanup to avoid writing non-zero bits into the reserved entryhi bits. This avoid triggering some debugging assertion in the Cavium simulator. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/mmu_context.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
index d9743536a621..ed331c2e4882 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -165,12 +165,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
165 * having ASID_MASK smaller than the hardware maximum, 165 * having ASID_MASK smaller than the hardware maximum,
166 * make sure no "soft" bits become "hard"... 166 * make sure no "soft" bits become "hard"...
167 */ 167 */
168 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) 168 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
169 | (cpu_context(cpu, next) & ASID_MASK)); 169 cpu_asid(cpu, next));
170 ehb(); /* Make sure it propagates to TCStatus */ 170 ehb(); /* Make sure it propagates to TCStatus */
171 evpe(mtflags); 171 evpe(mtflags);
172#else 172#else
173 write_c0_entryhi(cpu_context(cpu, next)); 173 write_c0_entryhi(cpu_asid(cpu, next));
174#endif /* CONFIG_MIPS_MT_SMTC */ 174#endif /* CONFIG_MIPS_MT_SMTC */
175 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 175 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
176 176
@@ -226,11 +226,11 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)
226 } 226 }
227 /* See comments for similar code above */ 227 /* See comments for similar code above */
228 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | 228 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
229 (cpu_context(cpu, next) & ASID_MASK)); 229 cpu_asid(cpu, next));
230 ehb(); /* Make sure it propagates to TCStatus */ 230 ehb(); /* Make sure it propagates to TCStatus */
231 evpe(mtflags); 231 evpe(mtflags);
232#else 232#else
233 write_c0_entryhi(cpu_context(cpu, next)); 233 write_c0_entryhi(cpu_asid(cpu, next));
234#endif /* CONFIG_MIPS_MT_SMTC */ 234#endif /* CONFIG_MIPS_MT_SMTC */
235 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 235 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
236 236