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

[Xen-devel] [PATCH] [RFC] Building guests on monotonic Xen system time

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [RFC] Building guests on monotonic Xen system time
From: "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx>
Date: Fri, 16 May 2008 11:31:01 -0600
Delivery-date: Fri, 16 May 2008 10:32:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Organization: Oracle Corporation
Reply-to: "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci3epqdgAqFeBKUStuokRynVQBZpQ==
Currently, hvm guest platform timers are built on top of the tsc.
Even though the guest believes it is utilizing a monotonic timesource
(such as pit, hpet, or pmtimer), all of these plumb down to an
rdtsc instruction.

Since on many SMP platforms tsc's in different processors are not
synchronized, VMs re-scheduled from a "fast tsc" processor to
a "slow tsc" processor may experience "time going backwards".
This is discussed in the following thread:

http://lists.xensource.com/archives/html/xen-devel/2008-04/msg00277.html

The fix proposed by Keir is that "The logic in vpt.c should
be fixed to use Xen's concept of system time and everything,
guest TSC included, should be derived from that."

The attached patch is a first attempt to derive all
guest timers from Xen's system time... and also to ensure
that system time is non-decreasing. I don't believe the
patch is complete... and possibly not even correct.
For example, I'm concerned that Xen's system time uses
different units than a guest tsc and I don't recall if
all guest tsc accesses are trapped.

Dan

===================================
Thanks... for the memory
I really could use more / My throughput's on the floor
The balloon is flat / My swap disk's fat / I've OOM's in store
Overcommitted so much
(with apologies to the late great Bob Hope)

Attachment: hvmstime.patch
Description: Binary data

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