From owner-freebsd-current@FreeBSD.ORG Mon Dec 22 11:54:11 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22EC316A4CE for ; Mon, 22 Dec 2003 11:54:11 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74E2D43D5D for ; Mon, 22 Dec 2003 11:54:09 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hBMJrxiw004163; Mon, 22 Dec 2003 14:53:59 -0500 (EST) Date: Mon, 22 Dec 2003 14:53:59 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "Vladimir B. Grebenschikov" cc: "current@freebsd.org" Subject: Re: KSE and qt-mt X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2003 19:54:11 -0000 On Mon, 22 Dec 2003, Julian Elischer wrote: > > On Mon, 22 Dec 2003, Daniel Eischen wrote: > > > On Mon, 22 Dec 2003, Julian Elischer wrote: > > > > > > On Mon, 22 Dec 2003, Daniel Eischen wrote: > > > > > > > On Mon, 22 Dec 2003, Vladimir B. Grebenschikov wrote: > > > > > > > > > If libc_r mapped into libkse, like /etc/libmap.conf: > > > > > -- > > > > > libc_r.so.5 libkse.so.1 > > > > > libc_r.so libkse.so > > > > > -- > > > > > > > > > > Build of port avifile-0.7.38_1,2 coredumps while configure detects qt > > > > > library. With regular libc_r it builds as exprected. > > > > > > > > > # pkg_which /usr/X11R6/lib/libGL.so.1 > > > > > XFree86-libraries-4.3.0_6 nvidia-driver-1.0.4365_1 > > > > > > > > This is known problem; you can't use nvidia drivers with libthr > > > > or libkse. Nvidia will have to rebuild their drivers/openGL > > > > library to not use static ldt allocation. > > > > > > Actually they need to not allocate any LDTs but use the ones we have.. > > > > That's only when we support __thread properly. For FreeBSD, they currently > > assume that we don't and have some sort of hack to fudge up some LDTs. > > So it is easy enough for them to just use dynamic LDT allocation > > as a work around until __thread is fully supported. > > > > > unfortunatly, for that to work we need to leave 10 or so words free for > > > now at (%gs) as they do their own __thread implementation > > > but we could do that for now without too much pain.. > > > > They only want to build one driver/openGL library for both > > -current and -stable. I told them to use getosreldate() > > or just handle an invalid return when trying to use > > i386_set_ldt(LDT_AUTO_ALLOC, ...). > > I don't think that would work.. both we and they would be allocating > LDTs.. which one would be loaded? I also asked them to use %fs; I'm not sure if they will... > if tey just left the LDT alone they could use ours as long as we left > room for them to do so.. > they said they only need a few entries at the head.. > Alternatively thay can compile using __thread when we support it.. I don't want to add hacks for particular applications, especially when we're now mostly conformant with the TLS spec. Our %gs is is per-KSE, not per-thread, so leaving spares at the beginning of it probably wouldn't have the correct behavior. Our current (libkse i386) %gs usage is: /* * %gs points to a struct kcb. */ struct kcb { struct tcb *kcb_curtcb; struct kcb *kcb_self; /* self reference */ int kcb_ldt; struct kse *kcb_kse; struct kse_mailbox kcb_kmbx; }; struct tcb { struct tdv *tcb_tdv; struct pthread *tcb_thread; void *tcb_addr; /* allocated tcb address */ void *tcb_spare; /* align tcb_tmbx to 16 bytes */ struct kse_thr_mailbox tcb_tmbx; }; The dynamic thread vector (tcb_tdv) is supposed to point to the dynamic TLS but we don't currently allocate it. -- Dan Eischen