[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202175046.GA1155873@nvidia.com>
Date: Tue, 2 Dec 2025 13:50:46 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: iommu@...ts.linux.dev, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Kevin Tian <kevin.tian@...el.com>
Subject: [GIT PULL] Please pull IOMMUFD subsystem changes
Hi Linus,
This is a pretty consequential cycle for iommufd, though this PR is
not too big. It is based on a shared branch with VFIO that introduces
VFIO_DEVICE_FEATURE_DMA_BUF a DMABUF exporter for VFIO device's MMIO
PCI BARs. This was a large multiple series journey over the last year
and a half.
Based on that work IOMMUFD gains support for VFIO DMABUF's in its
existing IOMMU_IOAS_MAP_FILE, which closes the last major gap to
support PCI peer to peer transfers within VMs.
In Joerg's iommu tree we have the "generic page table" work which aims
to consolidate all the duplicated page table code in every iommu
driver into a single algorithm. This will be used by iommufd to
implement unique page table operations to start adding new features
and improve performance.
There are a few merge resolutions, Alex's VFIO shared branch has this
against the DMA tree:
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@@ -479,8 -479,9 +479,9 @@@ int dma_direct_map_sg(struct device *de
}
break;
case PCI_P2PDMA_MAP_BUS_ADDR:
- sg->dma_address = pci_p2pdma_bus_addr_map(&p2pdma_state,
- sg_phys(sg));
+ sg->dma_address = pci_p2pdma_bus_addr_map(
+ p2pdma_state.mem, sg_phys(sg));
+ sg_dma_len(sg) = sg->length;
sg_dma_mark_bus_address(sg);
continue;
default:
Also, there is a minor resolution against Alex's tree, take both:
https://lore.kernel.org/all/20251201124340.335d7144@canb.auug.org.au/
Thanks,
Jason
The following changes since commit ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d:
Linux 6.18-rc7 (2025-11-23 14:53:16 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git tags/for-linus-iommufd
for you to fetch changes up to 5185c4d8a56b34f33cec574793047fcd2dba2055:
Merge branch 'iommufd_dmabuf' into k.o-iommufd/for-next (2025-11-26 14:04:10 -0400)
----------------------------------------------------------------
iommufd 6.19 pull request
- Expand IOMMU_IOAS_MAP_FILE to accept a DMABUF exported from VFIO. This
is the first step to broader DMABUF support in iommufd, right now it
only works with VFIO. This closes the last functional gap with classic
VFIO type 1 to safely support PCI peer to peer DMA by mapping the VFIO
device's MMIO into the IOMMU.
- Relax SMMUv3 restrictions on nesting domains to better support qemu's
sequence to have an identity mapping before the vSID is established.
----------------------------------------------------------------
Jason Gunthorpe (12):
PCI/P2PDMA: Document DMABUF model
vfio/nvgrace: Support get_dmabuf_phys
vfio/pci: Add vfio_pci_dma_buf_iommufd_map()
iommufd: Add DMABUF to iopt_pages
iommufd: Do not map/unmap revoked DMABUFs
iommufd: Allow a DMABUF to be revoked
iommufd: Allow MMIO pages in a batch
iommufd: Have pfn_reader process DMABUF iopt_pages
iommufd: Have iopt_map_file_pages convert the fd to a file
iommufd: Accept a DMABUF through IOMMU_IOAS_MAP_FILE
iommufd/selftest: Add some tests for the dmabuf flow
Merge branch 'iommufd_dmabuf' into k.o-iommufd/for-next
Leon Romanovsky (7):
PCI/P2PDMA: Separate the mmap() support from the core logic
PCI/P2PDMA: Simplify bus address mapping API
PCI/P2PDMA: Refactor to separate core P2P functionality from memory allocation
PCI/P2PDMA: Provide an access to pci_p2pdma_map_type() function
dma-buf: provide phys_vec to scatter-gather mapping routine
vfio/pci: Enable peer-to-peer DMA transactions by default
vfio/pci: Add dma-buf export support for MMIO regions
Nicolin Chen (1):
iommu/arm-smmu-v3-iommufd: Allow attaching nested domain for GBPA cases
Vivek Kasireddy (2):
vfio: Export vfio device get and put registration helpers
vfio/pci: Share the core device pointer while invoking feature functions
Documentation/driver-api/pci/p2pdma.rst | 97 +++--
block/blk-mq-dma.c | 2 +-
drivers/dma-buf/Makefile | 2 +-
drivers/dma-buf/dma-buf-mapping.c | 248 ++++++++++++
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 13 +-
drivers/iommu/dma-iommu.c | 4 +-
drivers/iommu/iommufd/io_pagetable.c | 78 +++-
drivers/iommu/iommufd/io_pagetable.h | 54 ++-
drivers/iommu/iommufd/ioas.c | 8 +-
drivers/iommu/iommufd/iommufd_private.h | 14 +-
drivers/iommu/iommufd/iommufd_test.h | 10 +
drivers/iommu/iommufd/main.c | 10 +
drivers/iommu/iommufd/pages.c | 414 ++++++++++++++++++---
drivers/iommu/iommufd/selftest.c | 143 +++++++
drivers/pci/p2pdma.c | 186 ++++++---
drivers/vfio/pci/Kconfig | 3 +
drivers/vfio/pci/Makefile | 1 +
drivers/vfio/pci/nvgrace-gpu/main.c | 52 +++
drivers/vfio/pci/vfio_pci.c | 5 +
drivers/vfio/pci/vfio_pci_config.c | 22 +-
drivers/vfio/pci/vfio_pci_core.c | 53 ++-
drivers/vfio/pci/vfio_pci_dmabuf.c | 350 +++++++++++++++++
drivers/vfio/pci/vfio_pci_priv.h | 23 ++
drivers/vfio/vfio_main.c | 2 +
include/linux/dma-buf-mapping.h | 17 +
include/linux/dma-buf.h | 11 +
include/linux/pci-p2pdma.h | 120 +++---
include/linux/vfio.h | 2 +
include/linux/vfio_pci_core.h | 46 +++
include/uapi/linux/iommufd.h | 10 +
include/uapi/linux/vfio.h | 28 ++
kernel/dma/direct.c | 4 +-
mm/hmm.c | 2 +-
tools/testing/selftests/iommu/iommufd.c | 43 +++
tools/testing/selftests/iommu/iommufd_utils.h | 44 +++
35 files changed, 1909 insertions(+), 212 deletions(-)
create mode 100644 drivers/dma-buf/dma-buf-mapping.c
create mode 100644 drivers/vfio/pci/vfio_pci_dmabuf.c
create mode 100644 include/linux/dma-buf-mapping.h
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists