4 messages in com.xensource.lists.xen-devel[Xen-devel] Re: NPTL/TLS "emulation" ...
FromSent OnAttachments
Rik van Riel19 Oct 2004 11:28 
Roland McGrath19 Oct 2004 12:44 
Jakub Jelinek19 Oct 2004 13:06 
Keir Fraser20 Oct 2004 00:46 
Subject:[Xen-devel] Re: NPTL/TLS "emulation" idea
From:Jakub Jelinek (jak@redhat.com)
Date:10/19/2004 01:06:11 PM
List:com.xensource.lists.xen-devel

On Tue, Oct 19, 2004 at 12:45:01PM -0700, Roland McGrath wrote:

A few weeks ago Roland, Jakub and myself brainstormed about this problem. One of the things that came up is that the positive (glibc private data) and -ve (TLS) data are not generally used at the same time.

I am still brainstorming about this, but I will need to do some experiments to figure out how some other funny ways of using segments actually work.

If you allow modification of the user code by xen, then you can do some tricks. E.g. if an application doesn't ever use %fs segment, you could rewrite the positive accesses from %gs segment prefix to %fs segment prefix and have %gs be an expand-down segment while %fs expand-up segment with the same base.

The problem with this is that things break badly if the application wants to use %fs for its own purposes, or if it pokes at its own code (writing can be avoided by temporarily write protecting any pages where a rewrite has happened, but reading cannot). There is always the PaX trick - halving the address space and having non-overlapping %cs and %ds segments with some pages shared in between, but perhaps that's too complicated.

Jakub