All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v3] xen/arm: domain_build: Black list devices using PPIs
@ 2019-06-23 12:56 Amit Singh Tomar
  2019-07-07 18:10 ` Julien Grall
  0 siblings, 1 reply; 2+ messages in thread
From: Amit Singh Tomar @ 2019-06-23 12:56 UTC (permalink / raw)
  To: xen-devel; +Cc: andre.przywara, julien.grall, sstabellini, 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.

Suggested-by:  Julien Grall <julien.grall@arm.com>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
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(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d983677..53935f8 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;
 
@@ -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.
      */
-- 
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] 2+ messages in thread

* Re: [Xen-devel] [PATCH v3] xen/arm: domain_build: Black list devices using PPIs
  2019-06-23 12:56 [Xen-devel] [PATCH v3] xen/arm: domain_build: Black list devices using PPIs Amit Singh Tomar
@ 2019-07-07 18:10 ` Julien Grall
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2019-07-07 18:10 UTC (permalink / raw)
  To: Amit Singh Tomar, xen-devel; +Cc: andre.przywara, sstabellini

Hi Amit,

On 6/23/19 1:56 PM, Amit Singh Tomar wrote:
> 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.
> 
> Suggested-by:  Julien Grall <julien.grall@arm.com>
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>

With one minor change (see below):

Acked-by: Julien Grall <julien.grall@arm.com>


> @@ -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");

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

Cheers,

-- 
Julien Grall

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

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

end of thread, other threads:[~2019-07-08 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 12:56 [Xen-devel] [PATCH v3] xen/arm: domain_build: Black list devices using PPIs Amit Singh Tomar
2019-07-07 18:10 ` Julien Grall

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.