All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Alejandro Vallejo <alejandro.garciavallejo@amd.com>,
	xen-devel@lists.xenproject.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Bob Eshleman" <bobbyeshleman@gmail.com>,
	"Connor Davis" <connojdavis@gmail.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v7 05/11] xen/dt: Move bootinfo functions to a new bootinfo.h
Date: Mon, 21 Jul 2025 13:52:48 +0200	[thread overview]
Message-ID: <d9554d2b-4a44-4401-b490-2a10f3f29ca0@gmail.com> (raw)
In-Reply-To: <20250715161108.141126-6-alejandro.garciavallejo@amd.com>

[-- Attachment #1: Type: text/plain, Size: 20398 bytes --]


On 7/15/25 6:11 PM, Alejandro Vallejo wrote:
> Part of an unpicking process to extract bootfdt contents independent of
> bootinfo to a separate file for x86 to take.
>
> With this, bootfdt.h can be cleanly included from x86. A later patch
> extracts the definitions so the functions may be called too.
>
> Not a functional change.
>
> Signed-off-by: Alejandro Vallejo<alejandro.garciavallejo@amd.com>
> Reviewed-by: Stefano Stabellini<sstabellini@kernel.org>

LGTM: Reviewed-by: Oleksii Kurochko<oleksii.kurochko@gmail.com> # riscv

~ Oleksii

> ---
>   xen/arch/arm/domain_build.c             |   1 +
>   xen/arch/arm/include/asm/setup.h        |   2 +-
>   xen/arch/arm/setup.c                    |   1 +
>   xen/arch/riscv/mm.c                     |   2 +-
>   xen/arch/riscv/setup.c                  |   2 +-
>   xen/common/device-tree/bootfdt.c        |   2 +-
>   xen/common/device-tree/bootinfo.c       |   2 +-
>   xen/common/device-tree/dom0less-build.c |   2 +-
>   xen/common/device-tree/domain-build.c   |   2 +-
>   xen/common/device-tree/kernel.c         |   2 +-
>   xen/include/xen/bootfdt.h               | 207 -----------------------
>   xen/include/xen/bootinfo.h              | 213 ++++++++++++++++++++++++
>   xen/include/xen/fdt-domain-build.h      |   2 +-
>   xen/include/xen/fdt-kernel.h            |   2 +-
>   14 files changed, 225 insertions(+), 217 deletions(-)
>   create mode 100644 xen/include/xen/bootinfo.h
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index edc9a82c15..b66a172eb8 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1,5 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   #include <xen/init.h>
> +#include <xen/bootinfo.h>
>   #include <xen/compile.h>
>   #include <xen/fdt-domain-build.h>
>   #include <xen/fdt-kernel.h>
> diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
> index b199d92a42..1eaf13bd66 100644
> --- a/xen/arch/arm/include/asm/setup.h
> +++ b/xen/arch/arm/include/asm/setup.h
> @@ -3,7 +3,7 @@
>   
>   #include <public/version.h>
>   #include <asm/p2m.h>
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   
>   #if defined(CONFIG_MMU)
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 12b76a0a98..8abc1d641d 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -8,6 +8,7 @@
>    * Copyright (c) 2011 Citrix Systems.
>    */
>   
> +#include <xen/bootinfo.h>
>   #include <xen/compile.h>
>   #include <xen/device_tree.h>
>   #include <xen/domain_page.h>
> diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
> index 774ea42f2d..1ef015f179 100644
> --- a/xen/arch/riscv/mm.c
> +++ b/xen/arch/riscv/mm.c
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/bug.h>
>   #include <xen/compiler.h>
>   #include <xen/domain_page.h>
> diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
> index a17096bf02..483cdd7e17 100644
> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -2,7 +2,7 @@
>   
>   #include <xen/acpi.h>
>   #include <xen/bug.h>
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/compile.h>
>   #include <xen/console.h>
>   #include <xen/device_tree.h>
> diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
> index 67fe5c3cc3..e372096b19 100644
> --- a/xen/common/device-tree/bootfdt.c
> +++ b/xen/common/device-tree/bootfdt.c
> @@ -5,7 +5,7 @@
>    * Copyright (C) 2012-2014 Citrix Systems, Inc.
>    */
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   #include <xen/efi.h>
>   #include <xen/init.h>
> diff --git a/xen/common/device-tree/bootinfo.c b/xen/common/device-tree/bootinfo.c
> index 2a27d1318b..00a43fb358 100644
> --- a/xen/common/device-tree/bootinfo.c
> +++ b/xen/common/device-tree/bootinfo.c
> @@ -10,7 +10,7 @@
>    */
>   
>   #include <xen/acpi.h>
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/bug.h>
>   #include <xen/device_tree.h>
>   #include <xen/init.h>
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index e950691d1e..93734e0ea8 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   #include <xen/domain.h>
>   #include <xen/domain_page.h>
> diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
> index 2fdea6624a..95b383e00f 100644
> --- a/xen/common/device-tree/domain-build.c
> +++ b/xen/common/device-tree/domain-build.c
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/fdt-domain-build.h>
>   #include <xen/init.h>
>   #include <xen/lib.h>
> diff --git a/xen/common/device-tree/kernel.c b/xen/common/device-tree/kernel.c
> index 6de2334dbe..ef393182b6 100644
> --- a/xen/common/device-tree/kernel.c
> +++ b/xen/common/device-tree/kernel.c
> @@ -1,6 +1,6 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   #include <xen/fdt-kernel.h>
>   #include <xen/errno.h>
> diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
> index a5dfaa5c1d..b22d7b39c2 100644
> --- a/xen/include/xen/bootfdt.h
> +++ b/xen/include/xen/bootfdt.h
> @@ -5,10 +5,7 @@
>   #include <xen/byteorder.h>
>   #include <xen/bug.h>
>   #include <xen/types.h>
> -#include <xen/kernel.h>
>   #include <xen/lib.h>
> -#include <xen/macros.h>
> -#include <xen/xmalloc.h>
>   
>   #if __has_include(<asm/bootfdt.h>)
>   #include <asm/bootfdt.h>
> @@ -16,15 +13,10 @@
>   
>   #define MIN_FDT_ALIGN 8
>   
> -#define NR_MEM_BANKS 256
> -#define NR_SHMEM_BANKS 32
> -
>   /* Default #address and #size cells */
>   #define DT_ROOT_NODE_ADDR_CELLS_DEFAULT 2
>   #define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>   
> -#define MAX_MODULES 32 /* Current maximum useful modules */
> -
>   #define DEVICE_TREE_MAX_DEPTH 16
>   
>   /* Helper to read a big number; size is in cells (not bytes) */
> @@ -116,77 +108,6 @@ typedef enum {
>       BOOTMOD_UNKNOWN
>   }  boot_module_kind;
>   
> -enum membank_type {
> -    /*
> -     * The MEMBANK_DEFAULT type refers to either reserved memory for the
> -     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
> -     * the bank is in 'mem').
> -     */
> -    MEMBANK_DEFAULT,
> -    /*
> -     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
> -     * bank is bound to a static Xen domain. It is only valid when the bank
> -     * is in reserved_mem.
> -     */
> -    MEMBANK_STATIC_DOMAIN,
> -    /*
> -     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
> -     * bank is reserved as static heap. It is only valid when the bank is
> -     * in reserved_mem.
> -     */
> -    MEMBANK_STATIC_HEAP,
> -    /*
> -     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
> -     * bank is from the FDT reserve map.
> -     */
> -    MEMBANK_FDT_RESVMEM,
> -};
> -
> -enum region_type {
> -    MEMORY,
> -    RESERVED_MEMORY,
> -    STATIC_SHARED_MEMORY
> -};
> -
> -/* Indicates the maximum number of characters(\0 included) for shm_id */
> -#define MAX_SHM_ID_LENGTH 16
> -
> -struct shmem_membank_extra {
> -    char shm_id[MAX_SHM_ID_LENGTH];
> -    unsigned int nr_shm_borrowers;
> -};
> -
> -struct membank {
> -    paddr_t start;
> -    paddr_t size;
> -    union {
> -        enum membank_type type;
> -#ifdef CONFIG_STATIC_SHM
> -        struct shmem_membank_extra *shmem_extra;
> -#endif
> -    };
> -};
> -
> -struct membanks {
> -    __struct_group(membanks_hdr, common, ,
> -        unsigned int nr_banks;
> -        unsigned int max_banks;
> -        enum region_type type;
> -    );
> -    struct membank bank[];
> -};
> -
> -struct meminfo {
> -    struct membanks_hdr common;
> -    struct membank bank[NR_MEM_BANKS];
> -};
> -
> -struct shared_meminfo {
> -    struct membanks_hdr common;
> -    struct membank bank[NR_SHMEM_BANKS];
> -    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
> -};
> -
>   struct boot_domain {
>       struct domain *d;
>   
> @@ -220,134 +141,6 @@ struct boot_module {
>   #endif
>   };
>   
> -/* DT_MAX_NAME is the node name max length according the DT spec */
> -#define DT_MAX_NAME 41
> -struct bootcmdline {
> -    boot_module_kind kind;
> -    bool domU;
> -    paddr_t start;
> -    char dt_name[DT_MAX_NAME];
> -    char cmdline[BOOTMOD_MAX_CMDLINE];
> -};
> -
> -struct boot_modules {
> -    int nr_mods;
> -    struct boot_module module[MAX_MODULES];
> -};
> -
> -struct bootcmdlines {
> -    unsigned int nr_mods;
> -    struct bootcmdline cmdline[MAX_MODULES];
> -};
> -
> -struct bootinfo {
> -    struct meminfo mem;
> -    /* The reserved regions are only used when booting using Device-Tree */
> -    struct meminfo reserved_mem;
> -    struct boot_modules modules;
> -    struct bootcmdlines cmdlines;
> -#ifdef CONFIG_ACPI
> -    struct meminfo acpi;
> -#endif
> -#ifdef CONFIG_STATIC_SHM
> -    struct shared_meminfo shmem;
> -#endif
> -};
> -
> -#ifdef CONFIG_ACPI
> -#define BOOTINFO_ACPI_INIT                          \
> -    .acpi.common.max_banks = NR_MEM_BANKS,          \
> -    .acpi.common.type = MEMORY,
> -#else
> -#define BOOTINFO_ACPI_INIT
> -#endif
> -
> -#ifdef CONFIG_STATIC_SHM
> -#define BOOTINFO_SHMEM_INIT                         \
> -    .shmem.common.max_banks = NR_SHMEM_BANKS,       \
> -    .shmem.common.type = STATIC_SHARED_MEMORY,
> -#else
> -#define BOOTINFO_SHMEM_INIT
> -#endif
> -
> -#define BOOTINFO_INIT                               \
> -{                                                   \
> -    .mem.common.max_banks = NR_MEM_BANKS,           \
> -    .mem.common.type = MEMORY,                      \
> -    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
> -    .reserved_mem.common.type = RESERVED_MEMORY,    \
> -    BOOTINFO_ACPI_INIT                              \
> -    BOOTINFO_SHMEM_INIT                             \
> -}
> -
> -extern struct bootinfo bootinfo;
> -
> -bool check_reserved_regions_overlap(paddr_t region_start,
> -                                    paddr_t region_size,
> -                                    bool allow_memreserve_overlap);
> -
> -struct boot_module *add_boot_module(boot_module_kind kind,
> -                                   paddr_t start, paddr_t size, bool domU);
> -struct boot_module *boot_module_find_by_kind(boot_module_kind kind);
> -struct boot_module * boot_module_find_by_addr_and_kind(boot_module_kind kind,
> -                                                             paddr_t start);
> -void add_boot_cmdline(const char *name, const char *cmdline,
> -                      boot_module_kind kind, paddr_t start, bool domU);
> -struct bootcmdline *boot_cmdline_find_by_kind(boot_module_kind kind);
> -struct bootcmdline * boot_cmdline_find_by_name(const char *name);
> -const char *boot_module_kind_as_string(boot_module_kind kind);
> -
> -void populate_boot_allocator(void);
> -
> -size_t boot_fdt_info(const void *fdt, paddr_t paddr);
> -
> -const char *boot_fdt_cmdline(const void *fdt);
> -int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
> -
> -static inline struct membanks *bootinfo_get_reserved_mem(void)
> -{
> -    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
> -}
> -
> -static inline struct membanks *bootinfo_get_mem(void)
> -{
> -    return container_of(&bootinfo.mem.common, struct membanks, common);
> -}
> -
> -#ifdef CONFIG_ACPI
> -static inline struct membanks *bootinfo_get_acpi(void)
> -{
> -    return container_of(&bootinfo.acpi.common, struct membanks, common);
> -}
> -#endif
> -
> -#ifdef CONFIG_STATIC_SHM
> -static inline struct membanks *bootinfo_get_shmem(void)
> -{
> -    return container_of(&bootinfo.shmem.common, struct membanks, common);
> -}
> -
> -static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
> -{
> -    return bootinfo.shmem.extra;
> -}
> -#endif
> -
> -static inline struct membanks *membanks_xzalloc(unsigned int nr,
> -                                                enum region_type type)
> -{
> -    struct membanks *banks = xzalloc_flex_struct(struct membanks, bank, nr);
> -
> -    if ( !banks )
> -        goto out;
> -
> -    banks->max_banks = nr;
> -    banks->type = type;
> -
> - out:
> -    return banks;
> -}
> -
>   /*
>    * Interpret the property `prop_name` of `node` as a u32.
>    *
> diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
> new file mode 100644
> index 0000000000..f834f19571
> --- /dev/null
> +++ b/xen/include/xen/bootinfo.h
> @@ -0,0 +1,213 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef XEN_BOOTINFO_H
> +#define XEN_BOOTINFO_H
> +
> +#include <xen/bootfdt.h>
> +#include <xen/kernel.h>
> +#include <xen/macros.h>
> +#include <xen/xmalloc.h>
> +
> +#define NR_MEM_BANKS 256
> +#define NR_SHMEM_BANKS 32
> +
> +#define MAX_MODULES 32 /* Current maximum useful modules */
> +
> +enum membank_type {
> +    /*
> +     * The MEMBANK_DEFAULT type refers to either reserved memory for the
> +     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
> +     * the bank is in 'mem').
> +     */
> +    MEMBANK_DEFAULT,
> +    /*
> +     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
> +     * bank is bound to a static Xen domain. It is only valid when the bank
> +     * is in reserved_mem.
> +     */
> +    MEMBANK_STATIC_DOMAIN,
> +    /*
> +     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
> +     * bank is reserved as static heap. It is only valid when the bank is
> +     * in reserved_mem.
> +     */
> +    MEMBANK_STATIC_HEAP,
> +    /*
> +     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
> +     * bank is from the FDT reserve map.
> +     */
> +    MEMBANK_FDT_RESVMEM,
> +};
> +
> +enum region_type {
> +    MEMORY,
> +    RESERVED_MEMORY,
> +    STATIC_SHARED_MEMORY
> +};
> +
> +/* Indicates the maximum number of characters(\0 included) for shm_id */
> +#define MAX_SHM_ID_LENGTH 16
> +
> +struct shmem_membank_extra {
> +    char shm_id[MAX_SHM_ID_LENGTH];
> +    unsigned int nr_shm_borrowers;
> +};
> +
> +struct membank {
> +    paddr_t start;
> +    paddr_t size;
> +    union {
> +        enum membank_type type;
> +#ifdef CONFIG_STATIC_SHM
> +        struct shmem_membank_extra *shmem_extra;
> +#endif
> +    };
> +};
> +
> +struct membanks {
> +    __struct_group(membanks_hdr, common, ,
> +        unsigned int nr_banks;
> +        unsigned int max_banks;
> +        enum region_type type;
> +    );
> +    struct membank bank[];
> +};
> +
> +struct meminfo {
> +    struct membanks_hdr common;
> +    struct membank bank[NR_MEM_BANKS];
> +};
> +
> +struct shared_meminfo {
> +    struct membanks_hdr common;
> +    struct membank bank[NR_SHMEM_BANKS];
> +    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
> +};
> +
> +/* DT_MAX_NAME is the node name max length according the DT spec */
> +#define DT_MAX_NAME 41
> +struct bootcmdline {
> +    boot_module_kind kind;
> +    bool domU;
> +    paddr_t start;
> +    char dt_name[DT_MAX_NAME];
> +    char cmdline[BOOTMOD_MAX_CMDLINE];
> +};
> +
> +struct boot_modules {
> +    int nr_mods;
> +    struct boot_module module[MAX_MODULES];
> +};
> +
> +struct bootcmdlines {
> +    unsigned int nr_mods;
> +    struct bootcmdline cmdline[MAX_MODULES];
> +};
> +
> +struct bootinfo {
> +    struct meminfo mem;
> +    /* The reserved regions are only used when booting using Device-Tree */
> +    struct meminfo reserved_mem;
> +    struct boot_modules modules;
> +    struct bootcmdlines cmdlines;
> +#ifdef CONFIG_ACPI
> +    struct meminfo acpi;
> +#endif
> +#ifdef CONFIG_STATIC_SHM
> +    struct shared_meminfo shmem;
> +#endif
> +};
> +
> +#ifdef CONFIG_ACPI
> +#define BOOTINFO_ACPI_INIT                          \
> +    .acpi.common.max_banks = NR_MEM_BANKS,          \
> +    .acpi.common.type = MEMORY,
> +#else
> +#define BOOTINFO_ACPI_INIT
> +#endif
> +
> +#ifdef CONFIG_STATIC_SHM
> +#define BOOTINFO_SHMEM_INIT                         \
> +    .shmem.common.max_banks = NR_SHMEM_BANKS,       \
> +    .shmem.common.type = STATIC_SHARED_MEMORY,
> +#else
> +#define BOOTINFO_SHMEM_INIT
> +#endif
> +
> +#define BOOTINFO_INIT                               \
> +{                                                   \
> +    .mem.common.max_banks = NR_MEM_BANKS,           \
> +    .mem.common.type = MEMORY,                      \
> +    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
> +    .reserved_mem.common.type = RESERVED_MEMORY,    \
> +    BOOTINFO_ACPI_INIT                              \
> +    BOOTINFO_SHMEM_INIT                             \
> +}
> +
> +extern struct bootinfo bootinfo;
> +
> +bool check_reserved_regions_overlap(paddr_t region_start,
> +                                    paddr_t region_size,
> +                                    bool allow_memreserve_overlap);
> +
> +struct boot_module *add_boot_module(boot_module_kind kind,
> +                                    paddr_t start, paddr_t size, bool domU);
> +struct boot_module *boot_module_find_by_kind(boot_module_kind kind);
> +struct boot_module * boot_module_find_by_addr_and_kind(boot_module_kind kind,
> +                                                             paddr_t start);
> +void add_boot_cmdline(const char *name, const char *cmdline,
> +                      boot_module_kind kind, paddr_t start, bool domU);
> +struct bootcmdline *boot_cmdline_find_by_kind(boot_module_kind kind);
> +struct bootcmdline * boot_cmdline_find_by_name(const char *name);
> +const char *boot_module_kind_as_string(boot_module_kind kind);
> +
> +void populate_boot_allocator(void);
> +
> +size_t boot_fdt_info(const void *fdt, paddr_t paddr);
> +const char *boot_fdt_cmdline(const void *fdt);
> +int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
> +
> +static inline struct membanks *bootinfo_get_reserved_mem(void)
> +{
> +    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
> +}
> +
> +static inline struct membanks *bootinfo_get_mem(void)
> +{
> +    return container_of(&bootinfo.mem.common, struct membanks, common);
> +}
> +
> +#ifdef CONFIG_ACPI
> +static inline struct membanks *bootinfo_get_acpi(void)
> +{
> +    return container_of(&bootinfo.acpi.common, struct membanks, common);
> +}
> +#endif
> +
> +#ifdef CONFIG_STATIC_SHM
> +static inline struct membanks *bootinfo_get_shmem(void)
> +{
> +    return container_of(&bootinfo.shmem.common, struct membanks, common);
> +}
> +
> +static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
> +{
> +    return bootinfo.shmem.extra;
> +}
> +#endif
> +
> +static inline struct membanks *membanks_xzalloc(unsigned int nr,
> +                                                enum region_type type)
> +{
> +    struct membanks *banks = xzalloc_flex_struct(struct membanks, bank, nr);
> +
> +    if ( !banks )
> +        goto out;
> +
> +    banks->max_banks = nr;
> +    banks->type = type;
> +
> + out:
> +    return banks;
> +}
> +
> +#endif /* XEN_BOOTINFO_H */
> diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
> index 3a20623cf5..886a853816 100644
> --- a/xen/include/xen/fdt-domain-build.h
> +++ b/xen/include/xen/fdt-domain-build.h
> @@ -3,7 +3,7 @@
>   #ifndef __XEN_FDT_DOMAIN_BUILD_H__
>   #define __XEN_FDT_DOMAIN_BUILD_H__
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   #include <xen/fdt-kernel.h>
>   #include <xen/mm.h>
> diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
> index 8363865282..33a60597bb 100644
> --- a/xen/include/xen/fdt-kernel.h
> +++ b/xen/include/xen/fdt-kernel.h
> @@ -7,7 +7,7 @@
>   #ifndef __XEN_FDT_KERNEL_H__
>   #define __XEN_FDT_KERNEL_H__
>   
> -#include <xen/bootfdt.h>
> +#include <xen/bootinfo.h>
>   #include <xen/device_tree.h>
>   #include <xen/types.h>
>   

[-- Attachment #2: Type: text/html, Size: 20319 bytes --]

  reply	other threads:[~2025-07-21 11:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 16:10 [PATCH v7 00/11] Allow x86 to unflatten DTs Alejandro Vallejo
2025-07-15 16:10 ` [PATCH v7 01/11] x86: Replace arch-specific boot_module with common one Alejandro Vallejo
2025-07-21 22:27   ` Daniel P. Smith
2025-07-21 23:07     ` Alejandro Vallejo
2025-07-15 16:10 ` [PATCH v7 02/11] xen: Refactor kernel_info to have a header like boot_domain Alejandro Vallejo
2025-07-15 16:10 ` [PATCH v7 03/11] x86: Replace arch-specific boot_domain with the common one Alejandro Vallejo
2025-07-18  0:09   ` Stefano Stabellini
2025-07-18  6:51     ` Jan Beulich
2025-07-18  6:47   ` Jan Beulich
2025-07-15 16:10 ` [PATCH v7 04/11] xen/dt: Move bootfdt functions to xen/bootfdt.h Alejandro Vallejo
2025-07-21 11:24   ` Oleksii Kurochko
2025-07-15 16:11 ` [PATCH v7 05/11] xen/dt: Move bootinfo functions to a new bootinfo.h Alejandro Vallejo
2025-07-21 11:52   ` Oleksii Kurochko [this message]
2025-07-15 16:11 ` [PATCH v7 06/11] xen/dt: Rename bootfdt.c -> bootinfo-fdt.c Alejandro Vallejo
2025-07-17 14:43   ` Orzel, Michal
2025-07-15 16:11 ` [PATCH v7 07/11] xen/dt: Extract bootinfo-independent functions to bootfdt.c Alejandro Vallejo
2025-07-17 14:43   ` Orzel, Michal
2025-07-15 16:11 ` [PATCH v7 08/11] xen/dt: Extract helper to map nodes to module kinds Alejandro Vallejo
2025-07-15 16:11 ` [PATCH v7 09/11] xen: Split HAS_DEVICE_TREE in two Alejandro Vallejo
2025-07-21 11:34   ` Oleksii Kurochko
2025-07-21 22:08   ` Daniel P. Smith
2025-07-15 16:11 ` [PATCH v7 10/11] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h} Alejandro Vallejo
2025-07-15 16:11 ` [PATCH v7 11/11] xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/ Alejandro Vallejo
2025-07-16 15:55   ` Alejandro Vallejo

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=d9554d2b-4a44-4401-b490-2a10f3f29ca0@gmail.com \
    --to=oleksii.kurochko@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=alejandro.garciavallejo@amd.com \
    --cc=alistair.francis@wdc.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=connojdavis@gmail.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.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.