From 363cbacee4c54051bc9a8e717ccbbcb276c1356d Mon Sep 17 00:00:00 2001 From: Andrew Dutcher Date: Tue, 29 Aug 2017 03:14:36 -0700 Subject: [PATCH] Only set eip to the instruction pointer after an interrupt if the interrupt was user-generated (#875) --- qemu/cpu-exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index a0a6d9e3..7755adf2 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -143,8 +143,10 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq } cpu->exception_index = -1; #if defined(TARGET_X86_64) - // point EIP to the next instruction after INT - env->eip = env->exception_next_eip; + if (env->exception_is_int) { + // point EIP to the next instruction after INT + env->eip = env->exception_next_eip; + } #endif #if defined(TARGET_MIPS) || defined(TARGET_MIPS64) env->active_tc.PC = uc->next_pc;