search for: vhost_get_features

Displaying 20 results from an estimated 184 matches for "vhost_get_features".

2019 Sep 03
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...t; + } > + case VFIO_DEVICE_GET_REGION_INFO: > + case VFIO_DEVICE_GET_IRQ_INFO: > + case VFIO_DEVICE_SET_IRQS: > + case VFIO_DEVICE_RESET: > + ret = -EINVAL; > + break; > + > + case VHOST_MDEV_SET_STATE: > + ret = vhost_set_state(vdpa, argp); > + break; > + case VHOST_GET_FEATURES: > + ret = vhost_get_features(vdpa, argp); > + break; > + case VHOST_SET_FEATURES: > + ret = vhost_set_features(vdpa, argp); > + break; > + case VHOST_GET_VRING_BASE: > + ret = vhost_get_vring_base(vdpa, argp); > + break; > + default: > + ret = vhost_dev_ioctl(&...
2019 Sep 03
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...t; + } > + case VFIO_DEVICE_GET_REGION_INFO: > + case VFIO_DEVICE_GET_IRQ_INFO: > + case VFIO_DEVICE_SET_IRQS: > + case VFIO_DEVICE_RESET: > + ret = -EINVAL; > + break; > + > + case VHOST_MDEV_SET_STATE: > + ret = vhost_set_state(vdpa, argp); > + break; > + case VHOST_GET_FEATURES: > + ret = vhost_get_features(vdpa, argp); > + break; > + case VHOST_SET_FEATURES: > + ret = vhost_set_features(vdpa, argp); > + break; > + case VHOST_GET_VRING_BASE: > + ret = vhost_get_vring_base(vdpa, argp); > + break; > + default: > + ret = vhost_dev_ioctl(&...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...talking about the virtual IOMMU (i.e. iotlb in vhost). It should be rephrased to cover the noiommu case as well. Thanks for spotting this. > > + > > + switch (cmd) { > > + case VHOST_MDEV_SET_STATE: > > + r = vhost_set_state(m, argp); > > + break; > > + case VHOST_GET_FEATURES: > > + r = vhost_get_features(m, argp); > > + break; > > + case VHOST_SET_FEATURES: > > + r = vhost_set_features(m, argp); > > + break; > > + case VHOST_GET_VRING_BASE: > > + r = vhost_get_vring_base(m, argp); > > + break; > > > Does...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...talking about the virtual IOMMU (i.e. iotlb in vhost). It should be rephrased to cover the noiommu case as well. Thanks for spotting this. > > + > > + switch (cmd) { > > + case VHOST_MDEV_SET_STATE: > > + r = vhost_set_state(m, argp); > > + break; > > + case VHOST_GET_FEATURES: > > + r = vhost_get_features(m, argp); > > + break; > > + case VHOST_SET_FEATURES: > > + r = vhost_set_features(m, argp); > > + break; > > + case VHOST_GET_VRING_BASE: > > + r = vhost_get_vring_base(m, argp); > > + break; > > > Does...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...e noiommu case as well. Thanks for > > spotting this. > > > > > > > > + > > > > + switch (cmd) { > > > > + case VHOST_MDEV_SET_STATE: > > > > + r = vhost_set_state(m, argp); > > > > + break; > > > > + case VHOST_GET_FEATURES: > > > > + r = vhost_get_features(m, argp); > > > > + break; > > > > + case VHOST_SET_FEATURES: > > > > + r = vhost_set_features(m, argp); > > > > + break; > > > > + case VHOST_GET_VRING_BASE: > > > > + r = vho...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...st_vfio_write(dev, &op); > } > > To get things from the device, two steps are needed. > Take VHOST_GET_FEATURE as an example: > > int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) > { > struct vhost_vfio_op op; > int ret; > > op.request = VHOST_GET_FEATURES; > op.flags = VHOST_VFIO_NEED_REPLY; > op.size = 0; > > /* Just need to write the header */ > ret = vhost_vfio_write(dev, &op); > if (ret != 0) > goto out; > > /* `op` wasn't changed during write */ > op.flags = 0; > op.size = sizeof(*features); &g...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...(features); op.payload.u64 = features; return vhost_vfio_write(dev, &op); } To get things from the device, two steps are needed. Take VHOST_GET_FEATURE as an example: int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) { struct vhost_vfio_op op; int ret; op.request = VHOST_GET_FEATURES; op.flags = VHOST_VFIO_NEED_REPLY; op.size = 0; /* Just need to write the header */ ret = vhost_vfio_write(dev, &op); if (ret != 0) goto out; /* `op` wasn't changed during write */ op.flags = 0; op.size = sizeof(*features); ret = vhost_vfio_read(dev, &op); if (ret != 0)...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...(features); op.payload.u64 = features; return vhost_vfio_write(dev, &op); } To get things from the device, two steps are needed. Take VHOST_GET_FEATURE as an example: int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) { struct vhost_vfio_op op; int ret; op.request = VHOST_GET_FEATURES; op.flags = VHOST_VFIO_NEED_REPLY; op.size = 0; /* Just need to write the header */ ret = vhost_vfio_write(dev, &op); if (ret != 0) goto out; /* `op` wasn't changed during write */ op.flags = 0; op.size = sizeof(*features); ret = vhost_vfio_read(dev, &op); if (ret != 0)...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+ if (m->state == state) + return 0; + + m->state = state; + + switch (m->state) { + case VHOST_MDEV_S_RUNNING: + r = vhost_mdev_start(m); + break; + case VHOST_MDEV_S_STOPPED: + r = vhost_mdev_reset(m); + break; + default: + r = -EINVAL; + break; + } + + return r; +} + +static long vhost_get_features(struct vhost_mdev *m, u64 __user *featurep) +{ + if (copy_to_user(featurep, &m->features, sizeof(m->features))) + return -EFAULT; + return 0; +} + +static long vhost_set_features(struct vhost_mdev *m, u64 __user *featurep) +{ + u64 features; + + if (copy_from_user(&features, featurep...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+ if (m->state == state) + return 0; + + m->state = state; + + switch (m->state) { + case VHOST_MDEV_S_RUNNING: + r = vhost_mdev_start(m); + break; + case VHOST_MDEV_S_STOPPED: + r = vhost_mdev_reset(m); + break; + default: + r = -EINVAL; + break; + } + + return r; +} + +static long vhost_get_features(struct vhost_mdev *m, u64 __user *featurep) +{ + if (copy_to_user(featurep, &m->features, sizeof(m->features))) + return -EFAULT; + return 0; +} + +static long vhost_set_features(struct vhost_mdev *m, u64 __user *featurep) +{ + u64 features; + + if (copy_from_user(&features, featurep...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...(features); op.payload.u64 = features; return vhost_vfio_write(dev, &op); } To get things from the device, two steps are needed. Take VHOST_GET_FEATURE as an example: int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) { struct vhost_vfio_op op; int ret; op.request = VHOST_GET_FEATURES; op.flags = VHOST_VFIO_NEED_REPLY; op.size = 0; /* Just need to write the header */ ret = vhost_vfio_write(dev, &op); if (ret != 0) goto out; /* `op` wasn't changed during write */ op.flags = 0; op.size = sizeof(*features); ret = vhost_vfio_read(dev, &op); if (ret != 0)...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...(features); op.payload.u64 = features; return vhost_vfio_write(dev, &op); } To get things from the device, two steps are needed. Take VHOST_GET_FEATURE as an example: int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) { struct vhost_vfio_op op; int ret; op.request = VHOST_GET_FEATURES; op.flags = VHOST_VFIO_NEED_REPLY; op.size = 0; /* Just need to write the header */ ret = vhost_vfio_write(dev, &op); if (ret != 0) goto out; /* `op` wasn't changed during write */ op.flags = 0; op.size = sizeof(*features); ret = vhost_vfio_read(dev, &op); if (ret != 0)...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...e. iotlb in vhost). > It should be rephrased to cover the noiommu case as well. Thanks for > spotting this. > > >>> + >>> + switch (cmd) { >>> + case VHOST_MDEV_SET_STATE: >>> + r = vhost_set_state(m, argp); >>> + break; >>> + case VHOST_GET_FEATURES: >>> + r = vhost_get_features(m, argp); >>> + break; >>> + case VHOST_SET_FEATURES: >>> + r = vhost_set_features(m, argp); >>> + break; >>> + case VHOST_GET_VRING_BASE: >>> + r = vhost_get_vring_base(m, argp); >>> + break...
2018 Apr 10
0
[RFC] vhost: introduce mdev based hardware vhost backend
...st_vfio_write(dev, &op); > } > > To get things from the device, two steps are needed. > Take VHOST_GET_FEATURE as an example: > > int vhost_vfio_get_features(struct vhost_dev *dev, uint64_t *features) > { > struct vhost_vfio_op op; > int ret; > > op.request = VHOST_GET_FEATURES; > op.flags = VHOST_VFIO_NEED_REPLY; > op.size = 0; > > /* Just need to write the header */ > ret = vhost_vfio_write(dev, &op); > if (ret != 0) > goto out; > > /* `op` wasn't changed during write */ > op.flags = 0; > op.size = sizeof(*features); &g...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...ly? VHOST_NET supported ANY_LAYOUT > from day one. For this reason it does not need to know about > VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes. It's the knowledge of vhost_net code it self but not userspace. For userspace, it should depends on the value of returned by VHOST_GET_FEATURES. So when userspace can set_features with ANY_LAYOUT, vhost may think it wants VHOST_NET_F_VIRTIO_NET_HDR. > > > >> Fixing this by safely removing >> VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even >> no userspace can use this. > Quite possibly, b...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...ly? VHOST_NET supported ANY_LAYOUT > from day one. For this reason it does not need to know about > VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes. It's the knowledge of vhost_net code it self but not userspace. For userspace, it should depends on the value of returned by VHOST_GET_FEATURES. So when userspace can set_features with ANY_LAYOUT, vhost may think it wants VHOST_NET_F_VIRTIO_NET_HDR. > > > >> Fixing this by safely removing >> VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even >> no userspace can use this. > Quite possibly, b...
2019 Sep 04
0
[RFC v3] vhost: introduce mdev based hardware vhost backend
...t; > + case VFIO_DEVICE_GET_IRQ_INFO: > > + case VFIO_DEVICE_SET_IRQS: > > + case VFIO_DEVICE_RESET: > > + ret = -EINVAL; > > + break; > > + > > + case VHOST_MDEV_SET_STATE: > > + ret = vhost_set_state(vdpa, argp); > > + break; > > + case VHOST_GET_FEATURES: > > + ret = vhost_get_features(vdpa, argp); > > + break; > > + case VHOST_SET_FEATURES: > > + ret = vhost_set_features(vdpa, argp); > > + break; > > + case VHOST_GET_VRING_BASE: > > + ret = vhost_get_vring_base(vdpa, argp); > > + break; > &g...
2015 Jan 26
1
[PATCH] vhost-scsi: introduce an ioctl to get the minimum tpgt
...return 0; + case VHOST_SCSI_GET_TPGT: + if (copy_from_user(&backend, argp, sizeof(backend))) + return -EFAULT; + r = vhost_scsi_get_first_tpgt(vs, &backend); + if (r < 0) + return r; + if (copy_to_user(argp, &backend, sizeof(backend))) + return -EFAULT; + return 0; case VHOST_GET_FEATURES: features = VHOST_SCSI_FEATURES; if (copy_to_user(featurep, &features, sizeof features)) diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h index bb6a5b4..5d350f7 100644 --- a/include/uapi/linux/vhost.h +++ b/include/uapi/linux/vhost.h @@ -155,4 +155,6 @@ struct vhost_sc...
2015 Jan 26
1
[PATCH] vhost-scsi: introduce an ioctl to get the minimum tpgt
...return 0; + case VHOST_SCSI_GET_TPGT: + if (copy_from_user(&backend, argp, sizeof(backend))) + return -EFAULT; + r = vhost_scsi_get_first_tpgt(vs, &backend); + if (r < 0) + return r; + if (copy_to_user(argp, &backend, sizeof(backend))) + return -EFAULT; + return 0; case VHOST_GET_FEATURES: features = VHOST_SCSI_FEATURES; if (copy_to_user(featurep, &features, sizeof features)) diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h index bb6a5b4..5d350f7 100644 --- a/include/uapi/linux/vhost.h +++ b/include/uapi/linux/vhost.h @@ -155,4 +155,6 @@ struct vhost_sc...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...h (m->state) { > + case VHOST_MDEV_S_RUNNING: > + r = vhost_mdev_start(m); > + break; > + case VHOST_MDEV_S_STOPPED: > + r = vhost_mdev_reset(m); > + break; > + default: > + r = -EINVAL; > + break; > + } > + > + return r; > +} > + > +static long vhost_get_features(struct vhost_mdev *m, u64 __user *featurep) > +{ > + if (copy_to_user(featurep, &m->features, sizeof(m->features))) > + return -EFAULT; > + return 0; > +} > + > +static long vhost_set_features(struct vhost_mdev *m, u64 __user *featurep) > +{ > + u64 features; &...