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

RE: [Xen-devel] Question about /lib/tls

  • To: "Nuutti Kotivuori" <naked@xxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
  • From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
  • Date: Fri, 24 Dec 2004 22:49:46 -0000
  • Delivery-date: Fri, 24 Dec 2004 22:51:16 +0000
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
  • Thread-index: AcToKf0QNiJOshB4QEWkzNOWKJ94UQB3t3xA
  • Thread-topic: [Xen-devel] Question about /lib/tls

> As I understand it - emulating the standard /lib/tls 
> behaviour efficiently and properly with Xen is tricky. 
> However, a change in libc could make it easier to implement 
> or something? And this change could work with Xen and outside Xen?

Yes, with a few modifications to glibc we'd have a library that worked
fine on Xen and also on native Linux. I seriously doubt there'd be any
measureable performance loss.

The other problem is that the very latest versions of gcc will also
generate problematic code if the program uses the new thread local
variable attribute. Fortunately, almost nothing does right now. There's
already a flag to cause gcc to generate code that doesn't generate -ve
segment offsets, but its not the default. It would be great if it was...

We just haven't had time to look into modifying libc, but it would be
great if someone could. I'd probably modify Xen's seg fixup code to
print out EIPs to collect a hit list of the most frequently executed
problematic cases, then go and fix those in the source: rather than
doing a -ve segment offset, access gs:0 to read out the start of the
thread control block, then access tcb_start-offset. The only slight
problem is that a register needs to be used to hold the tcb_start value,
so there might need to be a bit of juggling with the stack if there
isn't an obvious unused register.  


SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
Xen-devel mailing list



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