From 2b40ba07efc6756a056776db3fe3ae829b0251c1 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Fri, 29 May 2026 11:25:54 +0200 Subject: [PATCH] xen/numa: prepare NUMA setup code for unit testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce __XEN__ guards to differentiate between hypervisor vs unit test builds. Also move numa_set_node() so it's outside the __XEN__ guards. No functional change intended. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich Release-Acked-by: Oleksii Kurochko --- xen/common/numa.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xen/common/numa.c b/xen/common/numa.c index ad75955a16..8544a15982 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -4,6 +4,7 @@ * Adapted for Xen: Ryan Harper */ +#ifdef __XEN__ #include #include #include @@ -13,6 +14,7 @@ #include #include #include +#endif /* __XEN__ */ static nodemask_t __initdata processor_nodes_parsed; static nodemask_t __initdata memory_nodes_parsed; @@ -561,6 +563,12 @@ void __init numa_init_array(void) } } +void numa_set_node(unsigned int cpu, nodeid_t node) +{ + cpu_to_node[cpu] = node; +} + +#ifdef __XEN__ #ifdef CONFIG_NUMA_EMU static unsigned int __initdata numa_fake; @@ -661,11 +669,6 @@ void numa_add_cpu(unsigned int cpu) cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); } -void numa_set_node(unsigned int cpu, nodeid_t node) -{ - cpu_to_node[cpu] = node; -} - /* [numa=off] */ static int __init cf_check numa_setup(const char *opt) { @@ -830,3 +833,4 @@ static int __init cf_check register_numa_trigger(void) return 0; } __initcall(register_numa_trigger); +#endif /* __XEN__ */