#endif
+ rdtscll(tmp_tsc);
+ v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
rdtscll(info->time_state.cached_host_tsc);
- guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc;
+ // guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc;
//V3_Print("Calling v3_svm_launch\n");
v3_last_exit = (uint32_t)(guest_ctrl->exit_code);
- rdtscll(tmp_tsc);
+ //rdtscll(tmp_tsc);
+ // v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
//PrintDebug("SVM Returned\n");
info->num_exits++;
- v3_update_time(info, tmp_tsc - info->time_state.cached_host_tsc);
+
// Save Guest state from VMCB
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) {
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);