[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/3] xen: add correct 500 ms offset when setting Xen wallclock



From: David Vrabel <david.vrabel@xxxxxxxxxx>

update_persistent_wallclock() (and hence xet_set_wallclock()) is
called 500 ms after the second.  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);
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.