qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v7 09/26] vfio: Force nested if iommu requires it


From: Kunkun Jiang
Subject: Re: [RFC v7 09/26] vfio: Force nested if iommu requires it
Date: Sat, 28 Nov 2020 17:01:49 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

Hi Eric,
@@ -1668,6 +1679,14 @@ static int vfio_connect_container(VFIOGroup *group, 
AddressSpace *as,
     VFIOContainer *container;
     int ret, fd;
     VFIOAddressSpace *space;
+    IOMMUMemoryRegion *iommu_mr;
+    bool nested = false;
+
+    if (as != &address_space_memory && memory_region_is_iommu(as->root)) {
+        iommu_mr = IOMMU_MEMORY_REGION(as->root);
+        memory_region_iommu_get_attr(iommu_mr, IOMMU_ATTR_VFIO_NESTED,
+                                     (void *)&nested);
+    }
 
     space = vfio_get_address_space(as);
Is the condition "as != &address_space_memory" needed to determine whether a vIOMMU is in place? I think "memory_region_is_iommu(as->root)" is enough. Looking forward to your reply.:) Thanks, Kunkun Jiang

reply via email to

[Prev in Thread] Current Thread [Next in Thread]