From owner-cvs-all Mon Jan 15 12:59:39 2001 Delivered-To: cvs-all@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 64E3D37B402; Mon, 15 Jan 2001 12:59:10 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id HAA25934; Tue, 16 Jan 2001 07:56:21 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01JYYUKA1HCWEMXSNK@cim.alcatel.com.au>; Tue, 16 Jan 2001 07:56:24 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.0/8.11.0) id f0FKuIe38057; Tue, 16 Jan 2001 07:56:18 +1100 (EST envelope-from jeremyp) Content-return: prohibited Date: Tue, 16 Jan 2001 07:56:18 +1100 From: Peter Jeremy Subject: Re: cvs commit: src/sys/i386/conf GENERIC In-reply-to: <200101152012.f0FKCns56756@aslan.scsiguy.com>; from gibbs@scsiguy.com on Mon, Jan 15, 2001 at 01:12:49PM -0700 To: "Justin T. Gibbs" Cc: John Baldwin , Bruce Evans , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, Wilko Bulte , Poul-Henning Kamp , Peter Wemm Mail-followup-to: "Justin T. Gibbs" , John Baldwin , Bruce Evans , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, Wilko Bulte , Poul-Henning Kamp , Peter Wemm Message-id: <20010116075618.F91029@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <200101152012.f0FKCns56756@aslan.scsiguy.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2001-Jan-15 13:12:49 -0700, "Justin T. Gibbs" wrote: >>So are you ready to write the code in trap() to handle an illegal instruction >>fault in userland that decodes and executes all variants of cmpxchg? The new >>threading code in libc will be using atomic_cmpset() from userland, which is >>going to be the main hurdle to get over. > >This is the wrong way to handle it. I tend to agree. > Have atomic_cmpset() perform a fixup >of the calling code on first entry and the result will be code as optimized >as possible for the processor type the code is running on. The other approach (at least for dynamically linked programs) is the one Solaris uses: linking against libX.so has an implied linkage against machine/libX.so (if the latter exists). This allows `generic' functions to be replaced with ones that are optimised for a particular processor. > If the user >decides to write their own code that uses cmpxchg, they get what they >deserve, but the primitives should not require a *fault* to work correctly. The only way a user is going to get a cmpxchg in their code is if they write one in assembler. If a user is writing assembler code, they should be expected to know what they are doing. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message