On 09/04/2018 11:13, Pavel Dovgalyuk wrote:
> @@ -29,6 +29,7 @@ void cpu_loop_exit_noexc(CPUState *cpu)
>  {
>      /* XXX: restore cpu registers saved in host registers */
>  
> +    cpu->can_do_io = !use_icount;
>      cpu->exception_index = -1;
>      siglongjmp(cpu->jmp_env, 1);
>  }
> @@ -65,14 +66,16 @@ void cpu_reloading_memory_map(void)
>  
>  void cpu_loop_exit(CPUState *cpu)
>  {
> +    cpu->can_do_io = !use_icount;
>      siglongjmp(cpu->jmp_env, 1);
>  }
>  
>  void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
>  {
>      if (pc) {
> -        cpu_restore_state(cpu, pc);
> +        cpu_restore_state(cpu, pc, true);
>      }
> +    cpu->can_do_io = !use_icount;
>      siglongjmp(cpu->jmp_env, 1);
>  }

This is incorrect, "cpu->can_do_io" is 1 when not in tcg_qemu_tb_exec.
In fact, in cpu_exec we have "cpu->can_do_io = 1;" immediately after
siglongjmp, so I propose adding the same "cpu->can_do_io = 1;"
assignment to cpu_exec_step_atomic.

In any case, please change the two siglongjmp of
cpu_loop_exit_{noexc,restore} to cpu_loop_exit, instead of duplicating
that cpu->can_do_io assignment.

Thanks,

Paolo


Reply via email to