[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: "Barry Silverman": Setting GDT entries for Thread Local Storage



> I am trying to port the Fedora version of Linux to xeno-linux. It involves
> porting the NPTL Library (New Posix Thread Library), and TLS (Thread Local
> Storage) kernel changes which Redhat backported from 2.6 into 2.4.
> 
> It seems that with TLS the guest Fedora must:
> 1) Have a per-cpu GDT
> 2) Be able to change some descriptors within the GDT when the
> "set_thread_area" syscall is executed, and on thread context switches. TLS
> maintain a small array of free descriptors which can be freely used by for
> thread local storage by the guest libc - (mediated by the guest syscall)
> 
> In looking at the code, I have seen how a Xen can set up its own per CPU GDT
> when Domain 0 is building it, but how would a non-Domain 0 guest change GDT
> descriptors on the fly for "set_thread_area"?

You would use HYPERVISOR_update_descriptor(), which takes the physical
address of the descriptor-table entry to be updated, and the two
32-bit values to write into that descriptor entry.

This shoudl all work straightforwardly, unless TLS tries to install
segments that are "full size" (i.e. 4GB). I know that one of the
recent glibc threading solutions tries to do this --- it won't work
with Xen because we clip segments so that they do not overlap with
Xen's reserved area in the top 64MB of the virtual address space.

 -- Keir


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.