Displaying 20 results from an estimated 23 matches for "vhost_mdev_s_running".
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...UNNING _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...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...UNNING _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...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...x60, __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?
I like this idea. I will give it a try.
&...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...x60, __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?
I like this idea. I will give it a try.
&...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...t; > +/* 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. Tha...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...t; > +/* 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. Tha...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...t vhost_mdev *m, u64 __user *statep)
+{
+ u64 state;
+ long r;
+
+ 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, size...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...t vhost_mdev *m, u64 __user *statep)
+{
+ u64 state;
+ long r;
+
+ 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, size...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...t; > > > > > > +
> > > > > > > > +#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 th...
2019 Sep 26
0
[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 __use...
2019 Sep 27
0
[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 __use...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...#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?
> I like this idea. I will...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
..._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. Shou...
2019 Sep 27
0
[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 underlying device that behaves like virtio:
>>>>> I think they are really good questions/suggestions. Than...
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...t vhost_mdev *m, u64 __user *statep)
+{
+ u64 state;
+ long r;
+
+ 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_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->...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...)
> + return -EFAULT;
> +
> + if (state >= VHOST_MDEV_S_MAX)
> + return -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 *vdp...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...)
> + return -EFAULT;
> +
> + if (state >= VHOST_MDEV_S_MAX)
> + return -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 *vdp...
2019 Sep 17
1
[RFC v4 3/3] 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_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_mde...
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