xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xen.org
Cc: Julien Grall <julien.grall@arm.com>,
	sstabellini@kernel.org, steve.capper@arm.com,
	wei.chen@linaro.org
Subject: [PATCH] xen/arm: gic-v2: Only create GICv2m node when there are GICv2m frame available
Date: Wed, 15 Jun 2016 14:40:48 +0100	[thread overview]
Message-ID: <1465998048-21682-1-git-send-email-julien.grall@arm.com> (raw)

Xen will crash on platform where GICv2m is not available with the
following error:

(XEN) Can't find ranges property for the gic node
(XEN) Device tree generation failed (-15).
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) ****************************************

This is because the property "ranges" may not be present in the GIC
when there are no GICv2m frames.

Skip the creation of the GICv2m node when the hardware does not
support it.

This fixes boot after commit "xen/arm: Export GICv2m register frames to
DOM0 by device tree".

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/gic-v2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 2c1c0ba..4e2f4c7 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -669,6 +669,10 @@ static int gicv2m_make_dt_node(const struct domain *d,
     const struct dt_device_node *v2m = NULL;
     const struct v2m_data *v2m_data;
 
+    /* It is not necessary to create the node if there are not GICv2m frames */
+    if ( list_empty(&gicv2m_info) )
+        return 0;
+
     /* The sub-nodes require the ranges property */
     prop = dt_get_property(gic, "ranges", &len);
     if ( !prop )
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

             reply	other threads:[~2016-06-15 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 13:40 Julien Grall [this message]
2016-06-16  1:54 ` [PATCH] xen/arm: gic-v2: Only create GICv2m node when there are GICv2m frame available Wei Chen

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=1465998048-21682-1-git-send-email-julien.grall@arm.com \
    --to=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=steve.capper@arm.com \
    --cc=wei.chen@linaro.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).