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-next>] [day] [month] [year] [list]
Date:	Mon, 1 Dec 2008 16:46:34 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	linux-kernel@...r.kernel.org
Cc:	Ingo Molnar <mingo@...hat.com>
Subject: [PATCH 1/4] cpumask: cpu_coregroup_mask(): x86

Like cpu_coregroup_map, but returns a (const) pointer.

(This will go to Ingo separately as part of the x86 series, just
airing it here for thoroughness).

Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
Signed-off-by: Mike Travis <travis@....com>
Cc: Ingo Molnar <mingo@...hat.com>
---
 arch/x86/include/asm/topology.h |    1 +
 arch/x86/kernel/smpboot.c       |   11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff -r 11a884ebd99b arch/x86/include/asm/topology.h
--- a/arch/x86/include/asm/topology.h	Thu Nov 20 13:54:24 2008 +1030
+++ b/arch/x86/include/asm/topology.h	Thu Nov 20 13:55:44 2008 +1030
@@ -231,6 +231,7 @@
 #endif
 
 extern cpumask_t cpu_coregroup_map(int cpu);
+extern const struct cpumask *cpu_coregroup_mask(int cpu);
 
 #ifdef ENABLE_TOPO_DEFINES
 #define topology_physical_package_id(cpu)	(cpu_data(cpu).phys_proc_id)
diff -r 11a884ebd99b arch/x86/kernel/smpboot.c
--- a/arch/x86/kernel/smpboot.c	Thu Nov 20 13:54:24 2008 +1030
+++ b/arch/x86/kernel/smpboot.c	Thu Nov 20 13:55:44 2008 +1030
@@ -497,7 +497,7 @@
 }
 
 /* maps the cpu to the sched domain representing multi-core */
-cpumask_t cpu_coregroup_map(int cpu)
+const struct cpumask *cpu_coregroup_mask(int cpu)
 {
 	struct cpuinfo_x86 *c = &cpu_data(cpu);
 	/*
@@ -505,9 +505,14 @@
 	 * And for power savings, we return cpu_core_map
 	 */
 	if (sched_mc_power_savings || sched_smt_power_savings)
-		return per_cpu(cpu_core_map, cpu);
+		return &per_cpu(cpu_core_map, cpu);
 	else
-		return c->llc_shared_map;
+		return &c->llc_shared_map;
+}
+
+cpumask_t cpu_coregroup_map(int cpu)
+{
+	return *cpu_coregroup_mask(cpu);
 }
 
 static void impress_friends(void)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ