[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-4.22 3/5] xen/numa: prepare NUMA setup code for unit testing
- To: xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Date: Mon, 1 Jun 2026 17:43:30 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- 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=yu9/xQAD77EIoxmFDVZnSIjHYBTCvLPxtQ2HQsAYi8c=; b=xH4UL8HtY14AUs4v72k8pY1FN24xTQQp43MvAyh0uypBg63ZrEGv0ZT7xgsEwfreKzpuP/4iR2JNoW7GGPuRc43YMMDJfzjHEpoDhk53Oj5ZJ0gt59IeWYQaG0TEUUACphqOCpOIVs6DhnIHQ76fesYGtyIBCpdGsB2fUtrLIMkkBMURCjzk75asadoz5VV4C4RHndoZAKhMaSXo6QPqKBEhHe7+RGjcwN8EiqoRpZSqDinyR/+KpkCsgJlMGbjF02OZDVINzBX3WWEML0c+aYT3dXL4U1eOpyqS/Qy/NLcCVnmX+WPf9eZFWawBQg3x1k5LbJNX3NLrq/uDsji1gg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kBLI8zIhf9+iXwKkTCw6s49TVitfkr/MLDdtwhbbUWSW8ZPTzRqwD03aU6SN5/ijX4mT+hC8Ei4rxa9vHBlzIqRnvU2vNvnFOMxFpgo+c5WimYz56JYD+A3/0+Sc88cCU30M6m67tVpwAY6AsNH4YmvhPYffzdSEyoanYv7ukrOga5xKNmtHjlSN94+odmAxthCassuHDeJ5jF0S+MVQ+V8b3hHh24uvT5OO+JA46s8ckK6gM9kgdj5KQXHiNif/8D2w6PkSCjCU0KMfSOLk1COMhGt57HzNpAwxMRn2V9Ba5rQC2fN+pReoau9Y0GasrZvGljfpmEAk8VyN0LmSJA==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Mon, 01 Jun 2026 15:44:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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é <roger.pau@xxxxxxxxxx>
---
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 ad75955a1622..8544a1598218 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -4,6 +4,7 @@
* Adapted for Xen: Ryan Harper <ryanh@xxxxxxxxxx>
*/
+#ifdef __XEN__
#include <xen/init.h>
#include <xen/keyhandler.h>
#include <xen/mm.h>
@@ -13,6 +14,7 @@
#include <xen/pfn.h>
#include <xen/sched.h>
#include <xen/softirq.h>
+#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__ */
--
2.53.0
|