X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=f12e17fcb9135a1301939625862483b953279f0e;hb=cd3edffa0e451af761b9dcee021ca06ebb301345;hp=16fc5cd602b7520ae71119b14bbc0607a3204d49;hpb=40e3dd3f222e2638dbdae0eadaf505e1f7a82ecc;p=palacios.releases.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 16fc5cd..f12e17f 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -225,8 +225,9 @@ static int init_vmcs_bios(struct guest_info * info, struct vmx_data * vmx_state) 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_TSC_OFFSET +#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)); @@ -668,17 +669,13 @@ int v3_vmx_enter(struct guest_info * info) { } 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); -#ifdef CONFIG_TIME_TSC_OFFSET + 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); -#endif - PrintDebug("Stored 0x %x %x into vmcs TSC offset.\n", + 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; @@ -698,10 +695,9 @@ int v3_vmx_enter(struct guest_info * info) { return -1; } - v3_pause_time(info); -#ifdef CONFIG_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++;