From: "Dan Magenheimer" Subject: RE: System time monotonicity Date: Tue, 8 Apr 2008 11:39:36 -0600 Message-ID: <20080408113936921.00000004064@djm-pc> References: Reply-To: "dan.magenheimer@oracle.com" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org > > Where is the code that does this independent TSC sync'ing? I see > > code in smpboot.c that seems to do this at startup (though exactly > > how I admit I haven't yet figured out... looks like some kind of > > rendezvous loop triggered by the BP?). But I don't see where/how > > this gets called "every couple of seconds", nor do I see any writing > > to the TSC (except setting BP and each AP to zero at startup). > = > arch/x86/time.c:local_time_calibration() OK, thanks. If I read the code correctly, Xen goes through this effort to ensure that the TSC's are synchronized, but maintains this synchronization in a data structure and doesn't actually change each processor's physical TSC. Correct? This is of course just fine for the hypervisor's timer needs (and thus indirectly for paravirtualized domains). But I also observe that all of the hvm platform timer (pit, hpet, and pmtimer) code is built on top of the physical TSC plus the vmx/svm tsc_offset which doesn't seem to be affected by the Xen TSC synchronization. True? So assuming the above isn't mistaken, hvm domain reads of the platform timer on an SMP system lacking hardware-synchronized TSC may suffer from non-monotonicity. Correct? Thanks, Dan