[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260204095659.5a983af2@shazbot.org>
Date: Wed, 4 Feb 2026 09:56:59 -0700
From: Alex Williamson <alex@...zbot.org>
To: Christian König <christian.koenig@....com>
Cc: Leon Romanovsky <leon@...nel.org>,
Sumit Semwal <sumit.semwal@...aro.org>,
Alex Deucher <alexander.deucher@....com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Gerd Hoffmann <kraxel@...hat.com>,
Dmitry Osipenko <dmitry.osipenko@...labora.com>,
Gurchetan Singh <gurchetansingh@...omium.org>,
Chia-I Wu <olvaffe@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Lucas De Marchi <lucas.demarchi@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>, Jason Gunthorpe <jgg@...pe.ca>,
Kevin Tian <kevin.tian@...el.com>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Felix Kuehling <Felix.Kuehling@....com>,
Ankit Agrawal <ankita@...dia.com>,
Vivek Kasireddy <vivek.kasireddy@...el.com>, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linaro-mm-sig@...ts.linaro.org,
linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
virtualization@...ts.linux.dev, intel-xe@...ts.freedesktop.org,
linux-rdma@...r.kernel.org, iommu@...ts.linux.dev, kvm@...r.kernel.org
Subject: Re: [PATCH v7 7/8] vfio: Permit VFIO to work with pinned importers
On Wed, 4 Feb 2026 17:21:45 +0100
Christian König <christian.koenig@....com> wrote:
> On 1/31/26 06:34, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@...dia.com>
> >
> > Till now VFIO has rejected pinned importers, largely to avoid being used
> > with the RDMA pinned importer that cannot handle a move_notify() to revoke
> > access.
> >
> > Using dma_buf_attach_revocable() it can tell the difference between pinned
> > importers that support the flow described in dma_buf_invalidate_mappings()
> > and those that don't.
> >
> > Thus permit compatible pinned importers.
> >
> > This is one of two items IOMMUFD requires to remove its private interface
> > to VFIO's dma-buf.
> >
> > Reviewed-by: Kevin Tian <kevin.tian@...el.com>
> > Reviewed-by: Alex Williamson <alex@...zbot.org>
> > Reviewed-by: Christian König <christian.koenig@....com>
> > Signed-off-by: Leon Romanovsky <leonro@...dia.com>
> > ---
> > drivers/vfio/pci/vfio_pci_dmabuf.c | 15 +++------------
> > 1 file changed, 3 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c
> > index 78d47e260f34..a5fb80e068ee 100644
> > --- a/drivers/vfio/pci/vfio_pci_dmabuf.c
> > +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c
> > @@ -22,16 +22,6 @@ struct vfio_pci_dma_buf {
> > u8 revoked : 1;
> > };
> >
> > -static int vfio_pci_dma_buf_pin(struct dma_buf_attachment *attachment)
> > -{
> > - return -EOPNOTSUPP;
> > -}
> > -
> > -static void vfio_pci_dma_buf_unpin(struct dma_buf_attachment *attachment)
> > -{
> > - /* Do nothing */
> > -}
> > -
>
> This chunk here doesn't want to apply to drm-misc-next, my educated
> guess is that the patch adding those lines is missing in that tree.
>
> How should we handle that? Patches 1-3 have already been pushed to
> drm-misc-next and I would rather like to push patches 4-6 through
> that branch as well.
>
> I can request a backmerge from the drm-misc-next maintainers, but
> then we clearly don't get that upstream this week.
Hmm, drm-next already has a backmerge up to v6.19-rc7, the patch here is
based on a commit merged in rc8. The tag for that change was based on
rc6. It can be found here:
https://github.com/awilliam/linux-vfio.git tags/vfio-v6.19-rc8
As the same tag Linus merged in:
1f97d9dcf536 ("Merge tag 'vfio-v6.19-rc8' of https://github.com/awilliam/linux-vfio")
drm-misc-next only seems to be based on v6.19-rc1 though, so I don't
know that any of that helps. Thanks,
Alex
> > static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf,
> > struct dma_buf_attachment
> > *attachment) {
> > @@ -43,6 +33,9 @@ static int vfio_pci_dma_buf_attach(struct dma_buf
> > *dmabuf, if (priv->revoked)
> > return -ENODEV;
> >
> > + if (!dma_buf_attach_revocable(attachment))
> > + return -EOPNOTSUPP;
> > +
> > return 0;
> > }
> >
> > @@ -107,8 +100,6 @@ static void vfio_pci_dma_buf_release(struct
> > dma_buf *dmabuf) }
> >
> > static const struct dma_buf_ops vfio_pci_dmabuf_ops = {
> > - .pin = vfio_pci_dma_buf_pin,
> > - .unpin = vfio_pci_dma_buf_unpin,
> > .attach = vfio_pci_dma_buf_attach,
> > .map_dma_buf = vfio_pci_dma_buf_map,
> > .unmap_dma_buf = vfio_pci_dma_buf_unmap,
> >
>
>
Powered by blists - more mailing lists