]> Git Repo - qemu.git/commitdiff
target/ppc: improve performance of large BAT invalidations
authorArtyom Tarasenko <[email protected]>
Fri, 12 Apr 2019 21:06:17 +0000 (23:06 +0200)
committerDavid Gibson <[email protected]>
Fri, 26 Apr 2019 01:37:57 +0000 (11:37 +1000)
Performing a complete flush is ~ 100 times faster than flushing
256MiB of 4KiB pages. Set a limit of 1024 pages and perform a complete
flush afterwards.

This patch significantly speeds up AIX 5.1 and NetBSD-ofppc.

Signed-off-by: Artyom Tarasenko <[email protected]>
Message-Id: <1555103178[email protected]>
Reviewed-by: HervĂ© Poussineau <[email protected]>
Signed-off-by: David Gibson <[email protected]>
target/ppc/mmu_helper.c

index d226b3573940858cc982c97d96bdf0f9e70025c5..1dbc9acb75efe54ccf3c7e3a98ca8cb64a8c4ac1 100644 (file)
@@ -1820,6 +1820,13 @@ static inline void do_invalidate_BAT(CPUPPCState *env, target_ulong BATu,
 
     base = BATu & ~0x0001FFFF;
     end = base + mask + 0x00020000;
+    if (((end - base) >> TARGET_PAGE_BITS) > 1024) {
+        /* Flushing 1024 4K pages is slower than a complete flush */
+        LOG_BATS("Flush all BATs\n");
+        tlb_flush(CPU(cs));
+        LOG_BATS("Flush done\n");
+        return;
+    }
     LOG_BATS("Flush BAT from " TARGET_FMT_lx " to " TARGET_FMT_lx " ("
              TARGET_FMT_lx ")\n", base, end, mask);
     for (page = base; page != end; page += TARGET_PAGE_SIZE) {
This page took 0.02977 seconds and 4 git commands to generate.