Re: [PATCH 0/6] rust: iommu: add a paging domain abstraction
From: Daniel Almeida
Date: Wed Nov 18 2026 - 10:56:47 EST
>
>>
>>> The fault handler is used in the same way it is used in GPU drivers: to kill
>>> sessions if they fault. This way the driver can simply refuse further work from
>>> a misbehaving client, for example. It is also the natural place to enqueue a
>>> reset if the codec hardware is frozen as a result of the fault.
>>
>> IIRC no GPU driver does that, they hook the obsolete fault handler not
>> supported in new iommu drivers not the new PRI based one... IDK we
>> have even wired this up to work this way.
>>
>> It is nicer if the HW can tell you it faulted rather than expect the
>> iommu to do it.
>
> We most likely don't need that, and should drop it from this series. We have
> never used the fault handler in any linux-media codec in the past, the HW would
> always endup producing an IRQ with a error or a timeout. Using the fault handler
> would probably be a bit racy too. Pausing work from a faulty source though isn't
> a bad idea, but more of a nice future addition, assuming it can work in a non-
> racy way.
>
> Nicolas
I am still collecting my thoughts to reply to Jason, but I don't see why we
wouldn't want a fault handler. For example this:
> IIRC no GPU driver does that, they hook the obsolete fault handler not
> supported in new iommu drivers not the new PRI based one... IDK we have even
> wired this up to work this way.
Perhaps does not account for the fact that the fault handler in Mali doesn't go
through the iommu subsystem, but there is a fault handler. Not only did I write
the handler, I also had to use it constantly as tyr initially faulted all the
time :/
Also, saying that a handler was never used in media is not a good argument,
IMHO. Yes, eventually the decoder reports some error, but this is orthogonal to
knowing whether someone is trying to access invalid memory. And if you know
that, you can prevent further invalid accesses before they bring the whole
thing down. Quite often I had to reboot the whole machine because the hardware
was perpetually stuck, and if the objective is having all the users of the
encoder play nice together, then this is not very ideal.
This is not unlike my time reverse engineering the NVIDIA codec hardware:
nouveau would complain on faults and kill the channel too.
What I am trying to say is: if the argument is "not all iommu drivers properly
support fault handlers", then perhaps I can vonlunteer to fix this in the C
code, if they want it and if a "fix" is technically feasible(?). But the overall
desire to kill a faulting user is something we could definitely use, and the
remaining question is whether this is possible via the iommu API.
— Daniel