Skip to content

Commit e710d66

Browse files
mpredfearnralfbaechle
authored andcommitted
MIPS: tlb-r4k: If there are wired entries, don't use TLBINVF
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 <[email protected]> Cc: Bjorn Andersson <[email protected]> Cc: Ohad Ben-Cohen <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: Hugh Dickins <[email protected]> Cc: Huacai Chen <[email protected]> Cc: David S. Miller <[email protected]> Cc: James Hogan <[email protected]> Cc: Paul Burton <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/14283/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent b2ff717 commit e710d66

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/mips/mm/tlb-r4k.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ void local_flush_tlb_all(void)
6767

6868
entry = read_c0_wired();
6969

70-
/* Blast 'em all away. */
71-
if (cpu_has_tlbinv) {
70+
/*
71+
* Blast 'em all away.
72+
* If there are any wired entries, fall back to iterating
73+
*/
74+
if (cpu_has_tlbinv && !entry) {
7275
if (current_cpu_data.tlbsizevtlb) {
7376
write_c0_index(0);
7477
mtc0_tlbw_hazard();

0 commit comments

Comments
 (0)