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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105100547.287332-3-john.g.garry@oracle.com>
Date: Mon,  5 Jan 2026 10:05:45 +0000
From: John Garry <john.g.garry@...cle.com>
To: chenhuacai@...nel.org, kernel@...0n.name, jiaxun.yang@...goat.com,
        tsbogend@...ha.franken.de, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
        luto@...nel.org, peterz@...radead.org, arnd@...db.de, x86@...nel.org
Cc: loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-arch@...r.kernel.org,
        vulab@...as.ac.cn, gregkh@...uxfoundation.org, rafael@...nel.org,
        dakr@...nel.org, John Garry <john.g.garry@...cle.com>
Subject: [PATCH 2/4] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE

The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which
is a valid index - so add a check for this.

Signed-off-by: John Garry <john.g.garry@...cle.com>
---
 arch/loongarch/include/asm/topology.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
index f06e7ff25bb7c..9857e4c20023c 100644
--- a/arch/loongarch/include/asm/topology.h
+++ b/arch/loongarch/include/asm/topology.h
@@ -12,7 +12,9 @@
 
 extern cpumask_t cpus_on_node[];
 
-#define cpumask_of_node(node)  (&cpus_on_node[node])
+#define cpumask_of_node(node)  ((node) == NUMA_NO_NODE ?	\
+				cpu_all_mask :			\
+				&cpus_on_node[node])
 
 struct pci_bus;
 extern int pcibus_to_node(struct pci_bus *);
-- 
2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ