[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 16/16] arm: use /chosen/module1-args for domain 0 command line
On Thu, 2012-09-06 at 15:19 +0100, David Vrabel wrote: > On 03/09/12 14:30, Ian Campbell wrote: > > Ideally this would use module1-args iff the kernel came from > > module1-{start,end} and the existing xen,dom0-bootargs if the kernel > > came from flash, but this approach is simpler and has the sme effect > > in practice. > > Is module1-args defined in a spec somewhere? Nope, I made it up as a PoC. I described it a little bit in the 0/16 mail. > If the DT has xen,dom0-bootargs followed by module1-args you will end up > with two bootargs nodes. Suggest preferring the first one found and > discard the other. Yes. > > > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> > > --- > > xen/arch/arm/domain_build.c | 23 ++++++++++++++++++++--- > > 1 files changed, 20 insertions(+), 3 deletions(-) > > > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > > index e96ed10..2b65637 100644 > > --- a/xen/arch/arm/domain_build.c > > +++ b/xen/arch/arm/domain_build.c > > @@ -88,6 +88,8 @@ static int write_properties(struct domain *d, struct > > kernel_info *kinfo, > > { > > int prop; > > > > + int had_mod1_args = 0; > > + > > for ( prop = fdt_first_property_offset(fdt, node); > > prop >= 0; > > prop = fdt_next_property_offset(fdt, prop) ) > > @@ -104,15 +106,30 @@ static int write_properties(struct domain *d, struct > > kernel_info *kinfo, > > prop_len = fdt32_to_cpu(p->len); > > > > /* > > - * In chosen node: replace bootargs with value from > > - * xen,dom0-bootargs. > > + * In chosen node: > > + * > > + * * replace bootargs with value from module1-args, falling > > + * back to xen,dom0-bootargs if not present. > > + * * remove all other module*. > > */ > > if ( device_tree_node_matches(fdt, node, "chosen") ) > > { > > if ( strcmp(prop_name, "bootargs") == 0 ) > > continue; > > - if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 ) > > + if ( strncmp(prop_name, "module", strlen("module")) == 0 ) > > + continue; > > Clearer to write this as: > > if ( strncmp(prop_name, "module", strlen("module")) == 0 ) > if ( strcmp(prop_name, "module1-args") == 0 ) > { > prop_name = "bootargs"; > had_mod1_args = 1; > } > else > continue; > } > > > + if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 ) > > + { > > + if ( had_mod1_args ) > > + continue; > > + else > > + prop_name = "bootargs"; > > + } > > } > > /* > > * In a memory node: adjust reg property. > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |