From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 23 16:21:07 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 C6A4D16A4E9 for ; Sun, 23 Jul 2006 16:21:07 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from outmx014.isp.belgacom.be (outmx014.isp.belgacom.be [195.238.4.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1818343D45 for ; Sun, 23 Jul 2006 16:21:06 +0000 (GMT) (envelope-from tijl@ulyssis.org) Received: from outmx014.isp.belgacom.be (localhost [127.0.0.1]) by outmx014.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6NGL4Nm020611 for ; Sun, 23 Jul 2006 18:21:04 +0200 (envelope-from ) Received: from kalimero.kotnet.org (88.193-245-81.adsl-dyn.isp.belgacom.be [81.245.193.88]) by outmx014.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id k6NGL0pA020572 for ; Sun, 23 Jul 2006 18:21:00 +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 k6NGJcYA026039 for ; Sun, 23 Jul 2006 18:19:38 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-hackers@freebsd.org Date: Sun, 23 Jul 2006 18:19:30 +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="nextPart16024009.7F5hMMiKkD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200607231819.37642.tijl@ulyssis.org> 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:21:07 -0000 --nextPart16024009.7F5hMMiKkD 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. Nothing we can > > do about that except patch wine so it doesn't. Look at the > > console messages for: > > > > 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. --nextPart16024009.7F5hMMiKkD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQBEw6GZdMR2xnarec8RAiFCAKC/ac0cKBUNYC4YQm39cx7HsxjAWwCglwuq L+gCHC+iXaMNY/q2S4I8pz0= =VBHV -----END PGP SIGNATURE----- --nextPart16024009.7F5hMMiKkD--