All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
To: Alejandro Vallejo <alejandro.garciavallejo@amd.com>,
	<xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <agarciav@amd.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	"Connor Davis" <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v6 05/11] xen/dt: Move bootfdt functions to xen/bootfdt.h
Date: Fri, 11 Jul 2025 19:45:28 +0200	[thread overview]
Message-ID: <DB9EVWXIJQ8X.3M8QTEWAFSEH2@amd.com> (raw)
In-Reply-To: <20250708180721.2338036-6-alejandro.garciavallejo@amd.com>

On Tue Jul 8, 2025 at 8:07 PM CEST, Alejandro Vallejo wrote:
> From: Alejandro Vallejo <agarciav@amd.com>
>
> Part of an unpicking process to extract bootfdt contents independent of bootinfo
> to a separate file for x86 to take.
>
> Move functions required for early FDT parsing from device_tree.h and arm's
> setup.h onto bootfdt.h
>
> Declaration motion only. Not a functional change.
>
> Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  xen/arch/riscv/cpufeature.c            |  1 +
>  xen/arch/riscv/smpboot.c               |  1 +
>  xen/common/device-tree/device-tree.c   |  1 +
>  xen/common/device-tree/static-evtchn.c |  1 +
>  xen/common/sched/boot-cpupool.c        |  1 +
>  xen/include/xen/bootfdt.h              | 91 ++++++++++++++++++++++++++
>  xen/include/xen/device_tree.h          | 78 ----------------------
>  7 files changed, 96 insertions(+), 78 deletions(-)
>
> diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
> index b7d5ec6580..b846a106a3 100644
> --- a/xen/arch/riscv/cpufeature.c
> +++ b/xen/arch/riscv/cpufeature.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <xen/bitmap.h>
> +#include <xen/bootfdt.h>
>  #include <xen/ctype.h>
>  #include <xen/device_tree.h>
>  #include <xen/errno.h>
> diff --git a/xen/arch/riscv/smpboot.c b/xen/arch/riscv/smpboot.c
> index 470f6d1311..3b8bf98e20 100644
> --- a/xen/arch/riscv/smpboot.c
> +++ b/xen/arch/riscv/smpboot.c
> @@ -1,3 +1,4 @@
> +#include <xen/bootfdt.h>
>  #include <xen/cpumask.h>
>  #include <xen/device_tree.h>
>  #include <xen/errno.h>
> diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/device-tree.c
> index 7bede20fa6..4ebdb2e52e 100644
> --- a/xen/common/device-tree/device-tree.c
> +++ b/xen/common/device-tree/device-tree.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <xen/bitops.h>
> +#include <xen/bootfdt.h>
>  #include <xen/types.h>
>  #include <xen/init.h>
>  #include <xen/guest_access.h>
> diff --git a/xen/common/device-tree/static-evtchn.c b/xen/common/device-tree/static-evtchn.c
> index 8b82e6b3d8..88342b44a1 100644
> --- a/xen/common/device-tree/static-evtchn.c
> +++ b/xen/common/device-tree/static-evtchn.c
> @@ -1,5 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0-only */
>  
> +#include <xen/bootfdt.h>
>  #include <xen/event.h>
>  #include <xen/static-evtchn.h>
>  
> diff --git a/xen/common/sched/boot-cpupool.c b/xen/common/sched/boot-cpupool.c
> index 641f3495cb..03be73efdd 100644
> --- a/xen/common/sched/boot-cpupool.c
> +++ b/xen/common/sched/boot-cpupool.c
> @@ -7,6 +7,7 @@
>   * Copyright (C) 2022 Arm Ltd.
>   */
>  
> +#include <xen/bootfdt.h>
>  #include <xen/acpi.h>
>  #include <xen/sched.h>
>  
> diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
> index 65ba818e1a..6cf6c1317c 100644
> --- a/xen/include/xen/bootfdt.h
> +++ b/xen/include/xen/bootfdt.h
> @@ -2,8 +2,11 @@
>  #ifndef XEN_BOOTFDT_H
>  #define XEN_BOOTFDT_H
>  
> +#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>
>  
> @@ -16,8 +19,80 @@
>  #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) */
> +static inline u64 dt_read_number(const __be32 *cell, int size)
> +{
> +    u64 r = 0;
> +
> +    while ( size-- )
> +        r = (r << 32) | be32_to_cpu(*(cell++));
> +    return r;
> +}

Bah, bad rebase. This should've been the new switch. I'll correct it on when I
resend it.

Cheers,
Alejandro


  reply	other threads:[~2025-07-11 17:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 18:07 [PATCH v6 00/11] Allow x86 to unflatten DTs Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 01/11] xen: Conditionally compile out the boot_module.domU Alejandro Vallejo
2025-07-08 18:39   ` Stefano Stabellini
2025-07-09  0:26   ` dmkhn
2025-07-08 18:07 ` [PATCH v6 02/11] x86: Replace arch-specific boot_module with common one Alejandro Vallejo
2025-07-09 14:18   ` Jan Beulich
2025-07-08 18:07 ` [PATCH v6 03/11] xen: Refactor kernel_info to have a header like boot_domain Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 04/11] x86: Replace arch-specific boot_domain with the common one Alejandro Vallejo
2025-07-09 14:24   ` Jan Beulich
2025-07-10 12:03     ` Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 05/11] xen/dt: Move bootfdt functions to xen/bootfdt.h Alejandro Vallejo
2025-07-11 17:45   ` Alejandro Vallejo [this message]
2025-07-08 18:07 ` [PATCH v6 06/11] xen/dt: Move bootinfo functions to a new bootinfo.h Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 07/11] xen/dt: Rename bootfdt.c -> bootinfo-fdt.c Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 08/11] xen/dt: Extract helper to map nodes to module kinds Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 09/11] xen: Split HAS_DEVICE_TREE in two Alejandro Vallejo
2025-07-08 18:44   ` Stefano Stabellini
2025-07-09 14:31   ` Jan Beulich
2025-07-08 18:07 ` [PATCH v6 10/11] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h} Alejandro Vallejo
2025-07-08 18:07 ` [PATCH v6 11/11] xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/ Alejandro Vallejo
2025-07-15  6:58   ` Orzel, Michal

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=DB9EVWXIJQ8X.3M8QTEWAFSEH2@amd.com \
    --to=alejandro.garciavallejo@amd.com \
    --cc=agarciav@amd.com \
    --cc=alistair.francis@wdc.com \
    --cc=bertrand.marquis@arm.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=connojdavis@gmail.com \
    --cc=dfaggioli@suse.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=gwd@xenproject.org \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=oleksii.kurochko@gmail.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.