From b7bc13650c56ebaad47264c7c7cf5a5a72e25fd4 Mon Sep 17 00:00:00 2001 From: lazymio Date: Sat, 5 Mar 2022 22:32:14 +0100 Subject: [PATCH] Sync PC after we exit We should sync PC if there is no UC_HOOK_CODE hook --- qemu/accel/tcg/cpu-exec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qemu/accel/tcg/cpu-exec.c b/qemu/accel/tcg/cpu-exec.c index d4e90f68..471ddc94 100644 --- a/qemu/accel/tcg/cpu-exec.c +++ b/qemu/accel/tcg/cpu-exec.c @@ -72,7 +72,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) * of the start of the TB. */ CPUClass *cc = CPU_GET_CLASS(cpu); - if (!HOOK_EXISTS(env->uc, UC_HOOK_CODE) && !env->uc->timeout) { + if (!HOOK_EXISTS(env->uc, UC_HOOK_CODE)) { // We should sync pc for R/W error. switch (env->uc->invalid_error) { case UC_ERR_WRITE_PROT: @@ -87,9 +87,6 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) break; default: if (cc->synchronize_from_tb) { - // avoid sync twice when helper_uc_tracecode() already did this. - if (env->uc->emu_counter <= env->uc->emu_count && - !env->uc->stop_request && !env->uc->quit_request) cc->synchronize_from_tb(cpu, last_tb); } else { assert(cc->set_pc);