diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-09-14 08:26:47 -0700 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-10-03 02:01:36 +0300 |
commit | 6c2e2e4f77f7c3ac8f20f5a37d5e02eaf5e99246 (patch) | |
tree | b4198972df6ac21feb524a59b031a94adf33b48b | |
parent | a98097d3a96bb24e4a1ffb02a2033ecd394da757 (diff) |
accel/tcg: Improve setting of can_do_io at start of TB
Initialize can_do_io to true if this the TB has CF_LAST_IO
and will consist of a single instruction. This avoids a
set to 0 followed immediately by a set to 1.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit a2f99d484c54adda13e62bf75ba512618a3fe470)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r-- | accel/tcg/translator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 850d82e26f..dd507cd471 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -87,12 +87,12 @@ static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags) offsetof(ArchCPU, neg.icount_decr.u16.low) - offsetof(ArchCPU, env)); /* - * cpu->can_do_io is cleared automatically here at the beginning of + * cpu->can_do_io is set automatically here at the beginning of * each translation block. The cost is minimal and only paid for * -icount, plus it would be very easy to forget doing it in the * translator. */ - set_can_do_io(db, false); + set_can_do_io(db, db->max_insns == 1 && (cflags & CF_LAST_IO)); } return icount_start_insn; |