Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[XEN] The TLS issue on X86_64
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
kueitao
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 241

PostPosted: Tue Jul 15, 2008 4:52 pm    Post subject: [XEN] The TLS issue on X86_64 Reply with quote

Hello,

I'm a bit confused about what to do with those Thread Local Storage libraries...

(1) The Official XEN V3.0 User's Manual says that everyone (32 and 64 bits) should disable the libraries by doing "mv /lib/tls /lib/tls.disabled"... It would be fine both because of the inherent reversibility of the procedure and because of the user being not forced to modify CHOST flags (like other sources say the user should to).

The problem is that I am not able to find the libraries they are talking about. Do someone exactly know which libraries are to be put in a "disabled state"?

(2) Gentoo-Wiki says that in a x86_64 box the problem is simply solved by enabling the GGC '-mno-tls-direct-seg-refs' option in the CHOST variable in /etc/make.conf only when compiling the GNU C Library (sys-libs/glibc).

In this case, my question is how I can automate this procedure in order to miss not any C Library update everytime I run an "emerge -uDN world".

Thanks in advance to anyone who will reply.

Regards,

fabio
Back to top
View user's profile Send private message
Spooky Ghost
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 210
Location: Bristol, United Kingdom

PostPosted: Fri Jul 18, 2008 6:03 pm    Post subject: Reply with quote

My understanding was that amd64 did not need the -mno-tls-direct-seg-refs flag, indeed my cflags is:

CFLAGS="-march=opteron -O3 -pipe"

When I tried an x86 system without this option I got a big warning from Xen. If you aren't seeing this then it probably isn't necessary to enable it.
Back to top
View user's profile Send private message
kueitao
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 241

PostPosted: Sat Jul 19, 2008 7:32 am    Post subject: Reply with quote

Spooky Ghost wrote:
My understanding was that amd64 did not need the -mno-tls-direct-seg-refs flag, indeed my cflags is:

CFLAGS="-march=opteron -O3 -pipe"

When I tried an x86 system without this option I got a big warning from Xen. If you aren't seeing this then it probably isn't necessary to enable it.

I am not so sure as you are about the irrelevance of the option (-mno-tls-direct-seg-refs). Please, consider that the XEN 3.0 Official User Manual, the Gentoo XEN Installation Guide and the Gentoo Wiki, all the three of them say of the option to be enabled also in amd64 (at least for GNU C Library).

Al least, do you know how to automate the only sys-libs/glibc emerge with CHOST="... -mno-tls-direct-seg-refs"?

Thanks.
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Sat Jul 19, 2008 2:05 pm    Post subject: Reply with quote

Quote:
do you know how to automate the only sys-libs/glibc emerge with CHOST="... -mno-tls-direct-seg-refs"?


you could try f.ex. :

Code:
mkdir -p /etc/portage/env/sys-libs/
nano /etc/portage/env/sys-libs/glibc
CFLAGS="-march=opteron -O2 -pipe -mno-tls-direct-seg-refs"
CXXFLAGS="${CFLAGS}"


or whatever you may need. There are other .bashrc hacks available too.

cheers
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285
Location: Ashford, Kent

PostPosted: Sat Jul 19, 2008 4:26 pm    Post subject: Reply with quote

kueitao wrote:
Spooky Ghost wrote:
My understanding was that amd64 did not need the -mno-tls-direct-seg-refs flag, indeed my cflags is:

CFLAGS="-march=opteron -O3 -pipe"

When I tried an x86 system without this option I got a big warning from Xen. If you aren't seeing this then it probably isn't necessary to enable it.

I am not so sure as you are about the irrelevance of the option (-mno-tls-direct-seg-refs). Please, consider that the XEN 3.0 Official User Manual, the Gentoo XEN Installation Guide and the Gentoo Wiki, all the three of them say of the option to be enabled also in amd64 (at least for GNU C Library).

Al least, do you know how to automate the only sys-libs/glibc emerge with CHOST="... -mno-tls-direct-seg-refs"?

Thanks.


1. Gentoo-Wiki says not required for amd64: http://gentoo-wiki.com/Xen#TLS_and_CFLAGS
2. Xen Wiki says http://wiki.xensource.com/xenwiki/XenSpecificGlibc (note that the entire page summary starts with "On 32-bit x86")
3. The Xen User Manual doesn't mention -mno-tls-direct-seg-refs anywhere (I could find)
4. While the Gentoo Xen guide does mention the flag, it doesn't mention what platforms it applies to, but it does mention that it is optional. (If you feel this guide should mention that the flag is specific to x86 32-bit systems, file a bug)

So I don't know what Internet you're looking at, but it's not the same one as me.
_________________
http://gentoo-wiki.com :: http://lug.org.uk :: http://www.linux.org/groups/ :: User Blogs
Back to top
View user's profile Send private message
kueitao
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 241

PostPosted: Fri Jul 25, 2008 12:36 pm    Post subject: Reply with quote

AllenJB wrote:
kueitao wrote:
Spooky Ghost wrote:
My understanding was that amd64 did not need the -mno-tls-direct-seg-refs flag, indeed my cflags is:

CFLAGS="-march=opteron -O3 -pipe"

When I tried an x86 system without this option I got a big warning from Xen. If you aren't seeing this then it probably isn't necessary to enable it.

I am not so sure as you are about the irrelevance of the option (-mno-tls-direct-seg-refs). Please, consider that the XEN 3.0 Official User Manual, the Gentoo XEN Installation Guide and the Gentoo Wiki, all the three of them say of the option to be enabled also in amd64 (at least for GNU C Library).

Al least, do you know how to automate the only sys-libs/glibc emerge with CFLAGS="... -mno-tls-direct-seg-refs"?

Thanks.


AllenJB wrote:
1. Gentoo-Wiki says not required for amd64: http://gentoo-wiki.com/Xen#TLS_and_CFLAGS

From the very same source: "Note: The '-mno-tls-direct-seg-refs' flag does not make sense on any 64bit system. For such systems you can skip the recompilation of the whole world and just RECOMPILE GLIBC". [Uppercase is not in the original document]
Why do you have to "just recompile GNU LibC if that option does not make sense on any 64 bit system"? It implicitly means that the option makes sense, don't you think so?
AllenJB wrote:
2. Xen Wiki says http://wiki.xensource.com/xenwiki/XenSpecificGlibc (note that the entire page summary starts with "On 32-bit x86")

I'm not interested on 32-bit x86 (see the post subject, at least). What is most important is that I've never cited this document in this thread, so why are you opposing that to me?
AllenJB wrote:
3. The Xen User Manual doesn't mention -mno-tls-direct-seg-refs anywhere (I could find)

Section 2.5.3 from the XEN 3.0 User's Manual says: "TLS Libraries - Users of the XenLinux 2.6 kernel should disable Thread Local Storage (TLS) (e.g. by doing a mv /lib/tls /lib/tls.disabled) before attempting to boot a XenLinux kernel. You can always reenable TLS by restoring the directory to its original location (i.e. mv /lib/tls.disabled /lib/tls).". May be you miss that "-mno-tls-direct-seg-refs" makes exactily what is here requested. In some other distributions you may move away /lib/tls to disable TLS; unfortunately, in Gentoo Linux x86_64 bit machines, the GNU LibC is built in a way that doesn't create /lib/tls. In summary, in Gentoo, in order to disable Thread Local Storage only the above-mentioned option can work.
AllenJB wrote:
4. While the Gentoo Xen guide does mention the flag, it doesn't mention what platforms it applies to, but it does mention that it is optional. (If you feel this guide should mention that the flag is specific to x86 32-bit systems, file a bug)

First, did you understand in what sense it is optional? Read again this fragment: "Guest operating systems running under Xen might otherwise see major PERFORMANCE DEGRADATION. If you, however, are planning on checking out Xen rather than installing it for PRODUCTION USE and are not terribly fond of rebuilding all programs, you can skip this step. In this case you will notice performance degradation but you will still be able to use Xen.".
Second, the GCC 4.x documentation states that "-mno-tls-direct-seg-refs" is an option that works (with same results) on x86 architecture both on 32bit and on 64bit variants. So, why should I think that the Gentoo xen-guide is talking only about x86 32bit processors, instead of any architecture variant where it applies?

AllenJB wrote:
So I don't know what Internet you're looking at, but it's not the same one as me.

Please, think twice before kidding.

Regards,

fabio de francesco
Back to top
View user's profile Send private message
kueitao
Apprentice
Apprentice


Joined: 22 Jan 2005
Posts: 241

PostPosted: Fri Jul 25, 2008 12:50 pm    Post subject: Reply with quote

gringo wrote:
Quote:
do you know how to automate the only sys-libs/glibc emerge with CHOST="... -mno-tls-direct-seg-refs"?


you could try f.ex. :

Code:
mkdir -p /etc/portage/env/sys-libs/
nano /etc/portage/env/sys-libs/glibc
CFLAGS="-march=opteron -O2 -pipe -mno-tls-direct-seg-refs"
CXXFLAGS="${CFLAGS}"


or whatever you may need. There are other .bashrc hacks available too.

cheers


Thank you gringo. I hadn't ever heard of such a possibility. It may also work for a couple of different problems where I didn't find out how to automate packages building that need configuration modifications respect to /etc/make.conf.

Regards,

fabio
Back to top
View user's profile Send private message
grassu
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2004
Posts: 91
Location: Berlin

PostPosted: Wed Sep 24, 2008 9:51 am    Post subject: Reply with quote

any clarification about this?

I'm currently building a gentoo/xen server on a xeon core duo (64bit). It is not clear to me whether to enable the -mno-tls-direct-seg-refs in make.conf or not?

Thanks in advance,

grassu
Back to top
View user's profile Send private message
a_me
n00b
n00b


Joined: 21 Jan 2006
Posts: 43

PostPosted: Fri Oct 03, 2008 10:37 pm    Post subject: Reply with quote

same thing here.

any clarification about this? my build will be a amd64 gentoo/xen server.

thanks a lot
andreas
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum