From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 23 16:31:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45A5816A4DD; Sun, 23 Jul 2006 16:31:49 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from outmx022.isp.belgacom.be (outmx022.isp.belgacom.be [195.238.4.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1E1543D46; Sun, 23 Jul 2006 16:31:46 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from outmx022.isp.belgacom.be (localhost [127.0.0.1]) by outmx022.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6NGVdLA017684; Sun, 23 Jul 2006 18:31:39 +0200 (envelope-from ) Received: from kalimero.kotnet.org (88.193-245-81.adsl-dyn.isp.belgacom.be [81.245.193.88]) by outmx022.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6NGVasu017665; Sun, 23 Jul 2006 18:31:36 +0200 (envelope-from ) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.13.6/8.13.6) with ESMTP id k6NGVWKr026231; Sun, 23 Jul 2006 18:31:32 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-hackers@freebsd.org Date: Sun, 23 Jul 2006 18:31:27 +0200 User-Agent: KMail/1.9.3 References: <200607221914.15826.lofi@freebsd.org> <20060723091824.GA79726@stud.fit.vutbr.cz> In-Reply-To: <20060723091824.GA79726@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3152903.kl0IZcXFWA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200607231831.32410.tijl@ulyssis.org> Cc: Daniel Eischen , Divacky Roman , kmacy@fsmware.com, freebsd-emulation@freebsd.org, Michael Nottebrock Subject: Re: WINE vs. FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jul 2006 16:31:49 -0000 --nextPart3152903.kl0IZcXFWA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 23 July 2006 11:18, Divacky Roman wrote: > On Sat, Jul 22, 2006 at 07:15:35PM -0400, Daniel Eischen wrote: > > I think it is because WINE stomps on or TLS. =A0Nothing we can > > do about that except patch wine so it doesn't. =A0Look at the > > console messages for: > > > > =A0 Warning: pid XXX used static ldt allocation Wine's LDT code could probably be improved to bring in LDT_AUTO_ALLOC=20 and/or use the GDT entry for %fs through i386_set_fsbase() for TLS=20 instead of allocating an LDT entry (per thread). But, I don't think=20 this is currently a problem. As far as I can see FreeBSD's TLS support=20 doesn't use the LDT (anymore) so wine's static ldt allocation can't=20 possibly interfere with it. > I dont know details but judging from what linux does I think it might > be that wine requires more then one GDT entry for TLS areas. at least > comment in linux sources suggests so. > > linux has 3 GDT entries for TLS while fbsd just 1. Wine on FreeBSD doesn't use the GDT (yet?). It allocates LDT entries for=20 TLS which should work just as well. In any case, FreeBSD and Linux don't differ that much in this. =46reeBSD has 2 GDT entries available, one for %gs which is used by the=20 threading libs (following http://people.redhat.com/drepper/tls.pdf I=20 suppose) and one for %fs which is used by win32 code so wine could use=20 this instead of the LDT way. The related (undocumented) libc functions=20 are i386_get_fsbase, i386_set_fsbase, i386_get_gsbase and=20 i386_set_gsbase. Linux reserves 3 GDT entries, that can be manipulated through one=20 syscall (set_thread_area) and then it's up to the user to point %fs=20 or %gs (or some other selector?) to one of these entries. --nextPart3152903.kl0IZcXFWA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQBEw6RkdMR2xnarec8RAmiZAKCxPxrOeOEXIDvTORBkVMZuFTTHMACgyNNQ s1337fO7ram0QU52sVBd/XA= =dP1Q -----END PGP SIGNATURE----- --nextPart3152903.kl0IZcXFWA--