From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz28c-0005re-Fh for qemu-devel@nongnu.org; Thu, 01 Sep 2011 03:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz28a-000125-Kb for qemu-devel@nongnu.org; Thu, 01 Sep 2011 03:56:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz28a-00010c-C7 for qemu-devel@nongnu.org; Thu, 01 Sep 2011 03:56:36 -0400 Message-ID: <4E5F3AA9.5020804@redhat.com> Date: Thu, 01 Sep 2011 09:56:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1314857389-13363-1-git-send-email-david@gibson.dropbear.id.au> <1314862622.26813.6.camel@lappy> In-Reply-To: <1314862622.26813.6.camel@lappy> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Sasha Levin Cc: aliguori@us.ibm.com, aik@ozlabs.ru, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org, David Gibson 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. Paolo