Displaying 20 results from an estimated 28 matches for "vhost_vdpa_open".
2020 Sep 24
1
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...c
> @@ -764,6 +764,12 @@ static void vhost_vdpa_free_domain(struct vhost_vdpa *v)
> v->domain = NULL;
> }
>
> +static void vhost_vdpa_cleanup(struct vhost_vdpa *v)
> +{
> + vhost_dev_cleanup(&v->vdev);
> + kfree(v->vdev.vqs);
> +}
> +
> static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> {
> struct vhost_vdpa *v;
> @@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> return 0;
>
> err_init_iotlb:
> - vhost_dev_cleanup(&v->vdev);
> + vhost_vdpa_cleanup(v);
> err...
2020 Sep 25
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...v->domain = NULL;
>> }
>>
>> +static void vhost_vdpa_cleanup(struct vhost_vdpa *v)
>> +{
>> + vhost_dev_cleanup(&v->vdev);
>> + kfree(v->vdev.vqs);
>> +}
>> +
> Wouldn't it be cleaner to call kfree(vqs) explicilty inside
> vhost_vdpa_open() in case of failure and keep the symetry of
> vhost_dev_init()/vhost_dev_cleanup()?
That's also fine.
See
https://www.mail-archive.com/virtualization at lists.linux-foundation.org/msg42558.html
I will use that for the next version.
Thanks.
>
>> static int vhost_vdpa_open(...
2020 Sep 24
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...44
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -764,6 +764,12 @@ static void vhost_vdpa_free_domain(struct vhost_vdpa *v)
v->domain = NULL;
}
+static void vhost_vdpa_cleanup(struct vhost_vdpa *v)
+{
+ vhost_dev_cleanup(&v->vdev);
+ kfree(v->vdev.vqs);
+}
+
static int vhost_vdpa_open(struct inode *inode, struct file *filep)
{
struct vhost_vdpa *v;
@@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
return 0;
err_init_iotlb:
- vhost_dev_cleanup(&v->vdev);
+ vhost_vdpa_cleanup(v);
err:
atomic_dec(&v->opened);
return r...
2020 Sep 22
0
[PATCH 1/8] vhost vdpa: fix vhost_vdpa_open error handling
...t oracle.com>
> ---
> drivers/vhost/vdpa.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 3fab94f..3301214 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -808,6 +808,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
>
> err_init_iotlb:
> vhost_dev_cleanup(&v->vdev);
> + kfree(vqs);
> err:
> atomic_dec(&v->opened);
> return r;
Acked-by: Jason Wang <jasowang at redhat.com>
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
...index);
> + if (IS_ERR(d)) {
> + r = PTR_ERR(d);
> + goto err_device_create;
> + }
> +
I can't understand what this messing around with major/minor numbers
does. Without allocating a cdev via cdev_add/etc there is only a
single char dev in existence here. This and the stuff in
vhost_vdpa_open() looks non-functional.
> +static void vhost_vdpa_remove(struct device *dev)
> +{
> + DEFINE_WAIT_FUNC(wait, woken_wake_function);
> + struct vhost_vdpa *v = dev_get_drvdata(dev);
> + int opened;
> +
> + add_wait_queue(&vhost_vdpa.release_q, &wait);
> +
> + do {...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
...index);
> + if (IS_ERR(d)) {
> + r = PTR_ERR(d);
> + goto err_device_create;
> + }
> +
I can't understand what this messing around with major/minor numbers
does. Without allocating a cdev via cdev_add/etc there is only a
single char dev in existence here. This and the stuff in
vhost_vdpa_open() looks non-functional.
> +static void vhost_vdpa_remove(struct device *dev)
> +{
> + DEFINE_WAIT_FUNC(wait, woken_wake_function);
> + struct vhost_vdpa *v = dev_get_drvdata(dev);
> + int opened;
> +
> + add_wait_queue(&vhost_vdpa.release_q, &wait);
> +
> + do {...
2020 Feb 19
0
[PATCH] vhost: introduce vDPA based backend
...r = PTR_ERR(d);
> > + goto err_device_create;
> > + }
> > +
>
> I can't understand what this messing around with major/minor numbers
> does. Without allocating a cdev via cdev_add/etc there is only a
> single char dev in existence here. This and the stuff in
> vhost_vdpa_open() looks non-functional.
I followed the code in VFIO. Please see more details below.
>
> > +static void vhost_vdpa_remove(struct device *dev)
> > +{
> > + DEFINE_WAIT_FUNC(wait, woken_wake_function);
> > + struct vhost_vdpa *v = dev_get_drvdata(dev);
> > + int ope...
2020 May 28
0
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...vqs[i];
> + poll = &vq->poll;
> + if (vq->handle_kick) {
> + init_waitqueue_func_entry(&poll->wait,
> + vhost_vdpa_poll_worker);
> + poll->work.fn = vq->handle_kick;
Why this is needed?
> + }
> +
> + }
> +}
> +
> static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> {
> struct vhost_vdpa *v;
> @@ -697,6 +795,8 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> vhost_dev_init(dev, vqs, nvqs, 0, 0, 0,
> vhost_vdpa_process_iotlb_msg);
>
> + vhost_vdpa_poll_...
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
...tch 24 for more implementation details.
Please review.
Note that patch 1 and a equivalent of patch 2 have been posted in the
list. Those two are requirement for this series to work, so I add them
here.
Thank
Jason Wang (24):
vhost-vdpa: fix backend feature ioctls
vhost-vdpa: fix vqs leak in vhost_vdpa_open()
vhost: move the backend feature bits to vhost_types.h
virtio-vdpa: don't set callback if virtio doesn't need it
vhost-vdpa: passing iotlb to IOMMU mapping helpers
vhost-vdpa: switch to use vhost-vdpa specific IOTLB
vdpa: add the missing comment for nvqs in struct vdpa_device
v...
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
...tch 24 for more implementation details.
Please review.
Note that patch 1 and a equivalent of patch 2 have been posted in the
list. Those two are requirement for this series to work, so I add them
here.
Thank
Jason Wang (24):
vhost-vdpa: fix backend feature ioctls
vhost-vdpa: fix vqs leak in vhost_vdpa_open()
vhost: move the backend feature bits to vhost_types.h
virtio-vdpa: don't set callback if virtio doesn't need it
vhost-vdpa: passing iotlb to IOMMU mapping helpers
vhost-vdpa: switch to use vhost-vdpa specific IOTLB
vdpa: add the missing comment for nvqs in struct vdpa_device
v...
2020 May 29
1
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...vm_start != notify.size)
> + return -ENOTSUPP;
> +
> + vma->vm_ops = &vhost_vdpa_vm_ops;
> + return 0;
> +}
> +
> static const struct file_operations vhost_vdpa_fops = {
> .owner = THIS_MODULE,
> .open = vhost_vdpa_open,
> .release = vhost_vdpa_release,
> .write_iter = vhost_vdpa_chr_write_iter,
> .unlocked_ioctl = vhost_vdpa_unlocked_ioctl,
> + .mmap = vhost_vdpa_mmap,
> .compat_ioctl = compat_ptr_ioctl,
> };
>
> --
> 2.20.1...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...index);
+ if (notify.addr & (PAGE_SIZE - 1))
+ return -EINVAL;
+ if (vma->vm_end - vma->vm_start != notify.size)
+ return -ENOTSUPP;
+
+ vma->vm_ops = &vhost_vdpa_vm_ops;
+ return 0;
+}
+
static const struct file_operations vhost_vdpa_fops = {
.owner = THIS_MODULE,
.open = vhost_vdpa_open,
.release = vhost_vdpa_release,
.write_iter = vhost_vdpa_chr_write_iter,
.unlocked_ioctl = vhost_vdpa_unlocked_ioctl,
+ .mmap = vhost_vdpa_mmap,
.compat_ioctl = compat_ptr_ioctl,
};
--
2.20.1
2020 Jul 13
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
...stered irq_bypass_producer,
> + * we should update it when ctx (its token)
> + * changes.
> + */
> + if (vq->call_ctx.producer.irq)
> + vhost_vdpa_update_vq_irq(vq);
> +#endif
> break;
>
> case VHOST_SET_VRING_NUM:
> @@ -741,6 +809,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> vqs[i] = &v->vqs[i];
> vqs[i]->handle_kick = handle_vq_kick;
> }
> +
Unnecessary change.
Thanks
> vhost_dev_init(dev, vqs, nvqs, 0, 0, 0, false,
> vhost_vdpa_process_iotlb_msg);
>
2023 Mar 10
0
[PATCH] vhost-vdpa: cleanup memory maps when closing vdpa fds
...:
> > > >
> > > > For iommu mapping, it should be freed by vhost_vdpa_free_domain() in
> > > > vhost_vdpa_release()?
> > > >
> > >
> > > Please consider the following lifecycle of the vdpa device:
> > >
> > > 1. vhost_vdpa_open
> > > vhost_vdpa_alloc_domain
> > >
> > > 2. vhost_vdpa_pa_map
> > > pin_user_pages
> > > vhost_vdpa_map
> > > iommu_map
> > >
> > > 3. kill QEMU
> > >
> > > 4. vhost_vdpa_release...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...ify.size)
>> +??????? return -ENOTSUPP;
>> +
>> +??? vma->vm_ops = &vhost_vdpa_vm_ops;
>> +??? return 0;
>> +}
>> +
>> ? static const struct file_operations vhost_vdpa_fops = {
>> ????? .owner??????? = THIS_MODULE,
>> ????? .open??????? = vhost_vdpa_open,
>> ????? .release??? = vhost_vdpa_release,
>> ????? .write_iter??? = vhost_vdpa_chr_write_iter,
>> ????? .unlocked_ioctl??? = vhost_vdpa_unlocked_ioctl,
>> +??? .mmap??????? = vhost_vdpa_mmap,
>> ????? .compat_ioctl??? = compat_ptr_ioctl,
>> ? };
>
2020 Jul 15
0
[PATCH 3/7] vhost_vdpa: implement IRQ offloading functions in vhost_vdpa
...???????? * changes.
>>> +???????? */
>>> +??????? if (vq->call_ctx.producer.irq)
>>> +??????????? vhost_vdpa_update_vq_irq(vq);
>>> +#endif
>>> ????????? break;
>>> ? ????? case VHOST_SET_VRING_NUM:
>>> @@ -741,6 +809,7 @@ static int vhost_vdpa_open(struct inode *inode,
>>> struct file *filep)
>>> ????????? vqs[i] = &v->vqs[i];
>>> ????????? vqs[i]->handle_kick = handle_vq_kick;
>>> ????? }
>>> +
>>
>>
>> Unnecessary change.
>>
>> Thanks
>>
>>
>...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...@@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
> cb.private = NULL;
> }
> ops->set_vq_cb(vdpa, idx, &cb);
> + vhost_vdpa_update_vq_irq(vq);
> break;
>
> case VHOST_SET_VRING_NUM:
> @@ -765,6 +829,18 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> return r;
> }
>
> +static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
> +{
> + struct vhost_virtqueue *vq;
> + int i;
> +
> + for (i = 0; i < v->nvqs; i++) {
> + vq = &v->vqs[i];
> + if (vq->ca...
2020 May 29
0
[PATCH 1/6] vhost: allow device that does not depend on vhost worker
...VHOST_SCSI_WEIGHT, 0, NULL);
+ VHOST_SCSI_WEIGHT, 0, true, NULL);
vhost_scsi_init_inflight(vs, NULL);
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 20476b505d99..6ff72289f488 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -696,7 +696,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
vqs[i] = &v->vqs[i];
vqs[i]->handle_kick = handle_vq_kick;
}
- vhost_dev_init(dev, vqs, nvqs, 0, 0, 0,
+ vhost_dev_init(dev, vqs, nvqs, 0, 0, 0, false,
vhost_vdpa_process_iotlb_msg);
dev->iotlb = vhost_iotlb_alloc(0, 0);
di...
2020 Jul 28
0
[PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...@@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
> cb.private = NULL;
> }
> ops->set_vq_cb(vdpa, idx, &cb);
> + vhost_vdpa_update_vq_irq(vq);
> break;
>
> case VHOST_SET_VRING_NUM:
> @@ -765,6 +829,18 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
> return r;
> }
>
> +static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
> +{
> + struct vhost_virtqueue *vq;
> + int i;
> +
> + for (i = 0; i < v->nvqs; i++) {
> + vq = &v->vqs[i];
> + if (vq->ca...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...????????????? cb.private = NULL;
> ????????? }
> ????????? ops->set_vq_cb(vdpa, idx, &cb);
> +??????? vhost_vdpa_update_vq_irq(vq);
> ????????? break;
> ? ????? case VHOST_SET_VRING_NUM:
> @@ -765,6 +829,18 @@ static int vhost_vdpa_open(struct inode *inode,
> struct file *filep)
> ????? return r;
> ? }
> ? +static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
> +{
> +??? struct vhost_virtqueue *vq;
> +??? int i;
> +
> +??? for (i =...