From owner-freebsd-threads@FreeBSD.ORG Tue Aug 5 10:33:16 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A954737B401 for ; Tue, 5 Aug 2003 10:33:16 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0E5F43F85 for ; Tue, 5 Aug 2003 10:33:15 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h75HXEnj004145; Tue, 5 Aug 2003 13:33:14 -0400 (EDT) Date: Tue, 5 Aug 2003 13:33:14 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030805165817.GA796@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Good news: KSE on ia64 is starting to work X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 17:33:17 -0000 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