xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@linaro.org>
To: Julien Grall <julien.grall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2] ARM: parse separate DT properties for different commandlines
Date: Tue, 20 Aug 2013 14:09:34 +0200	[thread overview]
Message-ID: <52135C7E.3080105@linaro.org> (raw)
In-Reply-To: <CAPnVf8zT5RrAPu2XCQL0=YUfWK0QAC3Vs1z42RR7VJJdmA-7Og@mail.gmail.com>

On 07/10/2013 01:48 PM, Julien Grall wrote:
> On 3 June 2013 14:43, Andre Przywara <andre.przywara@calxeda.com> wrote:
>> Currently we use the chosen/bootargs property as the Xen commandline
>> and rely on xen,dom0-bootargs for Dom0. However this brings issues
>> with bootloaders, which usually build bootargs by bootscripts for a
>> Linux kernel - and not for the entirely different Xen hypervisor.
>> Introduce a new possible device tree property "xen,xen-bootargs"
>> explicitly for the Xen hypervisor and make the selection of which to
>> use more fine grained:
>> - If xen,xen-bootargs is present, it will be used for Xen.
>> - If xen,dom0-bootargs is present, it will be used for Dom0.
>> - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
>>    bootargs will be used for Xen. Like the current situation.
>> - If no Xen specific properties are present, bootargs is for Dom0.
>> - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
>>    bootargs will be used for Dom0.
>>
>> The aim is to allow common bootscripts to boot both Xen and native
>> Linux with the same device tree blob. If needed, one could hard-code
>> the Xen commandline into the DTB, leaving bootargs for Dom0 to be set
>> by the (non Xen-aware) bootloader.
>> I also have a simple patch for u-boot to transfer the content of the
>> "xen_bootargs" environment variable into the xen,xen-bootargs dtb
>> property.
>> I will post the u-boot patch to their ML later.
>>
>> Changes from v1:
>> - fix whitespace issues
>
> Any news about this patch ? :)

Sorry for the lag ;-)

>
>> Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
>> ---
>>   xen/arch/arm/domain_build.c | 13 ++++++++++---
>>   xen/common/device_tree.c    |  7 ++++++-
>>   2 files changed, 16 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index b92c64b..5809489 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -139,6 +139,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
>>                               u32 address_cells, u32 size_cells)
>>   {
>>       const char *bootargs = NULL;
>> +    int had_dom0_bootargs = 0;
>>       int prop;
>>
>>       if ( early_info.modules.nr_mods >= 1 &&
>> @@ -169,11 +170,17 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
>>            */
>>           if ( device_tree_node_matches(fdt, node, "chosen") )
>>           {
>> -            if ( strcmp(prop_name, "bootargs") == 0 )
>> +            if ( strcmp(prop_name, "xen,xen-bootargs") == 0 )
>> +                continue;
>> +            if ( strcmp(prop_name, "xen,dom0-bootargs") == 0 )
>> +            {
>> +                had_dom0_bootargs = 1;
>> +                bootargs = prop_data;
>
> Here, you overwrite the previous "bootargs". This variable is set if
> the module node contains "bootargs" property
> (see process_multiboot_node in common/device_tree.c)

I'd say that is intended. I think those command lines directly under 
/chosen should have the highest priority. If someone has
/chosen/xen,dom0-bootargs, that should be used instead of a most likely 
hard-coded value under modules.

I have incorporated your previous comments and will send out a new 
version ASAP.

Regards,
Andre.

>
> Could you either:
>      1) Remove the possibility to set the command line via the custom multiboot
>      2) Check if "bootargs" was not set
>
> I think nobody uses the custom multiboot with the command line. So the
> first solution seems to be the best.
>
> --
> Julien Grall
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

  reply	other threads:[~2013-08-20 12:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 13:43 [PATCH v2] ARM: parse separate DT properties for different commandlines Andre Przywara
2013-06-03 14:22 ` Julien Grall
2013-07-10 11:48 ` Julien Grall
2013-08-20 12:09   ` Andre Przywara [this message]
2013-08-20 12:19     ` Julien Grall
2013-08-20 13:11       ` Ian Campbell
2013-08-20 13:32         ` Julien Grall
2013-08-20 13:39           ` Ian Campbell
2013-08-20 13:47             ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52135C7E.3080105@linaro.org \
    --to=andre.przywara@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).