Skip to contentSkip to conversation

Don't flush global TLB entries

PATCH New Thiemo Seufer 1 participant 1 message Feb 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't flush global TLB entries

Hello All,

this avoids flushing of global TLB entries for differing ASIDs.

Thiemo

target-mips/op_helper.c +3 -2
Index: qemu-work/target-mips/op_helper.c
===================================================================
@@ -622,13 +622,14 @@
 void do_tlbr (void)
 {
     tlb_t *tlb;
+    uint8_t ASID;
     int size;
 
+    ASID = env->CP0_EntryHi & 0xFF;
     tlb = &env->tlb[env->CP0_index & (MIPS_TLB_NB - 1)];
 
     /* If this will change the current ASID, flush qemu's TLB.  */
-    /* FIXME: Could avoid flushing things which match global entries... */
-    if ((env->CP0_EntryHi & 0xFF) != tlb->ASID)
+    if (ASID != tlb->ASID && tlb->G != 1)
       tlb_flush (env, 1);
 
     env->CP0_EntryHi = tlb->VPN | tlb->ASID;