Skip to content

Commit

Permalink
accel/tcg: Improve setting of can_do_io at start of TB
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
rth7680 authored and Michael Tokarev committed Sep 20, 2023
1 parent 4e9bc3c commit 24d4e0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accel/tcg/translator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 24d4e0e

Please sign in to comment.