From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OloS0-0000hj-Ha for qemu-devel@nongnu.org; Wed, 18 Aug 2010 15:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OloRu-000808-QY for qemu-devel@nongnu.org; Wed, 18 Aug 2010 15:37:28 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:51072) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OloRu-0007zV-Hn for qemu-devel@nongnu.org; Wed, 18 Aug 2010 15:37:22 -0400 Date: Wed, 18 Aug 2010 12:37:19 -0700 From: Nathan Froyd Subject: Re: [Qemu-devel] Implementing atomic SWP in qemu-arm Message-ID: <20100818193719.GW25394@codesourcery.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter W Schultz Cc: qemu-devel@nongnu.org On Wed, Aug 18, 2010 at 12:15:09PM -0700, Peter W Schultz wrote: > How would I go about modifying the qemu source to implement SWP > atomically? I have been studying the source for a few days now, and I > am at a loss as to what all needs to be done. You should look at how the load/store-exclusive instructions work and see if you can use a similar mechanism. It should be fairly straightforward. > I feel it would be most desirable to add a TCG_SWAP instruction that > is guaranteed to be an atomic compare-and-swap, and implement that as > needed. I believe there was an thread several months ago discussing doing this or something similar and it was decided that mechanism was not the way to go. -Nathan