Re: [RFT][PATCH v1 3/6] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-06-21 Thread Nicolin Chen
On Fri, Jun 17, 2022 at 01:42:42AM -0700, Christoph Hellwig wrote: > On Thu, Jun 16, 2022 at 04:52:09PM -0700, Nicolin Chen wrote: > > + ret = vfio_unpin_pages(&vgpu->vfio_device, gfn << PAGE_SHIFT, npage); > > + drm_WARN_ON(&i915->drm, ret != npage); > > The shifting of gfn seems to happen bo

Re: [RFT][PATCH v1 3/6] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-06-17 Thread Nicolin Chen
On Fri, Jun 17, 2022 at 01:42:42AM -0700, Christoph Hellwig wrote: > On Thu, Jun 16, 2022 at 04:52:09PM -0700, Nicolin Chen wrote: > > + ret = vfio_unpin_pages(&vgpu->vfio_device, gfn << PAGE_SHIFT, npage); > > + drm_WARN_ON(&i915->drm, ret != npage); > > The shifting of gfn seems to happen bo

[RFT][PATCH v1 3/6] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-06-17 Thread Nicolin Chen
The vfio_pin/unpin_pages() so far accepted arrays of PFNs of user IOVA. Among all three callers, there was only one caller possibly passing in a non-contiguous PFN list, which is now ensured to have contiguous PFN inputs too. Pass in the starting address with "iova" alone to simplify things, so ca