Skip to contentSkip to conversation

[5669] KVM: simplify kvm_cpu_exec hook

Qemu-devel Anthony Liguori 1 participant 1 message Nov 10, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5669

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5669
Author:   aliguori
Date:     2008-11-10 15:55:14 +0000 (Mon, 10 Nov 2008)

Log Message:
-----------
KVM: simplify kvm_cpu_exec hook

We don't need to use cpu_loop_exit() because we never use the condition codes so everything can be folded into a single case.

Modified Paths:
--------------
trunk/cpu-exec.c
trunk/kvm-all.c

Modified: trunk/cpu-exec.c
===================================================================

cpu-exec.c +2 -10
@@ -369,16 +369,8 @@
 #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 */

Modified: trunk/kvm-all.c
===================================================================

kvm-all.c +5 -0
@@ -298,6 +298,11 @@
         }
     } while (ret > 0);
 
+    if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
+        env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
+        env->exception_index = EXCP_INTERRUPT;
+    }
+
     return ret;
 }