All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Chen <Wei.Chen@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>
Subject: Re: [PATCH v4 1/3] arm/efi: Introduce xen,uefi-cfg-load DT property
Date: Thu, 30 Sep 2021 14:33:30 +0000	[thread overview]
Message-ID: <0A3942A2-C668-4BDD-A1A0-D6EFD2738560@arm.com> (raw)
In-Reply-To: <20210930142846.13348-2-luca.fancellu@arm.com>

Hi Luca,

> On 30 Sep 2021, at 15:28, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
> 
> Introduce the xen,uefi-cfg-load DT property of /chosen
> node for ARM whose presence decide whether to force
> the load of the UEFI Xen configuration file.
> 
> The logic is that if any multiboot,module is found in
> the DT, then the xen,uefi-cfg-load property is used to see
> if the UEFI Xen configuration file is needed.
> 
> Modify a comment in efi_arch_use_config_file, removing
> the part that states "dom0 required" because it's not
> true anymore with this commit.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> v4 changes:
> - modify property name to xen,uefi-cfg-load
> v3 changes:
> - add documentation to misc/arm/device-tree/booting.txt
> - Modified variable name and logic from skip_cfg_file to
> load_cfg_file
> - Add in the commit message that I'm modifying a comment.
> v2 changes:
> - Introduced uefi,cfg-load property
> - Add documentation about the property
> ---
> docs/misc/arm/device-tree/booting.txt |  8 ++++++++
> docs/misc/efi.pandoc                  |  2 ++
> xen/arch/arm/efi/efi-boot.h           | 28 ++++++++++++++++++++++-----
> 3 files changed, 33 insertions(+), 5 deletions(-)
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> index 44cd9e1a9a..352b0ec43a 100644
> --- a/docs/misc/arm/device-tree/booting.txt
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -121,6 +121,14 @@ A Xen-aware bootloader would set xen,xen-bootargs for Xen, xen,dom0-bootargs
> for Dom0 and bootargs for native Linux.
> 
> 
> +UEFI boot and DT
> +================
> +
> +When Xen is booted using UEFI, it doesn't read the configuration file if any
> +multiboot module is specified. To force Xen to load the configuration file, the
> +boolean property xen,uefi-cfg-load must be declared in the /chosen node.
> +
> +
> Creating Multiple Domains directly from Xen
> ===========================================
> 
> diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc
> index ac3cd58cae..ed85351541 100644
> --- a/docs/misc/efi.pandoc
> +++ b/docs/misc/efi.pandoc
> @@ -14,6 +14,8 @@ loaded the modules and describes them in the device tree provided to Xen.  If a
> bootloader provides a device tree containing modules then any configuration
> files are ignored, and the bootloader is responsible for populating all
> relevant device tree nodes.
> +The property "xen,uefi-cfg-load" can be specified in the /chosen node to force
> +Xen to load the configuration file even if multiboot modules are found.
> 
> Once built, `make install-xen` will place the resulting binary directly into
> the EFI boot partition, provided `EFI_VENDOR` is set in the environment (and
> diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
> index cf9c37153f..a3e46453d4 100644
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/efi/efi-boot.h
> @@ -581,22 +581,40 @@ static void __init efi_arch_load_addr_check(EFI_LOADED_IMAGE *loaded_image)
> 
> static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
> {
> +    bool load_cfg_file = true;
>     /*
>      * For arm, we may get a device tree from GRUB (or other bootloader)
>      * that contains modules that have already been loaded into memory.  In
> -     * this case, we do not use a configuration file, and rely on the
> -     * bootloader to have loaded all required modules and appropriate
> -     * options.
> +     * this case, we search for the property xen,uefi-cfg-load in the /chosen
> +     * node to decide whether to skip the UEFI Xen configuration file or not.
>      */
> 
>     fdt = lookup_fdt_config_table(SystemTable);
>     dtbfile.ptr = fdt;
>     dtbfile.need_to_free = false; /* Config table memory can't be freed. */
> -    if ( !fdt || fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") < 0 )
> +
> +    if ( fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") > 0 )
> +    {
> +        /* Locate chosen node */
> +        int node = fdt_subnode_offset(fdt, 0, "chosen");
> +        const void *cfg_load_prop;
> +        int cfg_load_len;
> +
> +        if ( node > 0 )
> +        {
> +            /* Check if xen,uefi-cfg-load property exists */
> +            cfg_load_prop = fdt_getprop(fdt, node, "xen,uefi-cfg-load",
> +                                        &cfg_load_len);
> +            if ( !cfg_load_prop )
> +                load_cfg_file = false;
> +        }
> +    }
> +
> +    if ( !fdt || load_cfg_file )
>     {
>         /*
>          * We either have no FDT, or one without modules, so we must have a
> -         * Xen EFI configuration file to specify modules.  (dom0 required)
> +         * Xen EFI configuration file to specify modules.
>          */
>         return true;
>     }
> -- 
> 2.17.1
> 



  reply	other threads:[~2021-09-30 14:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 14:28 [PATCH v4 0/3] arm/efi: Add dom0less support to UEFI boot Luca Fancellu
2021-09-30 14:28 ` [PATCH v4 1/3] arm/efi: Introduce xen,uefi-cfg-load DT property Luca Fancellu
2021-09-30 14:33   ` Bertrand Marquis [this message]
2021-10-01 23:29     ` Stefano Stabellini
2021-10-06 18:32   ` Julien Grall
2021-10-07 14:25     ` Luca Fancellu
2021-09-30 14:28 ` [PATCH v4 2/3] arm/efi: Use dom0less configuration when using EFI boot Luca Fancellu
2021-09-30 14:33   ` Bertrand Marquis
2021-09-30 21:47   ` Stefano Stabellini
2021-10-01 11:02   ` Jan Beulich
2021-10-01 13:55     ` Luca Fancellu
2021-10-01 14:22       ` Jan Beulich
2021-10-01 15:13         ` Luca Fancellu
2021-10-07  7:15           ` Jan Beulich
2021-10-08 13:38             ` Luca Fancellu
2021-10-08 14:14               ` Jan Beulich
2021-09-30 14:28 ` [PATCH v4 3/3] arm/efi: load dom0 modules from DT using UEFI Luca Fancellu
2021-09-30 14:34   ` Bertrand Marquis
2021-09-30 21:58   ` Stefano Stabellini
2021-10-01 11:16   ` Jan Beulich
2021-10-01 14:08     ` Luca Fancellu
2021-10-01 14:24       ` Jan Beulich

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=0A3942A2-C668-4BDD-A1A0-D6EFD2738560@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=Wei.Chen@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.