Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


moved atomic interrupt handling past state save
[palacios.git] / palacios / src / palacios / svm.c
index 8f87be9..ba7f5b3 100644 (file)
@@ -338,21 +338,15 @@ static int update_irq_state(struct guest_info * info) {
        
        guest_ctrl->EVENTINJ.valid = 1;
 
+#ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("<%d> Injecting Exception %d (CR2=%p) (EIP=%p)\n", 
                   (int)info->num_exits, 
                   guest_ctrl->EVENTINJ.vector, 
                   (void *)(addr_t)info->ctrl_regs.cr2,
                   (void *)(addr_t)info->rip);
-
-
-#ifdef CONFIG_DEBUG_INTERRUPTS
-       PrintDebug("Injecting Exception %d (EIP=%p)\n", 
-                  guest_ctrl->EVENTINJ.vector, 
-                  (void *)(addr_t)info->rip);
 #endif
-       v3_injecting_excp(info, excp);
-
 
+       v3_injecting_excp(info, excp);
     } else if (info->intr_state.irq_started == 1) {
 #ifdef CONFIG_DEBUG_INTERRUPTS
        PrintDebug("IRQ pending from previous injection\n");
@@ -408,7 +402,7 @@ static int update_irq_state(struct guest_info * info) {
  * CAUTION and DANGER!!! 
  * 
  * The VMCB CANNOT(!!) be accessed outside of the clgi/stgi calls inside this function
- * When exectuing a symbiotic call the VMCB WILL be overwritten, so any dependencies 
+ * When exectuing a symbiotic call, the VMCB WILL be overwritten, so any dependencies 
  * on its contents will cause things to break. The contents at the time of the exit WILL 
  * change before the exit handler is executed.
  */
@@ -472,13 +466,6 @@ int v3_svm_enter(struct guest_info * info) {
 
     v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
 
-#ifdef CONFIG_SYMBIOTIC
-    if (info->sym_state.sym_call_active == 0) {
-       update_irq_state_atomic(info);
-    }
-#else 
-    update_irq_state_atomic(info);
-#endif
 
     // Save Guest state from VMCB
     info->rip = guest_state->rip;
@@ -509,6 +496,15 @@ int v3_svm_enter(struct guest_info * info) {
     exit_info2 = guest_ctrl->exit_info2;
 
 
+#ifdef CONFIG_SYMBIOTIC
+    if (info->sym_state.sym_call_active == 0) {
+       update_irq_state_atomic(info);
+    }
+#else
+    update_irq_state_atomic(info);
+#endif
+
+
     // reenable global interrupts after vm exit
     v3_stgi();