kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kvm-unit-tests] asm-generic: add smp memory barriers
@ 2016-07-11 15:01 Paolo Bonzini
  0 siblings, 0 replies; only message in thread
From: Paolo Bonzini @ 2016-07-11 15:01 UTC (permalink / raw)
  To: kvm; +Cc: agordeev, drjones

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 lib/asm-generic/barrier.h | 10 ++++++++++
 lib/x86/asm/barrier.h     |  1 -
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/asm-generic/barrier.h b/lib/asm-generic/barrier.h
index 21c88e9..12ae782 100644
--- a/lib/asm-generic/barrier.h
+++ b/lib/asm-generic/barrier.h
@@ -18,4 +18,14 @@
 #define wmb()	asm volatile("":::"memory")
 #endif
 
+#ifndef smp_mb
+#define smp_mb()	mb()
+#endif
+#ifndef smp_rmb
+#define smp_rmb()	rmb()
+#endif
+#ifndef smp_wmb
+#define smp_wmb()	wmb()
+#endif
+
 #endif /* _ASM_BARRIER_H_ */
diff --git a/lib/x86/asm/barrier.h b/lib/x86/asm/barrier.h
index c12c2f6..7c108bd 100644
--- a/lib/x86/asm/barrier.h
+++ b/lib/x86/asm/barrier.h
@@ -10,7 +10,6 @@
 #define rmb()	asm volatile("lfence":::"memory")
 #define wmb()	asm volatile("sfence":::"memory")
 
-#define smp_mb()	mb()
 #define smp_rmb()	barrier()
 #define smp_wmb()	barrier()
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-11 15:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 15:01 [PATCH kvm-unit-tests] asm-generic: add smp memory barriers Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).