[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN RFC PATCH 15/40] xen/x86: move NUMA API from x86 header to common header


  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <jbeulich@xxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Wed, 11 Aug 2021 18:23:58 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JGeH1SM1ROZ3KKy1kyx91+XnuUZdgjTfuLm34BheG1s=; b=PsZKMbNDKOESPkIsfbNnXau+QFjUOgKAxdNSp+0HCBSl710NeWVVoakOgdX0r3/i5W52BKhK/rN79XaMy3Ss/Dm8F6Pr/0vptYTYXX0SU1bLWsFryhRGBqfB8/kfg2cqh+BV4fE4TN3yvUITS6t0Df/qWvOYGfGcwYdgjQIzodu44CwbyFhEneWZWXRYfaY95sFvY3d9MGEe8L+ZgZ059+KSu6vKHOfL3G/T7Cp5+FcTP95pvlkThoSgmRPKwVbRvp26d7PNBXcKofNTrpBvaFhPAlqB/MKCX1H9InRy1GZluDc6o3ROD3ZH6+KZKWk7cCN8gtzEudRx0E+saQAT+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJLFbiz0+2S4OvTIOXalxLNggoVsK524UZamCZGpTbMYU660dtmt+BbSDyegth+r/nVGFz/oFFMedLPtpbnyzRWn27IWGYyZQLe6BG/4t91VCpMGaUmCfDFXZSBSytxdvX5s9MEXsK0RbLsUjyvCgj5h+0Ov3jMI4OCPx9ETu1wZOb7KKl01hOB714LDn8gWrEe4l1fb8LpKmiGt1KqEQW5ko4j6Gj5K12ncqsvS+v56u1r7xY8pxjSF2GQykIXLssbmTWTerf9DJhb6KEUCkOLYXUL0I4qfksfXC/pFxeFkTgmk4CLSZ0rRtR7qdA6KNoJZmwbskFpzi5R3QMVZGw==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Wed, 11 Aug 2021 10:31:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

As all functions and macros that depends on these NUMA API, like
clear_node_cpumask, have been moved to common header file. In this
case, we can move NUMA API from x86 header file to common header
file, and will not trigger the symbols not found error when
functions in arch NUMA header file depends on the symbols in common
NUMA header file.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 xen/include/asm-x86/numa.h | 13 -------------
 xen/include/xen/numa.h     | 13 +++++++++++++
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
index 69859b0a57..5a57a51e26 100644
--- a/xen/include/asm-x86/numa.h
+++ b/xen/include/asm-x86/numa.h
@@ -9,14 +9,6 @@ typedef u8 nodeid_t;
 
 extern int srat_rev;
 
-extern nodeid_t      cpu_to_node[NR_CPUS];
-extern cpumask_t     node_to_cpumask[];
-
-#define cpu_to_node(cpu)               (cpu_to_node[cpu])
-#define parent_node(node)              (node)
-#define node_to_first_cpu(node)  (__ffs(node_to_cpumask[node]))
-#define node_to_cpumask(node)    (node_to_cpumask[node])
-
 extern nodeid_t pxm_to_node(unsigned int pxm);
 
 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
@@ -28,11 +20,6 @@ extern void srat_detect_node(int cpu);
 extern nodeid_t apicid_to_node[];
 extern void init_cpu_to_node(void);
 
-static inline void clear_node_cpumask(int cpu)
-{
-       cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]);
-}
-
 void srat_parse_regions(u64 addr);
 extern u8 __node_distance(nodeid_t a, nodeid_t b);
 unsigned int arch_get_dma_bitsize(void);
diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
index 3972aa6b93..cb08d2eca9 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -22,6 +22,14 @@
 /* The following content can be used when NUMA feature is enabled */
 #if defined(CONFIG_NUMA)
 
+extern nodeid_t      cpu_to_node[NR_CPUS];
+extern cpumask_t     node_to_cpumask[];
+
+#define cpu_to_node(cpu)               (cpu_to_node[cpu])
+#define parent_node(node)              (node)
+#define node_to_first_cpu(node)  (__ffs(node_to_cpumask[node]))
+#define node_to_cpumask(node)    (node_to_cpumask[node])
+
 /* Simple perfect hash to map pdx to node numbers */
 extern int memnode_shift;
 extern unsigned long memnodemapsize;
@@ -76,6 +84,11 @@ extern int numa_fake;
 
 extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end);
 
+static inline void clear_node_cpumask(int cpu)
+{
+       cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]);
+}
+
 #endif /* CONFIG_NUMA */
 
 #endif /* _XEN_NUMA_H */
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.