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] pvclock in userland (reprise)

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] pvclock in userland (reprise)
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 17 Sep 2009 10:58:31 -0700 (PDT)
Cc: "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "Dugger, Donald D" <donald.d.dugger@xxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Thu, 17 Sep 2009 10:59:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Some offlist email with the Intel team may have
solved the thorniest issues for my earlier proposal
explained here:

http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01209.html

The key showstoppers for this were that the pvclock
mechanism as used by a guest kernel depends on
knowing the vcpu number and fetching the proper
adjustment values which differ depending on the
vcpu.  AND even if you could get the vcpu number
and proper adjustment values, there is no way
to ensure that a context switch doesn't occur
right in the middle of the pvclock computation
that changes what values must be used.

Jun pointed out that on the majority of Intel
processors and Intel-based systems that Xen runs
on today AND the VAST majority of new Intel
and AMD systems being shipped that Xen will run on
tomorrow, TSC is "reliable", meaning it is synchronized
within a reasonable error range across all processors.

So suppose there is a single page for all processors
that contains a flag field: "TSC_is_reliable".
If TSC_is_reliable is set (by Xen), then the app can
safely use the remaining fields to compute the pvclock
algorithm.  If it is NOT set, the app must use
a much slower system call (or a somewhat-slower
yet-to-be-designed userland hypercall).

A remaining hard problem is that this single
"userland-accessible shared page" must be somehow
made available to apps (I suggested a rdmsr emulated
by Xen so that it works in userland) and must be
mapped into the app address space without kernel
changes.  I think someone (Keir?) suggested this
problem was solveable before we got sidetracked
on the need-vcpu-number-in-userland problem.

Comments?

Thanks,
Dan

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