From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjZx8-0008WL-J1 for qemu-devel@nongnu.org; Mon, 22 Feb 2010 10:12:06 -0500 Received: from [199.232.76.173] (port=57840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjZx8-0008WD-3x for qemu-devel@nongnu.org; Mon, 22 Feb 2010 10:12:06 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjZx5-0002Td-U2 for qemu-devel@nongnu.org; Mon, 22 Feb 2010 10:12:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49136) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjZx5-0002TU-Ip for qemu-devel@nongnu.org; Mon, 22 Feb 2010 10:12:03 -0500 Date: Mon, 22 Feb 2010 17:08:48 +0200 From: "Michael S. Tsirkin" Message-ID: <20100222150848.GD20580@redhat.com> References: <20100222135906.347393434@amt.cnet> <20100222140210.130087300@amt.cnet> <4B829364.7020300@redhat.com> <20100222144541.GC18992@amt.cnet> <4B829B59.3020803@redhat.com> <20100222145739.GC20580@redhat.com> <4B829DD0.4010009@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B829DD0.4010009@redhat.com> Subject: [Qemu-devel] Re: [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org On Mon, Feb 22, 2010 at 05:08:00PM +0200, Avi Kivity wrote: > On 02/22/2010 04:57 PM, Michael S. Tsirkin wrote: >> >> >>>> There is no need (for this case). Older read cannot be reordered with >>>> write, writes are not reordered with other writes, writes by a single >>>> processor are observed in the same order by all processors. >>>> >>>> >>> Well, Linux does use sfence. >>> >> At least on 64 bit it doesnt. >> > > Right, I was looking at wmb(), not smp_wmb(). > >>> I imagine all arches need an instruction. For reads as well. >>> >>> Note, gcc has a __sync_synchronize() builtin that compiles to mfence on >>> x86. We might use that as a baseline for both rmb and wmb, and let each >>> arch override it incrementally. >>> >> This it what my patch did. Note it only works well for recent gcc. >> > > Do you know how recent? IIRC 4.3 has broken implementation. 4.4 seems OK as far as I can tell. > -- > error compiling committee.c: too many arguments to function