From 3895eea3b465af4be794bc9bb8492bcf82957c52 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Sat, 3 Mar 2018 14:07:48 -0500 Subject: [PATCH] target/i386: optimize cross-page direct jumps in softmmu Instead of unconditionally exiting to the exec loop, use the gen_jr helper to jump to the target if it is valid. Perf impact: see next commit's log. Backports commit fe62089563ffc6a42f16ff28a6b6be34d2697766 from qemu --- qemu/target/i386/translate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu/target/i386/translate.c b/qemu/target/i386/translate.c index 2c96d974..8fe6b2aa 100644 --- a/qemu/target/i386/translate.c +++ b/qemu/target/i386/translate.c @@ -2430,9 +2430,8 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) gen_jmp_im(s, eip); tcg_gen_exit_tb(tcg_ctx, (uintptr_t)s->tb + tb_num); } else { - /* jump to another page: currently not optimized */ - gen_jmp_im(s, eip); - gen_eob(s); + /* jump to another page */ + gen_jr(s, tcg_ctx->cpu_tmp0); } }