Subject: Re: Strange numbers from gettimeofday(2)
To: None <port-xen@NetBSD.org>
From: Jed Davis <jdev@panix.com>
List: port-xen
Date: 02/28/2006 19:01:05
YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> writes:

>> Hum, at last for Xen3, tsc_timestamp is updated just before the context
>> switch, so it should be OK. Xen2 looks similar.
>
> iirc, xen2 does rdtsc in its timer interrupt handler
> and stores it to a global variable, and uses it for any domains.

I noticed, in xen2's start-of-day code (arch/x86/smpboot.c), a
procedure that attempts to get all the CPUs TSCs as synchronized as
possible; the comments indicate an assumption that they'll run at the
same rate thereafter.

-- 
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))