From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NupG9-0003W9-3D for qemu-devel@nongnu.org; Thu, 25 Mar 2010 11:46:13 -0400 Received: from [140.186.70.92] (port=58949 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NupG7-0003Vm-Lw for qemu-devel@nongnu.org; Thu, 25 Mar 2010 11:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NupG4-00033G-Vu for qemu-devel@nongnu.org; Thu, 25 Mar 2010 11:46:11 -0400 Received: from are.twiddle.net ([75.149.56.221]:51421) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NupG4-00033A-PC for qemu-devel@nongnu.org; Thu, 25 Mar 2010 11:46:08 -0400 Message-ID: <4BAB853E.1070303@twiddle.net> Date: Thu, 25 Mar 2010 08:46:06 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 09/10] target-alpha: Implement load-locked/store-conditional properly. References: <20100325133920.GS16726@codesourcery.com> In-Reply-To: <20100325133920.GS16726@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Froyd Cc: qemu-devel@nongnu.org, aurelien@aurel32.net On 03/25/2010 06:39 AM, Nathan Froyd wrote: > On Wed, Mar 24, 2010 at 05:11:43PM -0700, Richard Henderson wrote: >> Use __sync_bool_compare_and_swap to yield correctly atomic results. >> As yet, this assumes running on an strict-memory-ordering host (i.e. x86), >> since we're still "implementing" the memory-barrier instructions as nops. > > Did the approach taken by other targets (arm/mips/ppc) not work on > Alpha? Mips doesn't even pretend to be atomic. Powerpc and Arm -- if I've got this straight -- use some sort of stop-the-world mutex+condition and then perform the compare-and-exchange by hand. I can't see how that's better than using an actual compare-and-exchange provided by the host cpu. In fact, I'm mildly horrified by the prospect. Honestly. Even ARM and HPPA which doesn't (always) natively have cmpxchg, have an easy to use kernel trap to perform the operation. I suppose real 80386 and sparc-pre-v9 don't have anything particularly useful, but frankly it wouldn't bother me to deprecate them as hosts since the modern editions all do work. r~