diff options
author | Artyom Tarasenko <atar4qemu@gmail.com> | 2019-04-12 23:06:17 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-04-26 11:37:57 +1000 |
commit | aaef873b130f4f9c78f8e97b69c235c81b8b8b88 (patch) | |
tree | a109020b7eee2bbc95cad4c873bab2f52ee5e40b /target | |
parent | 6e8a65abbbd47a870ddc37484e7c9f183b7a7cce (diff) | |
download | qemu-aaef873b130f4f9c78f8e97b69c235c81b8b8b88.zip qemu-aaef873b130f4f9c78f8e97b69c235c81b8b8b88.tar.gz qemu-aaef873b130f4f9c78f8e97b69c235c81b8b8b88.tar.bz2 |
target/ppc: improve performance of large BAT invalidations
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 <atar4qemu@gmail.com>
Message-Id: <1555103178-21894-4-git-send-email-atar4qemu@gmail.com>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target')
-rw-r--r-- | target/ppc/mmu_helper.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index d226b35..1dbc9ac 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -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) { |