search for: vhost_set_features

Displaying 20 results from an estimated 149 matches for "vhost_set_features".

Did you mean: vhost_get_features
2019 Sep 03
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...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(&vdpa->dev, cmd, argp); > + if (ret == -ENOIOCTLCMD) > + ret = vhost_vring_ioc...
2019 Sep 03
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...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(&vdpa->dev, cmd, argp); > + if (ret == -ENOIOCTLCMD) > + ret = vhost_vring_ioc...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...e 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 it mean the SET_VRING_BASE may only take affect after > VHOST_MEV_SET_STATE? Yeah, in this version,...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...e 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 it mean the SET_VRING_BASE may only take affect after > VHOST_MEV_SET_STATE? Yeah, in this version,...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...(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 it mean the SET_VRING_BASE may only take affect after &...
2015 Oct 30
5
[PATCH] vhost: move is_le setup to the backend
...fix endianness when accessing the vring via the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: 1) host is big endian and device is modern virtio 2) host has cross-endian support and device is legacy virtio with a different endianness than the host Both cases rely on the VHOST_SET_FEATURES ioctl, but 2) also needs the VHOST_SET_VRING_ENDIAN ioctl to be called by userspace. Since vq->is_le is only needed when the backend is active, it was decided to set it at backend start. This is currently done in vhost_init_used()->vhost_init_is_le() but it obfuscates the core vhost code. Th...
2015 Oct 30
5
[PATCH] vhost: move is_le setup to the backend
...fix endianness when accessing the vring via the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: 1) host is big endian and device is modern virtio 2) host has cross-endian support and device is legacy virtio with a different endianness than the host Both cases rely on the VHOST_SET_FEATURES ioctl, but 2) also needs the VHOST_SET_VRING_ENDIAN ioctl to be called by userspace. Since vq->is_le is only needed when the backend is active, it was decided to set it at backend start. This is currently done in vhost_init_used()->vhost_init_is_le() but it obfuscates the core vhost code. Th...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...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, sizeof(features))) + return -EFAULT; + + if (features & ~m->features) + return -EINVAL; + + m->acked_features = features; + + return 0; +} + +static long vhost_get_vring_base(s...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...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, sizeof(features))) + return -EFAULT; + + if (features & ~m->features) + return -EINVAL; + + m->acked_features = features; + + return 0; +} + +static long vhost_get_vring_base(s...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
.... > > >>> + >>> + 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 it mean the SET_VRING_BASE may only take affect after >> VHOST_MEV_SET_STATE? > Yeah, i...
2019 Sep 04
0
[RFC v3] vhost: introduce mdev based hardware vhost backend
..._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(&vdpa->dev, cmd, argp); > > + if (ret == -ENO...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...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, sizeof(features))) > + return -EFAULT; > + > + if (features & ~m->features) > + return -EINVAL; > + > + m->acked_features = features; >...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...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, sizeof(features))) > + return -EFAULT; > + > + if (features & ~m->features) > + return -EINVAL; > + > + m->acked_features = features; >...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...state) { > + case VHOST_MDEV_S_RUNNING: > + vdpa->ops->start(vdpa); > + break; > + case VHOST_MDEV_S_STOPPED: > + vdpa->ops->stop(vdpa); > + break; > + } > + > + mutex_unlock(&vdpa->dev.mutex); > + > + return 0; > +} > + > +static int vhost_set_features(struct vhost_mdev *vdpa, u64 __user *featurep) > +{ > + u64 features; > + > + if (copy_from_user(&features, featurep, sizeof(features))) > + return -EFAULT; > + > + if (features & ~vdpa->features) > + return -EINVAL; > + > + vdpa->acked_features = featu...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...state) { > + case VHOST_MDEV_S_RUNNING: > + vdpa->ops->start(vdpa); > + break; > + case VHOST_MDEV_S_STOPPED: > + vdpa->ops->stop(vdpa); > + break; > + } > + > + mutex_unlock(&vdpa->dev.mutex); > + > + return 0; > +} > + > +static int vhost_set_features(struct vhost_mdev *vdpa, u64 __user *featurep) > +{ > + u64 features; > + > + if (copy_from_user(&features, featurep, sizeof(features))) > + return -EFAULT; > + > + if (features & ~vdpa->features) > + return -EINVAL; > + > + vdpa->acked_features = featu...
2016 Jan 11
2
[PATCH] vhost: move is_le setup to the backend
...fix endianness when accessing the vring via the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: 1) host is big endian and device is modern virtio 2) host has cross-endian support and device is legacy virtio with a different endianness than the host Both cases rely on the VHOST_SET_FEATURES ioctl, but 2) also needs the VHOST_SET_VRING_ENDIAN ioctl to be called by userspace. Since vq->is_le is only needed when the backend is active, it was decided to set it at backend start. This is currently done in vhost_init_used()->vhost_init_is_le() but it obfuscates the core vhost code. Th...
2016 Jan 11
2
[PATCH] vhost: move is_le setup to the backend
...fix endianness when accessing the vring via the cpu_to_vhost16() and vhost16_to_cpu() helpers in the following cases: 1) host is big endian and device is modern virtio 2) host has cross-endian support and device is legacy virtio with a different endianness than the host Both cases rely on the VHOST_SET_FEATURES ioctl, but 2) also needs the VHOST_SET_VRING_ENDIAN ioctl to be called by userspace. Since vq->is_le is only needed when the backend is active, it was decided to set it at backend start. This is currently done in vhost_init_used()->vhost_init_is_le() but it obfuscates the core vhost code. Th...
2013 May 08
1
[PATCH v2] vhost-test: Make vhost/test.c work
...ost_test_ioctl(struct file *f, unsigned int ioctl, return -EFAULT; return vhost_test_run(n, test); case VHOST_GET_FEATURES: - features = VHOST_NET_FEATURES; + features = VHOST_FEATURES; if (copy_to_user(featurep, &features, sizeof features)) return -EFAULT; return 0; case VHOST_SET_FEATURES: if (copy_from_user(&features, featurep, sizeof features)) return -EFAULT; - if (features & ~VHOST_NET_FEATURES) + if (features & ~VHOST_FEATURES) return -EOPNOTSUPP; return vhost_test_set_features(n, features); case VHOST_RESET_OWNER: -- 1.8.1.4
2013 May 08
1
[PATCH v2] vhost-test: Make vhost/test.c work
...ost_test_ioctl(struct file *f, unsigned int ioctl, return -EFAULT; return vhost_test_run(n, test); case VHOST_GET_FEATURES: - features = VHOST_NET_FEATURES; + features = VHOST_FEATURES; if (copy_to_user(featurep, &features, sizeof features)) return -EFAULT; return 0; case VHOST_SET_FEATURES: if (copy_from_user(&features, featurep, sizeof features)) return -EFAULT; - if (features & ~VHOST_NET_FEATURES) + if (features & ~VHOST_FEATURES) return -EOPNOTSUPP; return vhost_test_set_features(n, features); case VHOST_RESET_OWNER: -- 1.8.1.4
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...host_mdev_stop_backend(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, sizeof(features))) + return -EFAULT; + + if (features & ~m->features) + return -EINVAL; + + m->acked_features = features; + + return 0; +} + +static long vhost_get_vring_base(s...