All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: Roy Franz <roy.franz@linaro.org>,
	Naresh Bhat <naresh.bhat@linaro.org>,
	tim@xen.org, Fu Wei <fu.wei@linaro.org>,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 07/10] xen: arm: store per-boot module type instead of relying on index
Date: Mon, 16 Jun 2014 13:48:04 +0100	[thread overview]
Message-ID: <539EE784.40803@linaro.org> (raw)
In-Reply-To: <1402919103-29642-7-git-send-email-ian.campbell@citrix.com>

Hi Ian,

On 06/16/2014 12:45 PM, Ian Campbell wrote:
> This is more natural and better matches how multiboot is actually supposed to
> work.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/arch/arm/bootfdt.c      |   49 +++++++++++++++----------------------------
>  xen/arch/arm/domain_build.c |   20 +++++++++++-------
>  xen/arch/arm/kernel.c       |   15 ++++++-------
>  xen/arch/arm/setup.c        |   47 ++++++++++++++++++++++++++++++++++++-----
>  xen/include/asm-arm/setup.h |   29 +++++++++++++++++--------
>  5 files changed, 100 insertions(+), 60 deletions(-)

It looks like you forgot to modify xsm/xsm_policy.c.

> +void add_boot_module(bootmodulekind kind, paddr_t start, paddr_t size,
> +                     const char *cmdline)
> +{
> +    struct bootmodules *mods = &bootinfo.modules;
> +    struct bootmodule *mod;
> +
> +    if ( mods->nr_mods == MAX_MODULES )
> +    {
> +        printk("Ignoring boot module at %"PRIpaddr"-%"PRIpaddr" (too many)\n",
> +               start, start + size);
> +        return;
> +    }

As we don't have any way to know if the user add multiple the kernel
and/or the initramfs, I would add a print message here to say what kind
of boot module we are currently adding. It will help the guy to find the
problem quickly.

[..]

>  void __init discard_initial_modules(void)
>  {
>      struct bootmodules *mi = &bootinfo.modules;
>      int i;
>  
> -    for ( i = MOD_DISCARD_FIRST; i <= mi->nr_mods; i++ )
> +    for ( i = 0; i <= mi->nr_mods; i++ )
>      {
>          paddr_t s = mi->module[i].start;
>          paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
>  
> -        dt_unreserved_regions(s, e, init_domheap_pages, 0);
> +        if ( mi->module[i].kind > BOOTMOD_LAST_PRESERVE )
> +            dt_unreserved_regions(s, e, init_domheap_pages, 0);
>      }

[..]


> +typedef enum {
> +    BOOTMOD_XEN,
> +    BOOTMOD_FDT,
> +    /* Everything up to here is not freed after start of day */
> +    BOOTMOD_LAST_PRESERVE = BOOTMOD_FDT,

Currently we also discard the FDT, this is because the FDT is copied
another place in the memory. With this patch the FDT module stays in memory.

I think BOOTMOD_LAST_PRESERVE should be equal to BOOTMOD_XEN.

> +    BOOTMOD_KERNEL,
> +    BOOTMOD_RAMDISK,
> +    BOOTMOD_XSM,
> +    BOOTMOD_UNKNOWN
> +}  bootmodulekind;

I would rename to bootmodule_kind. It's easier to read and you know that
the enum is used for a bootmodule.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-06-16 12:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 11:44 [PATCH 00/10] xen: arm: Refactor/improve early DT parsing and multiboot module support Ian Campbell
2014-06-16 11:44 ` [PATCH 01/10] xen: arm: implement generic multiboot compatibility strings Ian Campbell
2014-06-16 11:44 ` [PATCH 02/10] xen: arm: /chosen/module@N/bootargs bootprotcol node is not deprecated Ian Campbell
2014-06-16 11:44 ` [PATCH 03/10] xen: arm: prefer typesafe max()/min() over MAX()/MIN() Ian Campbell
2014-06-16 12:08   ` Julien Grall
2014-06-16 11:44 ` [PATCH 04/10] xen: arm: rename early_info structs Ian Campbell
2014-06-16 12:10   ` Julien Grall
2014-06-18 13:56   ` Stefano Stabellini
2014-06-16 11:44 ` [PATCH 05/10] xen: arm: move boot time fdt parsing into separate file Ian Campbell
2014-06-16 12:13   ` Julien Grall
2014-06-18 14:00   ` Stefano Stabellini
2014-06-16 11:44 ` [PATCH 06/10] xen: arm: device_tree_bootargs to bootfdt.c, renaming to boot_fdt_cmdline Ian Campbell
2014-06-16 12:32   ` Julien Grall
2014-06-18 14:02   ` Stefano Stabellini
2014-06-16 11:45 ` [PATCH 07/10] xen: arm: store per-boot module type instead of relying on index Ian Campbell
2014-06-16 12:48   ` Julien Grall [this message]
2014-06-16 12:52     ` Ian Campbell
2014-06-18 14:18   ` Stefano Stabellini
2014-06-16 11:45 ` [PATCH 08/10] xen: arm: support bootmodule type detection by ordering Ian Campbell
2014-06-18 14:40   ` Stefano Stabellini
2014-06-18 14:45     ` Ian Campbell
2014-06-18 15:19       ` Stefano Stabellini
2014-06-16 11:45 ` [PATCH 09/10] xen: arm: Drop device_tree_node_compatible Ian Campbell
2014-06-18 14:43   ` Stefano Stabellini
2014-06-18 14:47     ` Ian Campbell
2014-06-18 14:57       ` Julien Grall
2014-06-18 14:59         ` Stefano Stabellini
2014-06-18 15:20         ` Ian Campbell
2014-06-16 11:45 ` [PATCH 10/10] xen: arm: update multiboot device tree bindings Ian Campbell
2014-06-18 14:56   ` Stefano Stabellini
2014-06-18 15:17     ` Ian Campbell
2014-06-18 15:22       ` Stefano Stabellini
2014-06-18 15:24         ` Ian Campbell
2014-07-15 18:22 ` [PATCH 00/10] xen: arm: Refactor/improve early DT parsing and multiboot module support Roy Franz
2014-07-16  8:31   ` Ian Campbell

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=539EE784.40803@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=fu.wei@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=naresh.bhat@linaro.org \
    --cc=roy.franz@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.