qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] target/hppa: Check page crossings in use_goto_tb() only in s


From: Ahmed Karaman
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

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 <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]