aboutsummaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 62886a4f18..b3662400ff 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -22,6 +22,7 @@
#include "exec.h"
#include "disas.h"
#include "tcg.h"
+#include "kvm.h"
#if !defined(CONFIG_SOFTMMU)
#undef EAX
@@ -371,6 +372,19 @@ 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);
+ }
+
next_tb = 0; /* force lookup of first TB */
for(;;) {
interrupt_request = env->interrupt_request;