Hi, On Wed, Nov 07, 2018 at 11:40:30AM +0800, Lu Baolu wrote: > Hi Joerg, > > On 11/7/18 12:25 AM, j...@8bytes.org wrote: > Nowadays, we can find PASID granular DMA translation on both ARM and x86 > platforms. With PASID granular DMA translation supported in system iommu, if > a device divides itself into multiple subsets and tag the DMA > transfers of each subset with a unique PASID, each subset become > assignable. We call the assignable subset as an ADI (Assignable Device > Interface). As the result, each ADI could be attached with a domain.
Yeah, I know the background. The point is, the IOMMU-API as of today implements a strict one-to-one relationship between domains and devices, every device can only have one domain assigned at a given time. If we assign a new domain to a device, the old gets unassigned. If we allow to attach multiple domains to a single device we fundamentally break that semantic. Therefore I think it is better is support the ADI devices with subdomains and a new set of functions in the API to handle only these sub-domains. > Further more, a single domain might be attached to an ADI of device A, > while attached to another legacy device B which doesn't support PASID > features. In this case, we say "Domain 4" is attached to ADI(PASID#x) in > aux mode and attached to device B in primary mode. This will of course not work with subdomains, but is that really necessary? VFIO already allocates a separate domain for each device anyway (iirc), so it is unlikely that is uses the same domain for a legacy and an ADI device. Regards, Joerg _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu