lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240812-mips-numa-v2-1-fd9bdb2033b9@flygoat.com>
Date: Mon, 12 Aug 2024 10:37:15 +0100
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>, Arnd Bergmann <arnd@...db.de>, 
 Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
 Huacai Chen <chenhuacai@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org, 
 linux-mips@...r.kernel.org, Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: [PATCH v2 1/7] arch_numa: Provide platform numa init hook

For some pre-devicetree systems, NUMA information may come from
platform specific way.

Provide platform numa init hook to allow platform code kick in
as last resort method to supply NUMA configuration, and use
ARCH_PLATFORM_NUMA Kconfig symbol to gate that function.

Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
---
v2: Use Kconfig symbol instead of weak function (arnd)
---
 drivers/base/Kconfig       | 4 ++++
 drivers/base/arch_numa.c   | 9 +++++++++
 include/asm-generic/numa.h | 1 +
 3 files changed, 14 insertions(+)

diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 064eb52ff7e2..e169627b9172 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -231,6 +231,10 @@ config GENERIC_ARCH_NUMA
 	  Enable support for generic NUMA implementation. Currently, RISC-V
 	  and ARM64 use it.
 
+config ARCH_PLATFORM_NUMA
+	bool
+	depends on GENERIC_ARCH_NUMA
+
 config FW_DEVLINK_SYNC_STATE_TIMEOUT
 	bool "sync_state() behavior defaults to timeout instead of strict"
 	help
diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
index 8d49893c0e94..19be18b35430 100644
--- a/drivers/base/arch_numa.c
+++ b/drivers/base/arch_numa.c
@@ -305,6 +305,13 @@ static int __init arch_acpi_numa_init(void)
 }
 #endif
 
+#ifndef CONFIG_ARCH_PLATFORM_NUMA
+int __init arch_platform_numa_init(void)
+{
+	return -EOPNOTSUPP;
+}
+#endif
+
 /**
  * arch_numa_init() - Initialize NUMA
  *
@@ -318,6 +325,8 @@ void __init arch_numa_init(void)
 			return;
 		if (acpi_disabled && !numa_init(of_numa_init))
 			return;
+		if (!numa_init(arch_platform_numa_init))
+			return;
 	}
 
 	numa_init(dummy_numa_init);
diff --git a/include/asm-generic/numa.h b/include/asm-generic/numa.h
index c2b046d1fd82..53a8210fde00 100644
--- a/include/asm-generic/numa.h
+++ b/include/asm-generic/numa.h
@@ -31,6 +31,7 @@ static inline const struct cpumask *cpumask_of_node(int node)
 #endif
 
 void __init arch_numa_init(void);
+int __init arch_platform_numa_init(void);
 int __init numa_add_memblk(int nodeid, u64 start, u64 end);
 void __init early_map_cpu_to_node(unsigned int cpu, int nid);
 int __init early_cpu_to_node(int cpu);

-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ