iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: iommu@lists.linux.dev, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Kevin Tian <kevin.tian@intel.com>
Subject: [GIT PULL] Please pull IOMMUFD subsystem changes
Date: Tue, 2 Dec 2025 13:50:46 -0400	[thread overview]
Message-ID: <20251202175046.GA1155873@nvidia.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 6508 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

             reply	other threads:[~2025-12-02 17:50 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 17:50 Jason Gunthorpe [this message]
2025-12-05  3:01 ` [GIT PULL] Please pull IOMMUFD subsystem changes pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2025-11-25 15:09 Jason Gunthorpe
2025-11-25 16:38 ` pr-tracker-bot
2025-11-07 18:51 Jason Gunthorpe
2025-11-07 21:21 ` pr-tracker-bot
2025-10-02 14:29 Jason Gunthorpe
2025-10-04  1:40 ` pr-tracker-bot
2025-09-22 14:33 Jason Gunthorpe
2025-09-22 18:27 ` pr-tracker-bot
2025-08-22 14:21 Jason Gunthorpe
2025-08-22 21:28 ` pr-tracker-bot
2025-07-30 18:47 Jason Gunthorpe
2025-07-31 20:01 ` pr-tracker-bot
2025-07-02 14:14 Jason Gunthorpe
2025-07-02 17:06 ` pr-tracker-bot
2025-03-31 16:12 Jason Gunthorpe
2025-04-02  1:50 ` pr-tracker-bot
2025-01-23 16:59 Jason Gunthorpe
2025-01-24 21:45 ` pr-tracker-bot
2024-12-05 18:44 Jason Gunthorpe
2024-12-05 23:08 ` pr-tracker-bot
2024-11-20 14:53 Jason Gunthorpe
2024-11-21 21:20 ` pr-tracker-bot
2024-09-23 17:45 Jason Gunthorpe
2024-09-24 19:36 ` pr-tracker-bot
2024-08-20 22:48 Jason Gunthorpe
2024-08-20 23:52 ` pr-tracker-bot
2024-07-17 18:46 Jason Gunthorpe
2024-07-19 18:09 ` pr-tracker-bot
2024-04-19 17:29 Jason Gunthorpe
2024-04-19 21:07 ` pr-tracker-bot
2024-03-02  0:08 Jason Gunthorpe
2024-03-02  1:31 ` pr-tracker-bot
2024-02-22 13:23 Jason Gunthorpe
2024-02-22 20:03 ` pr-tracker-bot
2024-01-12 17:49 Jason Gunthorpe
2024-01-18 23:35 ` pr-tracker-bot
2023-12-04 19:35 Jason Gunthorpe
2023-12-04 21:59 ` pr-tracker-bot
2023-10-31 13:14 Jason Gunthorpe
2023-11-02  2:51 ` pr-tracker-bot
2023-08-30 23:40 Jason Gunthorpe
2023-08-31  3:50 ` pr-tracker-bot
2023-08-31  3:59 ` Linus Torvalds
2023-08-31 16:43   ` Jason Gunthorpe
2023-07-28 13:48 Jason Gunthorpe
2023-07-28 18:39 ` pr-tracker-bot
2023-06-28 14:04 Jason Gunthorpe
2023-06-30  4:16 ` pr-tracker-bot
2023-04-25 14:46 Jason Gunthorpe
2023-04-27 17:15 ` pr-tracker-bot
2023-04-06 13:34 Jason Gunthorpe
2023-04-06 18:46 ` pr-tracker-bot
2023-02-21 15:39 Jason Gunthorpe
2023-02-24 22:50 ` Linus Torvalds
2023-02-25  0:02   ` Jason Gunthorpe
2023-02-25  0:50     ` Linus Torvalds
2023-02-24 23:27 ` pr-tracker-bot
2022-12-12 18:30 Jason Gunthorpe
2022-12-14 18:04 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251202175046.GA1155873@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).