diff mbox series

[RFC,18/21] xen/arm: iommu: skip the iommu-map property for PCI devices

Message ID f023f8fbace84c83a9026bbc3aaf35173a847e36.1669888522.git.rahul.singh@arm.com (mailing list archive)
State New, archived
Headers show
Series Add SMMUv3 Stage 1 Support for XEN guests | expand

Commit Message

Rahul Singh Dec. 1, 2022, 4:02 p.m. UTC
Current code skip the IOMMUS specific properties for the non PCI devices
when handling the dom0 node but there is no support to skip the IOMMUS
specific properties for the PCI devices.

This patch will add the support to skip the IOMMUS specific properties
for the PCI devices.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
---
 xen/arch/arm/domain_build.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8e85fb7854..7cd99a6771 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1112,9 +1112,18 @@  static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
      * Use "iommu_node" as an indicator of the master device which properties
      * should be skipped.
      */
-    iommu_node = dt_parse_phandle(node, "iommus", 0);
-    if ( iommu_node && device_get_class(iommu_node) != DEVICE_IOMMU )
-        iommu_node = NULL;
+    if ( dt_device_type_is_equal(node, "pci") )
+    {
+        iommu_node = dt_parse_phandle(node, "iommu-map", 1);
+        if ( iommu_node && device_get_class(iommu_node) != DEVICE_IOMMU )
+            iommu_node = NULL;
+    }
+    else
+    {
+        iommu_node = dt_parse_phandle(node, "iommus", 0);
+        if ( iommu_node && device_get_class(iommu_node) != DEVICE_IOMMU )
+            iommu_node = NULL;
+    }
 
     dt_for_each_property_node (node, prop)
     {