qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 2/2] target/rx: Check for page crossings in use_goto_tb()


From: Ahmed Karaman
Subject: [PATCH 2/2] target/rx: Check for page crossings in use_goto_tb()
Date: Tue, 19 May 2020 18:21:44 +0200

Add the page crossings check when using system mode. If this
fix is not applied, a number of bugs may occasionally occur during
target rx system mode emulation.

Rename parameter dc of type DisasContext* to the more common
name ctx, to keep consistency with other targets.

Signed-off-by: Ahmed Karaman <address@hidden>
---
 target/rx/translate.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/target/rx/translate.c b/target/rx/translate.c
index 61e86653a4..77497ddbfb 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -143,13 +143,17 @@ void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
     }
 }
 
-static bool use_goto_tb(DisasContext *dc, target_ulong dest)
+static bool use_goto_tb(DisasContext *ctx, target_ulong dest)
 {
-    if (unlikely(dc->base.singlestep_enabled)) {
+    if (unlikely(ctx->base.singlestep_enabled)) {
         return false;
-    } else {
-        return true;
     }
+
+#ifndef CONFIG_USER_ONLY
+    return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
+#else
+    return true;
+#endif
 }
 
 static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
-- 
2.17.1




reply via email to

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