[PATCH v2 3/3] iommu: Allow drivers to say if they use report_iommu_fault()
Jason Gunthorpe
jgg at nvidia.com
Tue Nov 18 11:00:21 PST 2025
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:
> > 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 at linux.intel.com>
> > Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> > Reviewed-by: Vasant Hegde <vasant.hegde at amd.com>
> > Reviewed-by: Kevin Tian <kevin.tian at 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
More information about the Linux-rockchip
mailing list