Commit 5f5cd8fd authored by Ingo Molnar's avatar Ingo Molnar

x86: add debug of invalid per_cpu map accesses

dont crash survivable situations.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c49a4955
...@@ -66,14 +66,15 @@ static inline int early_cpu_to_node(int cpu) ...@@ -66,14 +66,15 @@ static inline int early_cpu_to_node(int cpu)
static inline int cpu_to_node(int cpu) static inline int cpu_to_node(int cpu)
{ {
#ifdef CONFIG_DEBUG_PER_CPU_MAPS #ifdef CONFIG_DEBUG_PER_CPU_MAPS
if(x86_cpu_to_node_map_early_ptr) { if (x86_cpu_to_node_map_early_ptr) {
printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n", printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n",
(int)cpu); (int)cpu);
BUG(); dump_stack();
return ((int *)x86_cpu_to_node_map_early_ptr)[cpu];
} }
#endif #endif
if(per_cpu_offset(cpu)) if (per_cpu_offset(cpu))
return per_cpu(x86_cpu_to_node_map, cpu); return per_cpu(x86_cpu_to_node_map, cpu);
else else
return NUMA_NO_NODE; return NUMA_NO_NODE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment