xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xensource.com,
	Andre Przywara <andre.przywara@linaro.org>
Subject: Re: [Xen-staging] [xen staging] ARM: parse separate DT properties for different commandlines
Date: Mon, 07 Oct 2013 13:23:19 +0100	[thread overview]
Message-ID: <5252A7B7.9020104@linaro.org> (raw)
In-Reply-To: <1380622369.925.53.camel@kazak.uk.xensource.com>

On 10/01/2013 11:12 AM, Ian Campbell wrote:
> On Tue, 2013-10-01 at 10:56 +0100, Ian Campbell wrote:
>> On Thu, 2013-09-19 at 10:44 +0100, Julien Grall wrote:
>>>
>>> On 19 Sep 2013 09:29, "Andre Przywara" <andre.przywara@linaro.org>
>>> wrote:
>>>>>
>>>>>> @@ -261,7 +261,12 @@ const char *device_tree_bootargs(const void
>>> *fdt)
>>>>>>       if ( node < 0 )
>>>>>>           return NULL;
>>>>>>
>>>>>> -    prop = fdt_get_property(fdt, node, "bootargs", NULL);
>>>>>> +    prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
>>>>>> +    if ( prop == NULL )
>>>>>> +    {
>>>>>> +        if (fdt_get_property(fdt, node, "xen,dom0-bootargs",
>>> NULL))
>>>>>> +            prop = fdt_get_property(fdt, node, "bootargs", NULL);
>>>>>> +    }
>>>
>>> The logic seems wrong here, we returns bootargs only if the property
>>> "xen,dom0-bootargs" exists. We should also check if the user give the
>>> dom0
>>> command line via the multiboot module.
>>
>> Anyone investigating this? I've just been using the following, which is
>> obviously bogus!
> 
> How about this:
> 8<------------------------------------
> 
> From a158dee49bb59e76c0f9103f512bb4bf9489f770 Mon Sep 17 00:00:00 2001
> From: Ian Campbell <ijc@hellion.org.uk>
> Date: Fri, 20 Sep 2013 23:45:34 +0100
> Subject: [PATCH] xen: arm: fix usage of bootargs for Xen.
> 
> The chosen node's bootargs property should be used for Xen if there is a dom0
> kernel multiboot module with a command line, not just if xen,dom0-bootargs is
> present.

>From docs/misc/arm/device-tree/booting.txt:
If no Xen specific properties are present, bootargs is for Dom0.

The current behaviour seems logic. Can you update the documentation?

> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/common/device_tree.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 27ee708..fe25508 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -242,7 +242,7 @@ static int __init device_tree_for_each_node(const void *fdt,
>   */
>  const char *device_tree_bootargs(const void *fdt)
>  {
> -    int node; 
> +    int node;
>      const struct fdt_property *prop;
>  
>      node = fdt_path_offset(fdt, "/chosen");
> @@ -252,7 +252,13 @@ const char *device_tree_bootargs(const void *fdt)
>      prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
>      if ( prop == NULL )
>      {
> -        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL))
> +        struct dt_mb_module *dom0_mod = NULL;
> +
> +        if ( early_info.modules.nr_mods >= MOD_KERNEL )
> +            dom0_mod = &early_info.modules.module[MOD_KERNEL];
> +
> +        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
> +            ( dom0_mod && dom0_mod->cmdline[0] ) )
>              prop = fdt_get_property(fdt, node, "bootargs", NULL);
>      }
>      if ( prop == NULL )
> 


-- 
Julien Grall

  reply	other threads:[~2013-10-07 12:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VLwaI-0003p8-2e@xenbits.xen.org>
2013-09-18 20:47 ` [Xen-staging] [xen staging] ARM: parse separate DT properties for different commandlines Ian Campbell
2013-09-19  8:24   ` Andre Przywara
2013-09-19  9:44     ` Julien Grall
2013-10-01  9:56       ` Ian Campbell
2013-10-01 10:12         ` Ian Campbell
2013-10-07 12:23           ` Julien Grall [this message]
2013-10-07 12:44             ` Ian Campbell
2013-10-07 13:08               ` 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=5252A7B7.9020104@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=andre.przywara@linaro.org \
    --cc=xen-devel@lists.xensource.com \
    /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).