From: Patrick G. Bridges Date: Thu, 11 Nov 2010 18:22:31 +0000 (-0700) Subject: Fixed (hopefully) bug introduced previously by moving update_timers outside of the... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=39b4fae9c539fbd848edd786500e60aae17b84a0;p=palacios.git Fixed (hopefully) bug introduced previously by moving update_timers outside of the interrupt clocking in enter_vm(). Also a few miscellaneous debugging config/print changes --- diff --git a/palacios/src/devices/Kconfig b/palacios/src/devices/Kconfig index b60f420..685b245 100644 --- a/palacios/src/devices/Kconfig +++ b/palacios/src/devices/Kconfig @@ -265,6 +265,11 @@ config FILEDISK help Includes the file based disk backend +config DEBUG_FILEDISK + bool "FILEDISK backend debugging" + depends on FILEDISK && DEBUG_ON + help + Enable debugging for the file based disk backend config NETDISK bool "NETDISK storage backend" @@ -280,6 +285,11 @@ config RAMDISK help Includes the RAM based disk backend +config DEBUG_RAMDISK + bool "RAMDISK baskend debugging" + depends on RAMDISK && DEBUG_ON + help + Enable debugging for the ram based disk backend config TMPDISK bool "TMPDISK storage backend" diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index a88ff0e..2295912 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -427,7 +427,6 @@ 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_update_timers(info); v3_adjust_time(info); // Conditionally yield the CPU if the timeslice has expired @@ -480,6 +479,7 @@ int v3_svm_enter(struct guest_info * info) { } #endif + v3_update_timers(info); guest_ctrl->TSC_OFFSET = v3_tsc_host_offset(&info->time_state); //V3_Print("Calling v3_svm_launch\n"); diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 0dffb4c..8e65dbe 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -212,7 +212,7 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) { } if (vm->num_cores > avail_cores) { - PrintError("Attempted to start a VM with too many cores (MAX=%d)\n", MAX_CORES); + PrintError("Attempted to start a VM with too many cores (vm->num_cores = %d, avail_cores = %d, MAX=%d)\n", vm->num_cores, avail_cores, MAX_CORES); return -1; } diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 6ada30f..2d75065 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -650,6 +650,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 +678,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);