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

[XEN RFC PATCH 26/40] xen/arm: Add boot and secondary CPU to NUMA system


  • 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:24:09 +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=FMHvog/ZeUKCEsfAn5HVuMBBiWdgn9MS9BQ8ztuD3iQ=; b=dQN82trnFkr4OiOHT/NEOdi5zdAjMPIzLXzEOgCVNLAoiatt0U+aT1YuYLBHau1wUN2w6Ui9r8IMvFhC2bEHJvAZJYdoLz7gAjmZhBuHQB8ITwVxwLrxhFx54oTggoM79SXVIDt3Nvk2aaXJX+wDwrTESL1bz8r9pYl8eLq1mDtyA+wTfkT795RIGo1IMV31d6F/mt+avocDHtwYUNuoTLqJCwdVsxf0GgVW1a90P9rV++a3WxF5r3CEJwGgNVB2s8C7nBgo/YEEJmCX0o01diw2x3KjFvMbfNz+kK7uDUmRC+KHQeURo5KgkeMUYyZx4+ZjlzNcDSMBZCHGa2YOUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FHlK1AIPyRH2hEE2cha/yLkFByH8Qe5yGzvIc9p0M3kNcFwXt7l2QDKeKgytLOaXZAdZgbMuOVZ3sBW9yrqC8c1Ad3SYoNv9ia9U7Vziu2HGtad33QsX2fj3tvLv8fe4eDpY6dm6e4k3w0vqpmqjX4WyLFhesKRn5KgxKrqg+mJxRXGSM6mhTkU7OJVI62QoUB3nD6OfNjzN/R+NZb3ay8WHk+G1AiIYTMwiOtNyGaeB9Lxzcms52oG9UQJrMB+yj7KFv6gXbFYYWjoO/xIvi+2BK2lJKSITNQjz5jkNau7Ok21GocSHrDFiFEoiHTd9PG04fPIIGDWC4RumCBPOiQ==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Wed, 11 Aug 2021 10:32:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

When cpu boot up, we have add them to NUMA system. In current
stage, we have not parsed the NUMA data, but we have created
a fake NUMA node. So, in this patch, all CPU will be added
to NUMA node#0. After the NUMA data has been parsed from device
tree, the CPU will be added to correct NUMA node as the NUMA
data described.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 xen/arch/arm/setup.c       | 6 ++++++
 xen/arch/arm/smpboot.c     | 6 ++++++
 xen/include/asm-arm/numa.h | 1 +
 3 files changed, 13 insertions(+)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3c58d2d441..7531989f21 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -918,6 +918,12 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     processor_id();
 
+    /*
+     * If Xen is running on a NUMA off system, there will
+     * be a node#0 at least.
+     */
+    numa_add_cpu(0);
+
     smp_init_cpus();
     cpus = smp_get_max_cpus();
     printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index a1ee3146ef..aa78958c07 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -358,6 +358,12 @@ void start_secondary(void)
      */
     smp_wmb();
 
+    /*
+     * If Xen is running on a NUMA off system, there will
+     * be a node#0 at least.
+     */
+    numa_add_cpu(cpuid);
+
     /* Now report this CPU is up */
     cpumask_set_cpu(cpuid, &cpu_online_map);
 
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index 7a3588ac7f..dd31324b0b 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -59,6 +59,7 @@ extern mfn_t first_valid_mfn;
 #define __node_distance(a, b) (20)
 
 #define numa_init(x) do { } while (0)
+#define numa_add_cpu(x) do { } while (0)
 #define numa_set_node(x, y) do { } while (0)
 
 #endif
-- 
2.25.1




 


Rackspace

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