Thread (15 messages) 15 messages, 4 authors, 2025-11-20

Re: [PATCH v2 3/3] iommu: Allow drivers to say if they use report_iommu_fault()

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-11-18 19:00:28
Also in: linux-arm-msm, linux-iommu, linux-mediatek, linux-patches, linux-rdma, linux-rockchip, linux-sunxi

On Tue, Nov 18, 2025 at 09:30:29AM +0800, Chaoyi Chen wrote:
Hello Jason,

On 11/7/2025 4:34 AM, Jason Gunthorpe wrote:
quoted
report_iommu_fault() is an older API that has been superseded by
iommu_report_device_fault() which is capable to support PRI.

Only two external drivers consume this, drivers/remoteproc and
drivers/gpu/drm/msm. Ideally they would move over to the new APIs, but for
now protect against accidentally mix and matching the wrong components.

The iommu drivers support either the old iommu_set_fault_handler() via the
driver calling report_iommu_fault(), or they are newer server focused
drivers that call iommu_report_device_fault().

Include a flag in the iommu_ops if the driver calls report_iommu_fault()
and block iommu_set_fault_handler() for domain's of iommu drivers that
can't support it.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Sorry for the noise. Sometimes non-IOMMU drivers, such as DRM
devices, also want to handle IOMMU fault events, so they might use
iommu_set_fault_handler() before. What API should they use as an
alternative now?
The new flow is through iommu_report_device_fault() which an end user
can access by setting domain->iopf_handler currently.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help