Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-08 Thread Eric Farman
On Tue, 2022-07-05 at 23:27 -0700, Nicolin Chen wrote: > 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. > >

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-07 Thread Nicolin Chen
On Thu, Jul 07, 2022 at 08:46:12AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Nicolin Chen > > Sent: Wednesday, July 6, 2022 2:28 PM > > /* > > - * Pin a set of guest PFNs and return their associated host PFNs for local > > + * Pin contiguo

RE: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-07 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Wednesday, July 6, 2022 2:28 PM > /* > - * Pin a set of guest PFNs and return their associated host PFNs for local > + * Pin contiguous guest pages and return their associated host pages for > local can we replace 'guest' with 'user'? > * domain only. > * @device

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Nicolin Chen
On Wed, Jul 06, 2022 at 02:49:23PM -0300, Jason Gunthorpe wrote: > On Tue, Jul 05, 2022 at 11:27:54PM -0700, Nicolin Chen wrote: > > > These functions call back into the back-end IOMMU module by using the > > pin_pages > > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c > > b/drivers/gpu/drm/i915

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Nicolin Chen
On Wed, Jul 06, 2022 at 02:49:23PM -0300, Jason Gunthorpe wrote: > On Tue, Jul 05, 2022 at 11:27:54PM -0700, Nicolin Chen wrote: > > > These functions call back into the back-end IOMMU module by using the > > pin_pages > > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c > > b/drivers/gpu/drm/i915

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Jason Gunthorpe
On Tue, Jul 05, 2022 at 11:27:54PM -0700, Nicolin Chen wrote: > These functions call back into the back-end IOMMU module by using the > pin_pages > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c > b/drivers/gpu/drm/i915/gvt/kvmgt.c > index 8c67c9aba82d..ea6041fa48ac 100644 > --- a/drivers/gpu/dr

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Kirti Wankhede
Reviewed by: Kirti Wankhede On 7/6/2022 11:57 AM, Nicolin Chen wrote: 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 t

Re: [RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-06 Thread Nicolin Chen
On Tue, Jul 05, 2022 at 11:56:25PM -0700, Christoph Hellwig wrote: > > - vfio_unpin_pages(&q->matrix_mdev->vdev, &q->saved_pfn, 1); > > + vfio_unpin_pages(&q->matrix_mdev->vdev, q->saved_pfn << > > PAGE_SHIFT, 1); > > Overly long line here. The following PATCH-5 drops the "<<

[RFT][PATCH v2 4/9] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-05 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