search for: vhost_mdev_s_max

Displaying 20 results from an estimated 23 matches for "vhost_mdev_s_max".

2019 Sep 27
2
[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. Thanks! > > > > > 1. Should we use SET_STATUS maybe? > > I like this idea. I wil...
2019 Sep 27
2
[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. Thanks! > > > > > 1. Should we use SET_STATUS maybe? > > I like this idea. I wil...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
..._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. > 2. Do we want a reset ioctl? I th...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
..._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. > 2. Do we want a reset ioctl? I th...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...> > + > > > > > > +#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
2
[PATCH] vhost: introduce mdev based hardware backend
...> > + > > > > > > +#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 26
6
[PATCH] vhost: introduce mdev based hardware backend
...CONFIG_S_NEEDS_RESET) + goto reset; + return 0; + +reset: + vhost_mdev_reset(m); + return -ENODEV; +} + +static long vhost_set_state(struct 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; + } + + retur...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...CONFIG_S_NEEDS_RESET) + goto reset; + return 0; + +reset: + vhost_mdev_reset(m); + return -ENODEV; +} + +static long vhost_set_state(struct 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; + } + + retur...
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 think they are really good questions/suggestions. Thanks! > > &g...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...vhost_mdev_reset(m); > + return -ENODEV; > +} > + > +static long vhost_set_state(struct 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...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...vhost_mdev_reset(m); > + return -ENODEV; > +} > + > +static long vhost_set_state(struct 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...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...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. > >> 2. Do we wa...
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. Thanks! >>> >>>> 1. Should we use SET_STATUS maybe? >>> I like t...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...gt;>>> + >>>>>>> +#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 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...us(mdev, VIRTIO_CONFIG_S_ACKNOWLEDGE); + mdev_add_status(mdev, VIRTIO_CONFIG_S_DRIVER); + return 0; +} + +static long vhost_set_state(struct 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...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...> + vdpa->ops->notify(vdpa, vq - vdpa->vqs); > +} > + > +static int vhost_set_state(struct vhost_mdev *vdpa, u64 __user *statep) > +{ > + u64 state; > + > + if (copy_from_user(&state, statep, sizeof(state))) > + 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); > + brea...
2019 Sep 02
2
[RFC v3] vhost: introduce mdev based hardware vhost backend
...> + vdpa->ops->notify(vdpa, vq - vdpa->vqs); > +} > + > +static int vhost_set_state(struct vhost_mdev *vdpa, u64 __user *statep) > +{ > + u64 state; > + > + if (copy_from_user(&state, statep, sizeof(state))) > + 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); > + brea...
2019 Sep 17
1
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...v, VIRTIO_CONFIG_S_DRIVER); > + return 0; > +} > + > +static long vhost_set_state(struct 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_md...
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