]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/numa: Add Devicetree support
authorSaurabh Sengar <ssengar@linux.microsoft.com>
Fri, 25 Aug 2023 07:47:37 +0000 (00:47 -0700)
committerIngo Molnar <mingo@kernel.org>
Mon, 2 Oct 2023 19:30:20 +0000 (21:30 +0200)
Hyper-V has usecases where it needs to fetch NUMA information from
Devicetree. Currently, it is not possible to extract the NUMA information
from Devicetree for the x86 arch.

Add support for Devicetree in the x86_numa_init() function, allowing the
retrieval of NUMA node information from the Devicetree.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/1692949657-16446-2-git-send-email-ssengar@linux.microsoft.com
arch/x86/Kconfig
arch/x86/mm/numa.c

index 66bfabae8814919c61902da3cdc77a45d9efa775..aab5e3205602f8ea943d1a852ffea0da3ca5cd6f 100644 (file)
@@ -1534,6 +1534,7 @@ config NUMA
        depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
        default y if X86_BIGSMP
        select USE_PERCPU_NUMA_NODE_ID
+       select OF_NUMA if OF
        help
          Enable NUMA (Non-Uniform Memory Access) support.
 
index 2aadb2019b4f235b58dbbc3a2aaa54f3c2da4921..c79f12e449eac1b3d63ee381ddd2e40d19f03f6c 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/acpi.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <linux/of.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/memblock.h>
@@ -733,6 +734,8 @@ void __init x86_numa_init(void)
                if (!numa_init(amd_numa_init))
                        return;
 #endif
+               if (acpi_disabled && !numa_init(of_numa_init))
+                       return;
        }
 
        numa_init(dummy_numa_init);