Re: [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-19 Thread Jason Gunthorpe
On Mon, Apr 18, 2022 at 11:25:15AM -0400, Jason J. Herne wrote: > On 4/12/22 11:53, Jason Gunthorpe wrote: > > Every caller has a readily available vfio_device pointer, use that instead > > of passing in a generic struct device. The struct vfio_device already > > contains the group we need so this

Re: [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-19 Thread Tony Krowiak
On 4/12/22 11:53 AM, Jason Gunthorpe wrote: Every caller has a readily available vfio_device pointer, use that instead of passing in a generic struct device. The struct vfio_device already contains the group we need so this avoids complexity, extra refcountings, and a confusing lifecycle

Re: [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-19 Thread Jason J. Herne
On 4/12/22 11:53, Jason Gunthorpe wrote: Every caller has a readily available vfio_device pointer, use that instead of passing in a generic struct device. The struct vfio_device already contains the group we need so this avoids complexity, extra refcountings, and a confusing lifecycle model. ...

Re: [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-14 Thread Eric Farman
On Tue, 2022-04-12 at 12:53 -0300, Jason Gunthorpe wrote: > Every caller has a readily available vfio_device pointer, use that > instead > of passing in a generic struct device. The struct vfio_device already > contains the group we need so this avoids complexity, extra > refcountings, > and a

Re: [PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-13 Thread Jason Gunthorpe
On Wed, Apr 13, 2022 at 07:57:17AM +0200, Christoph Hellwig wrote: > > - extern int vfio_pin_pages(struct device *dev, unsigned long *user_pfn, > > + extern int vfio_pin_pages(struct vfio_device *vdev, unsigned long > > *user_pfn, > > int npage, int prot,

[PATCH 3/9] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages()

2022-04-12 Thread Jason Gunthorpe
Every caller has a readily available vfio_device pointer, use that instead of passing in a generic struct device. The struct vfio_device already contains the group we need so this avoids complexity, extra refcountings, and a confusing lifecycle model. Signed-off-by: Jason Gunthorpe ---