aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-18 12:28:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-18 12:28:20 -0400
commit00ade1f553e3b947cd26228392ee47d6f0f550e1 (patch)
tree103650aae51d14e271542e068b7c89fec0cf4387 /tools
parent3ae839454e77cdc87d499a4bfd0932dec5763b55 (diff)
parentad2aa04218de9bd734d593adb0ac59854ec0cb68 (diff)
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio fixes and cleanups from Michael Tsirkin: "This fixes the virtio-test tool, and improves the error handling for virtio-ccw" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio/s390: handle failures of READ_VQ_CONF ccw tools/virtio: propagate V=X to kernel build vhost: move features to core tools/virtio: fix build after 4.2 changes
Diffstat (limited to 'tools')
-rw-r--r--tools/virtio/Makefile2
-rw-r--r--tools/virtio/asm/barrier.h2
-rw-r--r--tools/virtio/linux/export.h3
-rw-r--r--tools/virtio/linux/kernel.h8
4 files changed, 14 insertions, 1 deletions
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
index 505ad51b3b51..39c89a5ea990 100644
--- a/tools/virtio/Makefile
+++ b/tools/virtio/Makefile
@@ -6,7 +6,7 @@ vringh_test: vringh_test.o vringh.o virtio_ring.o
6CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE 6CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
7vpath %.c ../../drivers/virtio ../../drivers/vhost 7vpath %.c ../../drivers/virtio ../../drivers/vhost
8mod: 8mod:
9 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test 9 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
10.PHONY: all test mod clean 10.PHONY: all test mod clean
11clean: 11clean:
12 ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \ 12 ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index aff61e13306c..26b7926bda88 100644
--- a/tools/virtio/asm/barrier.h
+++ b/tools/virtio/asm/barrier.h
@@ -3,6 +3,8 @@
3#define mb() __sync_synchronize() 3#define mb() __sync_synchronize()
4 4
5#define smp_mb() mb() 5#define smp_mb() mb()
6# define dma_rmb() barrier()
7# define dma_wmb() barrier()
6# define smp_rmb() barrier() 8# define smp_rmb() barrier()
7# define smp_wmb() barrier() 9# define smp_wmb() barrier()
8/* Weak barriers should be used. If not - it's a bug */ 10/* Weak barriers should be used. If not - it's a bug */
diff --git a/tools/virtio/linux/export.h b/tools/virtio/linux/export.h
new file mode 100644
index 000000000000..416875e29254
--- /dev/null
+++ b/tools/virtio/linux/export.h
@@ -0,0 +1,3 @@
1#define EXPORT_SYMBOL_GPL(sym) extern typeof(sym) sym
2#define EXPORT_SYMBOL(sym) extern typeof(sym) sym
3
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 1e8ce6979c1e..0a3da64638ce 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -22,6 +22,7 @@
22 22
23typedef unsigned long long dma_addr_t; 23typedef unsigned long long dma_addr_t;
24typedef size_t __kernel_size_t; 24typedef size_t __kernel_size_t;
25typedef unsigned int __wsum;
25 26
26struct page { 27struct page {
27 unsigned long long dummy; 28 unsigned long long dummy;
@@ -47,6 +48,13 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
47 return __kmalloc_fake; 48 return __kmalloc_fake;
48 return malloc(s); 49 return malloc(s);
49} 50}
51static inline void *kzalloc(size_t s, gfp_t gfp)
52{
53 void *p = kmalloc(s, gfp);
54
55 memset(p, 0, s);
56 return p;
57}
50 58
51static inline void kfree(void *p) 59static inline void kfree(void *p)
52{ 60{