aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:33:23 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:23 -0500
commit5f5cd8fd60c71ce47d2ce4e60e7ccbc306e91c64 (patch)
treed41e31a278f4e70ce4d9cc2ad88d298058f673bf
parentc49a4955ea504c82f6b690491639bba5b8c1dc47 (diff)
x86: add debug of invalid per_cpu map accesses
dont crash survivable situations. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/asm-x86/topology.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index f1e12329078e..9a8228a177c7 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -66,14 +66,15 @@ static inline int early_cpu_to_node(int cpu)
66 66
67static inline int cpu_to_node(int cpu) 67static inline int cpu_to_node(int cpu)
68{ 68{
69#ifdef CONFIG_DEBUG_PER_CPU_MAPS 69#ifdef CONFIG_DEBUG_PER_CPU_MAPS
70 if(x86_cpu_to_node_map_early_ptr) { 70 if (x86_cpu_to_node_map_early_ptr) {
71 printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n", 71 printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n",
72 (int)cpu); 72 (int)cpu);
73 BUG(); 73 dump_stack();
74 return ((int *)x86_cpu_to_node_map_early_ptr)[cpu];
74 } 75 }
75#endif 76#endif
76 if(per_cpu_offset(cpu)) 77 if (per_cpu_offset(cpu))
77 return per_cpu(x86_cpu_to_node_map, cpu); 78 return per_cpu(x86_cpu_to_node_map, cpu);
78 else 79 else
79 return NUMA_NO_NODE; 80 return NUMA_NO_NODE;