Hi,
On 23/05/18 10:38, Xu Zaibo wrote:
+static int vfio_iommu_bind_group(struct vfio_iommu *iommu,
+A A A A A A A A A A A A A A A A struct vfio_group *group,
+A A A A A A A A A A A A A A A A struct vfio_mm *vfio_mm)
+{
+A A A int ret;
+A A A bool enabled_sva = false;
+A A A struct vfio_iommu_sva_bind_data data = {
+A A A A A A A .vfio_mmA A A = vfio_mm,
+A A A A A A A .iommuA A A A A A A = iommu,
+A A A A A A A .countA A A A A A A = 0,
+A A A };
+
+A A A if (!group->sva_enabled) {
+A A A A A A A ret = iommu_group_for_each_dev(group->iommu_group, NULL,
+A A A A A A A A A A A A A A A A A A A A A A A A A A vfio_iommu_sva_init);
Do we need to do *sva_init here or do anything to avoid repeated
initiation?
while another process already did initiation at this device, I think
that current process will get an EEXIST.
Right, sva_init() must be called once for any device that intends to use
bind(). For the second process though, group->sva_enabled will be true
so we won't call sva_init() again, only bind().
Well, while I create mediated devices based on one parent device to
support multiple