aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-01-28 19:11:20 -1000
committerRichard Henderson <richard.henderson@linaro.org>2023-03-01 07:33:27 -1000
commit9b1890ad901bd22352b8a9598220df51fe8b0d41 (patch)
treed2ebe1ff18628461d2099864a2fe86ecb5cffbc9
parent597f9b2d30b612d760f9f48fe04cda29bf628e67 (diff)
downloadqemu-9b1890ad901bd22352b8a9598220df51fe8b0d41.zip
qemu-9b1890ad901bd22352b8a9598220df51fe8b0d41.tar.gz
qemu-9b1890ad901bd22352b8a9598220df51fe8b0d41.tar.bz2
accel/tcg: Use more accurate max_insns for tb_overflow
Write back the number of insns that we attempt to translate, so that if we longjmp out we have a more accurate limit for the next attempt. This results in fewer restarts when some limit is consumed by few instructions. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--accel/tcg/translator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index f56da8e..d0babfe 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -78,7 +78,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
plugin_enabled = plugin_gen_tb_start(cpu, db, cflags & CF_MEMI_ONLY);
while (true) {
- db->num_insns++;
+ *max_insns = ++db->num_insns;
ops->insn_start(db, cpu);
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */