diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index 700c913e..c83485c3 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -144,6 +144,10 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq uc, cpu->exception_index, uc->hook_callbacks[uc->hook_intr_idx].user_data); cpu->exception_index = -1; +#if defined(TARGET_X86_64) + // point EIP to the next instruction after INT + env->eip = env->exception_next_eip; +#endif #endif } } diff --git a/qemu/target-i386/translate.c b/qemu/target-i386/translate.c index 6d93efe2..84db6114 100644 --- a/qemu/target-i386/translate.c +++ b/qemu/target-i386/translate.c @@ -2796,7 +2796,7 @@ static void gen_interrupt(DisasContext *s, int intno, gen_update_cc_op(s); // Unicorn: skip to the next instruction after our interrupt callback - gen_jmp_im(s, next_eip); + gen_jmp_im(s, cur_eip); gen_helper_raise_interrupt(tcg_ctx, tcg_ctx->cpu_env, tcg_const_i32(tcg_ctx, intno), tcg_const_i32(tcg_ctx, next_eip - cur_eip)); s->is_jmp = DISAS_TB_JUMP;