X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=2295912b188ea5332d98d3f3703047553c3dec7a;hb=c5dc4eb6184d792c87f8d17bfec558a1316718ce;hp=4ba619b1cf6d9305b277f27ad97dc7dd70cdd11b;hpb=30434aee50c56ff4a23400191562c5c9ffaff830;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 4ba619b..2295912 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -427,6 +427,8 @@ int v3_svm_enter(struct guest_info * info) { vmcb_saved_state_t * guest_state = GET_VMCB_SAVE_STATE_AREA((vmcb_t*)(info->vmm_data)); addr_t exit_code = 0, exit_info1 = 0, exit_info2 = 0; + v3_adjust_time(info); + // Conditionally yield the CPU if the timeslice has expired v3_yield_cond(info); @@ -478,11 +480,6 @@ int v3_svm_enter(struct guest_info * info) { #endif 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); - guest_ctrl->TSC_OFFSET = v3_tsc_host_offset(&info->time_state); //V3_Print("Calling v3_svm_launch\n"); @@ -586,6 +583,12 @@ int v3_start_svm_guest(struct guest_info * info) { v3_start_time(info); while (1) { + + if (info->vm_info->run_state == VM_STOPPED) { + info->core_run_state = CORE_STOPPED; + break; + } + if (v3_svm_enter(info) == -1) { vmcb_ctrl_t * guest_ctrl = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data)); addr_t host_addr; @@ -622,6 +625,13 @@ int v3_start_svm_guest(struct guest_info * info) { break; } + + + if (info->vm_info->run_state == VM_STOPPED) { + info->core_run_state = CORE_STOPPED; + break; + } + /* if ((info->num_exits % 5000) == 0) {