Re: [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing

From
Jean-Philippe Brucker <hidden>
Date
2018-05-24 11:44:58
Also in
kvm, linux-acpi, linux-arm-kernel, linux-iommu, linux-mm, linux-pci
Reply to
Xu Zaibo, 2018-05-23
Hi,

On 23/05/18 10:38, Xu Zaibo wrote:
quoted
+static int vfio_iommu_bind_group(struct vfio_iommu *iommu,
+                 struct vfio_group *group,
+                 struct vfio_mm *vfio_mm)
+{
+    int ret;
+    bool enabled_sva = false;
+    struct vfio_iommu_sva_bind_data data = {
+        .vfio_mm    = vfio_mm,
+        .iommu        = iommu,
+        .count        = 0,
+    };
+
+    if (!group->sva_enabled) {
+        ret = iommu_group_for_each_dev(group->iommu_group, NULL,
+                           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().

Thanks,
Jean
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Thread (121 messages) 121 messages, 13 authors, last reply 2018-09-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help