All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: Black list everything with a PPI
@ 2019-05-03 16:42 ` Amit Singh Tomar
  0 siblings, 0 replies; 11+ messages in thread
From: Amit Singh Tomar @ 2019-05-03 16:42 UTC (permalink / raw)
  To: xen-devel; +Cc: andre.przywara, julien.grall, sstabellini, Amit Singh Tomar

XEN should not forward PPIs to Dom0 as it only support SPIs.
One of solution to this problem is to skip any device that
uses PPI source completely while building domain itself.

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

Suggested-by:  Julien Grall <julien.grall@arm.com>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
    * This replaces following patch.
      https://patchwork.kernel.org/patch/10899881/
---
 xen/arch/arm/domain_build.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d983677..0ae54db 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1334,6 +1334,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         DT_MATCH_COMPATIBLE("arm,cortex-a15-pmu"),
         DT_MATCH_COMPATIBLE("arm,cortex-a53-edac"),
         DT_MATCH_COMPATIBLE("arm,armv8-pmuv3"),
+        DT_MATCH_COMPATIBLE("arm,cortex-a53-pmu"),
         DT_MATCH_PATH("/cpus"),
         DT_MATCH_TYPE("memory"),
         /* The memory mapped timer is not supported by Xen. */
@@ -1353,7 +1354,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;
 
@@ -1399,6 +1400,20 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
+    /* Skip the node, using PPI source */
+    nirq = dt_number_of_irq(node);
+
+    for ( i = 0 ; i < nirq ; i++ )
+    {
+        irq_id = platform_get_irq(node, i);
+
+        if ( irq_id >= 16 && irq_id < 32 )
+        {
+            dt_dprintk(" Skip node with (PPI source)\n");
+            return 0;
+        }
+    }
+
     /*
      * Xen is using some path for its own purpose. Warn if a node
      * already exists with the same path.
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] xen/arm: Black list everything with a PPI
@ 2019-05-03 17:02 Amit Singh Tomar
  2019-05-15 18:54 ` Oleksandr
  2019-05-29 17:47 ` Julien Grall
  0 siblings, 2 replies; 11+ messages in thread
From: Amit Singh Tomar @ 2019-05-03 17:02 UTC (permalink / raw)
  To: xen-devel; +Cc: andre.przywara, julien.grall, sstabellini, Amit Singh Tomar

XEN should not forward PPIs to Dom0 as it only support SPIs.
One of solution to this problem is to skip any device that
uses PPI source completely while building domain itself.

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

Suggested-by:  Julien Grall <julien.grall@arm.com>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
    * This replaces following patch.
      https://patchwork.kernel.org/patch/10899881/
---
 xen/arch/arm/domain_build.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d983677..8f54472 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -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;
 
@@ -1399,6 +1399,20 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
+    /* Skip the node, using PPI source */
+    nirq = dt_number_of_irq(node);
+
+    for ( i = 0 ; i < nirq ; i++ )
+    {
+        irq_id = platform_get_irq(node, i);
+
+        if ( irq_id >= 16 && irq_id < 32 )
+        {
+            dt_dprintk(" Skip node with (PPI source)\n");
+            return 0;
+        }
+    }
+
     /*
      * Xen is using some path for its own purpose. Warn if a node
      * already exists with the same path.
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-05-29 18:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 16:42 [PATCH] xen/arm: Black list everything with a PPI Amit Singh Tomar
2019-05-03 16:42 ` [Xen-devel] " Amit Singh Tomar
2019-05-03 16:48 ` Amit Tomer
2019-05-03 16:48   ` [Xen-devel] " Amit Tomer
  -- strict thread matches above, loose matches on Subject: below --
2019-05-03 17:02 Amit Singh Tomar
2019-05-15 18:54 ` Oleksandr
2019-05-16 11:45   ` Amit Tomer
2019-05-16 13:17     ` Andre Przywara
2019-05-16 13:59       ` Julien Grall
2019-05-29 17:47 ` Julien Grall
2019-05-29 18:56   ` Amit Tomer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.