qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
To: qemu-devel@nongnu.org, rth@twiddle.net, ysato@users.sourceforge.jp
Cc: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>,
	aleksandar.qemu.devel@gmail.com, alex.bennee@linaro.org,
	stefanha@redhat.com
Subject: [PATCH 1/2] target/hppa: Check page crossings in use_goto_tb() only in system mode
Date: Tue, 19 May 2020 18:21:43 +0200	[thread overview]
Message-ID: <20200519162144.10831-2-ahmedkhaledkaraman@gmail.com> (raw)
In-Reply-To: <20200519162144.10831-1-ahmedkhaledkaraman@gmail.com>

Restrict page crossing check to system mode only. By doing this, the
hppa target performance in user mode improves by up to 6.93%. Of course,
the amount of performance improvement will vary depending on the nature
of the hppa executable being emulated by QEMU.

While doing this correction, this patch adds some more verbose
comments in use_goto_tb() as well.

Signed-off-by: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
---
 target/hppa/translate.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..7c9180cd76 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -817,10 +817,20 @@ static bool gen_illegal(DisasContext *ctx)
 
 static bool use_goto_tb(DisasContext *ctx, target_ureg dest)
 {
-    /* Suppress goto_tb for page crossing, IO, or single-steping.  */
-    return !(((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK)
-             || (tb_cflags(ctx->base.tb) & CF_LAST_IO)
-             || ctx->base.singlestep_enabled);
+    /* No direct translation block linking with CF_LAST_IO or in singlestep */
+    if ((tb_cflags(ctx->base.tb) & CF_LAST_IO) ||
+        ctx->base.singlestep_enabled) {
+        return false;
+    }
+
+#ifndef CONFIG_USER_ONLY
+    /* Directly link translation blocks only from inside the same guest page */
+    if ((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK) {
+        return false;
+    }
+#endif
+
+    return true;
 }
 
 /* If the next insn is to be nullified, and it's on the same page,
-- 
2.17.1



  reply	other threads:[~2020-05-19 17:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 16:21 [PATCH 0/2] Update use_goto_tb() in hppa and rx targets Ahmed Karaman
2020-05-19 16:21 ` Ahmed Karaman [this message]
2020-05-19 16:21 ` [PATCH 2/2] target/rx: Check for page crossings in use_goto_tb() Ahmed Karaman
2020-05-19 18:01 ` [PATCH 0/2] Update use_goto_tb() in hppa and rx targets Richard Henderson
2020-05-19 18:38   ` Alex Bennée
2020-05-19 18:51     ` Richard Henderson
2020-05-21 11:32   ` Ahmed Karaman
2020-05-22  3:12     ` Richard Henderson
2020-05-25 18:39       ` Aleksandar Markovic
2020-05-26 14:14         ` Aleksandar Markovic
2020-05-26 16:08           ` Ahmed Karaman
2020-05-26 16:29             ` Aleksandar Markovic
2020-05-26 16:45               ` Aleksandar Markovic
2020-05-26 17:38                 ` Aleksandar Markovic

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=20200519162144.10831-2-ahmedkhaledkaraman@gmail.com \
    --to=ahmedkhaledkaraman@gmail.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=ysato@users.sourceforge.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).