# Disable Thread Local storage (TLS)

## mudnaes

Does anyone know how to disable the use of TLS (Thread Local Storage) in the kernel or in glibc? It doesn't seem to be any USE flags or kernel options to do this. 

I'm trying to run Xen (xen.sf.net) on Gentoo. It's strongly recommended to turn off TLS.

Morten.

----------

## runny_yolk

 *Quote:*   

> 
> 
> Users of the XenLinux 2.6 kernel should disable Thread Local Storage (e.g. by doing a mv /lib/tls /lib/tls.disabled) before attempting to run with a XenLinux kernel2.3. You can always reenable it by restoring the directory to its original location (i.e. mv /lib/tls.disabled /lib/tls).
> 
> 

 

From the XEN manual:

Users of the XenLinux 2.6 kernel should disable Thread Local Storage (e.g. by doing a mv /lib/tls /lib/tls.disabled) before attempting to run with a XenLinux kernel2.3. You can always reenable it by restoring the directory to its original location (i.e. mv /lib/tls.disabled /lib/tls).

In my case, I found tls in /usr/lib for my Gentoo with kernel 2.6.

Good luck...[/quote]

----------

## mudnaes

Thanks!

I also found out that the masked package of glibc had the normal /lib/tls structure described in the Xen manual. Xen is now running fine on my Gentoos. 

This is what I did to get it running (in case anyone else searches for Xen and Gentoo in these forums).

- Emerge new glibc (having nptl flag set, DO NOT SET nptlonly)

- Emerge udev package (XEN doesn't like devfs)

- Compiled and installed XEN 2.0.4 from source.

- Copied my gentoo installation into logical disk (chapter 5.1 in Xen manual), changed the ip-adress in /etc/init.d/net

- Created a Xen config with same partitionlayout (hda3,hda1) for logical disk (like the partitions the copy was made from). Failed horrible when trying to use sda (scsi drive setup).

Be aware that if you have a SMP setup, only 1 processor is available to one single domain (this includes Domain0). Running xm info will show both processors avaiable. CPU Affinity can be configured.

The whole thing works like a charm (running separate logical machines for web, mail and print services).

----------

