> -----Original Message-----
> From: Duan, Zhenzhong <[email protected]>
> Sent: 11 February 2026 10:38
> To: Shameer Kolothum Thodi <[email protected]>; qemu-
> [email protected]
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Jason Gunthorpe
> <[email protected]>; Nicolin Chen <[email protected]>;
> [email protected]; [email protected]; Tian, Kevin
> <[email protected]>; Liu, Yi L <[email protected]>; Hao, Xudong
> <[email protected]>
> Subject: RE: [RFC PATCH 01/14] backends/iommufd: Add pasid attach/detach
> callbacks

[...]

> > 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);
> 
> 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.

Thanks,
Shameer

Reply via email to