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/
Home Products Support Community News


RE: [Xen-users] Re: Xen and TLS, -mno-tls-direct-seg-refs needed?

To: "Molle Bestefich" <molle.bestefich@xxxxxxxxx>, "Sven Köhler" <skoehler@xxxxxx>
Subject: RE: [Xen-users] Re: Xen and TLS, -mno-tls-direct-seg-refs needed?
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Mon, 14 Aug 2006 13:05:47 +0200
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 14 Aug 2006 04:06:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <62b0912f0608120338g30a0ae13t520a9007e9b3dbb5@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aca9+5IIiqSabx/bTtS9LDeBlo5asQBlVlww
Thread-topic: [Xen-users] Re: Xen and TLS, -mno-tls-direct-seg-refs needed?

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Molle Bestefich
> Sent: 12 August 2006 11:39
> To: Sven Köhler
> Cc: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] Re: Xen and TLS, -mno-tls-direct-seg-refs needed?
> Sven Köhler wrote:
> > Yes, but what you describe is kernel-internal. But the
> > "-mno-tls-direct-seg-refs" is glibc-specific and changes 
> glibc-internal
> > things, not kernel-internal things.
> Yes, but what I was implying (but not writing - sorry), was that since
> the 4 GB address space is virtual, and Xen does not live within it,
> there's no need for Xen to fiddle with segments for protection
> purposes, and thus it probably doesn't.  And so there wouldn't be a
> performance penalty.
> > But who knows? :-)
> Not me, I just keep ranting :-).
> I hope Mats can answer it when he comes around; he seems to have quite
> a lot of knowledge on all things CPU and I've seen him help out people
> in xen-users quite a lot.

Seeing as I was mentioned directly, I suppose I have to try to reply to this. 

What is being said above seems to make sense to me (I actually don't REALLY 
know how the TLS stuff works, other than what I've read here, which says that 
it uses negative segment offsets, which makes funny things happen if you use 
limits other than 4GB on the segment!). 

In fact, the segment limits aren't being used in the 64-bit port at all - it 
uses some tricky page-table stuff instead. This is because when we initially 
made the 64-bit mode for Opteron/Athlon64 processors, we didn't foresee anyone 
using segments for protection any longer - most 32-bit code doesn't, the 
exception being some of the VMMs... So it was said that the limit of a segment 
is "unused". 

However, there is a fix in the later models of Opteron/Athlon64 processors that 
allows segments to be used. Intel, I think, hasn't got this feature (yet?)... 

So for backwards compatibility reasons and such, the 64-bit version of Xen uses 
a different method for protecting itself from being overwritten, and therfore 
negative segment references work fine. 

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

Xen-users mailing list