From patchwork Wed Nov 29 17:08:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120029 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3309236qgn; Wed, 29 Nov 2017 09:08:29 -0800 (PST) X-Google-Smtp-Source: AGs4zMYq/pxXFj3/m6lXUIKugCiojMDvx2QclDkoA9/GUmGvtKRLnGlMQ76tP7g1bgbQdz/DSC3J X-Received: by 10.37.174.85 with SMTP id g21mr2211288ybe.218.1511975309663; Wed, 29 Nov 2017 09:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511975309; cv=none; d=google.com; s=arc-20160816; b=inynG3Gu/6VvloE8pWjtpGYNeH+zRh6ObZKLp6w7D2qwRElmg60yihgviX+eBFnBs7 V850kIHAR4wcnuPwJySAQLHCFpadMJgWeiqWCNdaK7M/IPZ6Gwri25Pm/n5oV5P/wouQ wL24FA6/RZ9RYFinu2LPB+kVM3Nfhz/HAGXwYpfo/6QF0gL+Jx7atamPR060uKZx0rGy G9JRT4rRo0zrcaPbiFhJ48E/aW+EovCqiBQqMh+wL5kNpopgGDXSmviZ8H+adJsX6kmF nKnpO4Du5cQ9f0UUdJcXt8s79ltUqYhg5J79su2BFDegXsUN9CQu0DEvIxQprmTv/iN5 wk8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :arc-authentication-results; bh=0BGhPYEFU3q5ORaMNluzJU6PGA7C4Ie+OywNstkqY0o=; b=hPXMi5nrorxxYvbhQ2scAJKWzVWtm/eyJwH/SQSN8GnZ5d1bBZ67gC1q0M+mm40gL0 hYOnXJWa9XL0IxT9bVLAPD2Ny3EbYmvK6VNMP0RpB2BfBNTFoHKouTxFy4nQUHPKkH3b pLpD7nLoIAdQ9XDgUKGnRGzzIfJyELzQ948QQtoHNQx3CYY0GurJkKCyGZS1meElyF0C H+RJVEZOzp9mKLjcCag3L6LWieRNai7vHAwLLDJ0YaGgk3qZFDgE37z0hpHQpDV+csIp XMHPWnzELcEKR2YLwkAo+0srqvIBREaYrkFN/gMcd1NzBJUlMFvDhwVAm8jM/jnn9ySS eNvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SmyjxxrJ; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v142si391672ywg.282.2017.11.29.09.08.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 29 Nov 2017 09:08:29 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SmyjxxrJ; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK5qX-0003NS-8A for patch@linaro.org; Wed, 29 Nov 2017 12:08:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK5qR-0003NJ-MV for grub-devel@gnu.org; Wed, 29 Nov 2017 12:08:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK5qQ-0005lZ-MP for grub-devel@gnu.org; Wed, 29 Nov 2017 12:08:23 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:40692) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eK5qQ-0005iw-GN for grub-devel@gnu.org; Wed, 29 Nov 2017 12:08:22 -0500 Received: by mail-wm0-x244.google.com with SMTP id v19so7377508wmh.5 for ; Wed, 29 Nov 2017 09:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=e48GvRwpaptWAhYrV4uai8/t5H0VBu6YRyTIznb2z8g=; b=SmyjxxrJGhctcl6EoXsNDvKLD2Fr9YGL3wn8iwRa7TDmSl5KOR4bpFEsmpK9pAzy7z 9UOZoGaKQRdTQ3kxrSuB4q4FnSqF/1lYwpNJx7oVhNSzkZ1QiaCx/Rj52yU7+A+G3DB+ EWWPp7WvBHkArnrQ7mXRq/A09Uz34yrdffSA8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=e48GvRwpaptWAhYrV4uai8/t5H0VBu6YRyTIznb2z8g=; b=dWjW45Wt0WsyXYWw02R7E067evIwDUc9N+Hi/ipkVPzjhTIgo5qL8Q2QbVjCNpLizD ae1q2s7qt+5+gpgbMqvGAuMSvydUkMHZL0jfUwT6XFCysxdMvxviZE4GKVKNBiVgPO5I /UqhQZHhAh0zT8UKo8LC7gQZS1ccmC18+Lq6RYCINA2HGpHrEx21Ab7gA4ngwyX5N3nn 9hrxioG9Gn0JhKuIGP8ly5v+hify+TdMCpM/gbC0sBQ/ayuHalpa3TclM/5NiaHUPPWM QrRyw825YWZV1BtpJ1tdyN/sS+tQVRHVCQ2OyCTQK2bw2voJiPNL4fKA6cuC2I9k1ky7 M+bg== X-Gm-Message-State: AJaThX6daS3sfR0+Pkfq2CfSrHDqBj0V7Yry1VUWeADvfEZq3pOiyJaH RMaT8LKK52/7JxF1RW7soWFkEY+3vh0= X-Received: by 10.28.65.65 with SMTP id o62mr2785196wma.112.1511975299803; Wed, 29 Nov 2017 09:08:19 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id l16sm6310946wma.19.2017.11.29.09.08.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:08:19 -0800 (PST) From: Julien Grall To: grub-devel@gnu.org Subject: [PATCH] arm64/xen: Add missing #address-cells and #size-cells properties Date: Wed, 29 Nov 2017 17:08:12 +0000 Message-Id: <20171129170812.31951-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: daniel.kiper@oracle.com, Julien Grall , fu.wei@linaro.org, xen-devel@lists.xen.org MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" The properties #address-cells and #size-cells are used to know the number of cells for ranges provided by "regs". If they don't exist, the value are resp. 2 and 1. Currently, when multiboot nodes are created it is assumed that #address-cells and #size-cells are exactly 2. However, they are never set by GRUB and will result to later failure when the device-tree is generated by GRUB or contain different values. To prevent this failure, create the both properties in the chosen nodes. Signed-off-by: Julien Grall --- grub-core/loader/arm64/xen_boot.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index c95d6c5a8..6780b1f0c 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -115,6 +115,17 @@ prepare_xen_hypervisor_params (void *xen_boot_fdt) if (chosen_node < 1) return grub_error (GRUB_ERR_IO, "failed to get chosen node in FDT"); + /* + * The address and size are always written using 64-bits value. Set + * #address-cells and #size-cells accordingly. + */ + retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#address-cells", 2); + if (retval) + return grub_error (GRUB_ERR_IO, "failed to set #address-cells"); + retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#size-cells", 2); + if (retval) + return grub_error (GRUB_ERR_IO, "failed to set #size-cells"); + grub_dprintf ("xen_loader", "Xen Hypervisor cmdline : %s @ %p size:%d\n", xen_hypervisor->cmdline, xen_hypervisor->cmdline,