Merge branch 'nesting_reserved_regions' into iommufd.git for-next
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 27 Aug 2024 14:13:56 +0000 (11:13 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 27 Aug 2024 14:13:56 +0000 (11:13 -0300)
commit76889bbaabf5cab981a74ed69cb3816921edc5d4
treeed31de4f6682b7069475539b69d2f263108924b0
parent79ea4a496ab5c970a3a793d863ed8893b1af107c
parentb2f44814680b569be98e58111bd582fd3a689d4d
Merge branch 'nesting_reserved_regions' into iommufd.git for-next

Nicolin Chen says:

=========
IOMMU_RESV_SW_MSI is a unique region defined by an IOMMU driver. Though it
is eventually used by a device for address translation to an MSI location
(including nested cases), practically it is a universal region across all
domains allocated for the IOMMU that defines it.

Currently IOMMUFD core fetches and reserves the region during an attach to
an hwpt_paging. It works with a hwpt_paging-only case, but might not work
with a nested case where a device could directly attach to a hwpt_nested,
bypassing the hwpt_paging attachment.

Move the enforcement forward, to the hwpt_paging allocation function. Then
clean up all the SW_MSI related things in the attach/replace routine.
=========

Based on v6.11-rc5 for dependencies.

* nesting_reserved_regions: (562 commits)
  iommufd/device: Enforce reserved IOVA also when attached to hwpt_nested
  Linux 6.11-rc5
  ...
drivers/iommu/iommufd/device.c
drivers/iommu/iommufd/iommufd_private.h
drivers/iommu/iommufd/selftest.c