Re: [PATCH v7 15/16] iommufd: Allow vIOMMUs without a parent HWPT

From: Jason Gunthorpe

Date: Wed Oct 28 2026 - 15:26:57 EST


> VIOMMU_ALLOC currently requires a nesting parent HWPT_PAGING even when
> the selected vIOMMU implementation has no use for one. This would force
> implementations such as the following Arm Realm vIOMMU to create an
> unused parent.
>
> Add IOMMUFD_VIOMMU_NO_HWPT so an implementation can opt out. Require
> hwpt_id to be zero in that case and pass a NULL parent domain to its
> initialization callback. Keep the existing parent validation and
> reference handling for implementations that require a HWPT.
>
> Reject nested domain and hardware queue allocation for a vIOMMU without
> a parent, and document the two allocation modes in the UAPI.
>
> Cc: jgg@xxxxxxxx
> Cc: kevin.tian@xxxxxxxxx
> Cc: corbet@xxxxxxx
> Cc: skhan@xxxxxxxxxxxxxxxxxxx
> Cc: rdunlap@xxxxxxxxxxxxx
> Cc: joro@xxxxxxxxxx
> Cc: will@xxxxxxxxxx
> Cc: robin.murphy@xxxxxxx
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@xxxxxxxxxx>
> ---
> Documentation/userspace-api/iommufd.rst | 44 +++++++++----------
> drivers/iommu/iommufd/hw_pagetable.c | 14 +++++--
> drivers/iommu/iommufd/viommu.c | 56 +++++++++++++++----------
> include/linux/iommufd.h | 13 ++++--
> include/uapi/linux/iommufd.h | 3 +-
> 5 files changed, 77 insertions(+), 53 deletions(-)
>

I should check it carefully but this looks reasonable

--
Jason