X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=6d50ff3ad4721dd72e00a68d6c9bb01401b5e122;hb=29b7ff8811c82ab543f5c969e44ff217637a09c7;hp=6ada30f2e72ecdddc6b08f1ceeb23577acbd0c47;hpb=53a87a14f98c8f77b252f19d08a7c701b04730ed;p=palacios.releases.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 6ada30f..6d50ff3 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -463,6 +463,18 @@ int v3_init_vmx_vmcs(struct guest_info * info, v3_vm_class_t vm_class) { return 0; } + +int v3_deinit_vmx_vmcs(struct guest_info * core) { + struct vmx_data * vmx_state = core->vmm_data; + + V3_FreePages((void *)(vmx_state->vmcs_ptr_phys), 1); + + V3_Free(vmx_state); + + return 0; +} + + static int update_irq_exit_state(struct guest_info * info) { struct vmx_exit_idt_vec_info idt_vec_info; @@ -650,6 +662,10 @@ int v3_vmx_enter(struct guest_info * info) { // Conditionally yield the CPU if the timeslice has expired v3_yield_cond(info); + /* If this guest is frequency-lagged behind host time, wait + * for the appropriate host time before resuming the guest. */ + v3_adjust_time(info); + // v3_print_guest_state(info); // disable global interrupts for vm state transition @@ -674,10 +690,6 @@ int v3_vmx_enter(struct guest_info * info) { v3_update_timers(info); - /* If this guest is frequency-lagged behind host time, wait - * for the appropriate host time before resuming the guest. */ - v3_adjust_time(info); - 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);