From owner-freebsd-threads@FreeBSD.ORG Thu Jun 19 16:42:31 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 1C86E37B401 for ; Thu, 19 Jun 2003 16:42:31 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id D409743F93 for ; Thu, 19 Jun 2003 16:42:29 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5JNfwDZ072140; Thu, 19 Jun 2003 16:41:58 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5JNfw17001634; Thu, 19 Jun 2003 16:41:58 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h5JNfw2d001633; Thu, 19 Jun 2003 16:41:58 -0700 (PDT) (envelope-from marcel) Date: Thu, 19 Jun 2003 16:41:58 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030619234158.GE1273@dhcp01.pn.xcllnt.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: Implementing TLS: step 1 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jun 2003 23:42:31 -0000 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@xcllnt.net