[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/15] target/cris: Fix use_goto_tb
From: |
Richard Henderson |
Subject: |
[PATCH v3 05/15] target/cris: Fix use_goto_tb |
Date: |
Tue, 22 Jun 2021 08:48:10 -0700 |
Do not skip the page check for user-only -- mmap/mprotect can
still change page mappings. Only check dc->base.pc_first, not
dc->ppc -- the start page is the only one that's relevant.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/cris/translate.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/target/cris/translate.c b/target/cris/translate.c
index 24dbae6d58..9e1f2f9239 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -524,14 +524,9 @@ static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false)
gen_set_label(l1);
}
-static inline bool use_goto_tb(DisasContext *dc, target_ulong dest)
+static bool use_goto_tb(DisasContext *dc, target_ulong dest)
{
-#ifndef CONFIG_USER_ONLY
- return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)
||
- (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
-#else
- return true;
-#endif
+ return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0;
}
static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
--
2.25.1
- [PATCH v3 00/15] target/cris: Convert to TranslatorOps, Richard Henderson, 2021/06/22
- [PATCH v3 01/15] target/cris: Add DisasContextBase to DisasContext, Richard Henderson, 2021/06/22
- [PATCH v3 04/15] target/cris: Mark exceptions as DISAS_NORETURN, Richard Henderson, 2021/06/22
- [PATCH v3 07/15] target/cris: Mark helper_raise_exception noreturn, Richard Henderson, 2021/06/22
- [PATCH v3 05/15] target/cris: Fix use_goto_tb,
Richard Henderson <=
- [PATCH v3 10/15] target/cris: Add DISAS_UPDATE_NEXT, Richard Henderson, 2021/06/22
- [PATCH v3 11/15] target/cris: Add DISAS_DBRANCH, Richard Henderson, 2021/06/22
[PATCH v3 14/15] target/cris: Remove dc->flagx_known, Richard Henderson, 2021/06/22
[PATCH v3 13/15] target/cris: Improve JMP_INDIRECT, Richard Henderson, 2021/06/22
[PATCH v3 02/15] target/cris: Remove DISAS_SWI, Richard Henderson, 2021/06/22
[PATCH v3 03/15] target/cris: Replace DISAS_TB_JUMP with DISAS_NORETURN, Richard Henderson, 2021/06/22