search for: vhost_set_vring_base

Displaying 20 results from an estimated 95 matches for "vhost_set_vring_base".

Did you mean: vhost_get_vring_base
2023 Jun 05
2
[PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature
vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support packed virtqueue well yet, so let's filter the VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). This way, even if the device supports it, we don't risk it being negotiated, then the VMM is unable to set the vring state properly. Fixes: 4c8cf31885f6 (&q...
2023 Jun 05
2
[PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature
vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support packed virtqueue well yet, so let's filter the VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). This way, even if the device supports it, we don't risk it being negotiated, then the VMM is unable to set the vring state properly. Fixes: 4c8cf31885f6 (&q...
2020 Apr 13
0
[PATCH 0/8] tools/vhost: Reset virtqueue on tests
...ri, Apr 03, 2020 at 06:51:11PM +0200, Eugenio P??rez wrote: > > > This series add the tests used to validate the "vhost: Reset batched > > > descriptors on SET_VRING_BASE call" series, with a small change on the > > > reset code (delete an extra unneded reset on VHOST_SET_VRING_BASE). > > > > > > They are based on the tests sent back them, the ones that were not > > > included (reasons in that thread). This series changes: > > > > > > * Delete need to export the ugly function in virtio_ring, now all the > > > code is added...
2020 Feb 13
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...c > +++ b/drivers/vhost/vhost.c > @@ -1642,18 +1642,30 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg > r = -EINVAL; > break; > } > + > + if (vq->last_avail_idx || vq->avail_idx) { > + pr_debug( > + "strange VHOST_SET_VRING_BASE [vq=%p][s.index=%u][s.num=%u]", > + vq, s.index, s.num); > + dump_stack(); > + r = 0; > + break; > + } > vq->last_avail_idx = s.num; > /* Forget the cached index value. */ > vq->avail_idx = vq->last_avail_idx; > pr_debug( > - &quot...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...ri, 2020-02-14 at 13:22 +0100, Christian Borntraeger wrote: >> >> On 14.02.20 13:17, Eugenio P?rez wrote: >>> Can you try the inlined patch over 52c36ce7f334 ("vhost: use batched version by default")? My intention is to check >>> if >>> "strange VHOST_SET_VRING_BASE" line appears. In previous tests, it appears very fast, but maybe it takes some time >>> for >>> it to appear, or it does not appear anymore. yep it does: [ 67.801012] [1917] vhost:vhost_vring_ioctl:1655: VHOST_SET_VRING_BASE [vq=0000000088199421][vq->last_avail_idx=0...
2020 Apr 13
0
[PATCH 0/8] tools/vhost: Reset virtqueue on tests
On Fri, Apr 03, 2020 at 06:51:11PM +0200, Eugenio P??rez wrote: > This series add the tests used to validate the "vhost: Reset batched > descriptors on SET_VRING_BASE call" series, with a small change on the > reset code (delete an extra unneded reset on VHOST_SET_VRING_BASE). > > They are based on the tests sent back them, the ones that were not > included (reasons in that thread). This series changes: > > * Delete need to export the ugly function in virtio_ring, now all the > code is added in tools/virtio (except the one line fix). > * Add forg...
2023 Jun 06
2
[PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature
...0200, Stefano Garzarella wrote: > >> > > On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > >> > > > On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > >> > > > > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > >> > > > > don't support packed virtqueue well yet, so let's filter the > >> > > > > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). > >> > > > > > >> > > > > This way, even if the devi...
2020 Feb 13
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
On 13.02.20 11:47, Eugenio P?rez wrote: > > Can we try tracing last_avail_idx with the attached patch? Can you enable also line and thread id (dyndbg='+plt')? -------------- next part -------------- [ 326.584446] [2127] 1648: VHOST_SET_VRING_BASE [vq=0000000036fdfcb7][vq->last_avail_idx=0][vq->avail_idx=0] [ 326.584457] [2127] 1648: VHOST_SET_VRING_BASE [vq=0000000060d7302b][vq->last_avail_idx=0][vq->avail_idx=0] [ 326.584474] [2124] 2441: DISCARD [vq=0000000036fdfcb7][vq->last_avail_idx=0][vq->avail_idx=0][n=0] [ 327.2...
2023 Jun 05
1
[PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature
...0, Stefano Garzarella wrote: > > > > > On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > > > > > > On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > > > > > > > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > > > > > > > don't support packed virtqueue well yet, so let's filter the > > > > > > > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). > > > > > > > > > > > > > > This way, even if the...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...c > +++ b/drivers/vhost/vhost.c > @@ -1642,15 +1642,30 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg > r = -EINVAL; > break; > } > + > + if (vq->last_avail_idx || vq->avail_idx) { > + pr_debug( > + "strange VHOST_SET_VRING_BASE [vq=%p][s.index=%u][s.num=%u]", > + vq, s.index, s.num); > + dump_stack(); > + r = 0; > + break; > + } > vq->last_avail_idx = s.num; > /* Forget the cached index value. */ > vq->avail_idx = vq->last_avail_idx; > + pr_debug( > + &quot...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...r = -EINVAL; >>> break; >>> } >>> + >>> + if (vq->last_avail_idx || vq->avail_idx) { >>> + pr_debug( >>> + "strange VHOST_SET_VRING_BASE [vq=%p][s.index=%u][s.num=%u]", >>> + vq, s.index, s.num); >>> + dump_stack(); >>> + r = 0; >>> + break; >>> + } >>> vq->la...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
On 14.02.20 13:17, Eugenio P?rez wrote: > Can you try the inlined patch over 52c36ce7f334 ("vhost: use batched version by default")? My intention is to check if > "strange VHOST_SET_VRING_BASE" line appears. In previous tests, it appears very fast, but maybe it takes some time for > it to appear, or it does not appear anymore. LD [M] drivers/vhost/vhost_vsock.o CC [M] drivers/vhost/vhost.o In file included from ./include/linux/printk.h:331, from ./include/...
2023 Feb 28
0
[PATCH v2] vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready
...old >buffers that source driver already recover and are not available >anymore. > >Since vdpa_sim does not support receive inflight descriptors as a >destination of a migration, let's set both avail_idx and used_idx the >same at vq start. This is how vhost-user works in a >VHOST_SET_VRING_BASE call. > >Although the simple fix is to set last_used_idx at vdpasim_set_vq_state, >it would be reset at vdpasim_queue_ready. The last_avail_idx case is >fixed with commit a09f493c ("vdpa_sim: not reset state in >vdpasim_queue_ready"). Since the only option is to make it e...
2020 Apr 16
0
[PATCH v2 7/8] tools/virtio: Reset index in virtio_test --reset.
...{ > + struct vhost_vring_state s = { .index = 0 }; > + > + vq_reset(vq, vq->vring.num, &dev->vdev); > + > + r = ioctl(dev->control, VHOST_GET_VRING_BASE, > + &s); > + assert(!r); > + > + s.num = 0; > + r = ioctl(dev->control, VHOST_SET_VRING_BASE, > + &null_state); > + assert(!r); > + > r = ioctl(dev->control, VHOST_TEST_SET_BACKEND, > &backend); > assert(!r); > > + started = completed; > while (completed > next_reset) > next_reset += completed; >...
2020 Apr 17
0
[PATCH v2 7/8] tools/virtio: Reset index in virtio_test --reset.
...gt;control, VHOST_GET_VRING_BASE, > > > + &s); > > > + assert(!r); > > > + > > > + s.num = 0; > > > + r = ioctl(dev->control, VHOST_SET_VRING_BASE, > > > + &null_state); > > > + assert(!r); > > > + > > > r = ioctl(dev->control, VHOST_TEST_SET_BACKEND, > > >...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...vdpa = mdev_get_drvdata(mdev); > + if (!vdpa) > + return -ENODEV; > + > + if (qid >= vdpa->max_vrings) > + return -EINVAL; > + > + vring = &vdpa->vring_info[qid]; > + > + vring->size = num->num; > + > + return 0; > +} > + > +static int vhost_set_vring_base(struct mdev_device *mdev, > + struct vhost_vring_state *base) > +{ > + struct vdpa_dev *vdpa; > + int qid = base->index; > + struct vdpa_vring_info *vring; > + > + vdpa = mdev_get_drvdata(mdev); > + if (!vdpa) > + return -ENODEV; > + > + if (qid >= vdpa->...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...*vdpa; + int qid = num->index; + struct vdpa_vring_info *vring; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + if (qid >= vdpa->max_vrings) + return -EINVAL; + + vring = &vdpa->vring_info[qid]; + + vring->size = num->num; + + return 0; +} + +static int vhost_set_vring_base(struct mdev_device *mdev, + struct vhost_vring_state *base) +{ + struct vdpa_dev *vdpa; + int qid = base->index; + struct vdpa_vring_info *vring; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + if (qid >= vdpa->max_vrings) + return -EINVAL; + + vring = &vdpa-&g...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...*vdpa; + int qid = num->index; + struct vdpa_vring_info *vring; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + if (qid >= vdpa->max_vrings) + return -EINVAL; + + vring = &vdpa->vring_info[qid]; + + vring->size = num->num; + + return 0; +} + +static int vhost_set_vring_base(struct mdev_device *mdev, + struct vhost_vring_state *base) +{ + struct vdpa_dev *vdpa; + int qid = base->index; + struct vdpa_vring_info *vring; + + vdpa = mdev_get_drvdata(mdev); + if (!vdpa) + return -ENODEV; + + if (qid >= vdpa->max_vrings) + return -EINVAL; + + vring = &vdpa-&g...
2020 Apr 02
0
[PATCH v4 7/7] tools/virtio: Make --reset reset ring idx
...e. I think this calls for a better API that handles everything internally. > + virtqueue_reset_free_head(vq->vq); > + > + r = ioctl(dev->control, VHOST_GET_VRING_BASE, > + &s); > + assert(!r); > + > + s.num = 0; > + r = ioctl(dev->control, VHOST_SET_VRING_BASE, > + &null_state); > + assert(!r); > + > r = ioctl(dev->control, VHOST_TEST_SET_BACKEND, > &backend); > assert(!r); > > + started = completed; > while (completed > next_reset) > next_r...
2009 Dec 20
0
[PATCH 1/3] vhost: prevent modification of an active ring
...;t want to do that. */ + if (vq->private_data) { + r = -EBUSY; + break; + } r = copy_from_user(&s, argp, sizeof s); if (r < 0) break; @@ -298,6 +304,12 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) vq->num = s.num; break; case VHOST_SET_VRING_BASE: + /* Moving base with an active backend? + * You don't want to do that. */ + if (vq->private_data) { + r = -EBUSY; + break; + } r = copy_from_user(&s, argp, sizeof s); if (r < 0) break; @@ -413,6 +425,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl,...