]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: fix restart of RTC periodic timer with vpt_align=1
authorKouya Shimura <kouya@jp.fujitsu.com>
Fri, 8 Nov 2013 10:07:14 +0000 (11:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Nov 2013 10:07:14 +0000 (11:07 +0100)
The commit 58afa7ef "x86/hvm: Run the RTC periodic timer on a
consistent time series" aligns the RTC periodic timer to the VM's boot time.
However, it's aligned later again to the system time in create_periodic_time()
with vpt_align=1. The next tick might be skipped.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/rtc.c

index d1a6848fbb14acf62915fb946ee52c37d9de0a53..cdedefe3dd15cb2f709ad0825253a25b56b32a54 100644 (file)
@@ -130,7 +130,10 @@ static void rtc_timer_update(RTCState *s)
                 s->pt_code = period_code;
                 period = 1 << (period_code - 1); /* period in 32 Khz cycles */
                 period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
-                delta = period - ((NOW() - s->start_time) % period);
+                if ( v->domain->arch.hvm_domain.params[HVM_PARAM_VPT_ALIGN] )
+                    delta = 0;
+                else
+                    delta = period - ((NOW() - s->start_time) % period);
                 create_periodic_time(v, &s->pt, delta, period,
                                      RTC_IRQ, NULL, s);
             }