aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/topology.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-06-27 13:10:13 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 07:16:16 -0400
commit6a2f47ca27fad36f99e8478a3807d4b8c7db80e7 (patch)
tree9d281e3969e5431b1d330cbdc3ee13d626fba4ee /include/asm-x86/topology.h
parentcd5dce2fb023a6f0168344b7dd8adec30017458e (diff)
x86: add check for node passed to node_to_cpumask, v3
* When CONFIG_DEBUG_PER_CPU_MAPS is set, the node passed to node_to_cpumask and node_to_cpumask_ptr should be validated. If invalid, then a dump_stack is performed and a zero cpumask is returned. v2: Slightly different version to remove a compiler warning. v3: Redone to reflect moving setup.c -> setup_percpu.c Signed-off-by: Mike Travis <travis@sgi.com> Cc: Vegard Nossum <vegard.nossum@gmail.com> Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/topology.h')
-rw-r--r--include/asm-x86/topology.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 1f97758de4ab..98e5f17ea856 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -57,7 +57,12 @@ static inline int cpu_to_node(int cpu)
57} 57}
58#define early_cpu_to_node(cpu) cpu_to_node(cpu) 58#define early_cpu_to_node(cpu) cpu_to_node(cpu)
59 59
60/* Returns a bitmask of CPUs on Node 'node'. */ 60/* Returns a bitmask of CPUs on Node 'node'.
61 *
62 * Side note: this function creates the returned cpumask on the stack
63 * so with a high NR_CPUS count, excessive stack space is used. The
64 * node_to_cpumask_ptr function should be used whenever possible.
65 */
61static inline cpumask_t node_to_cpumask(int node) 66static inline cpumask_t node_to_cpumask(int node)
62{ 67{
63 return node_to_cpumask_map[node]; 68 return node_to_cpumask_map[node];