xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xen/arm: Black list everything with a PPI
@ 2019-06-02 18:04 Amit Singh Tomar
  2019-06-02 18:04 ` [Xen-devel] " Amit Singh Tomar
  2019-06-15 18:12 ` Julien Grall
  0 siblings, 2 replies; 3+ messages in thread
From: Amit Singh Tomar @ 2019-06-02 18:04 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>
---
Changes since v1:
    * Added comment for PPIs range.
---
 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..5035758 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,21 @@ 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);
+
+        /* PPIs ranges from ID 16 to 31 */
+        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] 3+ messages in thread

* [Xen-devel] [PATCH v2] xen/arm: Black list everything with a PPI
  2019-06-02 18:04 [PATCH v2] xen/arm: Black list everything with a PPI Amit Singh Tomar
@ 2019-06-02 18:04 ` Amit Singh Tomar
  2019-06-15 18:12 ` Julien Grall
  1 sibling, 0 replies; 3+ messages in thread
From: Amit Singh Tomar @ 2019-06-02 18:04 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>
---
Changes since v1:
    * Added comment for PPIs range.
---
 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..5035758 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,21 @@ 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);
+
+        /* PPIs ranges from ID 16 to 31 */
+        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] 3+ messages in thread

* Re: [Xen-devel] [PATCH v2] xen/arm: Black list everything with a PPI
  2019-06-02 18:04 [PATCH v2] xen/arm: Black list everything with a PPI Amit Singh Tomar
  2019-06-02 18:04 ` [Xen-devel] " Amit Singh Tomar
@ 2019-06-15 18:12 ` Julien Grall
  1 sibling, 0 replies; 3+ messages in thread
From: Julien Grall @ 2019-06-15 18:12 UTC (permalink / raw)
  To: Amit Singh Tomar, xen-devel; +Cc: andre.przywara, sstabellini

Hi Amit,

Sorry for the late answer.

Title: "xen/arm: domain_build: Black list devices using PPIs"

On 6/2/19 7:04 PM, Amit Singh Tomar wrote:
> XEN should not forward PPIs to Dom0 as it only support SPIs.

Reading this sentence, it leads to think that Xen does not support PPIs 
at all. However, we are supporting PPIs in Xen but not able to forward 
them directly to a guest.

So how about:

"Currently, the vGIC is not able to cope with hardware PPIs routed to 
guests."

> One of solution to this problem is to skip any device that

s/of solution/of the solutions/

> uses PPI source completely while building domain itself.

s/building domain/building the domain/

> 
> This patch goes through all the interrupt sources of device and skip it

s/of device/of a device/

> if one of interrupt source is PPI. It fixes XEN boot on i.MX8MQ by

"if one of the interrupts sources is a PPI".

> skipping PMU node.

s/PMU/the PMU/

> 
> Suggested-by:  Julien Grall <julien.grall@arm.com>
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Changes since v1:
>      * Added comment for PPIs range.
> ---
>   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..5035758 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,21 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
>           return 0;
>       }
>   
> +    /* Skip the node, using PPI source */

I would add a word explaining why they are skipped:

"The vGIC does not support routing hardware PPIs to guest. So we need to 
skip any nodes 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 node with (PPI source)\n");

The () looks a bit odd here. If you want to follow the other printk, 
then it should be: "  Skip it (using PPIs)\n"

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] 3+ messages in thread

end of thread, other threads:[~2019-06-15 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-02 18:04 [PATCH v2] xen/arm: Black list everything with a PPI Amit Singh Tomar
2019-06-02 18:04 ` [Xen-devel] " Amit Singh Tomar
2019-06-15 18:12 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).