Received: from eggs.gnu.org ([140.186.70.92]:60271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzHnD-0001DS-7B for qemu-devel@nongnu.org; Thu, 01 Sep 2011 20:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzHn9-0000m6-Kc for qemu-devel@nongnu.org; Thu, 01 Sep 2011 20:39:35 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:59585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzHn8-0000lQ-Pu for qemu-devel@nongnu.org; Thu, 01 Sep 2011 20:39:31 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp03.au.ibm.com (8.14.4/8.13.1) with ESMTP id p820XqlW011360 for ; Fri, 2 Sep 2011 10:33:52 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p820binw1269828 for ; Fri, 2 Sep 2011 10:37:46 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p820dDeD027100 for ; Fri, 2 Sep 2011 10:39:13 +1000 Date: Fri, 2 Sep 2011 10:09:52 +1000 From: David Gibson Message-ID: <20110902000952.GM11906@yookeroo.fritz.box> References: <1314857389-13363-1-git-send-email-david@gibson.dropbear.id.au> <1314862622.26813.6.camel@lappy> <4E5F3AA9.5020804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E5F3AA9.5020804@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, aik@ozlabs.ru, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org, Sasha Levin On Thu, Sep 01, 2011 at 09:56:25AM +0200, Paolo Bonzini wrote: > On 09/01/2011 09:37 AM, Sasha Levin wrote: > >>> -#define wmb() __asm__ __volatile__("": : :"memory") > >>> + /* TODO: we may also need rmb()s. It hasn't bitten us yet, but.. */ > >>> + #define wmb() __sync_synchronize() > > > >That asm directive also implicitly provided a compiler barrier, I could > ^^^^ > > only > > >find whether __sync_synchronize() provides one as well. > > > >Any idea if it does? > > Of course, __sync_synchronize() is a stronger barrier. The asm is > simply not a synchronization primitive. Good to hear that confirmed, I hadn't checked myself. But then a cpu memory barrier primitive without a compiler barrier would be an insane thing to have. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson