summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cpu-exec.c12
-rw-r--r--kvm-all.c5
2 files changed, 7 insertions, 10 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index c6db5adf5e..2c77b923fd 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -369,16 +369,8 @@ int cpu_exec(CPUState *env1)
 #endif
 
             if (kvm_enabled()) {
-                int ret;
-                ret = kvm_cpu_exec(env);
-                if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
-                    env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
-                    env->exception_index = EXCP_INTERRUPT;
-                    cpu_loop_exit();
-                } else if (env->halted) {
-                    cpu_loop_exit();
-                } else
-                    longjmp(env->jmp_env, 1);
+                kvm_cpu_exec(env);
+                longjmp(env->jmp_env, 1);
             }
 
             next_tb = 0; /* force lookup of first TB */
diff --git a/kvm-all.c b/kvm-all.c
index c3a46e2438..8575a4dee2 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -298,6 +298,11 @@ int kvm_cpu_exec(CPUState *env)
         }
     } while (ret > 0);
 
+    if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
+        env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
+        env->exception_index = EXCP_INTERRUPT;
+    }
+
     return ret;
 }