All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Michal Orzel" <michal.orzel@amd.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.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>
Subject: [PATCH 3/4] device-tree: Move Arm's static-memory feature to common
Date: Tue, 3 Jun 2025 12:03:28 +0200	[thread overview]
Message-ID: <20250603100329.149851-4-michal.orzel@amd.com> (raw)
In-Reply-To: <20250603100329.149851-1-michal.orzel@amd.com>

This feature is arch agnostic, thus move it to common.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile                                    | 1 -
 xen/arch/arm/arm32/mmu/mm.c                              | 2 +-
 xen/arch/arm/arm64/mmu/mm.c                              | 2 +-
 xen/arch/arm/dom0less-build.c                            | 2 +-
 xen/arch/arm/static-shmem.c                              | 2 +-
 xen/common/device-tree/Makefile                          | 1 +
 xen/common/device-tree/dom0less-build.c                  | 6 +-----
 xen/{arch/arm => common/device-tree}/static-memory.c     | 2 +-
 .../arm/include/asm => include/xen}/static-memory.h      | 9 +++++----
 9 files changed, 12 insertions(+), 15 deletions(-)
 rename xen/{arch/arm => common/device-tree}/static-memory.c (99%)
 rename xen/{arch/arm/include/asm => include/xen}/static-memory.h (93%)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index eeeac4e653ec..4f080145478d 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -51,7 +51,6 @@ obj-y += setup.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
-obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
 obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
 obj-y += sysctl.o
 obj-y += time.o
diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 956693232a1b..f3305e28e9df 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -6,9 +6,9 @@
 #include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/pfn.h>
+#include <xen/static-memory.h>
 #include <asm/fixmap.h>
 #include <asm/setup.h>
-#include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
 static unsigned long opt_xenheap_megabytes __initdata;
diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index c1efa1348aee..cded8f2787f9 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -4,9 +4,9 @@
 #include <xen/llc-coloring.h>
 #include <xen/mm.h>
 #include <xen/pfn.h>
+#include <xen/static-memory.h>
 
 #include <asm/setup.h>
-#include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index a49764f0add9..bcfd686a8b7f 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -12,6 +12,7 @@
 #include <xen/sched.h>
 #include <xen/serial.h>
 #include <xen/sizes.h>
+#include <xen/static-memory.h>
 #include <xen/vmap.h>
 
 #include <public/bootfdt.h>
@@ -22,7 +23,6 @@
 #include <asm/domain_build.h>
 #include <asm/grant_table.h>
 #include <asm/setup.h>
-#include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
 #ifdef CONFIG_VGICV2
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index 21fd2c3cd4fd..2055b7be0f3f 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -5,9 +5,9 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/rangeset.h>
 #include <xen/sched.h>
+#include <xen/static-memory.h>
 
 #include <asm/setup.h>
-#include <asm/static-memory.h>
 #include <asm/static-shmem.h>
 
 typedef struct {
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 57b9e6ca008f..ed11f2c3b42c 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
 obj-y += intc.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o
 obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
+obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 39cb2cd5c70e..c8c5a04f24cb 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -28,9 +28,7 @@
 #include <asm/dom0less-build.h>
 #include <asm/setup.h>
 
-#if __has_include(<asm/static-memory.h>)
-#   include <asm/static-memory.h>
-#endif
+#include <xen/static-memory.h>
 
 #if __has_include(<asm/static-shmem.h>)
 #   include <asm/static-shmem.h>
@@ -799,12 +797,10 @@ static int __init construct_domU(struct domain *d,
     {
         if ( !dt_find_property(node, "xen,static-mem", NULL) )
             allocate_memory(d, &kinfo);
-#ifdef CONFIG_STATIC_MEMORY
         else if ( !is_domain_direct_mapped(d) )
             allocate_static_memory(d, &kinfo, node);
         else
             assign_static_memory_11(d, &kinfo, node);
-#endif
 
 #ifdef CONFIG_STATIC_SHM
         rc = process_shm(d, &kinfo, node);
diff --git a/xen/arch/arm/static-memory.c b/xen/common/device-tree/static-memory.c
similarity index 99%
rename from xen/arch/arm/static-memory.c
rename to xen/common/device-tree/static-memory.c
index e0f76afcd8eb..0774d0680604 100644
--- a/xen/arch/arm/static-memory.c
+++ b/xen/common/device-tree/static-memory.c
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
 #include <xen/sched.h>
+#include <xen/static-memory.h>
 
 #include <asm/setup.h>
-#include <asm/static-memory.h>
 
 static bool __init append_static_memory_to_bank(struct domain *d,
                                                 struct membank *bank,
diff --git a/xen/arch/arm/include/asm/static-memory.h b/xen/include/xen/static-memory.h
similarity index 93%
rename from xen/arch/arm/include/asm/static-memory.h
rename to xen/include/xen/static-memory.h
index a32a3c6553bc..e445aa80578c 100644
--- a/xen/arch/arm/include/asm/static-memory.h
+++ b/xen/include/xen/static-memory.h
@@ -1,13 +1,14 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef __ASM_STATIC_MEMORY_H_
-#define __ASM_STATIC_MEMORY_H_
+#ifndef XEN_STATIC_MEMORY_H
+#define XEN_STATIC_MEMORY_H
 
 #include <xen/fdt-kernel.h>
-#include <xen/pfn.h>
 
 #ifdef CONFIG_STATIC_MEMORY
 
+#include <xen/pfn.h>
+
 static inline void init_staticmem_bank(const struct membank *bank)
 {
     mfn_t bank_start = _mfn(PFN_UP(bank->start));
@@ -46,7 +47,7 @@ static inline void init_staticmem_pages(void) {};
 
 #endif /* CONFIG_STATIC_MEMORY */
 
-#endif /* __ASM_STATIC_MEMORY_H_ */
+#endif /* XEN_STATIC_MEMORY_H */
 
 /*
  * Local variables:
-- 
2.25.1



  parent reply	other threads:[~2025-06-03 10:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 10:03 [PATCH 0/4] device-tree: Move static features to common Michal Orzel
2025-06-03 10:03 ` [PATCH 1/4] common: Drop unneeded Arm dependency for static-evtchn Michal Orzel
2025-06-03 10:55   ` Jan Beulich
2025-06-03 10:03 ` [PATCH 2/4] device-tree: Move domain_fdt_begin_node() to common Michal Orzel
2025-06-03 13:23   ` Julien Grall
2025-06-03 10:03 ` Michal Orzel [this message]
2025-06-03 13:28   ` [PATCH 3/4] device-tree: Move Arm's static-memory feature " Julien Grall
2025-06-03 14:58     ` Orzel, Michal
2025-06-03 10:03 ` [PATCH 4/4] device-tree: Move Arm's static-shmem " Michal Orzel
2025-06-03 13:29   ` Julien Grall

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=20250603100329.149851-4-michal.orzel@amd.com \
    --to=michal.orzel@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --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.