Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio updates from Michael Tsirkin: "vhost, vdpa, and virtio cleanups and fixes A very quiet cycle, no new features" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: MAINTAINERS: add URL for virtio-mem vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call vringh: fix __vringh_iov() when riov and wiov are different vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK s390: virtio: PV needs VIRTIO I/O device protection virtio: let arch advertise guest's memory access restrictions vhost_vdpa: Fix duplicate included kernel.h vhost: reduce stack usage in log_used virtio-mem: Constify mem_id_table virtio_input: Constify id_table virtio-balloon: Constify id_table vdpa/mlx5: Fix failure to bring link up vdpa/mlx5: Make use of a specific 16 bit endianness API
This commit is contained in:
@@ -176,6 +176,21 @@ int virtio_finalize_features(struct virtio_device *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = arch_has_restricted_virtio_memory_access();
|
||||
if (ret) {
|
||||
if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) {
|
||||
dev_warn(&dev->dev,
|
||||
"device must provide VIRTIO_F_VERSION_1\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!virtio_has_feature(dev, VIRTIO_F_ACCESS_PLATFORM)) {
|
||||
dev_warn(&dev->dev,
|
||||
"device must provide VIRTIO_F_ACCESS_PLATFORM\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user