[PATCH] kvm tool: Add own barrier() definition

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

 



Otherwise I'm getting the following compile
problem on my Fedora machine. The helper is
rather taken from linux kernel.

 | [cyrill@moon kvm]$ make tags
 | x86/include/kvm/barrier.h:11:25: fatal error: asm/barrier.h: No such file or directory compilation terminated.

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
 tools/kvm/x86/include/kvm/barrier.h |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Index: linux-2.6.git/tools/kvm/x86/include/kvm/barrier.h
===================================================================
--- linux-2.6.git.orig/tools/kvm/x86/include/kvm/barrier.h
+++ linux-2.6.git/tools/kvm/x86/include/kvm/barrier.h
@@ -1,13 +1,20 @@
 #ifndef _KVM_BARRIER_H_
 #define _KVM_BARRIER_H_
 
-/*
- * asm/system.h cannot be #included standalone on 32-bit x86 yet.
- *
- * Provide the dependencies here - we can drop these wrappers once
- * the header is fixed upstream:
- */
+#define barrier() asm volatile("": : :"memory")
 
-#include <asm/barrier.h>
+#define mb()	asm volatile ("mfence": : :"memory")
+#define rmb()	asm volatile ("lfence": : :"memory")
+#define wmb()	asm volatile ("sfence": : :"memory")
+
+#ifdef CONFIG_SMP
+#define smp_mb()	mb()
+#define smp_rmb()	rmb()
+#define smp_wmb()	wmb()
+#else
+#define smp_mb()	barrier()
+#define smp_rmb()	barrier()
+#define smp_wmb()	barrier()
+#endif
 
 #endif /* _KVM_BARRIER_H_ */
--
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