[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
- [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Ahmed Karaman, 2020/05/19
- [PATCH 2/2] target/rx: Check for page crossings in use_goto_tb(),
Ahmed Karaman <=
- [PATCH 1/2] target/hppa: Check page crossings in use_goto_tb() only in system mode, Ahmed Karaman, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Richard Henderson, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Alex Bennée, 2020/05/19
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Ahmed Karaman, 2020/05/21
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Richard Henderson, 2020/05/21
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/25
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Ahmed Karaman, 2020/05/26
- Re: [PATCH 0/2] Update use_goto_tb() in hppa and rx targets, Aleksandar Markovic, 2020/05/26