[Spice-devel] [PATCH] spice-ppc: adds powerpc64 mem barriers
Paolo Bonzini
pbonzini at redhat.com
Thu Aug 9 07:58:01 PDT 2012
Il 08/08/2012 14:52, Erlon Cruz ha scritto:
>>> >> +#elif defined __PPC64__
>>> >> +#define spice_mb() __asm__ __volatile__ ("sync" : : : "memory")
>> >
>> > Do we need a full sync here? Would an lwsync be enough?
>> > Without this, what happens? Is compilation broken? Are things buggy?
> Hi Christophe,
>
> I'm not shure about what would happen. I grab this from the kernel
> definition of mb(). Kernel have to deal with device mem ops. It guess
> lwsync, can be used once in this case only system memory is involved.
lwsync is a read memory barrier; writes can still be reordered with reads.
eieio is a write memory barrier if you do not care about write-combining
memory (usually you don't in userspace); writes can still be reordered
with reads.
sync is a full memory barrier.
Paolo
More information about the Spice-devel
mailing list