xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: sstabellini@kernel.org, Julien Grall <julien.grall@linaro.org>,
	andre.przywara@linaro.org
Subject: [PATCH v2 2/2] xen/arm: GICv3: Only initialize ITS when the distributor supports LPIs.
Date: Wed, 24 Jan 2018 18:26:16 +0000	[thread overview]
Message-ID: <20180124182616.3384-3-julien.grall@linaro.org> (raw)
In-Reply-To: <20180124182616.3384-1-julien.grall@linaro.org>

There are firmware tables out describing the ITS but does not support
LPIs. This will result to a data abort when trying to initialize ITS.

While this can be consider a bug in the Device-Tree, same configuration
boots on Linux. So gate the ITS initialization with the support of LPIs
in the distributor.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic-v3.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9f9cf59f82..730450e34b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1637,6 +1637,11 @@ static unsigned long gicv3_get_hwdom_extra_madt_size(const struct domain *d)
 }
 #endif
 
+static bool gic_dist_supports_lpis(void)
+{
+    return (readl_relaxed(GICD + GICD_TYPER) & GICD_TYPE_LPIS);
+}
+
 /* Set up the GIC */
 static int __init gicv3_init(void)
 {
@@ -1699,9 +1704,12 @@ static int __init gicv3_init(void)
 
     gicv3_dist_init();
 
-    res = gicv3_its_init();
-    if ( res )
-        panic("GICv3: ITS: initialization failed: %d\n", res);
+    if ( gic_dist_supports_lpis() )
+    {
+        res = gicv3_its_init();
+        if ( res )
+            panic("GICv3: ITS: initialization failed: %d\n", res);
+    }
 
     res = gicv3_cpu_init();
     if ( res )
-- 
2.11.0


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

  parent reply	other threads:[~2018-01-24 18:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 18:26 [PATCH v2 0/2] xen/arm: GICv3: Only initialize ITS when LPIs are available Julien Grall
2018-01-24 18:26 ` [PATCH v2 1/2] xen/arm: GICv3: Parse ITS information from the firmware tables later on Julien Grall
2018-01-30 17:55   ` Stefano Stabellini
2018-01-24 18:26 ` Julien Grall [this message]
2018-01-30 17:55   ` [PATCH v2 2/2] xen/arm: GICv3: Only initialize ITS when the distributor supports LPIs Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124182616.3384-3-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=andre.przywara@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).