From: Dan Magenheimer Subject: RE: RE: rdtsc: correctness vs performance on Xen (and KVM?) Date: Tue, 1 Sep 2009 15:41:04 -0700 (PDT) Message-ID: References: <4A9D9E70.8000905@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4A9D9E70.8000905@goop.org> 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 Cc: Jan, "Xen-Devel (E-mail)" , Beulich , Keir Fraser , Alan Cox List-Id: xen-devel@lists.xenproject.org > There's still a race there Good point. Essentially we need to ensure that {{rdtsc and the pvclock struct values for PCPU-X}} are obtained atomically and there's no way to guarantee that (at least without incurring overhead that's likely to exceed just emulating rdtsc to begin with). =20 > > I'm clueless about GDTs and the LSL instrution so would > > need some help prototyping this. > > =20 >=20 > It's what vsyscall already uses. Your scheme is precisely=20 > analogous to > what's already there. (...except if it can be done entirely in the app with no OS dependencies) Won't pvclock+vsyscall have the same race?