]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86: xen: Sync the CMOS RTC as well as the Xen wallclock
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 27 Jun 2013 10:35:48 +0000 (11:35 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 28 Jun 2013 21:15:07 +0000 (23:15 +0200)
commit47433b8c9d7480a3eebd99df38e857ce85a37cee
treed89d45a5fa0abc84602320d6e19579be73eaad2d
parent5584880e44e49c587059801faa2a9f7d22619c48
x86: xen: Sync the CMOS RTC as well as the Xen wallclock

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 is there to keep the hardware RTC
synchronized. On a guest this is pointless.

On Dom0 we can use the native implementaion which actually updates the
hardware RTC, but we still need to keep the software emulation of RTC
for the guests up to date. The subscription to the pvclock_notifier
allows us to emulate this easily. The notifier is called at every tick
and when the clock was set.

Right now we only use that notifier when the clock was set, but due to
the fact that it is called periodically from the timekeeping update
code, we can utilize it to emulate the NTP driven drift compensation
of update_persistant_clock() for the Xen wall (software) clock.

Add a 11 minutes periodic update to the pvclock_gtod notifier callback
to achieve that. The static variable 'next' which maintains that 11
minutes update cycle is protected by the core code serialization so
there is no need to add a Xen specific serialization mechanism.

[ tglx: Massaged changelog and added a few comments ]

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: <xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/1372329348-20841-6-git-send-email-david.vrabel@citrix.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/xen/time.c