Hi,

because Jonathan is hacking the segment model of Coyotos, here are a
couple of relevant discussions wrt L4Ka::Pistachio and support for the
ELF TLS ABI.

http://lists.gnu.org/archive/html/l4-hurd/2002-04/msg00017.html
https://lists.ira.uni-karlsruhe.de/pipermail/l4ka/2004-November/001082.html
https://lists.ira.uni-karlsruhe.de/pipermail/l4ka/2004-March/000874.html

The short story is this: The ELF TLS ABI is very invasive wrt the
segment model that the kernel is expected to support.  This is what is
required on ia32 to support it:

The application must be able to set up a segment descriptor that
points to a thread local storage area.  The segment descriptor is
loaded into %gs, and must be restored on thread switch.

Here is an additional requirement for the GNU variant (GNU/Linux): The
segment descriptor _must_ be 4GB in size so that negative offsets
access bytes _before_ the segment base address.  This is a
micro-optimization which is due to Ulrich Drepper (so you know who to
blame for this ;)

Note that this latter requirement makes use of small address spaces
hard and/or inefficient.

This issue is of importance for binary emulation, but can also be
important for practical purposes of sharing the source implementation
for some systems.

For binary emulation of Windows programs, a similar issue may arise
for the %fs segment register.

There may be a couple of issues on other architectures as well.  At
one point, I knew all the details.  Today, all I knew can be retrieved
from the above links and the threads within the archive.

Thanks,
Marcus

_______________________________________________
coyotos-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/coyotos-dev

Reply via email to