Good news: KSE on ia64 is starting to work

Daniel Eischen eischen at vigrid.com
Tue Aug 5 10:33:17 PDT 2003


On Tue, 5 Aug 2003, Marcel Moolenaar wrote:

> Ok,
> 
> I have a couple of changes and fixes in my tree that makes KSE on
> ia64 work. I have a couple of questions before I can commit it:
> 
> The current implementation defines the thread pointer to be per-KSE,
> like on i386. This is not how ia64 is supposed to work, so I have
> some hacks to cpu_set_upcall_kse() to preserve TP and a hack in
> _ia64_restore_context() to not restore TP (I still save TP in the
> context for now).

Right, you shouldn't need to do that.  The patches I have at:

  http://people.freebsd.org/~deischen/kse/libpthread.diffs

should work for ia64 and other archs that have per-thread
private doohickies.

> Am I right that this is currently the only way libkse can work and
> that I have to wait until the patches that are floating around get
> committed?

I'm almost ready to commit them.  Trying to figure out why
sysarch(AMD64_SET_FSBASE, foo) doesn't work on sledge (amd64).

> When libkse (then libpthread) does support a per-thread pointer.
> Does it expect the thread-pointer to set/switched by getcontext()
> setcontext() or will it assume that the thread-pointer is not
> itself part of the context?

See the ia64 part of the above patch.  Since getcontext()
and setcontext() are not meant to be used by applications
to switch between contexts in different threads, they
shouldn't need to save and restore TP.  But, the MD parts
of libpthread, _thread_enter_uts() and _thread_switch(),
do need to handle this.  I _think_ I took care of this
for ia64, but you might want to take a close look at the
patch to make sure.

The nice thing about per-thread private storage is that
it makes the MD part of libpthread really simple :-)

-- 
Dan Eischen



More information about the freebsd-threads mailing list