Displaying 20 results from an estimated 23 matches for "vhost_mdev_s_stop".
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...u64)
> > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> > > > +/* VHOST_MDEV specific defines */
> > > > +
> > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > +
> > > > +#define VHOST_MDEV_S_STOPPED 0
> > > > +#define VHOST_MDEV_S_RUNNING 1
> > > > +#define VHOST_MDEV_S_MAX 2
> > > > +
> > > > #endif
> > > So assuming we have an underlying device that behaves like virtio:
> > I think they are really good questions/suggestions....
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...u64)
> > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> > > > +/* VHOST_MDEV specific defines */
> > > > +
> > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > +
> > > > +#define VHOST_MDEV_S_STOPPED 0
> > > > +#define VHOST_MDEV_S_RUNNING 1
> > > > +#define VHOST_MDEV_S_MAX 2
> > > > +
> > > > #endif
> > > So assuming we have an underlying device that behaves like virtio:
> > I think they are really good questions/suggestions....
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...T_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64)
> > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> >
> > +/* VHOST_MDEV specific defines */
> > +
> > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > +
> > +#define VHOST_MDEV_S_STOPPED 0
> > +#define VHOST_MDEV_S_RUNNING 1
> > +#define VHOST_MDEV_S_MAX 2
> > +
> > #endif
>
> So assuming we have an underlying device that behaves like virtio:
I think they are really good questions/suggestions. Thanks!
>
> 1. Should we use SET_STATUS maybe...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...T_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64)
> > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> >
> > +/* VHOST_MDEV specific defines */
> > +
> > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > +
> > +#define VHOST_MDEV_S_STOPPED 0
> > +#define VHOST_MDEV_S_RUNNING 1
> > +#define VHOST_MDEV_S_MAX 2
> > +
> > #endif
>
> So assuming we have an underlying device that behaves like virtio:
I think they are really good questions/suggestions. Thanks!
>
> 1. Should we use SET_STATUS maybe...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
..._RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> > > > > > +/* VHOST_MDEV specific defines */
> > > > > > +
> > > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > > > +
> > > > > > +#define VHOST_MDEV_S_STOPPED 0
> > > > > > +#define VHOST_MDEV_S_RUNNING 1
> > > > > > +#define VHOST_MDEV_S_MAX 2
> > > > > > +
> > > > > > #endif
> > > > > So assuming we have an underlying device that behaves like virtio:
> >...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
..._RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
> > > > > > +/* VHOST_MDEV specific defines */
> > > > > > +
> > > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > > > +
> > > > > > +#define VHOST_MDEV_S_STOPPED 0
> > > > > > +#define VHOST_MDEV_S_RUNNING 1
> > > > > > +#define VHOST_MDEV_S_MAX 2
> > > > > > +
> > > > > > #endif
> > > > > So assuming we have an underlying device that behaves like virtio:
> >...
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
..._from_user(&state, statep, sizeof(state)))
+ return -EFAULT;
+
+ if (state >= VHOST_MDEV_S_MAX)
+ return -EINVAL;
+
+ if (m->state == state)
+ return 0;
+
+ m->state = state;
+
+ switch (m->state) {
+ case VHOST_MDEV_S_RUNNING:
+ r = vhost_mdev_start_backend(m);
+ break;
+ case VHOST_MDEV_S_STOPPED:
+ r = vhost_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;
+}
+...
2019 Sep 17
1
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...+
> + if (state >= VHOST_MDEV_S_MAX)
> + return -EINVAL;
> +
> + if (m->state == state)
> + return 0;
> +
> + m->state = state;
> +
> + switch (m->state) {
> + case VHOST_MDEV_S_RUNNING:
> + r = vhost_mdev_start_backend(m);
> + break;
> + case VHOST_MDEV_S_STOPPED:
> + r = vhost_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->featur...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...if (copy_from_user(&state, statep, sizeof(state)))
+ return -EFAULT;
+
+ if (state >= VHOST_MDEV_S_MAX)
+ return -EINVAL;
+
+ 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...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...if (copy_from_user(&state, statep, sizeof(state)))
+ return -EFAULT;
+
+ if (state >= VHOST_MDEV_S_MAX)
+ return -EINVAL;
+
+ 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...
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...> > > > > > +/* VHOST_MDEV specific defines */
> > > > > > > > +
> > > > > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
> > > > > > > > +
> > > > > > > > +#define VHOST_MDEV_S_STOPPED 0
> > > > > > > > +#define VHOST_MDEV_S_RUNNING 1
> > > > > > > > +#define VHOST_MDEV_S_MAX 2
> > > > > > > > +
> > > > > > > > #endif
> > > > > > > So assuming we have an und...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...LT;
> +
> + if (state >= VHOST_MDEV_S_MAX)
> + return -EINVAL;
> +
> + 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, siz...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...LT;
> +
> + if (state >= VHOST_MDEV_S_MAX)
> + return -EINVAL;
> +
> + 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, siz...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...IOW(VHOST_VIRTIO, 0x60, __u64)
>>> #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
>>>
>>> +/* VHOST_MDEV specific defines */
>>> +
>>> +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
>>> +
>>> +#define VHOST_MDEV_S_STOPPED 0
>>> +#define VHOST_MDEV_S_RUNNING 1
>>> +#define VHOST_MDEV_S_MAX 2
>>> +
>>> #endif
>> So assuming we have an underlying device that behaves like virtio:
> I think they are really good questions/suggestions. Thanks!
>
>> 1. Should we use...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...t;>>>> #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
>>>>> +/* VHOST_MDEV specific defines */
>>>>> +
>>>>> +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
>>>>> +
>>>>> +#define VHOST_MDEV_S_STOPPED 0
>>>>> +#define VHOST_MDEV_S_RUNNING 1
>>>>> +#define VHOST_MDEV_S_MAX 2
>>>>> +
>>>>> #endif
>>>> So assuming we have an underlying device that behaves like virtio:
>>> I think they are really good questions/su...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...K_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int)
>>>>>>> +/* VHOST_MDEV specific defines */
>>>>>>> +
>>>>>>> +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64)
>>>>>>> +
>>>>>>> +#define VHOST_MDEV_S_STOPPED 0
>>>>>>> +#define VHOST_MDEV_S_RUNNING 1
>>>>>>> +#define VHOST_MDEV_S_MAX 2
>>>>>>> +
>>>>>>> #endif
>>>>>> So assuming we have an underlying device that behaves like virtio:
>>>&...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...n -EINVAL;
> +
> + if (vdpa->state == state)
> + return 0;
> +
> + mutex_lock(&vdpa->dev.mutex);
> +
> + vdpa->state = state;
> +
> + switch (vdpa->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_us...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...n -EINVAL;
> +
> + if (vdpa->state == state)
> + return 0;
> +
> + mutex_lock(&vdpa->dev.mutex);
> +
> + vdpa->state = state;
> +
> + switch (vdpa->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_us...