Commit aaef873b authored by Artyom Tarasenko's avatar Artyom Tarasenko Committed by David Gibson
Browse files

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: default avatarArtyom Tarasenko <atar4qemu@gmail.com>
Message-Id: <1555103178-21894-4-git-send-email-atar4qemu@gmail.com>
Reviewed-by: default avatarHervé Poussineau <hpoussin@reactos.org>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 6e8a65ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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) {