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