cpu-exec: do not handle interrupts if HAX is working
authorIgor Mitsyanko <i.mitsyanko@samsung.com>
Wed, 5 Dec 2012 19:03:55 +0000 (23:03 +0400)
committerKitae Kim <kt920.kim@samsung.com>
Thu, 20 Dec 2012 07:37:52 +0000 (16:37 +0900)
When emulator works with HAX accelerator, all hardirq events should
be processed by HAX, not in cpu_exec loop. It is exactly how it works
most of the time even without this fix, but in some cases, for example,
if we're using YaGL openGL passthrough device, interrupt could be
handled incide cpu_exec loop, which will cause errors in emulation.

Use explicit check for HAX enabled to decide if we want to handle
interrupts. Note that it doesn't change behaviour for usual emulator
workflow because usually interrupt_request is always 0 at this point.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
cpu-exec.c

index 0a0858279da5c7b3431ce209738d03d1cb25e079..9500e91c04c154cb4d5fdb180afb6a52c555d69a 100644 (file)
@@ -288,7 +288,7 @@ int cpu_exec(CPUArchState *env)
 
             next_tb = 0; /* force lookup of first TB */
             for(;;) {
-                interrupt_request = env->interrupt_request;
+                interrupt_request = need_handle_intr_request(env);
                 if (unlikely(interrupt_request)) {
                     if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) {
                         /* Mask out external interrupts for this step. */