Re: [kvm-unit-tests PATCH v10 12/12] ppc64: Introduce lib/ppc64/asm/barrier.h

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

 




On 13/06/2016 16:04, Andrew Jones wrote:
> On Mon, Jun 13, 2016 at 03:34:53PM +0200, Paolo Bonzini wrote:
>>
>>
>> On 13/06/2016 12:49, Andrew Jones wrote:
>>>> +
>>>> +#ifndef mb
>>>> +#define mb()	asm volatile("":::"memory")
>>>> +#endif
>>>> +#ifndef rmb
>>>> +#define rmb()	asm volatile("":::"memory")
>>>> +#endif
>>>> +#ifndef wmb
>>>> +#define wmb()	asm volatile("":::"memory")
>>>> +#endif
>>
>> This is certainly wrong for PPC64.
> 
> Using the generic ones is good enough for ppc64 for now,
> since it doesn't use them. As soon as it's necessary to have
> proper barriers, then lib/ppc64/asm/barrier.h should be
> updated to stop including this, and to define their own.

Let's just do it right:

diff --git a/lib/ppc64/asm/barrier.h b/lib/ppc64/asm/barrier.h
index 5c772de..76f6efa 100644
--- a/lib/ppc64/asm/barrier.h
+++ b/lib/ppc64/asm/barrier.h
@@ -1,4 +1,9 @@
 #ifndef _ASMPPC64_BARRIER_H_
 #define _ASMPPC64_BARRIER_H_
+
+#define mb() asm volatile("sync":::"memory")
+#define rmb() asm volatile("sync":::"memory")
+#define wmb() asm volatile("sync":::"memory")
+
 #include <asm-generic/barrier.h>
 #endif

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux