Hi, On 10/23/18 12:48 AM, Jordan Crouse wrote:
On Fri, Oct 19, 2018 at 07:11:52PM +0100, Jean-Philippe Brucker wrote:(2) Allocate a domain and attach it to the device. dom = iommu_domain_alloc() iommu_attach_device(dom, dev) I still have concerns about this part, which are highlighted by the messy changes of patch 1. I think it would make more sense to introduce new attach/detach_dev_aux() functions instead of reusing attach/detach_dev() Can we reconsider this and avoid unnecessary complications in IOMMU core and drivers? Does the VFIO code greatly benefit from using the same attach() function? It could as well use a different one for devices in AUXD mode, which the mediating driver could tell by adding a flag in mdev_set_iommu_device(), for example. And I don't think other users of AUXD would benefit from using the same attach() function, since they will know whether they want to be using main or auxiliary domain when doing attach().I second this. For the arm-smmu-v2 multiple-pagetable model we would either need new API functions or do something along the lines of dom = iommu_domain_alloc() iommu_set_attr(dom, DOMAIN_ATTR_I_WANT_TO_BE_AUX) iommu_attach_device(dom,dev) Either that or do some some dummy device magic that I haven't started to work out in my head. Having aux specific functions just for this step would make the arm-smmu-v2 version work out much cleaner.
Okay! If there are no more comments, I will prepare a new version with aux specific functions. Best regards, Lu Baolu _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
