[Spice-devel] [PATCH] spice-ppc: adds powerpc64 mem barriers

Erlon Cruz sombrafam at gmail.com
Wed Aug 8 05:52:33 PDT 2012


On Wed, Aug 8, 2012 at 5:02 AM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> Hey,
>
> Thanks for looking into this! Just a few random questions below, mostly
> because I'm curious ;)
>
> On Tue, Aug 07, 2012 at 03:46:40PM -0300, sombrafam at gmail.com wrote:
>> From: Erlon Cruz <erlon.cruz at br.flextronics.com>
>>
>>
>> Signed-off-by: Erlon R. Cruz <erlon.cruz at br.flextronics.com>
>> Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio at fit-tecnologia.org.br>
>> Signed-off-by: Rafael F. Santos <Rafael.Santos at fit-tecnologia.org.br>
>>
>> ---
>>  spice/barrier.h |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/spice/barrier.h b/spice/barrier.h
>> index 710da09..77bce2e 100644
>> --- a/spice/barrier.h
>> +++ b/spice/barrier.h
>> @@ -36,9 +36,11 @@
>>
>>  #ifdef __i386__
>>  #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
>> -#else
>> +#elif defined __x86_64__
>>  //mfence
>>  #define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
>> +#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.

Thanks,
Erlon

> Thanks,
>
> Christophe


More information about the Spice-devel mailing list