device-tree: Move Arm's static-memory feature to common

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

While at it, move xen/pfn.h inclusion in static-memory.h below #ifdef
CONFIG_STATIC_MEMORY when it is only needed.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
Michal Orzel committed 2025-06-04 09:02:59 +02:00
1 parent 9b29c4ad0b
commit 3e027c2732
9 files changed
+12 -15

No files matched your search

-1
View File
@@ -51,7 +51,6 @@ obj-y += setup.o
obj-y += shutdown.o obj-y += shutdown.o
obj-y += smp.o obj-y += smp.o
obj-y += smpboot.o obj-y += smpboot.o
obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
obj-y += sysctl.o obj-y += sysctl.o
obj-y += time.o obj-y += time.o
+1 -1
View File
@@ -6,9 +6,9 @@
#include <xen/mm.h> #include <xen/mm.h>
#include <xen/param.h> #include <xen/param.h>
#include <xen/pfn.h> #include <xen/pfn.h>
#include <xen/static-memory.h>
#include <asm/fixmap.h> #include <asm/fixmap.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/static-memory.h>
#include <asm/static-shmem.h> #include <asm/static-shmem.h>
static unsigned long opt_xenheap_megabytes __initdata; static unsigned long opt_xenheap_megabytes __initdata;
+1 -1
View File
@@ -4,9 +4,9 @@
#include <xen/llc-coloring.h> #include <xen/llc-coloring.h>
#include <xen/mm.h> #include <xen/mm.h>
#include <xen/pfn.h> #include <xen/pfn.h>
#include <xen/static-memory.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/static-memory.h>
#include <asm/static-shmem.h> #include <asm/static-shmem.h>
/* Override macros from asm/page.h to make them work with mfn_t */ /* Override macros from asm/page.h to make them work with mfn_t */
+1 -1
View File
@@ -12,6 +12,7 @@
#include <xen/sched.h> #include <xen/sched.h>
#include <xen/serial.h> #include <xen/serial.h>
#include <xen/sizes.h> #include <xen/sizes.h>
#include <xen/static-memory.h>
#include <xen/vmap.h> #include <xen/vmap.h>
#include <public/bootfdt.h> #include <public/bootfdt.h>
@@ -22,7 +23,6 @@
#include <asm/domain_build.h> #include <asm/domain_build.h>
#include <asm/grant_table.h> #include <asm/grant_table.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/static-memory.h>
#include <asm/static-shmem.h> #include <asm/static-shmem.h>
#ifdef CONFIG_VGICV2 #ifdef CONFIG_VGICV2
+1 -1
View File
@@ -5,9 +5,9 @@
#include <xen/libfdt/libfdt.h> #include <xen/libfdt/libfdt.h>
#include <xen/rangeset.h> #include <xen/rangeset.h>
#include <xen/sched.h> #include <xen/sched.h>
#include <xen/static-memory.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/static-memory.h>
#include <asm/static-shmem.h> #include <asm/static-shmem.h>
typedef struct { typedef struct {
+1
View File
@@ -7,3 +7,4 @@ obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
obj-y += intc.o obj-y += intc.o
obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += kernel.o
obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
+1 -5
View File
@@ -28,9 +28,7 @@
#include <asm/dom0less-build.h> #include <asm/dom0less-build.h>
#include <asm/setup.h> #include <asm/setup.h>
#if __has_include(<asm/static-memory.h>) #include <xen/static-memory.h>
# include <asm/static-memory.h>
#endif
#if __has_include(<asm/static-shmem.h>) #if __has_include(<asm/static-shmem.h>)
# 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) ) if ( !dt_find_property(node, "xen,static-mem", NULL) )
allocate_memory(d, &kinfo); allocate_memory(d, &kinfo);
#ifdef CONFIG_STATIC_MEMORY
else if ( !is_domain_direct_mapped(d) ) else if ( !is_domain_direct_mapped(d) )
allocate_static_memory(d, &kinfo, node); allocate_static_memory(d, &kinfo, node);
else else
assign_static_memory_11(d, &kinfo, node); assign_static_memory_11(d, &kinfo, node);
#endif
#ifdef CONFIG_STATIC_SHM #ifdef CONFIG_STATIC_SHM
rc = process_shm(d, &kinfo, node); rc = process_shm(d, &kinfo, node);
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <xen/sched.h> #include <xen/sched.h>
#include <xen/static-memory.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/static-memory.h>
static bool __init append_static_memory_to_bank(struct domain *d, static bool __init append_static_memory_to_bank(struct domain *d,
struct membank *bank, struct membank *bank,
@@ -1,13 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __ASM_STATIC_MEMORY_H_ #ifndef XEN_STATIC_MEMORY_H
#define __ASM_STATIC_MEMORY_H_ #define XEN_STATIC_MEMORY_H
#include <xen/fdt-kernel.h> #include <xen/fdt-kernel.h>
#include <xen/pfn.h>
#ifdef CONFIG_STATIC_MEMORY #ifdef CONFIG_STATIC_MEMORY
#include <xen/pfn.h>
static inline void init_staticmem_bank(const struct membank *bank) static inline void init_staticmem_bank(const struct membank *bank)
{ {
mfn_t bank_start = _mfn(PFN_UP(bank->start)); 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 /* CONFIG_STATIC_MEMORY */
#endif /* __ASM_STATIC_MEMORY_H_ */ #endif /* XEN_STATIC_MEMORY_H */
/* /*
* Local variables: * Local variables:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.