[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 1/8] xen/device-tree: Move Arm's setup.c bootinfo functions to common


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 15 Jul 2024 12:15:10 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yg3+d9VsWm1DnUTslS/oveDOZBCjtkbsH3/s9DogokQ=; b=neko306aGUcTolGQoFMkphDDeVSHfLXCrv5dYNg4WnENTEoeZC9IyECn1cV9Yu3U7ciDzV7iGSXh+V3KkjWU9F4lMM2vpJgbe2a1MlWxCx6uEUZF4hzJioXx43OmizKrSxh1aXrX23aCkWOJzm0cKDLOuyh2KrzgESMBOMn7FBffHuh+JPQZQxDpRdMTbuCdqq2WV4BXm6ZHGl4pHNmY5W6C7hXnWH3fLbTNlEr+CwySPufLnLIY+GMMiQW+tjbt4CvQkkVBCrHNipV4pIl8LC8Iwbus255nKYCKfxE+EblJs5PzEBRVWLTP2kCylcHlwFuN0SwdaBLRHhyfbwfzSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BfhICrSY34LDbxvFvCF4U/6zt7nmz9yBM4klTgd9fU60j4bpvG+GzHllpLTTjz3Rcb9dJtZ6T6JHMO0nJSBuS2GGT4pPXNO8OMtzDhkgwU7bvFXmmEG0axfMu2Lh8cz7AoLb48uFrENYhnS2p6/Yv+yb0j7uAgHcKmKpgtrQ4DEaP8lfVeAOrSkVrDggoaZoN9AUbObEdvHbpkzEeV9aNcsOLJtXsWdULv30VUB0Kl+CU17WgtzVnIEbamcBgAYfGpNryRsCQzBR0cP01+NHH7QcoeeOODzJEzrwkESyaWlGrKc9JIGqIzqGuuQDseWT8kOa7EwSsxeajeMAdwVSeg==
  • Cc: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 15 Jul 2024 10:15:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Oleksii,

In general, the patch looks ok (apart from Jan comments). Just a couple of 
remarks.

On 12/07/2024 18:22, Oleksii Kurochko wrote:
> 
> 
> From: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
> 
> Arm's setup.c contains a collection of functions for parsing memory map
> and other boot information from a device tree. Since these routines are
> generally useful on any architecture that supports device tree booting,
> move them into xen/common/device-tree.
> 
> Suggested-by: Julien Grall <julien@xxxxxxx>
> Signed-off-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> ---
> Changes in V6:
>  - update the version of the patch to v6, to show that it is based
>    on the work done by Shawn in the patch v4.
> ---
> Changes in V5:
>  - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>  - drop message "Early device tree parsing and".
>  - After rebase on top of the current staging the following changes were done:
>    - init bootinfo variable in <common/device-tree/bootinfo.c> with 
> BOOTINFO_INIT;
>    - update the code of dt_unreserved_regions():
>        CONFIG_STATIC_SHM related changes and getting of reserved_mem
>        bootinfo_get_shmem() ??
>    - update the code of meminfo_overlap_check():
>        add check ( INVALID_PADDR == bank_start ) to if case.
>    - update the code of check_reserved_regions_overlap():
>        CONFIG_STATIC_SHM related changes.
>    - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
>    - add shared_meminfo ( because of CONFIG_STATIC_SHM )
>    - struct struct membanks was update with __struct group so <xen/kernel> is
>      neeeded to be included in bootfdt.h
>    - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic 
> bootfdt.h
>    - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(),
>      bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to 
> xen/bootfdt.h
>  - s/arm32/CONFIG_SEPARATE_XENHEAP/
>  - add inclusion of <xen/macros.h> because there are function in 
> <xen/bootfdt.h> which
>    are using container_of().
>  ---
> Changes in v4:
>   - create new xen/include/bootinfo.h rather than relying on arch's
>     asm/setup.h to provide required definitions for bootinfo.c
>   - build bootinfo.c as .init.o
>   - clean up and sort bootinfo.c's #includes
>   - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
>     xenheap-specific behavior of populate_boot_allocator
>   - (MAINTAINERS) include all of common/device-tree rather than just
>     bootinfo.c
> ---
>  MAINTAINERS                       |   2 +
>  xen/arch/arm/include/asm/setup.h  | 187 +-----------
>  xen/arch/arm/setup.c              | 432 ----------------------------
>  xen/common/Makefile               |   1 +
>  xen/common/device-tree/Makefile   |   1 +
>  xen/common/device-tree/bootinfo.c | 459 ++++++++++++++++++++++++++++++
>  xen/include/xen/bootfdt.h         | 196 +++++++++++++
>  7 files changed, 660 insertions(+), 618 deletions(-)
>  create mode 100644 xen/common/device-tree/Makefile
>  create mode 100644 xen/common/device-tree/bootinfo.c
>  create mode 100644 xen/include/xen/bootfdt.h
> 

[...]

> diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
> new file mode 100644
> index 0000000000..7cd45b3d4b
> --- /dev/null
> +++ b/xen/include/xen/bootfdt.h
> @@ -0,0 +1,196 @@
> +#ifndef __XEN_BOOTFDT_H__
AFAIR, to avoid violating MISRA rule 21.1, we should avoid introducing new 
macros with double underscore.

> +#define __XEN_BOOTFDT_H__
> +
> +#include <xen/types.h>
> +#include <xen/kernel.h>
> +#include <xen/macros.h>
> +
> +#define MIN_FDT_ALIGN 8
> +#define MAX_FDT_SIZE SZ_2M
2M blob limit is Arm64 specific. What will be the limit on RISCV? Shouldn't it 
be moved to some arch specific file?

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.