iommu: Remove iommu_[un]register_device_fault_handler()
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 12 Feb 2024 01:22:17 +0000 (09:22 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 16 Feb 2024 14:19:24 +0000 (15:19 +0100)
commit1ff25d798e52943d037accf15c675a6845d9776f
tree86079d678419f73e4d8b55dee736e72bd1fd8fd7
parent15fc60cdd2d236a73b32c99d21fc0f7b7ce6cbbb
iommu: Remove iommu_[un]register_device_fault_handler()

The individual iommu driver reports the iommu page faults by calling
iommu_report_device_fault(), where a pre-registered device fault handler
is called to route the fault to another fault handler installed on the
corresponding iommu domain.

The pre-registered device fault handler is static and won't be dynamic
as the fault handler is eventually per iommu domain. Replace calling
device fault handler with iommu_queue_iopf().

After this replacement, the registering and unregistering fault handler
interfaces are not needed anywhere. Remove the interfaces and the related
data structures to avoid dead code.

Convert cookie parameter of iommu_queue_iopf() into a device pointer that
is really passed.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Yan Zhao <yan.y.zhao@intel.com>
Tested-by: Longfang Liu <liulongfang@huawei.com>
Link: https://lore.kernel.org/r/20240212012227.119381-7-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
drivers/iommu/intel/iommu.c
drivers/iommu/io-pgfault.c
drivers/iommu/iommu-sva.h
drivers/iommu/iommu.c
include/linux/iommu.h