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

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

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: "Barry Silverman": Setting GDT entries for Thread Local Storage
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 09 Feb 2004 19:38:15 +0000
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir.Fraser@xxxxxxxxxxxx
Delivery-date: Tue, 10 Feb 2004 15:18:40 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Mon, 09 Feb 2004 19:01:19 GMT." <E1AqGel-0004YN-00@xxxxxxxxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> 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