Received: from eggs.gnu.org ([140.186.70.92]:60661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0rYu-0001yk-AV for qemu-devel@nongnu.org; Tue, 06 Sep 2011 05:03:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0rYl-0005wp-0f for qemu-devel@nongnu.org; Tue, 06 Sep 2011 05:03:20 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:37302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0rYk-0005jl-Gz for qemu-devel@nongnu.org; Tue, 06 Sep 2011 05:03:10 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp02.au.ibm.com (8.14.4/8.13.1) with ESMTP id p868u6mw009777 for ; Tue, 6 Sep 2011 18:56:06 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8690uak1265672 for ; Tue, 6 Sep 2011 19:00:57 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8692W0h018787 for ; Tue, 6 Sep 2011 19:02:32 +1000 Date: Tue, 6 Sep 2011 19:02:22 +1000 From: David Gibson Message-ID: <20110906090222.GI30278@yookeroo.fritz.box> References: <20110901163359.GB11620@redhat.com> <786649703.1049386.1314909069542.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <20110902154549.GA18368@redhat.com> <20110903144635.GD12965@yookeroo.fritz.box> <20110904091643.GA20795@redhat.com> <20110905044316.GD30278@yookeroo.fritz.box> <20110905091945.GC16038@redhat.com> <20110906031224.GH30278@yookeroo.fritz.box> <4E65C3EE.1090407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E65C3EE.1090407@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, "Michael S. Tsirkin" , aik@ozlabs.ru, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org On Tue, Sep 06, 2011 at 08:55:42AM +0200, Paolo Bonzini wrote: > On 09/06/2011 05:12 AM, David Gibson wrote: > >I'm not "fixing ppc". I'm fixing a fundamental flaw in the protocol > >implementation._So far_ I've only observed the effects on ppc, but > >that doesn't mean they don't exist. > > Actually Michael is right. The implementation is correct on x86, > though wrong anywhere else (perhaps s390?). On those architectures > you do not need rmb() and wmb(). > > So doing the __sync_synchronize() on ppc only as he proposed is > wrong; but not doing it (and leaving only a compiler barrier) on x86 > is correct. See http://g.oswego.edu/dl/jmm/cookbook.html under > "Multiprocessors". Well, in any case, I've realised that we ought to merge the barriers in virtio with those in qemu-barrier.h. Which are also unsafe on non-x86. I have a draft two patch series to do that, which I intend to post soon. Unfortunately, I haven't been able to test it on ppc kvm yet, because there are other bugs which are making qemu not even boot the pseries machine on a ppc64 host. Still trying to work out what the hell's going on there, smells like bad extension or masking of CTR (SLOF seems to get stuck in a bdnz loop with something close to 2^57 in CTR). -- 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