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 timer injection to track total time instead of guest time
[palacios.git] / palacios / src / palacios / vmx.c
index 4c37ddf..e8d32ed 100644 (file)
@@ -658,6 +658,9 @@ int v3_vmx_enter(struct guest_info * info) {
        vmcs_write(VMCS_GUEST_CR3, guest_cr3);
     }
 
+    // We do timer injection here to track real host time.
+    rdtscll(tmp_tsc);
+    v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
     rdtscll(info->time_state.cached_host_tsc);
 
     if (info->vm_info->run_state == VM_STOPPED) {
@@ -678,11 +681,11 @@ int v3_vmx_enter(struct guest_info * info) {
        return -1;
     }
 
-    rdtscll(tmp_tsc);
+    //   rdtscll(tmp_tsc);
+    //    v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
 
     info->num_exits++;
 
-    v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
 
     /* Update guest state */
     v3_vmx_save_vmcs(info);