WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Kernel printk timestamps and walltime drift

To: Roger Cruz <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx>, <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] Kernel printk timestamps and walltime drift
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 13 Jun 2008 23:09:25 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 13 Jun 2008 15:08:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <40B551BEDC7945419A5897958AB3947CB3550C@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjM0Rhtsp0FqzEJQH+pTArFmFSulQACI1i0ACgZ8YAAApu8UAAC5XoQAACb16AAAgYDkAAAuwVaAAC5roAAAG3PKA==
Thread-topic: [Xen-devel] Kernel printk timestamps and walltime drift
User-agent: Microsoft-Entourage/11.4.0.080122
On 13/6/08 23:02, "Roger Cruz" <rcruz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> Was I correct in my understanding on how the timestamp is being obtained
> via this call sequence?
> 
> -> vprintk -> printk_clock  -> sched_clock -> rdtscll
> 
> In other words, does your patchset use the rdtscll instruction on an
> i386, pv, 32-bit linux to compute determine that time?  If not, how is
> it derived (what file/function should I look at for sched_clock?).

The guest calculates current Xen system time based on extrapolating from a
Xen-supplied timestamp using current TSC:
 sys_time = sys_timestamp + (RDTSC - tsc_timestamp) * scale_factor

Where three terms on the RHS of the formula are supplied by Xen in the
shared_info page, and the fourth is returned by the RDTSC CPU instruction.

> While you are right that the only artifact that we have observed is the
> drifting timestamps, a future product of ours may need to have an
> accurate TSC presentation to the VM and if the time is being derived
> from the TSC as I'm conjecturing, then this drift is something we're
> going to have to worry about then.

Depends what you mean by accurate. PV guests see the underlying host TSC
directly. In that sense what they see is 100% accurate!

 -- Keir

> Thank you Keir and Dan 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel