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

[XEN RFC PATCH 32/40] xen/x86: make acpi_scan_nodes to be neutral


  • 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:15 +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=t/9Z30yQrnVeDNYbOYgNSbsnu664JdEj5BAT/JnizSg=; b=hC2yRKQJJivU4vTsYUSI6HE7lPs5dqosAyDlV4q1ZiqYk03cvkcWZS3wICpozplTFu+/Jt/Vs0fnCwjh2Bj00sbM0tiiA36ZARcVgCysEYLtBptd8rrvDasgVf6hvcjJIROcPB+7gHDump4hNcgyt9eEp5CeKDk8FdQfrZgiswVJ3onnyJEU2ppD7CU3+X63rlToxdt1cXywrag+lSJhy4UT7URVNDmrCTLm5qLZau9akv2JCNk14zSJ/ftL/3bkIVVpeShkkRRIi1Pj2+xzv7EV6NHKUWi0jf3OOfViFcwfq7KwzCBQccDoRElfFbBIK0ti9KIEITgr9lECNKpQ8w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqDxmdIlMlNad36wj/HNgeinp+CO3m6DbBmuXYgprQx/PSQpJBN2GOhx0fDrL2s7u6tjfwQ3a8NpFMffmF6PsHECbA+bTMMsjoeZM0OrNJC2Os/Ggj0Y5aF2/ELrPZwgPmphHLJWfRBbuc6J+Jh8jld025yGvJJ1dNOS4Nk2j11fLkmxXVqnKY+MUNskllCcN2HazVzL9ufn5lJtAlIJ3B3A0GNrey72l5GvUGn6SibbbZ63PDB61gdaThPGSQ4LwDQDzWlusPCP7pQWvu0rMw1LSYDqGM1iSoj2jEo8HgNGpotTjN1qYIzNBsv860nw0LuFX+Di8l4dtNYj2kvKwg==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Wed, 11 Aug 2021 10:31:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

The code in acpi_scan_nodes can be reused for device tree based
NUMA. So we rename acpi_scan_nodes to numa_scan_nodes for a neutral
function name. As acpi_numa variable is available in ACPU based NUMA
system only, we use CONFIG_ACPI_NUMA to protect it.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 xen/arch/x86/srat.c        | 4 +++-
 xen/common/numa.c          | 2 +-
 xen/include/asm-x86/acpi.h | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index dcebc7adec..3d4d90a622 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -362,7 +362,7 @@ void __init srat_parse_regions(u64 addr)
 }
 
 /* Use the information discovered above to actually set up the nodes. */
-int __init acpi_scan_nodes(u64 start, u64 end)
+int __init numa_scan_nodes(u64 start, u64 end)
 {
        int i;
        nodemask_t all_nodes_parsed;
@@ -371,8 +371,10 @@ int __init acpi_scan_nodes(u64 start, u64 end)
        for (i = 0; i < MAX_NUMNODES; i++)
                cutoff_node(i, start, end);
 
+#ifdef CONFIG_ACPI_NUMA
        if (acpi_numa <= 0)
                return -1;
+#endif
 
        if (!nodes_cover_memory()) {
                bad_srat();
diff --git a/xen/common/numa.c b/xen/common/numa.c
index 74960885a6..4152bbe83b 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -330,7 +330,7 @@ void __init numa_initmem_init(unsigned long start_pfn, 
unsigned long end_pfn)
 #endif
 
 #ifdef CONFIG_ACPI_NUMA
-    if ( !numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT,
+    if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT,
          (u64)end_pfn << PAGE_SHIFT) )
         return;
 #endif
diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h
index d347500a3c..33b71dfb3b 100644
--- a/xen/include/asm-x86/acpi.h
+++ b/xen/include/asm-x86/acpi.h
@@ -102,7 +102,7 @@ extern unsigned long acpi_wakeup_address;
 #define ARCH_HAS_POWER_INIT    1
 
 extern s8 acpi_numa;
-extern int acpi_scan_nodes(u64 start, u64 end);
+extern int numa_scan_nodes(u64 start, u64 end);
 
 extern struct acpi_sleep_info acpi_sinfo;
 #define acpi_video_flags bootsym(video_flags)
-- 
2.25.1




 


Rackspace

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