kvm.vger.kernel.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: Wed, 30 Jul 2025 15:47:34 -0300	[thread overview]
Message-ID: <20250730184734.GA179487@nvidia.com> (raw)

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

Hi Linus,

This PR broadly brings the assigned HW command queue support to
iommufd. This feature is used to improve SVA performance in VMs by
avoiding paravirtualization traps during SVA invalidations.

Along the way I think some of the core logic is in a much better state
to support future driver backed features.

Thanks,
Jason

The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:

  Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)

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 2c78e74493d33b002312296fbab1d688bfd0f76f:

  iommu/arm-smmu-v3: Replace vsmmu_size/type with get_viommu_size (2025-07-28 12:07:50 -0300)

----------------------------------------------------------------
iommufd 6.17 merge window pull

- IOMMU HW now has features to directly assign HW command queues to a
  guest VM. In this mode the command queue operates on a limited set of
  invalidation commands that are suitable for improving guest invalidation
  performance and easy for the HW to virtualize.

  This PR brings the generic infrastructure to allow IOMMU drivers to
  expose such command queues through the iommufd uAPI, mmap the doorbell
  pages, and get the guest physical range for the command queue ring
  itself.

- An implementation for the NVIDIA SMMUv3 extension "cmdqv" is built on
  the new iommufd command queue features. It works with the existing SMMU
  driver support for cmdqv in guest VMs.

- Many precursor cleanups and improvements to support the above cleanly,
  changes to the general ioctl and object helpers, driver support for
  VDEVICE, and mmap pgoff cookie infrastructure.

- Sequence VDEVICE destruction to always happen before VFIO device
  destruction. When using the above type features, and also in future
  confidential compute, the internal virtual device representation becomes
  linked to HW or CC TSM configuration and objects. If a VFIO device is
  removed from iommufd those HW objects should also be cleaned up to
  prevent a sort of UAF. This became important now that we have HW backing
  the VDEVICE.

- Fix one syzkaller found error related to math overflows during iova
  allocation

----------------------------------------------------------------
Arnd Bergmann (1):
      iommu/tegra241-cmdqv: import IOMMUFD module namespace

Jason Gunthorpe (2):
      iommufd: Prevent ALIGN() overflow
      iommufd/selftest: Test reserved regions near ULONG_MAX

Nicolin Chen (46):
      iommufd: Apply obvious cosmetic fixes
      iommufd: Drop unused ictx in struct iommufd_vdevice
      iommufd: Use enum iommu_viommu_type for type in struct iommufd_viommu
      iommufd: Use enum iommu_veventq_type for type in struct iommufd_veventq
      iommufd: Return EOPNOTSUPP for failures due to driver bugs
      iommu: Introduce get_viommu_size and viommu_init ops
      iommufd/viommu: Support get_viommu_size and viommu_init ops
      iommufd/selftest: Drop parent domain from mock_iommu_domain_nested
      iommufd/selftest: Replace mock_viommu_alloc with mock_viommu_init
      iommu/arm-smmu-v3: Replace arm_vsmmu_alloc with arm_vsmmu_init
      iommu: Deprecate viommu_alloc op
      iommufd: Move _iommufd_object_alloc out of driver.c
      iommufd: Introduce iommufd_object_alloc_ucmd helper
      iommufd: Apply the new iommufd_object_alloc_ucmd helper
      iommufd: Report unmapped bytes in the error path of iopt_unmap_iova_range
      iommufd: Correct virt_id kdoc at struct iommu_vdevice_alloc
      iommufd/viommu: Explicitly define vdev->virt_id
      iommu: Use enum iommu_hw_info_type for type in hw_info op
      iommu: Add iommu_copy_struct_to_user helper
      iommu: Pass in a driver-level user data structure to viommu_init op
      iommufd/viommu: Allow driver-specific user data for a vIOMMU object
      iommufd/selftest: Support user_data in mock_viommu_alloc
      iommufd/selftest: Add coverage for viommu data
      iommufd/access: Add internal APIs for HW queue to use
      iommufd/access: Bypass access->ops->unmap for internal use
      iommufd/viommu: Add driver-defined vDEVICE support
      iommufd/viommu: Introduce IOMMUFD_OBJ_HW_QUEUE and its related struct
      iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl
      iommufd/driver: Add iommufd_hw_queue_depend/undepend() helpers
      iommufd/selftest: Add coverage for IOMMUFD_CMD_HW_QUEUE_ALLOC
      iommufd: Add mmap interface
      iommufd/selftest: Add coverage for the new mmap interface
      Documentation: userspace-api: iommufd: Update HW QUEUE
      iommu: Allow an input type in hw_info op
      iommufd: Allow an input data_type via iommu_hw_info
      iommufd/selftest: Update hw_info coverage for an input data_type
      iommu/arm-smmu-v3-iommufd: Add vsmmu_size/type and vsmmu_init impl ops
      iommu/arm-smmu-v3-iommufd: Add hw_info to impl_ops
      iommu/tegra241-cmdqv: Use request_threaded_irq
      iommu/tegra241-cmdqv: Simplify deinit flow in tegra241_cmdqv_remove_vintf()
      iommu/tegra241-cmdqv: Do not statically map LVCMDQs
      iommu/tegra241-cmdqv: Add user-space use support
      iommu/tegra241-cmdqv: Add IOMMU_VEVENTQ_TYPE_TEGRA241_CMDQV support
      iommufd: Do not allow _iommufd_object_alloc_ucmd if abort op is set
      iommu/arm-smmu-v3: Do not bother impl_ops if IOMMU_VIOMMU_TYPE_ARM_SMMUV3
      iommu/arm-smmu-v3: Replace vsmmu_size/type with get_viommu_size

Xu Yilun (8):
      iommufd/viommu: Roll back to use iommufd_object_alloc() for vdevice
      iommufd: Add iommufd_object_tombstone_user() helper
      iommufd: Add a pre_destroy() op for objects
      iommufd: Destroy vdevice on idevice destroy
      iommufd/vdevice: Remove struct device reference from struct vdevice
      iommufd/selftest: Explicitly skip tests for inapplicable variant
      iommufd/selftest: Add coverage for vdevice tombstone
      iommufd: Rename some shortterm-related identifiers

 Documentation/userspace-api/iommufd.rst            |  12 +
 .../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c    |  70 ++-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |  17 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h        |  33 +-
 drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c     | 493 ++++++++++++++++++-
 drivers/iommu/intel/iommu.c                        |   7 +-
 drivers/iommu/iommufd/device.c                     | 143 +++++-
 drivers/iommu/iommufd/driver.c                     | 113 +++--
 drivers/iommu/iommufd/eventq.c                     |  14 +-
 drivers/iommu/iommufd/hw_pagetable.c               |  10 +-
 drivers/iommu/iommufd/io_pagetable.c               |  57 ++-
 drivers/iommu/iommufd/io_pagetable.h               |   5 +-
 drivers/iommu/iommufd/iommufd_private.h            | 135 ++++-
 drivers/iommu/iommufd/iommufd_test.h               |  20 +
 drivers/iommu/iommufd/iova_bitmap.c                |   1 -
 drivers/iommu/iommufd/main.c                       | 206 +++++++-
 drivers/iommu/iommufd/pages.c                      |  21 +-
 drivers/iommu/iommufd/selftest.c                   | 207 ++++++--
 drivers/iommu/iommufd/viommu.c                     | 309 +++++++++++-
 include/linux/iommu.h                              |  74 ++-
 include/linux/iommufd.h                            | 196 +++++++-
 include/uapi/linux/iommufd.h                       | 154 +++++-
 tools/testing/selftests/iommu/iommufd.c            | 541 +++++++++++++--------
 tools/testing/selftests/iommu/iommufd_fail_nth.c   |  15 +-
 tools/testing/selftests/iommu/iommufd_utils.h      |  89 +++-
 25 files changed, 2436 insertions(+), 506 deletions(-)

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

             reply	other threads:[~2025-07-30 18:47 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 18:47 Jason Gunthorpe [this message]
2025-07-31 20:01 ` [GIT PULL] Please pull IOMMUFD subsystem changes pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2025-08-22 14:21 Jason Gunthorpe
2025-08-22 21:28 ` 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=20250730184734.GA179487@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).