lkml.org 
[lkml]   [2013]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] x86/xen: sync the CMOS RTC as well as the Xen wallclock
On Thu, 27 Jun 2013, David Vrabel wrote:

> From: David Vrabel <david.vrabel@citrix.com>
>
> Adjustments to Xen's persistent clock via update_persistent_clock()
> don't actually persist, as the Xen wallclock is a software only clock
> and modifications to it do not modify the underlying CMOS RTC.
>
> The x86_platform.set_wallclock hook can be used to keep the hardware
> RTC synchronized (as on bare metal). Because the Xen wallclock is now
> kept synchronized by pvclock_gtod notifier, xen_set_wallclock() need
> not do this and dom0 can simply use the native implementation.

I can understand that part, but ...

> static int xen_pvclock_gtod_notify(struct notifier_block *nb, unsigned long was_set,
> void *priv)
> {
> + static struct timespec next;
> struct timespec now;
> struct xen_platform_op op;
>
> - if (!was_set)
> - return NOTIFY_OK;
> -
> now = __current_kernel_time();
>
> + if (!was_set && timespec_compare(&now, &next) < 0)
> + return NOTIFY_OK;
> +
> op.cmd = XENPF_settime;
> op.u.settime.secs = now.tv_sec;
> op.u.settime.nsecs = now.tv_nsec;
> op.u.settime.system_time = xen_clocksource_read();
>
> (void)HYPERVISOR_dom0_op(&op);
> +
> + /*
> + * Don't update the wallclock for another 11 minutes. This is
> + * the same period as the sync_cmos_clock() work.
> + */
> + next = now;
> + next.tv_sec += 11*60;
> +

How is this related to the changelog? /me is confused .....



\
 
 \ /
  Last update: 2013-06-28 18:01    [W:0.130 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site