From: Daniel Almeida <daniel.almeida@collabora.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: "Jason Gunthorpe" <jgg@ziepe.ca>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"Abdiel Janulgue" <abdiel.janulgue@gmail.com>,
iommu@lists.linux.dev, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
"Detlev Casanova" <detlev.casanova@collabora.com>
Subject: Re: [PATCH 0/6] rust: iommu: add a paging domain abstraction
Date: Wed, 18 Nov 2026 12:55:49 -0300 [thread overview]
Message-ID: <42134022-AFBD-49E0-9AE5-0C5885F6C71D@collabora.com> (raw)
In-Reply-To: <b145b2ceb92c73a4fa0477d7b3895a6e3b4adf99.camel@collabora.com>
>
>>
>>> 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
next prev parent reply other threads:[~2026-11-18 15:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 17:00 Daniel Almeida
2026-11-12 17:00 ` [PATCH 1/6] rust: iommu: move the protection flags to the module root Daniel Almeida
2026-11-12 17:00 ` [PATCH 2/6] rust: scatterlist: make SGTable::as_raw() visible to the crate Daniel Almeida
2026-11-12 17:00 ` [PATCH 3/6] rust: iommu: add the paging domain abstraction Daniel Almeida
2026-11-12 17:00 ` [PATCH 4/6] rust: iommu: add Domain::attach() Daniel Almeida
2026-11-16 21:54 ` Detlev Casanova
2026-11-12 17:00 ` [PATCH 5/6] rust: iommu: add Domain::map() Daniel Almeida
2026-11-12 17:00 ` [PATCH 6/6] rust: iommu: add Domain::with_fault_handler() Daniel Almeida
2026-11-16 19:38 ` [PATCH 0/6] rust: iommu: add a paging domain abstraction Jason Gunthorpe
2026-11-17 20:09 ` Daniel Almeida
2026-11-17 20:20 ` Jason Gunthorpe
2026-11-18 15:25 ` Nicolas Dufresne
2026-11-18 15:55 ` Daniel Almeida [this message]
2026-11-16 21:54 ` Detlev Casanova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42134022-AFBD-49E0-9AE5-0C5885F6C71D@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=a.hindborg@kernel.org \
--cc=abdiel.janulgue@gmail.com \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=detlev.casanova@collabora.com \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=ojeda@kernel.org \
--cc=robin.murphy@arm.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=will@kernel.org \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®