From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 08:56:43 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 5A3A016A4CE for ; Wed, 10 Dec 2003 08:56:43 -0800 (PST) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C4B343D1D for ; Wed, 10 Dec 2003 08:56:42 -0800 (PST) (envelope-from craig@xfoil.gank.org) Received: from localhost (ion.gank.org [69.55.238.164]) by ion.gank.org (mail) with ESMTP id A18892B2FD; Wed, 10 Dec 2003 10:56:41 -0600 (CST) Received: from ion.gank.org ([69.55.238.164]) by localhost (ion.gank.org [69.55.238.164]) (amavisd-new, port 10024) with LMTP id 32063-02; Wed, 10 Dec 2003 10:56:40 -0600 (CST) Received: from owen1492.uf.corelab.com (pix.corelab.com [12.45.169.2]) by ion.gank.org (mail) with ESMTP id 34B462B2FC; Wed, 10 Dec 2003 10:56:40 -0600 (CST) From: Craig Boston To: Daniel Eischen Date: Wed, 10 Dec 2003 10:56:36 -0600 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312101056.36458.craig@xfoil.gank.org> X-Virus-Scanned: by amavisd-new at gank.org cc: Current Subject: Re: nss and pthreads and wine, oh my! 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: Wed, 10 Dec 2003 16:56:43 -0000 On Wednesday 10 December 2003 09:56 am, Daniel Eischen wrote: > The mplayer patch is to make it use LDT_AUTO_ALLOC. The ldt > fiddling code (taken from wine) doesn't use LDT_AUTO_ALLOC, > so I had to make it use it. See if you can patch wine to > use LDT_AUTO_ALLOC; it shouldn't be calling i386_set_ldt() > any other way. Ah, I see... Makes sense. Unfortunately I'm not having much success patching wine in this fashion. The problems are two-fold: 1. The internal API used by wine wants to be able to allocate ldts before actually calling i386_set_ldt. From what I can see, it's never actually used in this fasion -- the caller always uses set_ldt right after allocating one. I could probably fix this but it would involve making a fairly fundamental change to the internals of wine. Still, it might be ugly-but-doable as a BSD-local patch. Question: Would using some dummy descriptor in i386_set_ldt just to allocate the selector do any harm, with the understanding that it would be reset to something valid before it's actually used? 2. The wine_ldt_alloc_entries() function takes a count parameter, which is documented as "Allocate a number of consecutive ldt entries, without setting the LDT contents". From my perusal of the kernel sources, it seems that LDT_AUTO_ALLOC only works when num_sels==1 and doesn't guarantee that subsequent allocations are consecutive. This is a harder problem as it's used for emulating a Windows API call "AllocSelectorArray" so we really don't have any control over how it's used :( I'll see what I can come up with for #1. Any thoughts or comments about how to tackle #2 would be appreciated. Craig