[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io befor
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block |
Date: |
Wed, 24 Jul 2019 16:35:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> From: Pavel Dovgalyuk <address@hidden>
>
> Most of IO instructions can be executed only at the end of the block in
> icount mode. Therefore translator can set cpu_can_io flag when translating
> the last instruction.
> But when the blocks are chained, then this flag is not reset and may
> remain set at the beginning of the next block.
> This patch resets the flag before "chaining" the translation blocks.
>
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
> accel/tcg/tcg-runtime.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
> index 8a1e408e31..fe6b83d0fc 100644
> --- a/accel/tcg/tcg-runtime.c
> +++ b/accel/tcg/tcg-runtime.c
> @@ -151,6 +151,8 @@ void *HELPER(lookup_tb_ptr)(CPUArchState *env)
> target_ulong cs_base, pc;
> uint32_t flags;
>
> + /* We are going to jump to the next block. can_do_io should be reset */
> + cpu->can_do_io = !use_icount;
> tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, curr_cflags());
> if (tb == NULL) {
> return tcg_ctx->code_gen_epilogue;
>
This only fixes indirect jumps though.
I think you do not need this patch if you remove the assignment in
cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start
instead.
Paolo
- [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename, (continued)
- [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions, Pavel Dovgalyuk, 2019/07/24
- [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block, Pavel Dovgalyuk, 2019/07/24
- Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes, Paolo Bonzini, 2019/07/24