Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eKOXw-0001Z0-54 for mharc-grub-devel@gnu.org; Thu, 30 Nov 2017 08:06:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKOXn-0001UM-M0 for grub-devel@gnu.org; Thu, 30 Nov 2017 08:06:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKOXh-0001wO-Ln for grub-devel@gnu.org; Thu, 30 Nov 2017 08:06:23 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:18752) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKOXh-0001w9-EY for grub-devel@gnu.org; Thu, 30 Nov 2017 08:06:17 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAUD6FPY023053 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Nov 2017 13:06:15 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAUD6EEs003994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Nov 2017 13:06:14 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAUD6E7G026741; Thu, 30 Nov 2017 13:06:14 GMT Received: from olila.local.net-space.pl (/10.175.181.104) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Nov 2017 05:06:13 -0800 Date: Thu, 30 Nov 2017 14:06:09 +0100 From: Daniel Kiper To: Julien Grall Cc: grub-devel@gnu.org, xen-devel@lists.xen.org, fu.wei@linaro.org Subject: Re: [PATCH] arm64/xen: Add missing #address-cells and #size-cells properties Message-ID: <20171130130609.GA12877@olila.local.net-space.pl> References: <20171129170812.31951-1-julien.grall@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171129170812.31951-1-julien.grall@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 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: , X-List-Received-Date: Thu, 30 Nov 2017 13:06:31 -0000 On Wed, Nov 29, 2017 at 05:08:12PM +0000, Julien Grall wrote: > 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 IIRC ARM boot protocol is not related to Multiboot protocol in any way. So, calling it in that way is very confusing. Could you invent a better not confusion name. Or at least provide a spec. I am happy to see it in GRUB2 tree. > 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(+) > > 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 Here you say "64-bits value"... > + * #address-cells and #size-cells accordingly. > + */ > + retval = grub_fdt_set_prop32 (xen_boot_fdt, chosen_node, "#address-cells", 2); ...and then call grub_fdt_set_prop32(). I am confused... > + 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); Ditto. Daniel