Skip to contentSkip to conversation

Don't trap STGI within VMRUN

PATCH New Alexander Graf 1 participant 1 message Jun 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't trap STGI within VMRUN

If VMRUN gets called with the STGI trap set active, it traps within the VMRUN call itself, creating an endless loop.

This patch makes VMRUN set the GIF flag manually without calling helper_stgi. Thus it eliminates the trap.

Alex

op_helper.c +2 -1
Index: target-i386/op_helper.c
===================================================================
@@ -4910,7 +4910,8 @@
         break;
     }
 
-    helper_stgi();
+    /* STGI to enable interrupts again */
+    env->hflags |= HF_GIF_MASK;
 
     /* maybe we need to inject an event */
     event_inj = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.event_inj));