diff --git a/qemu/accel/tcg/cputlb.c b/qemu/accel/tcg/cputlb.c index 3684c8f1..01e11f85 100644 --- a/qemu/accel/tcg/cputlb.c +++ b/qemu/accel/tcg/cputlb.c @@ -1521,7 +1521,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -1542,7 +1542,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced &&!uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -1610,7 +1610,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -1642,7 +1642,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -1692,7 +1692,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -1806,6 +1806,10 @@ _out: continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { + cpu_restore_state(uc->cpu, retaddr, false); + synced = true; + } JIT_CALLBACK_GUARD(((uc_cb_hookmem_t)hook->callback)(env->uc, UC_MEM_READ_AFTER, paddr, size, res, hook->user_data)); // the last callback may already asked to stop emulation if (uc->stop_request) @@ -2150,7 +2154,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -2169,7 +2173,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; } @@ -2222,7 +2226,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val, continue; if (!HOOK_BOUND_CHECK(hook, paddr)) continue; - if (!synced && retaddr) { + if (!synced && !uc->skip_sync_pc_on_exit && retaddr) { cpu_restore_state(uc->cpu, retaddr, false); synced = true; }