Displaying 20 results from an estimated 30 matches for "vhost_vdpa_release".
2023 Mar 10
0
[PATCH] vhost-vdpa: cleanup memory maps when closing vdpa fds
...rk in kernel is a
> > > > > suitable choice?
> > > >
> > > > I think I need understand what does "resources" mean here:
> > > >
> > > > 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
&...
2020 May 29
1
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...5,7 @@
> #include <linux/module.h>
> #include <linux/cdev.h>
> #include <linux/device.h>
> +#include <linux/mm.h>
> #include <linux/iommu.h>
> #include <linux/uuid.h>
> #include <linux/vdpa.h>
> @@ -741,12 +742,70 @@ static int vhost_vdpa_release(struct inode *inode,
> struct file *filep)
> return 0;
> }
>
> +static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
> +{
> + struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
> + struct vdpa_device *vdpa = v->vdpa;
> + con...
2020 Sep 24
1
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...+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;
> @@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_vdpa_free_domain(v);
> vhost_vdpa_config_put(v);
> vhost_vdpa_clean_irq(v);
> - vhost_dev_cleanup(&v->vdev);
> - kfree(v->vdev.vqs);
> + vhost_vdpa_cleanup(v);
> mutex_unlock(&d->mutex);
>
> ato...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...c
+++ b/drivers/vhost/vdpa.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/cdev.h>
#include <linux/device.h>
+#include <linux/mm.h>
#include <linux/iommu.h>
#include <linux/uuid.h>
#include <linux/vdpa.h>
@@ -741,12 +742,70 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
return 0;
}
+static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
+{
+ struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
+ struct vdpa_device *vdpa = v->vdpa;
+ const struct vdpa_config_ops *ops = vdpa->config;
+ struct vdpa_not...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...odule.h>
>> ? #include <linux/cdev.h>
>> ? #include <linux/device.h>
>> +#include <linux/mm.h>
>> ? #include <linux/iommu.h>
>> ? #include <linux/uuid.h>
>> ? #include <linux/vdpa.h>
>> @@ -741,12 +742,70 @@ static int vhost_vdpa_release(struct inode
>> *inode, struct file *filep)
>> ????? return 0;
>> ? }
>> ? +static vm_fault_t vhost_vdpa_fault(struct vm_fault *vmf)
>> +{
>> +??? struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
>> +??? struct vdpa_device *vdpa = v->vdp...
2023 Mar 21
1
[PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks
...e(v);
break;
+ case VHOST_SET_OWNER:
+ r = vhost_dev_set_owner(d);
+ if (r)
+ break;
+ r = vhost_vdpa_bind_mm(v);
+ if (r)
+ vhost_dev_reset_owner(d, NULL);
+ break;
default:
r = vhost_dev_ioctl(&v->vdev, cmd, argp);
if (r == -ENOIOCTLCMD)
@@ -1287,6 +1317,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
vhost_vdpa_clean_irq(v);
vhost_vdpa_reset(v);
vhost_dev_stop(&v->vdev);
+ vhost_vdpa_unbind_mm(v);
vhost_vdpa_config_put(v);
vhost_vdpa_cleanup(v);
mutex_unlock(&d->mutex);
--
2.39.2
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...t i;
> +
> + for (i = 0; i < v->nvqs; i++) {
> + vq = &v->vqs[i];
> + if (vq->call_ctx.producer.irq)
> + irq_bypass_unregister_producer(&vq->call_ctx.producer);
> + }
> +}
Why not using vhost_vdpa_unsetup_vq_irq()?
Thanks
> +
> static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> {
> struct vhost_vdpa *v = filep->private_data;
> @@ -777,6 +853,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> vhost_vdpa_config_put...
2020 Jul 28
0
[PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...v)
> +{
> + struct vhost_virtqueue *vq;
> + int i;
> +
> + for (i = 0; i < v->nvqs; i++) {
> + vq = &v->vqs[i];
> + if (vq->call_ctx.producer.irq)
> + irq_bypass_unregister_producer(&vq->call_ctx.producer);
> + }
> +}
> +
> static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> {
> struct vhost_vdpa *v = filep->private_data;
> @@ -777,6 +853,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> vhost_vdpa_config_put...
2020 Aug 04
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...p_vq_irq()?
>
> IMHO, in this cleanup phase, the device is almost dead, user space won't change ctx anymore, so I think we don't need to check ctx or irq, can just unregister it.
>
> Thanks!
>
>
> Thanks
>
>
>
> +
> ? static int vhost_vdpa_release(struct inode *inode, struct file
> *filep)
> ? {
> ????? struct vhost_vdpa *v = filep->private_data;
> @@ -777,6 +853,7 @@ static int vhost_vdpa_release(struct inode *inode,
> struct file *filep)
> ????? vhost_vdpa_iotlb_free(v);...
2020 Aug 05
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
...more, so I think we don't need to check ctx or irq,
But you check irq here? For ctx, irq_bypass_unregister_producer() can do
the check instead of us.
Thanks
> can just unregister it.
>
> Thanks!
>>
>> Thanks
>>
>>
>>> +
>>> ? static int vhost_vdpa_release(struct inode *inode, struct file
>>> *filep)
>>> ? {
>>> ????? struct vhost_vdpa *v = filep->private_data;
>>> @@ -777,6 +853,7 @@ static int vhost_vdpa_release(struct inode
>>> *inode, struct file *filep)
>>> ????? vhost_vdpa_iotlb_free(v)...
2020 Apr 26
1
[PATCH 1/2] vdpa: Support config interrupt in vhost_vdpa
...T_LOG_FD:
> r = -ENOIOCTLCMD;
> break;
> + case VHOST_VDPA_SET_CONFIG_CALL:
> + r = vhost_vdpa_set_config_call(v, argp);
> + break;
> default:
> r = vhost_dev_ioctl(&v->vdev, cmd, argp);
> if (r == -ENOIOCTLCMD)
> @@ -734,6 +786,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_dev_stop(&v->vdev);
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> + vhost_vdpa_config_put(v);
> vhost_dev_cleanup(&v->vdev);
> kfree(v->vdev.vqs);
> mutex_unlock(&d->mutex);...
2020 Aug 05
0
[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa
..._vdpa_unsetup_vq_irq()?
Thanks
>
> Thanks!
>>
>> Thanks
>>
>>
>>> ? can just unregister it.
>>>
>>> Thanks!
>>>>
>>>> Thanks
>>>>
>>>>
>>>>> +
>>>>> ? static int vhost_vdpa_release(struct inode *inode, struct file
>>>>> *filep)
>>>>> ? {
>>>>> ????? struct vhost_vdpa *v = filep->private_data;
>>>>> @@ -777,6 +853,7 @@ static int vhost_vdpa_release(struct inode
>>>>> *inode, struct file *filep)
>...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...T_LOG_FD:
> r = -ENOIOCTLCMD;
> break;
> + case VHOST_VDPA_SET_CONFIG_CALL:
> + r = vhost_vdpa_set_config_call(v, argp);
> + break;
> default:
> r = vhost_dev_ioctl(&v->vdev, cmd, argp);
> if (r == -ENOIOCTLCMD)
> @@ -734,6 +780,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_dev_stop(&v->vdev);
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> + vhost_vdpa_config_put(v);
> vhost_dev_cleanup(&v->vdev);
> kfree(v->vdev.vqs);
> mutex_unlock(&d->mutex);...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...T_LOG_FD:
> r = -ENOIOCTLCMD;
> break;
> + case VHOST_VDPA_SET_CONFIG_CALL:
> + r = vhost_vdpa_set_config_call(v, argp);
> + break;
> default:
> r = vhost_dev_ioctl(&v->vdev, cmd, argp);
> if (r == -ENOIOCTLCMD)
> @@ -734,6 +780,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_dev_stop(&v->vdev);
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> + vhost_vdpa_config_put(v);
> vhost_dev_cleanup(&v->vdev);
> kfree(v->vdev.vqs);
> mutex_unlock(&d->mutex);...
2020 May 29
12
[PATCH 0/6] vDPA: doorbell mapping
Hi all:
This series introduce basic functionality of doorbell mapping support
for vhost-vDPA. Userspace program may use mmap() to map a the doorbell
of a specific virtqueue into its address space. This is help to reudce
the syscall or vmexit overhead.
A new vdpa_config_ops was introduced to report the location of the
doorbell, vhost_vdpa may then choose to map the doorbell when:
- The doorbell
2020 May 29
12
[PATCH 0/6] vDPA: doorbell mapping
Hi all:
This series introduce basic functionality of doorbell mapping support
for vhost-vDPA. Userspace program may use mmap() to map a the doorbell
of a specific virtqueue into its address space. This is help to reudce
the syscall or vmexit overhead.
A new vdpa_config_ops was introduced to report the location of the
doorbell, vhost_vdpa may then choose to map the doorbell when:
- The doorbell
2020 Sep 22
0
[PATCH 1/8] vhost vdpa: fix vhost_vdpa_open error handling
On 2020/9/22 ??2:23, Mike Christie wrote:
> We must free the vqs array in the open failure path, because
> vhost_vdpa_release will not be called.
>
> Signed-off-by: Mike Christie <michael.christie at 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...
2020 Sep 24
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...*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;
@@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
vhost_vdpa_free_domain(v);
vhost_vdpa_config_put(v);
vhost_vdpa_clean_irq(v);
- vhost_dev_cleanup(&v->vdev);
- kfree(v->vdev.vqs);
+ vhost_vdpa_cleanup(v);
mutex_unlock(&d->mutex);
atomic_dec(&v->opened);
--
2.20.1
2020 Sep 25
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...ct 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;
>> @@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
>> vhost_vdpa_free_domain(v);
>> vhost_vdpa_config_put(v);
>> vhost_vdpa_clean_irq(v);
>> - vhost_dev_cleanup(&v->vdev);
>> - kfree(v->vdev.vqs);
>> + vhost_vdpa_cleanup(v);
>> mutex_unlock(&...
2020 Apr 26
0
[PATCH V3 1/2] vdpa: Support config interrupt in vhost_vdpa
...T_LOG_FD:
> r = -ENOIOCTLCMD;
> break;
> + case VHOST_VDPA_SET_CONFIG_CALL:
> + r = vhost_vdpa_set_config_call(v, argp);
> + break;
> default:
> r = vhost_dev_ioctl(&v->vdev, cmd, argp);
> if (r == -ENOIOCTLCMD)
> @@ -734,6 +780,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep)
> vhost_dev_stop(&v->vdev);
> vhost_vdpa_iotlb_free(v);
> vhost_vdpa_free_domain(v);
> + vhost_vdpa_config_put(v);
> vhost_dev_cleanup(&v->vdev);
> kfree(v->vdev.vqs);
> mutex_unlock(&d->mutex);...