Re: [PATCH 0/6] rust: iommu: add a paging domain abstraction
From: Jason Gunthorpe
Date: Thu Nov 19 2026 - 11:37:00 EST
On Thu, Nov 19, 2026 at 10:47:01AM -0500, Nicolas Dufresne wrote:
> Le jeudi 19 novembre 2026 à 11:08 -0400, Jason Gunthorpe a écrit :
> > On Thu, Nov 19, 2026 at 09:52:59AM -0500, Nicolas Dufresne wrote:
> > > Le jeudi 19 novembre 2026 à 10:31 -0400, Jason Gunthorpe a écrit :
> > > > With the additional twist that alot of embedded HW has apparently
> > > > choosen to not implement SSID but instead has a pool of SIDs that one
> > > > device can use, functionally similar to SSID.
> > > >
> > > > We'd need also API support for unbundling the DT iommus=[] SID list
> > > > into something that the SIDs can be attached more like a PASID. That
> > > > need, I think, has become clear with all the DT tricks and fake busses
> > > > to try to work around this issue. :|
> > >
> > > The word "fake" never flies with the DT maintainers. On that subject, I still
> > > don't know what you mean with iommus=[].
> >
> > When you write your DT you can list all the iommu streams in one
> > iommus property. Like this randomly picked out of the DT files:
> >
> > iommus = <&sysmmu_decon0x>, <&sysmmu_decon1x>;
> >
> > If you do that then Linux sets the struct device containing it to
> > put the same paging domain on all of those iommus.
> >
> > It doesn't make any sense to open code this in drivers when you can
> > just have the core code do it by writing your DT to match how the
> > driver wants to work...
>
> The will be rejected, as it does not map the hardware. If you check multi-core
> codecs, each pair of core+iommu are independent from each other, at least enough
> that they could be driven by different device drivers. And so they have been
> described separately in the DTs. I don't see a fault here.
All these multi-stream things have a choice how you model them in DT,
both ways are "describing the HW". Fully seperate HW blocks with
multiple struct devices or a single struct device with a list of
sub-engines. IMHO neither is obviously more correctly "describing the
HW" than the other.
However, the DT choice strongly influences how Linux works and drives
certain behaviors inside the kernel. So it is not just describing the
HW, it is very strongly describing the SW model too :(
Choosing the opposite DT model to what the kernel driver wants and
then undoing it with a bunch of code in Linux is not nice. We have run
into trouble when people go down this path and start asking for new
APIs we don't want to give them. :(
We had this chat with the DT maintiners too, I think everyone agrees
things are imperfect here. So far the direction has been to change the
DT to match the desired kernel SW model rather than hack the kernel to
accomodate the DT.
If you truely have HW with frozen DT in firmware then maybe that is a
strong argument to push back in this case.
I recognize this is all imperfect/problematic :|
Jason