Commit 483dcf538ea2ac86914bf7deef1d07f3b48d8878
1 parent
b362e5e0
Avoid redundant TLB flushes (Daniel Jacobowitz).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2211 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
0 deletions
target-mips/op_helper.c
... | ... | @@ -572,8 +572,17 @@ static void invalidate_tlb (int idx) |
572 | 572 | { |
573 | 573 | tlb_t *tlb; |
574 | 574 | target_ulong addr; |
575 | + uint8_t ASID; | |
576 | + | |
577 | + ASID = env->CP0_EntryHi & 0xFF; | |
575 | 578 | |
576 | 579 | tlb = &env->tlb[idx]; |
580 | + /* The qemu TLB is flushed then the ASID changes, so no need to | |
581 | + flush these entries again. */ | |
582 | + if (tlb->G == 0 && tlb->ASID != ASID) { | |
583 | + return; | |
584 | + } | |
585 | + | |
577 | 586 | if (tlb->V0) { |
578 | 587 | tb_invalidate_page_range(tlb->PFN[0], tlb->end - tlb->VPN); |
579 | 588 | addr = tlb->VPN; | ... | ... |