All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: qemu-devel@nongnu.org, hpoussin@reactos.org
Cc: qemu-ppc@nongnu.org, Artyom Tarasenko <atar4qemu@gmail.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 3/4] target/ppc: improve performance of large BAT invalidations
Date: Fri, 12 Apr 2019 23:06:17 +0200	[thread overview]
Message-ID: <1555103178-21894-4-git-send-email-atar4qemu@gmail.com> (raw)
In-Reply-To: <1555103178-21894-1-git-send-email-atar4qemu@gmail.com>

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>
---
 target/ppc/mmu_helper.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 4a6be4d..d7eed3a 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -1809,6 +1809,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) {
-- 
2.7.2

  parent reply	other threads:[~2019-04-12 21:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 21:06 [Qemu-devel] [PATCH 0/4] Improve 40p, make AIX 5.1 boot Artyom Tarasenko
2019-04-12 21:06 ` [Qemu-devel] [PATCH 1/4] lsi53c895a: hide 53c895a registers in 53c810 Artyom Tarasenko
2019-04-12 21:06   ` Artyom Tarasenko
2019-04-14 15:43   ` Hervé Poussineau
2019-04-14 15:43     ` Hervé Poussineau
2019-04-14 18:36     ` Artyom Tarasenko
2019-04-14 18:36       ` Artyom Tarasenko
2019-04-15  9:21       ` Paolo Bonzini
2019-04-15  9:21         ` Paolo Bonzini
2019-04-12 21:06 ` [Qemu-devel] [PATCH 2/4] 40p and prep: implement PCI bus mastering Artyom Tarasenko
2019-04-14 15:43   ` Hervé Poussineau
2019-04-12 21:06 ` Artyom Tarasenko [this message]
2019-04-14 15:43   ` [Qemu-devel] [PATCH 3/4] target/ppc: improve performance of large BAT invalidations Hervé Poussineau
2019-04-15  0:20   ` David Gibson
2019-04-15  0:20     ` David Gibson
2019-04-12 21:06 ` [Qemu-devel] [PATCH 4/4] hw/isa/i82378.c: use 1900 as a base year Artyom Tarasenko
2019-04-14 17:01   ` Hervé Poussineau
2019-04-14 18:53     ` Artyom Tarasenko
2019-04-14 18:53       ` Artyom Tarasenko
2019-04-14 21:24       ` Hervé Poussineau
2019-04-14 21:24         ` Hervé Poussineau
2019-04-15 10:36         ` Philippe Mathieu-Daudé
2019-04-15 10:45           ` Artyom Tarasenko
2019-04-15 10:45             ` Artyom Tarasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555103178-21894-4-git-send-email-atar4qemu@gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.