diff mbox series

[v4,1/6] xen/ppc: Introduce stub asm/static-shmem.h

Message ID feadb431b4c7a13e803c342ed00c60a6415f2ceb.1712893887.git.sanastasio@raptorengineering.com (mailing list archive)
State New
Headers show
Series Early Boot Allocation on Power | expand

Commit Message

Shawn Anastasio April 12, 2024, 3:55 a.m. UTC
Required for bootfdt.c to build.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in v4: none

 xen/arch/ppc/include/asm/static-shmem.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 xen/arch/ppc/include/asm/static-shmem.h

--
2.30.2

Comments

Julien Grall April 24, 2024, 6:31 p.m. UTC | #1
Hi Shawn,

On 12/04/2024 04:55, Shawn Anastasio wrote:
> Required for bootfdt.c to build.

AFAIU, this patch is only necessary in #4. So I would consider to fold 
it there as it doesn't seem to add any value alone.

> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> ---
> Changes in v4: none
> 
>   xen/arch/ppc/include/asm/static-shmem.h | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>   create mode 100644 xen/arch/ppc/include/asm/static-shmem.h
> 
> diff --git a/xen/arch/ppc/include/asm/static-shmem.h b/xen/arch/ppc/include/asm/static-shmem.h
> new file mode 100644
> index 0000000000..84370d6e6c
> --- /dev/null
> +++ b/xen/arch/ppc/include/asm/static-shmem.h

Just an idea to avoid introducing static-shmem.h for PPC (and I guess 
RISC-V). Could we instead ifdef the inclusion and in bootfdt.c provide a 
stub for...

> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier:  GPL-2.0-only */
> +
> +#ifndef __ASM_PPC_STATIC_SHMEM_H__
> +#define __ASM_PPC_STATIC_SHMEM_H__
> +
> +static inline int process_shm_node(const void *fdt, int node,
> +                                   uint32_t address_cells, uint32_t size_cells)
> +{
> +    return -EINVAL;
> +}

... this helper? Something like [1].

Cheers,


[1]
diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 4d708442a19e..26dada1e3a1e 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -15,7 +15,9 @@
  #include <xen/sort.h>
  #include <xsm/xsm.h>
  #include <asm/setup.h>
+#ifdef CONFIG_STATIC_SHM
  #include <asm/static-shmem.h>
+#endif

  static void __init __maybe_unused build_assertions(void)
  {
@@ -436,6 +438,15 @@ static int __init process_domain_node(const void 
*fdt, int node,
                                     MEMBANK_STATIC_DOMAIN);
  }

+#ifndef CONFIG_STATIC_SHM
+static inline int process_shm_node(const void *fdt, int node,
+                                   uint32_t address_cells, uint32_t 
size_cells)
+{
+    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared 
memory nodes\n");
+    return -EINVAL;
+}
+#endif
+
  static int __init early_scan_node(const void *fdt,
                                    int node, const char *name, int depth,
                                    u32 address_cells, u32 size_cells,
diff --git a/xen/arch/arm/include/asm/static-shmem.h 
b/xen/arch/arm/include/asm/static-shmem.h
index 3b6569e5703f..39b5881d24aa 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -68,13 +68,6 @@ static inline int process_shm_chosen(struct domain *d,
      return 0;
  }

-static inline int process_shm_node(const void *fdt, int node,
-                                   uint32_t address_cells, uint32_t 
size_cells)
-{
-    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared 
memory nodes\n");
-    return -EINVAL;
-}
-
  static inline void early_print_info_shmem(void) {};

  static inline void init_sharedmem_pages(void) {};


Cheers,
diff mbox series

Patch

diff --git a/xen/arch/ppc/include/asm/static-shmem.h b/xen/arch/ppc/include/asm/static-shmem.h
new file mode 100644
index 0000000000..84370d6e6c
--- /dev/null
+++ b/xen/arch/ppc/include/asm/static-shmem.h
@@ -0,0 +1,12 @@ 
+/* SPDX-License-Identifier:  GPL-2.0-only */
+
+#ifndef __ASM_PPC_STATIC_SHMEM_H__
+#define __ASM_PPC_STATIC_SHMEM_H__
+
+static inline int process_shm_node(const void *fdt, int node,
+                                   uint32_t address_cells, uint32_t size_cells)
+{
+    return -EINVAL;
+}
+
+#endif /* __ASM_PPC_STATIC_SHMEM_H__ */