Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

virtio/test: fix up after IOTLB changes

Allow building vringh without IOTLB (that's the case for userspace
builds, will be useful for CAIF/VOD down the road too).
Update for API tweaks.
Don't include vringh with userspace builds.

Cc: Jason Wang <jasowang@redhat.com>
Cc: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>

+18 -4
+2
drivers/vhost/Kconfig
··· 3 3 tristate 4 4 help 5 5 Generic IOTLB implementation for vhost and vringh. 6 + This option is selected by any driver which needs to support 7 + an IOMMU in software. 6 8 7 9 config VHOST_RING 8 10 tristate
+2 -2
drivers/vhost/test.c
··· 120 120 vqs[VHOST_TEST_VQ] = &n->vqs[VHOST_TEST_VQ]; 121 121 n->vqs[VHOST_TEST_VQ].handle_kick = handle_vq_kick; 122 122 vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX, UIO_MAXIOV, 123 - VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT); 123 + VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT, NULL); 124 124 125 125 f->private_data = n; 126 126 ··· 225 225 { 226 226 void *priv = NULL; 227 227 long err; 228 - struct vhost_umem *umem; 228 + struct vhost_iotlb *umem; 229 229 230 230 mutex_lock(&n->dev.mutex); 231 231 err = vhost_dev_check_owner(&n->dev);
+5
drivers/vhost/vringh.c
··· 13 13 #include <linux/uaccess.h> 14 14 #include <linux/slab.h> 15 15 #include <linux/export.h> 16 + #if IS_REACHABLE(CONFIG_VHOST_IOTLB) 16 17 #include <linux/bvec.h> 17 18 #include <linux/highmem.h> 18 19 #include <linux/vhost_iotlb.h> 20 + #endif 19 21 #include <uapi/linux/virtio_config.h> 20 22 21 23 static __printf(1,2) __cold void vringh_bad(const char *fmt, ...) ··· 1061 1059 } 1062 1060 EXPORT_SYMBOL(vringh_need_notify_kern); 1063 1061 1062 + #if IS_REACHABLE(CONFIG_VHOST_IOTLB) 1063 + 1064 1064 static int iotlb_translate(const struct vringh *vrh, 1065 1065 u64 addr, u64 len, struct bio_vec iov[], 1066 1066 int iov_size, u32 perm) ··· 1420 1416 } 1421 1417 EXPORT_SYMBOL(vringh_need_notify_iotlb); 1422 1418 1419 + #endif 1423 1420 1424 1421 MODULE_LICENSE("GPL");
+6
include/linux/vringh.h
··· 14 14 #include <linux/virtio_byteorder.h> 15 15 #include <linux/uio.h> 16 16 #include <linux/slab.h> 17 + #if IS_REACHABLE(CONFIG_VHOST_IOTLB) 17 18 #include <linux/dma-direction.h> 18 19 #include <linux/vhost_iotlb.h> 20 + #endif 19 21 #include <asm/barrier.h> 20 22 21 23 /* virtio_ring with information needed for host access. */ ··· 256 254 return __cpu_to_virtio64(vringh_is_little_endian(vrh), val); 257 255 } 258 256 257 + #if IS_REACHABLE(CONFIG_VHOST_IOTLB) 258 + 259 259 void vringh_set_iotlb(struct vringh *vrh, struct vhost_iotlb *iotlb); 260 260 261 261 int vringh_init_iotlb(struct vringh *vrh, u64 features, ··· 287 283 void vringh_notify_disable_iotlb(struct vringh *vrh); 288 284 289 285 int vringh_need_notify_iotlb(struct vringh *vrh); 286 + 287 + #endif /* CONFIG_VHOST_IOTLB */ 290 288 291 289 #endif /* _LINUX_VRINGH_H */
+3 -2
tools/virtio/Makefile
··· 4 4 virtio_test: virtio_ring.o virtio_test.o 5 5 vringh_test: vringh_test.o vringh.o virtio_ring.o 6 6 7 - CFLAGS += -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 7 + CFLAGS += -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 -include ../../include/linux/kconfig.h 8 8 vpath %.c ../../drivers/virtio ../../drivers/vhost 9 9 mod: 10 10 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V} ··· 22 22 CONFIG_VHOST=m \ 23 23 CONFIG_VHOST_NET=n \ 24 24 CONFIG_VHOST_SCSI=n \ 25 - CONFIG_VHOST_VSOCK=n 25 + CONFIG_VHOST_VSOCK=n \ 26 + CONFIG_VHOST_RING=n 26 27 OOT_BUILD=KCFLAGS="-I "${OOT_VHOST} ${MAKE} -C ${OOT_KSRC} V=${V} 27 28 oot-build: 28 29 echo "UNSUPPORTED! Don't use the resulting modules in production!"
tools/virtio/generated/autoconf.h