summaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-11-12 20:55:05 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-11-12 20:55:05 +0000
commit483dcf538ea2ac86914bf7deef1d07f3b48d8878 (patch)
treecc220efd4eb49dc465bc28385122e4dd737e3a95 /target-mips
parentb362e5e067835d04ddde5fb1277272d4b498b970 (diff)
downloadqemu-483dcf538ea2ac86914bf7deef1d07f3b48d8878.tar.gz
Avoid redundant TLB flushes (Daniel Jacobowitz).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2211 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/op_helper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index bf397c9b44..6e31436f5b 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -572,8 +572,17 @@ static void invalidate_tlb (int idx)
{
tlb_t *tlb;
target_ulong addr;
+ uint8_t ASID;
+
+ ASID = env->CP0_EntryHi & 0xFF;
tlb = &env->tlb[idx];
+ /* The qemu TLB is flushed then the ASID changes, so no need to
+ flush these entries again. */
+ if (tlb->G == 0 && tlb->ASID != ASID) {
+ return;
+ }
+
if (tlb->V0) {
tb_invalidate_page_range(tlb->PFN[0], tlb->end - tlb->VPN);
addr = tlb->VPN;