[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yqw+goqTJwb0lrxy@infradead.org>
Date: Fri, 17 Jun 2022 01:42:42 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: kwankhede@...dia.com, corbet@....net, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
zhenyuw@...ux.intel.com, zhi.a.wang@...el.com,
jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
rodrigo.vivi@...el.com, tvrtko.ursulin@...ux.intel.com,
airlied@...ux.ie, daniel@...ll.ch, farman@...ux.ibm.com,
mjrosato@...ux.ibm.com, pasic@...ux.ibm.com, vneethv@...ux.ibm.com,
oberpar@...ux.ibm.com, freude@...ux.ibm.com,
akrowiak@...ux.ibm.com, jjherne@...ux.ibm.com,
alex.williamson@...hat.com, cohuck@...hat.com, jgg@...dia.com,
kevin.tian@...el.com, jchrist@...ux.ibm.com, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org
Subject: Re: [RFT][PATCH v1 3/6] vfio: Pass in starting IOVA to
vfio_pin/unpin_pages API
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 bother here and in the callers.
Also this is the only caller that does anything withthe vfio_unpin_pages
return value. Given that you touch the API here we might as well
not return any value, and turn the debug checks that can return errors
into WARN_ON_ONCE calls the vfio/iommu_type1 code.
> +extern int vfio_pin_pages(struct vfio_device *device, dma_addr_t iova,
> int npage, int prot, unsigned long *phys_pfn);
> -extern int vfio_unpin_pages(struct vfio_device *device, unsigned long *user_pfn,
> +extern int vfio_unpin_pages(struct vfio_device *device, dma_addr_t iova,
> int npage);
This will clash with the extern removal patch that Alex has sent.
Powered by blists - more mailing lists