From: Ian Campbell Subject: Re: [PATCH RFC 03/15] xen: arm: allocate dom0 memory separately from preparing the dtb Date: Thu, 24 Oct 2013 18:06:13 +0100 Message-ID: <1382634373.22417.128.camel@hastur.hellion.org.uk> References: <1381163944.21562.129.camel@kazak.uk.xensource.com> <1381164001-1446-3-git-send-email-ian.campbell@citrix.com> <5256BC00.1020309@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5256BC00.1020309@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-10-10 at 15:38 +0100, Julien Grall wrote: > This function always return 0 or panic if an error occurred. Perhaps you > can move the return type to void? Yes, done all the way up the call chain. > > if ( platform_has_quirk(PLATFORM_QUIRK_DOM0_MAPPING_11) ) > > - return set_memory_reg_11(d, kinfo, pp, np, new_cell); > > + return allocate_memory_11(d, kinfo); > > + > > + memory = dt_find_node_by_type(NULL, "memory"); > > Can we try to have the same way to retrieve the memory node in each place? Hrm. The first one (device_tree.c) is using the early stuff while the other two are using the full datastructures. But for the last two I think the right thing to do is to check for device_type = "memory". > - common/device_tree.c: looking by memory@unit > - arch/arm/domain_build.c:write_properties: looking only the exact node > name "memory" > - here: looking by type "memory" > > Furthermore, your are assuming that there is only one memory node in DTS > tree. Perhaps a loop is better here? Yes, I'll change that. Ian.