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

Re: [Xen-devel] Re: NPTL/TLS "emulation" idea (fwd)

To: Rik van Riel <riel@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: NPTL/TLS "emulation" idea (fwd)
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 20 Oct 2004 15:42:03 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx, jakub@xxxxxxxxxx, roland@xxxxxxxxxx
Delivery-date: Wed, 20 Oct 2004 15:53:36 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Wed, 20 Oct 2004 09:28:30 EDT." <Pine.LNX.4.44.0410200927590.3945-100000@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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
> > > 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).

Yes, I was originally doing binary-rewriting tricks in Linux, but it
just doesn't work reliably. The main problem is that, if you patch the
/lib/tls libraries in place (i.e., directly into the buffer-cache
pages) then it is just about impossible to ensure the patches don't
end up on disc.

The bad interaction is with the prelinker --- this reads the existing
library (and so sees the patches) does some relocation and then writes
a new library file; finally it moves the new library file in place of
the old one. At that point the on-disc library contains the binary
patches, and we crash on reboot (when the out-of-line fixup code has
gone away).

> 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.

Boggle. Yuk!

 Cheers,
 Keir


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel