From patchwork Wed Jun 15 13:40:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 70113 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2579081qgf; Wed, 15 Jun 2016 06:43:02 -0700 (PDT) X-Received: by 10.36.107.210 with SMTP id v201mr16670301itc.52.1465998180649; Wed, 15 Jun 2016 06:43:00 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i196si12793861itc.102.2016.06.15.06.43.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jun 2016 06:43:00 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDB40-0000ib-BK; Wed, 15 Jun 2016 13:41:00 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDB3y-0000iV-OY for xen-devel@lists.xen.org; Wed, 15 Jun 2016 13:40:58 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id A9/6A-25713-AEA51675; Wed, 15 Jun 2016 13:40:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRWlGSWpSXmKPExsVysyfVTfd5VGK 4wczLMhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aL9coF87gqej62sDQwbuboYuTiEBLYwCix dvZili5GTiDnNKPErFtBIDabgKbEnc+fmEBsEQFpiWufLzOC2MwCuRKfFk0HqxcWiJdY9HkvG 4jNIqAq0duymh3E5hVwkVh/YR5Yr4SAnMTJY5NZJzByLmBkWMWoXpxaVJZapGukl1SUmZ5Rkp uYmaNraGCml5taXJyYnpqTmFSsl5yfu4kR6CsGINjBuOyv0yFGSQ4mJVFeD7nEcCG+pPyUyoz E4oz4otKc1OJDjDIcHEoSvLyRQDnBotT01Iq0zBxg0MCkJTh4lER4Y0HSvMUFibnFmekQqVOM ilLivCYgCQGQREZpHlwbLFAvMcpKCfMyAh0ixFOQWpSbWYIq/4pRnINRSZi3DmQKT2ZeCdz0V 0CLmYAW20yPB1lckoiQkmpg3FX8309klXpL1RxbdmPLY5tSGy9+DJ0tVLv4WOdereDflit2M6 8/lx7muv38vpwjM+PeLy/Oil3vu2URS+20BZ1npDWTz3vvnfvhp4Khy3mnrGWRdr62f207V25 YsGFPfvmDDvu/8epdWt6MaWV98z4+Zs386vdqtvyTpVbCuq/CbV8z10oeUWIpzkg01GIuKk4E AOIU1YlPAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1465998055!19049386!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30470 invoked from network); 15 Jun 2016 13:40:55 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-14.tower-21.messagelabs.com with SMTP; 15 Jun 2016 13:40:55 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 417B8F; Wed, 15 Jun 2016 06:41:35 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 521ED3F41F; Wed, 15 Jun 2016 06:40:53 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 15 Jun 2016 14:40:48 +0100 Message-Id: <1465998048-21682-1-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 Cc: Julien Grall , sstabellini@kernel.org, steve.capper@arm.com, wei.chen@linaro.org Subject: [Xen-devel] [PATCH] xen/arm: gic-v2: Only create GICv2m node when there are GICv2m frame available X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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 Acked-by: Wei Chen --- 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 )