Skip to contentSkip to conversation

xen/arm: domain_build: Black list devices using PPIs

PATCH In review Amit Singh Tomar 2 participants 2 messages Jun 23, 2019 – Jul 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 xen/arm: domain_build: Black list devices using PPIs

Currently, the vGIC is not able to cope with hardware PPIs routed to guests. One of the solutions to this problem is to skip any device that uses PPI source completely while building the domain itself.

This patch goes through all the interrupt sources of a device and skip it if one of the interrupts sources is a PPI. It fixes XEN boot on i.MX8MQ by skipping the PMU node.

---
Changes since v2:
* Update subject-line for the patch.
* Fix commit message.
* Add proper comments for changes.

Changes since v1:
* Added comment for PPIs range.

---
 xen/arch/arm/domain_build.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
xen/arch/arm/domain_build.c +19 -1
index d983677..53935f8 100644
@@ -1353,7 +1353,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         { /* sentinel */ },
     };
     struct dt_device_node *child;
-    int res;
+    int res, i, nirq, irq_id;
     const char *name;
     const char *path;
 
@@ -1400,6 +1400,24 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
     }
 
     /*
+     * The vGIC does not support routing hardware PPIs to guest. So
+     * we need to skip any node using PPIs.
+     */
+    nirq = dt_number_of_irq(node);
+
+    for ( i = 0 ; i < nirq ; i++ )
+    {
+        irq_id = platform_get_irq(node, i);
+
+        /* PPIs ranges from ID 16 to 31 */
+        if ( irq_id >= 16 && irq_id < 32 )
+        {
+            dt_dprintk(" Skip it(using PPIs)\n");
+            return 0;
+        }
+    }
+
+    /*
      * Xen is using some path for its own purpose. Warn if a node
      * already exists with the same path.
      */
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v3 1/1
#1 lore raw

Hi Amit,

Quoted 10 lines · Amit Singh Tomar

Currently, the vGIC is not able to cope with hardware PPIs routed to guests. One of the solutions to this problem is to skip any device that uses PPI source completely while building the domain itself.

This patch goes through all the interrupt sources of a device and skip it if one of the interrupts sources is a PPI. It fixes XEN boot on i.MX8MQ by skipping the PMU node.

With one minor change (see below):

Quoted 7 lines
xen/arch/arm/domain_build.c +3 -0
@@ -1400,6 +1400,24 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
      }
 
      /*
+     * The vGIC does not support routing hardware PPIs to guest. So
+     * we need to skip any node using PPIs.
+     */

xen/arch/arm/domain_build.c static int __init handle_node(struct domain *d, struct kernel_info *kinfo, · line 1415

Quoted 10 lines
xen/arch/arm/domain_build.c +10 -0
+    nirq = dt_number_of_irq(node);
+
+    for ( i = 0 ; i < nirq ; i++ )
+    {
+        irq_id = platform_get_irq(node, i);
+
+        /* PPIs ranges from ID 16 to 31 */
+        if ( irq_id >= 16 && irq_id < 32 )
+        {
+            dt_dprintk(" Skip it(using PPIs)\n");

NIT: missing space after "it". I can fix this on commit.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel