vhost: remove unused feature bit
Subsystems (5)
PATCH 1/2 vhost: remove unused feature bit
Signed-off-by Jason Wang <[email protected]>
--- include/uapi/linux/vhost.h | 2 -- 1 file changed, 2 deletions(-)
include/uapi/linux/vhost.h +0 -2
@@ -172,8 +172,6 @@ struct vhost_memory {#define VHOST_F_LOG_ALL 26/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */ #define VHOST_NET_F_VIRTIO_NET_HDR 27 -/* Vhost have device IOTLB */ -#define VHOST_F_DEVICE_IOTLB 63/* VHOST_SCSI specific definitions */
Signature · 1 line
2.7.4
PATCH 2/2 vhost: forbid IOTLB invalidation when not enabled
When IOTLB is not enabled, we should forbid IOTLB invalidation to avoid a NULL pointer dereference.
Signed-off-by Jason Wang <[email protected]>
--- drivers/vhost/vhost.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/vhost/vhost.c +4 -0
@@ -959,6 +959,10 @@ int vhost_process_iotlb_msg(struct vhost_dev *dev,vhost_iotlb_notify_vq (dev, msg);break ;case VHOST_IOTLB_INVALIDATE : +if (!dev->iotlb) { + ret = -EFAULT ; +break ; + }vhost_del_umem_range (dev->iotlb, msg->iova, msg->iova + msg->size -1 );break ;
Signature · 1 line
2.7.4