To extend the feature of vfio-mdev
jean-philippe.brucker at arm.com
Mon Oct 23 19:31:25 AEDT 2017
On 23/10/17 06:18, Kenneth Lee wrote:
>>>>> 3. Let iommu driver accept more than one iommu_domain for the same
>>>>> device. The substream id or pasid should be support for that
>>>> You're really extending the definition of an iommu_domain to include
>>>> PASID to do this, I don't think it makes sense in the general case. So
>>>> perhaps you're talking about a PASID management layer sitting on top of
>>>> an iommu_domain. AIUI for PCIe, a device has a requester ID which is
>>>> used to find the context entry for that device. The IOMMU may support
>>>> PASID, which would cause a first level lookup via those set of page
>>>> tables, or it might only support second level translation. The
>>>> iommu_domain is a reflection of that initial, single requester ID.
>>> Maybe I misunderstand this. But the IOMMU hardware, such as SMMU for ARM,
>>> support multiple page table and is referred by something like ASID. If we should
>>> support it in Linux, iommu_domain should be the best choice (no matter you call
>>> it cookie or id or something else). Or where you can get a object referring to it?
>> For PASID, a PASID is unique only within the requester ID. I don't
>> know of anything equivalent to your ASID within PCIe.
> As my understanding to the ARM Spec:
In the SMMUv3 spec, the PASID is dissociated from the ASID. We set the
ASID in the context descriptor indexed by PASID, which provides more
flexibility when the CPU's ASID capacity and endpoint's PASID capacity differ.
> For ARM SMMU, the Stream ID is used to index a Context Descriptors
> Table while and Sub-stream ID is used to index a Descriptor which refer
> to a general page table in the same format as MMU.
> So both RequestID and PASID uniquely identify a address space. Then
> every iommu-enabled device can service more than one user process at the
> same time.
> So the IOMMU should support more than one page table, which in turn
> should be added to somewhere in Linux. If the iommu_domain refer to one
> address space, the iommu driver should accept more than one
The current design choice is to have multiple address space per
iommu_domain (and one PASID table per domain). It fits better with
existing IOMMU and VFIO APIs.
More information about the Linux-accelerators