From: Patrick G. Bridges Date: Mon, 9 Apr 2012 16:30:45 +0000 (-0600) Subject: Bug fix in new time code based on testing by Oscar X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad729dec59181f490d165d9a0a84d1a10539d4a6;p=palacios.releases.git Bug fix in new time code based on testing by Oscar --- diff --git a/palacios/src/palacios/vmm_time.c b/palacios/src/palacios/vmm_time.c index 67cdee9..e1afacc 100644 --- a/palacios/src/palacios/vmm_time.c +++ b/palacios/src/palacios/vmm_time.c @@ -136,7 +136,7 @@ int v3_advance_time(struct guest_info * info, uint64_t *host_cycles) uint64_t dilated_elapsed = (host_elapsed * vm_ts->td_num) / vm_ts->td_denom; uint64_t guest_elapsed = host_to_guest_cycles(info, dilated_elapsed); guest_cycles = guest_elapsed - v3_get_guest_time(&info->time_state); - } else if (*host_cycles) { + } else if (host_cycles) { guest_cycles = host_to_guest_cycles(info, *host_cycles); } else { guest_cycles = 0; @@ -414,7 +414,7 @@ static int compute_core_ratios(struct guest_info * info, * If the GCD is too small, make it "big enough" */ khzGCD = gcd(hostKhz, guestKhz); if (khzGCD < 1024) - khzGCD = 1000; + khzGCD = 1024; time_state->clock_ratio_num = guestKhz / khzGCD; time_state->clock_ratio_denom = hostKhz / khzGCD;