vmx_state->pri_proc_ctrls.invlpg_exit = 1;
vmx_state->pri_proc_ctrls.use_msr_bitmap = 1;
vmx_state->pri_proc_ctrls.pause_exit = 1;
+#ifdef CONFIG_TIME_VIRTUALIZE_TSC
+ vmx_state->pri_proc_ctrls.tsc_offset = 1;
+ vmx_state->pri_proc_ctrls.rdtsc_exit = 1;
+#endif
vmx_ret |= check_vmcs_write(VMCS_IO_BITMAP_A_ADDR, (addr_t)V3_PAddr(info->vm_info->io_map.arch_data));
vmx_ret |= check_vmcs_write(VMCS_IO_BITMAP_B_ADDR,
}
v3_update_timers(info);
- v3_resume_time(info);
- tsc_offset_high =
- (uint32_t)((info->time_state.host_offset >> 32) & 0xffffffff);
- tsc_offset_low = (uint32_t)(info->time_state.host_offset & 0xffffffff);
+ tsc_offset_high = (uint32_t)((v3_tsc_host_offset(&info->time_state) >> 32) & 0xffffffff);
+ tsc_offset_low = (uint32_t)(v3_tsc_host_offset(&info->time_state) & 0xffffffff);
check_vmcs_write(VMCS_TSC_OFFSET_HIGH, tsc_offset_high);
check_vmcs_write(VMCS_TSC_OFFSET, tsc_offset_low);
-
+
+ PrintDebug("Stored 0x%x_%x into vmcs TSC offset.\n",
+ tsc_offset_high, tsc_offset_low);
if (info->vm_info->run_state == VM_STOPPED) {
info->vm_info->run_state = VM_RUNNING;
ret = v3_vmx_launch(&(info->vm_regs), info, &(info->ctrl_regs));
return -1;
}
- v3_pause_time(info);
-#ifdef OPTION_TIME_MASK_OVERHEAD
- v3_offset_time(info, -VMX_ENTRY_OVERHEAD);
-#endif
+ /* If this guest is frequency-lagged behind host time, wait
+ * for the appropriate host time. */
+ v3_adjust_time(info);
info->num_exits++;