RE: [PATCH v5 2/9] iommu: Replace sva_iommu with iommu_attach_handle

Tian, Kevin
2024-05-20T03:18:27Z

> From: Baolu Lu <baolu.lu@linux.intel.com>
> Sent: Sunday, May 19, 2024 6:14 PM
>
> On 5/15/24 3:21 PM, Tian, Kevin wrote:
> >> From: Lu Baolu <baolu.lu@linux.intel.com>
> >> Sent: Tuesday, April 30, 2024 10:57 PM
> >>
> >> #else
> >> -static inline struct iommu_sva *
> >> +static inline struct iommu_attach_handle *
> >> iommu_sva_bind_device(struct device *dev, struct mm_struct *mm)
> >> {
> >> - return NULL;
> >> + return ERR_PTR(-ENODEV);
> >> }
> >>
> >
> > this should be a separate fix.
>
> Yes. It could be a fix.
>
> >
> > existing drivers (idxd and uacce) only check IS_ERR() on the return
> > value. A Null pointer may lead to an error reported at a later point.
>
> Though I don't think it could cause any real problem because this
> interface should always be called after the sva enabling one.
>

correct.