From: "Jan Beulich" Subject: Re: rdtsc hypercall, from userland?!? (was: rdtsc: correctness vs performance on Xen) Date: Thu, 10 Sep 2009 10:59:04 +0100 Message-ID: <4AA8EA080200007800014784@vpn.id2.novell.com> References: <6dfe825c-f49e-402e-81d0-e8eaee3c9cda@default> <4AA7FAFF.20505@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4AA7FAFF.20505@goop.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge , Dan Magenheimer Cc: "Xen-Devel (E-mail)" , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> Jeremy Fitzhardinge 09.09.09 20:59 >>> >You could enable/disable emulation rdtsc each context switch according >to the app's desires/requrements. It would require an extra hypercall >per context switch, but it could be batched with the others, resulting >in little marginal cost. It would, however, leave the kernel's use of >rdtsc in a confused state. Not necessarily: There could be two flags, one saying app rdtsc needs to be emulated, and a second one for the kernel ones'. Unless a pv kernel wants this, its (emulated) reads could still return the real (hardware) value rather than the calculated, 1GHz-based one. Jan