RE: [PATCH v6 00/11] vfio/pci: Allow MMIO regions to be exported through dma-buf

Shameer Kolothum
2025-12-17T21:48:53Z

Hi Cédric,

> -----Original Message-----
> From: Cédric Le Goater <clg@redhat.com>
> Sent: 17 December 2025 17:02
> To: Nicolin Chen <nicolinc@nvidia.com>; Leon Romanovsky <leon@kernel.org>
> Cc: Bjorn Helgaas <bhelgaas@google.com>; Logan Gunthorpe
> <logang@deltatee.com>; Jens Axboe <axboe@kernel.dk>; Robin Murphy
> <robin.murphy@arm.com>; Joerg Roedel <joro@8bytes.org>; Will Deacon
> <will@kernel.org>; Marek Szyprowski <m.szyprowski@samsung.com>; Jason
> Gunthorpe <jgg@ziepe.ca>; Andrew Morton <akpm@linux-foundation.org>;
> Jonathan Corbet <corbet@lwn.net>; Sumit Semwal
> <sumit.semwal@linaro.org>; Christian König <christian.koenig@amd.com>;
> Alex Williamson <alex.williamson@redhat.com>; Kees Cook
> <kees@kernel.org>; Gustavo A. R. Silva <gustavoars@kernel.org>; Ankit
> Agrawal <ankita@nvidia.com>; Yishai Hadas <yishaih@nvidia.com>; Shameer
> Kolothum <skolothumtho@nvidia.com>; Kevin Tian <kevin.tian@intel.com>;
> Krishnakant Jaju <kjaju@nvidia.com>; Matt Ochs <mochs@nvidia.com>;
> linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> block@vger.kernel.org; iommu@lists.linux.dev; linux-mm@kvack.org; linux-
> doc@vger.kernel.org; linux-media@vger.kernel.org; dri-
> devel@lists.freedesktop.org; linaro-mm-sig@lists.linaro.org;
> kvm@vger.kernel.org; linux-hardening@vger.kernel.org; Vivek Kasireddy
> <vivek.kasireddy@intel.com>
> Subject: Re: [PATCH v6 00/11] vfio/pci: Allow MMIO regions to be exported
> through dma-buf
>
> External email: Use caution opening links or attachments
>
>
> Hello Nicolin,
>
> On 11/4/25 20:19, Nicolin Chen wrote:
> > On Sun, Nov 02, 2025 at 10:00:48AM +0200, Leon Romanovsky wrote:
> >> Changelog:
> >> v6:
> >> * Fixed wrong error check from pcim_p2pdma_init().
> >> * Documented pcim_p2pdma_provider() function.
> >> * Improved commit messages.
> >> * Added VFIO DMA-BUF selftest.
> >> * Added __counted_by(nr_ranges) annotation to struct
> vfio_device_feature_dma_buf.
> >> * Fixed error unwind when dma_buf_fd() fails.
> >> * Document latest changes to p2pmem.
> >> * Removed EXPORT_SYMBOL_GPL from pci_p2pdma_map_type.
> >> * Moved DMA mapping logic to DMA-BUF.
> >> * Removed types patch to avoid dependencies between subsystems.
> >> * Moved vfio_pci_dma_buf_move() in err_undo block.
> >> * Added nvgrace patch.
> >
> > I have verified this v6 using Jason's iommufd dmabuf branch:
> > https://github.com/jgunthorpe/linux/commits/iommufd_dmabuf/
> >
> > by drafting a QEMU patch on top of Shameer's vSMMU v5 series:
> > https://github.com/nicolinc/qemu/commits/wip/iommufd_dmabuf/
> >
> > with that, I see GPU BAR memory be correctly fetched in the QEMU:
> > vfio_region_dmabuf Device 0009:01:00.0, region "0009:01:00.0 BAR 0",
> > offset: 0x0, size: 0x1000000 vfio_region_dmabuf Device 0009:01:00.0,
> > region "0009:01:00.0 BAR 2", offset: 0x0, size: 0x44f00000
> > vfio_region_dmabuf Device 0009:01:00.0, region "0009:01:00.0 BAR 4",
> > offset: 0x0, size: 0x17a0000000
> >
> > Tested-by: Nicolin Chen <nicolinc@nvidia.com>
>
> Do you plan to provide P2P support with IOMMUFD for QEMU ?

Yes. We do plan to send that support patch soon.

Thanks,
Shameer