xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefanos@xilinx.com>,
	Achin.Gupta@arm.com, andrii_anisov@epam.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 3/5] xen/arm: handle "multiboot, dtb" compatible nodes
Date: Mon, 24 Dec 2018 13:58:50 +0000	[thread overview]
Message-ID: <70ff70c5-f79b-4141-feea-cb6e4d8b21b5@arm.com> (raw)
In-Reply-To: <1544030891-11906-3-git-send-email-sstabellini@kernel.org>

Hi,

On 12/5/18 5:28 PM, Stefano Stabellini wrote:
> Detect "multiboot,dtb" compatible nodes. Add them to the bootmod array
> as BOOTMOD_DTB.  In kernel_probe, find the right BOOTMOD_DTB and store a
> pointer to it in dtb_bootmodule.

This is too close to the name BOOTMOD_FDT. So this will confuse more 
than one developer.

This probably want to be renamed to BOOTMOD_GUEST_DTB.

> 
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
> ---
>   xen/arch/arm/bootfdt.c      |  2 ++
>   xen/arch/arm/kernel.c       | 12 +++++++++++-
>   xen/arch/arm/setup.c        |  1 +
>   xen/include/asm-arm/setup.h |  1 +
>   4 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
> index 72cb8d6..ad4fbac 100644
> --- a/xen/arch/arm/bootfdt.c
> +++ b/xen/arch/arm/bootfdt.c
> @@ -205,6 +205,8 @@ static void __init process_multiboot_node(const void *fdt, int node,
>           kind = BOOTMOD_RAMDISK;
>       else if ( fdt_node_check_compatible(fdt, node, "xen,xsm-policy") == 0 )
>           kind = BOOTMOD_XSM;
> +    else if ( fdt_node_check_compatible(fdt, node, "multiboot,dtb") == 0 )

I would prefer an explicit name such as "multiboot,device-tree".

> +        kind = BOOTMOD_DTB;
>       else
>           kind = BOOTMOD_UNKNOWN;
>   
> diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
> index d04a862..8918d75 100644
> --- a/xen/arch/arm/kernel.c
> +++ b/xen/arch/arm/kernel.c
> @@ -426,7 +426,7 @@ int __init kernel_probe(struct kernel_info *info,
>       struct bootmodule *mod = NULL;
>       struct bootcmdline *cmd = NULL;
>       struct dt_device_node *node;
> -    u64 kernel_addr, initrd_addr, size;
> +    u64 kernel_addr = 0, initrd_addr = 0, dtb_addr = 0, size;
>       int rc;
>   
>       /* domain is NULL only for the hardware domain */
> @@ -470,6 +470,16 @@ int __init kernel_probe(struct kernel_info *info,
>                   info->initrd_bootmodule = boot_module_find_by_addr_and_kind(
>                           BOOTMOD_RAMDISK, initrd_addr);
>               }
> +            else if ( dt_device_is_compatible(node, "multiboot,dtb") )
> +            {
> +                u32 len;
> +                const __be32 *val;
> +
> +                val = dt_get_property(node, "reg", &len);
> +                dt_get_range(&val, node, &dtb_addr, &size);
> +                info->dtb_bootmodule = boot_module_find_by_addr_and_kind(
> +                        BOOTMOD_DTB, dtb_addr);
> +            }
>               else
>                   continue;
>           }
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index e83221a..b3de0a2 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -344,6 +344,7 @@ const char * __init boot_module_kind_as_string(bootmodule_kind kind)
>       case BOOTMOD_KERNEL:  return "Kernel";
>       case BOOTMOD_RAMDISK: return "Ramdisk";
>       case BOOTMOD_XSM:     return "XSM";
> +    case BOOTMOD_DTB:     return "DTB";
>       case BOOTMOD_UNKNOWN: return "Unknown";
>       default: BUG();
>       }
> diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
> index 48187e1..0ff0768 100644
> --- a/xen/include/asm-arm/setup.h
> +++ b/xen/include/asm-arm/setup.h
> @@ -16,6 +16,7 @@ typedef enum {
>       BOOTMOD_KERNEL,
>       BOOTMOD_RAMDISK,
>       BOOTMOD_XSM,
> +    BOOTMOD_DTB,
>       BOOTMOD_UNKNOWN
>   }  bootmodule_kind;
>   
> 

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-12-24 13:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 17:28 [PATCH 0/5] dom0less device assignment Stefano Stabellini
2018-12-05 17:28 ` [PATCH 1/5] xen/arm: copy dtb fragment to guest dtb Stefano Stabellini
2018-12-24 11:17   ` Julien Grall
2019-01-02 12:22     ` Wei Liu
2019-01-02 23:25     ` Stefano Stabellini
2018-12-05 17:28 ` [PATCH 2/5] xen/arm: assign devices to boot domains Stefano Stabellini
2018-12-24 13:55   ` Julien Grall
2019-01-03 22:07     ` Stefano Stabellini
2019-01-15 12:50       ` Julien Grall
2018-12-05 17:28 ` [PATCH 3/5] xen/arm: handle "multiboot, dtb" compatible nodes Stefano Stabellini
2018-12-24 13:58   ` Julien Grall [this message]
2019-01-02 23:28     ` Stefano Stabellini
2018-12-05 17:28 ` [PATCH 4/5] xen/arm: use the physical number of gic lines for boot domains Stefano Stabellini
2018-12-24 14:01   ` Julien Grall
2019-01-03 19:07     ` Stefano Stabellini
2019-01-15 12:56       ` Julien Grall
2018-12-05 17:28 ` [PATCH 5/5] xen/arm: add dom0less device assignment info to docs Stefano Stabellini
2018-12-24 14:06   ` Julien Grall
2019-01-03 22:07     ` Stefano Stabellini
2019-01-03 23:31       ` Stefano Stabellini
2019-01-15 13:03         ` Julien Grall
2019-01-15 13:02       ` 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=70ff70c5-f79b-4141-feea-cb6e4d8b21b5@arm.com \
    --to=julien.grall@arm.com \
    --cc=Achin.Gupta@arm.com \
    --cc=andrii_anisov@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanos@xilinx.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).