@@ -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,
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(-)