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

Implementing TLS: step 1



On Thu, Jun 19, 2003 at 04:12:50PM -0700, Julian Elischer wrote:
> 
> 
> BTW Marcel, I think that we can get from where we are now with kse to
> what we need by just a little massaging of what points to what.
> it is possible that the register %gs could be pointed to the thread
> structure directly and we could derive the KSE from that. it will just
> make the context switches a fraction more expensive if we need to
> change the segment register..

Yes. On i386 because the indirection through %gs:0x0 allows having %gs
point anything we like: the KSE. On ia64 there's room for a pointer at
offset 8 in the TLS that we can use to point to whatever we like.  That
context switches involve an additional pointer fiddle to make sure we
always have the indirection to the KSE is something I don't worry about.

> On ia64 we don;t need to use descriptors so there is not that limit so 
> in effect we could point directly to the thread descriptor and let THAT
> point to teh VCPU mailbox in question. it's just an extra write or two
> at context switch time. I think we'll be just fine.

Agreed. As long as we have the right abstraction in libkse (by means
of MD headers/macros or whatever), we should not have to worry too
much about it.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel_(_at_)_xcllnt_(_dot_)_net