On Wed, Feb 11, 2026 at 09:14:33AM -0800, Shameer Kolothum Thodi wrote:
> > > Have you considered extending attach_hwpt() to
> > >take a PASID instead of introducing a separate callback?
> > 
> > Yes, I did. To extending attach/detach_hwpt(), we need to add two
> > parameters, "bool has_pasid, uint32_t pasid". E.g.,
> > 
> >     bool (*attach_hwpt)(HostIOMMUDeviceIOMMUFD *idev,
> >                                          bool has_pasid, uint32_t pasid,
> >                                          uint32_t hwpt_id, Error **errp);

The RID attach/detach could be just pasid=IOMMU_NO_PASID without
that "has_pasid"?

> > and refactor iommufd_cdev_attach/detach_ioas_hwpt() a bit.
> > 
> > I'm fine either way, two separate callbacks just look cleaner for me.
> > Let me know if extending is preferred.
> 
> Since PASID attach/detach is essentially an extension of the existing
> attach/detach flow, I would prefer extending the current callbacks.
> I think that keeps the interface simpler and avoids code duplication.

+1

Nicolin

Reply via email to