diff options
Diffstat (limited to 'tools/virtio')
-rw-r--r-- | tools/virtio/Makefile | 1 | ||||
-rw-r--r-- | tools/virtio/asm/barrier.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/bug.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/compiler.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/dma-mapping.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/err.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/kernel.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/module.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/scatterlist.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/slab.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/uaccess.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/virtio.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/virtio_byteorder.h | 1 | ||||
-rw-r--r-- | tools/virtio/linux/virtio_config.h | 1 | ||||
-rw-r--r-- | tools/virtio/ringtest/Makefile | 1 | ||||
-rw-r--r-- | tools/virtio/ringtest/main.h | 4 | ||||
-rw-r--r-- | tools/virtio/ringtest/noring.c | 1 | ||||
-rw-r--r-- | tools/virtio/ringtest/ptr_ring.c | 1 | ||||
-rwxr-xr-x | tools/virtio/ringtest/run-on-all.sh | 1 | ||||
-rw-r--r-- | tools/virtio/uapi/linux/virtio_ring.h | 1 | ||||
-rw-r--r-- | tools/virtio/virtio-trace/Makefile | 1 | ||||
-rw-r--r-- | tools/virtio/virtio-trace/trace-agent.h | 1 | ||||
-rw-r--r-- | tools/virtio/virtio_test.c | 1 | ||||
-rw-r--r-- | tools/virtio/vringh_test.c | 1 |
24 files changed, 27 insertions, 0 deletions
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile index 39c89a5ea990..8e2a908115c2 100644 --- a/tools/virtio/Makefile +++ b/tools/virtio/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 all: test mod test: virtio_test vringh_test virtio_test: virtio_ring.o virtio_test.o diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h index ba34f9e96efd..0ac3caf90877 100644 --- a/tools/virtio/asm/barrier.h +++ b/tools/virtio/asm/barrier.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #if defined(__i386__) || defined(__x86_64__) #define barrier() asm volatile("" ::: "memory") #define virt_mb() __sync_synchronize() diff --git a/tools/virtio/linux/bug.h b/tools/virtio/linux/bug.h index fb94f0787c47..b14c2c3b6b85 100644 --- a/tools/virtio/linux/bug.h +++ b/tools/virtio/linux/bug.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef BUG_H #define BUG_H diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h index c9ccfd42ec13..903dc9c4bd11 100644 --- a/tools/virtio/linux/compiler.h +++ b/tools/virtio/linux/compiler.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef LINUX_COMPILER_H #define LINUX_COMPILER_H diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h index 18601f6689b9..1571e24e9494 100644 --- a/tools/virtio/linux/dma-mapping.h +++ b/tools/virtio/linux/dma-mapping.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_DMA_MAPPING_H #define _LINUX_DMA_MAPPING_H diff --git a/tools/virtio/linux/err.h b/tools/virtio/linux/err.h index e32eff8b2a14..0943c644a701 100644 --- a/tools/virtio/linux/err.h +++ b/tools/virtio/linux/err.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef ERR_H #define ERR_H #define MAX_ERRNO 4095 diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index d9554fc3f340..395521a7a8d8 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef KERNEL_H #define KERNEL_H #include <stdbool.h> diff --git a/tools/virtio/linux/module.h b/tools/virtio/linux/module.h index 28ce95a05997..9dfa96fea2b2 100644 --- a/tools/virtio/linux/module.h +++ b/tools/virtio/linux/module.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <linux/export.h> #define MODULE_LICENSE(__MODULE_LICENSE_value) \ diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h index 68c9e2adc996..9a45f90e2d08 100644 --- a/tools/virtio/linux/scatterlist.h +++ b/tools/virtio/linux/scatterlist.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef SCATTERLIST_H #define SCATTERLIST_H #include <linux/kernel.h> diff --git a/tools/virtio/linux/slab.h b/tools/virtio/linux/slab.h index 7e1c1197d439..319dcaa07755 100644 --- a/tools/virtio/linux/slab.h +++ b/tools/virtio/linux/slab.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef LINUX_SLAB_H #define GFP_KERNEL 0 #define GFP_ATOMIC 0 diff --git a/tools/virtio/linux/uaccess.h b/tools/virtio/linux/uaccess.h index fa05d01b2c90..991dfb263998 100644 --- a/tools/virtio/linux/uaccess.h +++ b/tools/virtio/linux/uaccess.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef UACCESS_H #define UACCESS_H diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index d8f534025b7f..b751350d4ce8 100644 --- a/tools/virtio/linux/virtio.h +++ b/tools/virtio/linux/virtio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef LINUX_VIRTIO_H #define LINUX_VIRTIO_H #include <linux/scatterlist.h> diff --git a/tools/virtio/linux/virtio_byteorder.h b/tools/virtio/linux/virtio_byteorder.h index 9de9e6ac1d10..5b50f7eebd9c 100644 --- a/tools/virtio/linux/virtio_byteorder.h +++ b/tools/virtio/linux/virtio_byteorder.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_VIRTIO_BYTEORDER_STUB_H #define _LINUX_VIRTIO_BYTEORDER_STUB_H diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio_config.h index 9ba11815e0a1..dbf14c1e2188 100644 --- a/tools/virtio/linux/virtio_config.h +++ b/tools/virtio/linux/virtio_config.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #include <linux/virtio_byteorder.h> #include <linux/virtio.h> #include <uapi/linux/virtio_config.h> diff --git a/tools/virtio/ringtest/Makefile b/tools/virtio/ringtest/Makefile index c012edbdb13b..85c98c2810fb 100644 --- a/tools/virtio/ringtest/Makefile +++ b/tools/virtio/ringtest/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 all: all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder ptr_ring noring diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index 90b0133004e1..5706e075adf2 100644 --- a/tools/virtio/ringtest/main.h +++ b/tools/virtio/ringtest/main.h @@ -110,11 +110,15 @@ static inline void busy_wait(void) barrier(); } +#if defined(__x86_64__) || defined(__i386__) +#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc") +#else /* * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized * with other __ATOMIC_SEQ_CST calls. */ #define smp_mb() __sync_synchronize() +#endif /* * This abuses the atomic builtins for thread fences, and diff --git a/tools/virtio/ringtest/noring.c b/tools/virtio/ringtest/noring.c index b8d1c1daac7c..ce2440d5ca93 100644 --- a/tools/virtio/ringtest/noring.c +++ b/tools/virtio/ringtest/noring.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include "main.h" #include <assert.h> diff --git a/tools/virtio/ringtest/ptr_ring.c b/tools/virtio/ringtest/ptr_ring.c index 7b22f1b20652..38bb171aceba 100644 --- a/tools/virtio/ringtest/ptr_ring.c +++ b/tools/virtio/ringtest/ptr_ring.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include "main.h" #include <stdlib.h> diff --git a/tools/virtio/ringtest/run-on-all.sh b/tools/virtio/ringtest/run-on-all.sh index 29b0d3920bfc..dcc3ea758f48 100755 --- a/tools/virtio/ringtest/run-on-all.sh +++ b/tools/virtio/ringtest/run-on-all.sh @@ -1,4 +1,5 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0 CPUS_ONLINE=$(lscpu --online -p=cpu|grep -v -e '#') #use last CPU for host. Why not the first? diff --git a/tools/virtio/uapi/linux/virtio_ring.h b/tools/virtio/uapi/linux/virtio_ring.h index 4d99c78234d3..cf50b2e5ff02 100644 --- a/tools/virtio/uapi/linux/virtio_ring.h +++ b/tools/virtio/uapi/linux/virtio_ring.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef VIRTIO_RING_H #define VIRTIO_RING_H #include "../../../../include/uapi/linux/virtio_ring.h" diff --git a/tools/virtio/virtio-trace/Makefile b/tools/virtio/virtio-trace/Makefile index 0d2381633475..7843ebcda71d 100644 --- a/tools/virtio/virtio-trace/Makefile +++ b/tools/virtio/virtio-trace/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 CC = gcc CFLAGS = -O2 -Wall -pthread diff --git a/tools/virtio/virtio-trace/trace-agent.h b/tools/virtio/virtio-trace/trace-agent.h index 8de79bfeaa73..e67885969f0e 100644 --- a/tools/virtio/virtio-trace/trace-agent.h +++ b/tools/virtio/virtio-trace/trace-agent.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __TRACE_AGENT_H__ #define __TRACE_AGENT_H__ #include <pthread.h> diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c index 0fecaec90d0d..b427def67e7e 100644 --- a/tools/virtio/virtio_test.c +++ b/tools/virtio/virtio_test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <getopt.h> #include <string.h> diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index 9476c616d064..293653463303 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio/vringh_test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* Simple test of virtio code, entirely in userpsace. */ #define _GNU_SOURCE #include <sched.h> |