[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers

From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers
Date: Fri, 2 Sep 2011 10:09:52 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

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_!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]