From owner-freebsd-current@FreeBSD.ORG Fri Aug 1 16:57:14 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 7BA7237B401; Fri, 1 Aug 2003 16:57:14 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AFED43FBD; Fri, 1 Aug 2003 16:57:13 -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 h71NvCnj008032; Fri, 1 Aug 2003 19:57:12 -0400 (EDT) Date: Fri, 1 Aug 2003 19:57:12 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030801233758.GA7023@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: David Xu cc: current@freebsd.org Subject: Re: NVidia glx stuff dies in sysarch(I386_SET_LDT, ...) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 23:57:14 -0000 On Fri, 1 Aug 2003, Marcel Moolenaar wrote: > On Fri, Aug 01, 2003 at 07:18:11PM -0400, Daniel Eischen wrote: > > On Fri, 1 Aug 2003, Marcel Moolenaar wrote: > > > > > On Fri, Aug 01, 2003 at 06:51:33PM -0400, Daniel Eischen wrote: > > > > > > > Perhaps we need to rethink the interface and disallow > > > > specification of any ldt; only allow dynamic. We would > > > > need a different method of setting an array of them, though. > > > > > > Why not allow setting a specific entry when it's currently unused > > > and not reserved by us? > > > We can simply fail if the process is trying to set a LDT entry that's > > > currently being used or is reserved by us. The only case that causes > > > problems is when an existing LDT entry is overwritten by another > > > consumer. > > > > That's what I was worried about. Once an application or > > library is written to use specific LDTs, you never know > > how it will be affected by the use of threading libraries > > (or other libraries using threads). > > But if we only use the dynamic allocation then it can only fail for > a combination of 3rd party code. It should always work when there's > just one 3rd party piece of code involved. This makes it work for > anything we should care about. The moment a process is constructed > with various 3rd party pieces compatibility is out of our hands > anyway (compatibility between the various 3rd party pieces that is). If your 3rd party code is a library, and other application code is built to be threaded (or use other libraries that are threaded) _and_ use this 3rd party library, then you have a problem. You don't know what ldt allocation is going to come first. If our dynamic allocations are made first and the 3rd party static allocations are made next, then you can have something whacky ensue. It may not even be the same all the time; it could depend on which button a user clicks first. OpenGL is the example that I was thinking about. > Having a way to disallow using the static allocation should be easy > if we use compiler magic to test that the LDT entry is constant and > 0. If it is, all is ok (assuming that I'm not mistaken that we use a > 0 entry to indicate dynamic allocation -- I haven't actually paid > that close attention to it). If the LDT entry is non-constant, it > can still be 0 of course but I expect that to be a weird border case. This is all good :-) -- Dan Eischen