[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/3] xen: add correct 500 ms offset when setting Xen wallclock
On Fri, 2012-10-12 at 13:57 +0100, David Vrabel wrote: > From: David Vrabel <david.vrabel@xxxxxxxxxx> > > update_persistent_wallclock() (and hence xet_set_wallclock()) is > called 500 ms after the second. The comment in sync_cmos_clock says it is called 500ms before the next second. I only mention it to double check that the right semantics for set_wallclock are being implemented, i.e. that we are compensating in the right direction. > xen_set_wallclock() was not > considering this so the Xen wallclock would end up ~500 ms behind the > correct time. > > Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx> > --- > arch/x86/xen/time.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c > index 5e7f536..11770d0 100644 > --- a/arch/x86/xen/time.c > +++ b/arch/x86/xen/time.c > @@ -212,10 +212,15 @@ static int xen_set_wallclock(unsigned long now) > /* Set the hardware RTC. */ > mach_set_rtc_mmss(now); > > - /* Set the Xen wallclock. */ > + /* > + * Set the Xen wallclock. > + * > + * update_persistent_wallclock() is called ~500 ms after 'now' > + * so add an extra 500 ms. > + */ > op.cmd = XENPF_settime; > op.u.settime.secs = now; > - op.u.settime.nsecs = 0; > + op.u.settime.nsecs = NSEC_PER_SEC / 2; > op.u.settime.system_time = xen_clocksource_read(); > > rc = HYPERVISOR_dom0_op(&op); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |