]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommufd: Associate fault object with iommufd_hw_pgtable
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 2 Jul 2024 06:34:42 +0000 (14:34 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 9 Jul 2024 16:54:32 +0000 (13:54 -0300)
commit34765cbc679c59ea5d952d738d2d16bf4aadc497
treed1a35f549ab08bdd17e96bfb640bf0d0000d40ba
parentb7d8833677baad8c80ed1aac8c396d687e64a376
iommufd: Associate fault object with iommufd_hw_pgtable

When allocating a user iommufd_hw_pagetable, the user space is allowed to
associate a fault object with the hw_pagetable by specifying the fault
object ID in the page table allocation data and setting the
IOMMU_HWPT_FAULT_ID_VALID flag bit.

On a successful return of hwpt allocation, the user can retrieve and
respond to page faults by reading and writing the file interface of the
fault object.

Once a fault object has been associated with a hwpt, the hwpt is
iopf-capable, indicated by hwpt->fault is non NULL. Attaching,
detaching, or replacing an iopf-capable hwpt to an RID or PASID will
differ from those that are not iopf-capable.

Link: https://lore.kernel.org/r/20240702063444.105814-9-baolu.lu@linux.intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/fault.c
drivers/iommu/iommufd/hw_pagetable.c
drivers/iommu/iommufd/iommufd_private.h
include/uapi/linux/iommufd.h