From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/3] xen: sync the CMOS RTC as well as the Xen wallclock Date: Fri, 12 Oct 2012 10:57:16 -0400 Message-ID: <20121012145716.GA20842@phenom.dumpdata.com> References: <1350046634-2462-1-git-send-email-david.vrabel@citrix.com> <1350046634-2462-2-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1350046634-2462-2-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Oct 12, 2012 at 01:57:12PM +0100, David Vrabel wrote: > From: David Vrabel > > If NTP is used in dom0 and it is synchronized to its clock source, > then the kernel will periodically synchronize the Xen wallclock with > the system time. Updates to the Xen wallclock do not persist across > reboots, so also synchronize the CMOS RTC (as on bare metal). > > Signed-off-by: David Vrabel > --- > arch/x86/xen/time.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c > index 0296a95..5e7f536 100644 > --- a/arch/x86/xen/time.c > +++ b/arch/x86/xen/time.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -208,6 +209,10 @@ static int xen_set_wallclock(unsigned long now) > if (!xen_initial_domain()) > return -1; > > + /* Set the hardware RTC. */ > + mach_set_rtc_mmss(now); So how does this work? Is the hypervisor traping on the RTC CMOS clock? > + > + /* Set the Xen wallclock. */ > op.cmd = XENPF_settime; > op.u.settime.secs = now; > op.u.settime.nsecs = 0; > -- > 1.7.2.5