Re: [PATCH V2 01/11] iommufd: Support a HWPT without an iommu driver for noiommu

Jason Gunthorpe
2026-03-23T13:17:19Z

On Wed, Mar 18, 2026 at 06:38:14PM +0000, Samiullah Khawaja wrote:

> > +static const struct iommu_domain_ops noiommu_amdv1_ops = {
> > + IOMMU_PT_DOMAIN_OPS(amdv1),
>
> I understand that this fits in really well into the iommufd/hwpt
> construction, but do we need page tables for this as all the
> iova-to-phys information should be available in the IOPT in IOAS?

Yes we do! That is the whole point.

In iommufd once you pin the memory the phys is stored in only two
possible ways:

1) Inside an xarray if an access is used
2) Inside at least one iommu_domain

That's it. So to fit noiommu into this scheme, and have it rely on the
existing pinning, we either have to make it use an access or make it
use an iommu_domain -> a real one that can store phys.

Maybe a comment is helpful, but using the domain like this to store
the pinned phys has been the vfio design from day 1..

> get_pa() function introduced in the later patch is only used for noiommu
> use-cases, it can use the IOPT to get the physical addresses?

No.

Jason