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

RE: [Xen-devel] [PATCH] Implement rdtscp emulation and rdtscp_aux "suppo

To: Jan Beulich <JBeulich@xxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Implement rdtscp emulation and rdtscp_aux "support"
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 26 Nov 2009 06:57:09 -0800 (PST)
Cc:
Delivery-date: Thu, 26 Nov 2009 06:59:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B0E471E0200007800022289@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/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
> >>> Dan Magenheimer <dan.magenheimer@xxxxxxxxxx> 25.11.09 22:24 >>>
> >Xen intentionally does not expose the cpuid rdtscp bit
> >to PV OS's or to HVM guests, but PV apps can see this
> >bit and, as a result, may choose to use the rdtscp
> >instruction.  When a PV guest with such an app is migrated
> >to a machine that does not have rdtscp support, the
> >app will get killed due to an invalid op.  Fix this
> >by emulating the rdtscp instruction.  We also need
> >to emulate rdtscp in the case where the machine has
> >rdtscp support, but rdtsc emulation is enabled (which
> >is unfortunately a different path: a privileged op).
> 
> I realize that my comment really applies to your earlier 
> patch introducing
> rdtsc emulation, but somehow that aspect slipped my attention back
> then: Linux has, as a security option, a mechanism to disable 
> rdtsc for
> apps, but your emulation code doesn't honor the guest setting of
> CR4.TSD.

Hi Jan --

I suppose it's a moot point since Keir has patched it already
anyway, but what is the mechanism for Linux to do this?
Have you tried it on SuSE or any recent distro lately?
Does Linux emulate rdtsc then (and, if so, could you point
me to the code in the kernel that does it)?
I ask because I found that the dynamic loader uses rdtsc
(harmlessly) so if CR4.TSD is turned off by Linux and
Linux doesn't emulate rdtsc, I suspect turning on this
security option is suicidal.

Thanks,
Dan

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