x86-32, NUMA: Update numaq to use new NUMA init protocol
Update numaq such that it calls numa_add_memblk() and sets
numa_nodes_parsed instead of directly diddling with NUMA states. The
original get_memcfg_numaq() is renamed to numaq_numa_init() and new
get_memcfg_numaq() is created in numa_32.c.
The shim numa_add_memblk() implementation handles node_start/end_pfn[]
and node_set_online() for nodes with memory. The new
get_memcfg_numaq() exactly the same with get_memcfg_from_srat() other
than calling the numaq init function. Things get_memcfgs_numaq() do
are not strictly necessary for numaq but added for consistency and to
help unifying NUMA init handling.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 8641239..14135e5 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -332,6 +332,29 @@
nid, node_pa, node_pa + size, remap_va, remap_va + size);
}
+static int get_memcfg_numaq(void)
+{
+#ifdef CONFIG_X86_NUMAQ
+ int nid;
+
+ if (numa_off)
+ return 0;
+
+ if (numaq_numa_init() < 0) {
+ nodes_clear(numa_nodes_parsed);
+ remove_all_active_ranges();
+ return 0;
+ }
+
+ for_each_node_mask(nid, numa_nodes_parsed)
+ node_set_online(nid);
+ sort_node_map();
+ return 1;
+#else
+ return 0;
+#endif
+}
+
static int get_memcfg_from_srat(void)
{
#ifdef CONFIG_ACPI_NUMA