Re: [PATCH v7 1/6] iommufd: Support a HWPT without an iommu driver for noiommu

From: Jacob Pan

Date: Wed Jun 03 2026 - 13:14:20 EST


Hi Kevin,

On Wed, 3 Jun 2026 06:30:57 +0000
"Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:

> > From: Jacob Pan <jacob.pan@xxxxxxxxxxxxxxxxxxx>
> > Sent: Wednesday, June 3, 2026 1:45 PM
> >
> > +static const struct iommu_ops *get_iommu_ops(struct iommufd_device
> > *idev)
> > +{
> > + if (IS_ENABLED(CONFIG_IOMMUFD_NOIOMMU) && !idev->igroup-
> > >group)
> > + return &iommufd_noiommu_ops;
> > + if (WARN_ON_ONCE(!idev->dev->iommu))
> > + return NULL;
> > + return dev_iommu_ops(idev->dev);
> > +}
>
> Sashiko gave a valid comment:
>
> "
> While get_iommu_ops() correctly handles NO-IOMMU devices for
> hw_pagetable allocations, do the vIOMMU and vDevice allocation paths
> also need similar protection against NULL pointer dereferences?
> "
>
right, will fix in v8.

> with that fixed:
>
> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>