From: Ian Campbell Subject: Re: [PATCH v2 7/9] xen: arm: store per-boot module type instead of relying on index Date: Fri, 27 Jun 2014 13:27:15 +0100 Message-ID: <1403872035.25894.69.camel@kazak.uk.xensource.com> References: <1403801130.31742.1.camel@kazak.uk.xensource.com> <1403801151-11007-7-git-send-email-ian.campbell@citrix.com> <53AD4AC0.8010009@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53AD4AC0.8010009@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 Fri, 2014-06-27 at 11:43 +0100, Julien Grall wrote: > Hi Ian, > > On 26/06/14 17:45, Ian Campbell wrote: > > This is more natural and better matches how multiboot is actually supposed to > > work. > > I don't find any modification of consider_modules in this series. Is it > normal? This function is badly assuming that MOD_XEN will be always the > first one. So may end up to forget to exclude some modules during the > memory allocation. Cr*p, yes, I suspect you are right. I'll check. In an early (unpublished) version of the patch I jumped through some hoops to make sure that module 0 was always Xen. Looks like I shouldn't have been so eager to clean that up! > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > > index 5eef8a3..c1a54e5 100644 > > --- a/xen/arch/arm/domain_build.c > > +++ b/xen/arch/arm/domain_build.c > > @@ -161,9 +161,10 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, > > int res = 0; > > int had_dom0_bootargs = 0; > > > > - if ( bootinfo.modules.nr_mods >= MOD_KERNEL && > > - bootinfo.modules.module[MOD_KERNEL].cmdline[0] ) > > - bootargs = &bootinfo.modules.module[MOD_KERNEL].cmdline[0]; > > + struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_KERNEL); > > It looks like a bit pointless to search the BOOTMOD_KERNEL everytime we > try to write properties of a node. But it's not the purpose of this patch. Yeah, I should wrap it in a "dt_node_path_is_equal(node, "/chosen")" (and I'll make the two existing ones into a single bool_t foo = too while I'm there. > [..] > > > struct bootmodules { > > int nr_mods; > > /* Module 0 is Xen itself, followed by the provided modules-proper */ > > Does this comment still relevant? I suspect not. Ian.