Merge tag 'v2.4.0' into tizen_3.0_qemu_2.4
[sdk/emulator/qemu.git] / cpu-exec.c
index 75694f3..81d47a1 100644 (file)
@@ -28,6 +28,7 @@
 #include "exec/memory-internal.h"
 #include "qemu/rcu.h"
 #include "exec/tb-hash.h"
+#include "sysemu/hax.h"
 
 /* -icount align implementation. */
 
@@ -427,6 +428,11 @@ int cpu_exec(CPUState *cpu)
                 }
             }
 
+#ifdef CONFIG_HAX
+            if (hax_enabled() && !hax_vcpu_exec(cpu))
+                longjmp(cpu->jmp_env, 1);
+#endif
+
             next_tb = 0; /* force lookup of first TB */
             for(;;) {
                 interrupt_request = cpu->interrupt_request;
@@ -555,6 +561,10 @@ int cpu_exec(CPUState *cpu)
                     }
                 }
                 cpu->current_tb = NULL;
+#ifdef CONFIG_HAX
+                if (hax_enabled() && hax_stop_emulation(cpu))
+                    cpu_loop_exit(cpu);
+#endif
                 /* Try to align the host and virtual clocks
                    if the guest is in advance */
                 align_clocks(&sc, cpu);