Re: [PATCH 2/5] iommu: Add domain_alloc_identity()

Jason Gunthorpe
2025-02-12T14:03:21Z

On Wed, Feb 12, 2025 at 01:56:55PM +0000, Robin Murphy wrote:
> On 2025-02-07 2:46 pm, Jason Gunthorpe wrote:
> > virtio-iommu has a mode where the IDENTITY domain is actually a paging
> > domain with an identity mapping covering some of the system address
> > space manually created.
> >
> > To support this add a new domain_alloc_identity() op that accepts
> > the struct device so that virtio can allocate and fully finalize a
> > paging domain to return.
>
> Oh, I'd already managed to forget this idea - this could be convenient for
> DART to implement per-instance identity domain support as well.

If we are going to broaden this someday then I suggest the core code should
implement it entirely buy asking the driver for a paging domain and
then mapping all of system memory into it. There is nothing special
here that needs to be in driver code.

Jason