RE: [PATCH 6/7] iommu: Use right way to retrieve iommu_ops

From: Tian, Kevin
Date: Mon Jan 24 2022 - 22:15:42 EST


> From: Jason Gunthorpe via iommu
> Sent: Tuesday, January 25, 2022 1:37 AM
> > @@ -1295,7 +1298,7 @@ int iommu_page_response(struct device *dev,
> > msg->pasid = 0;
> > }
> >
> > - ret = domain->ops->page_response(dev, evt, msg);
> > + ret = ops->page_response(dev, evt, msg);
> > list_del(&evt->list);
> > kfree(evt);
> > break;
>
> Feels weird that page_response is not connected to a domain, the fault
> originated from a domain after all. I would say this op should be
> moved to the domain and the caller should provide the a pointer to the
> domain that originated the fault.
>

In concept yes.

But currently the entire sva path is not associated with domain. This was
one mistake as we discussed in the cover letter. Before extending iommu
domain to cover CPU page tables we may have to leave it in iommu_ops
given this series is just for cleanup...

Thanks
Kevin