From: Julien Grall Subject: [PATCH 4/8] xen/arm: Warn when a device tree path will be re-used by Xen Date: Tue, 22 Sep 2015 18:47:38 +0100 Message-ID: <1442944062-4324-5-git-send-email-julien.grall@citrix.com> References: <1442944062-4324-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZeRhC-0007OW-Pw for xen-devel@lists.xenproject.org; Tue, 22 Sep 2015 17:49:38 +0000 In-Reply-To: <1442944062-4324-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Julien Grall , stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Xen is using unconditionnally some device tree path to create DOM0 specific node (for instance /psci, /memory and /hypervisor). Rather than blindly add new nodes with the same, print a warning message on the console to let know the user that something may go wrong. Signed-off-by: Julien Grall --- xen/arch/arm/domain_build.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 651d75e..2670431 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1205,6 +1205,13 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, DT_MATCH_TIMER, { /* sentinel */ }, }; + static const struct dt_device_match reserved_matches[] __initconst = + { + DT_MATCH_PATH("/psci"), + DT_MATCH_PATH("/memory"), + DT_MATCH_PATH("/hypervisor"), + { /* sentinel */ }, + }; struct dt_device_node *child; int res; const char *name; @@ -1252,6 +1259,14 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return 0; } + /* + * Xen is using some path for its own purpose. Warn if a node + * already exists with the same path. + */ + if ( dt_match_node(reserved_matches, node) ) + printk(XENLOG_WARNING "WARNING: Path %s is reserved, skip the node\n", + path); + res = handle_device(d, node); if ( res) return res; -- 2.1.4