Commit 44581a28 authored by Brian Gerst's avatar Brian Gerst Committed by Ingo Molnar

x86: fix abuse of per_cpu_offset

Impact: bug fix

Don't use per_cpu_offset() to determine if it valid to access a
per-cpu variable for a given cpu number.  It is not a valid assumption
on x86-64 anymore. Use cpu_possible() instead.
Signed-off-by: default avatarBrian Gerst <brgerst@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2add8e23
...@@ -702,7 +702,7 @@ void __cpuinit numa_set_node(int cpu, int node) ...@@ -702,7 +702,7 @@ void __cpuinit numa_set_node(int cpu, int node)
} }
#ifdef CONFIG_DEBUG_PER_CPU_MAPS #ifdef CONFIG_DEBUG_PER_CPU_MAPS
if (cpu >= nr_cpu_ids || !per_cpu_offset(cpu)) { if (cpu >= nr_cpu_ids || !cpu_possible(cpu)) {
printk(KERN_ERR "numa_set_node: invalid cpu# (%d)\n", cpu); printk(KERN_ERR "numa_set_node: invalid cpu# (%d)\n", cpu);
dump_stack(); dump_stack();
return; return;
...@@ -790,7 +790,7 @@ int early_cpu_to_node(int cpu) ...@@ -790,7 +790,7 @@ int early_cpu_to_node(int cpu)
if (early_per_cpu_ptr(x86_cpu_to_node_map)) if (early_per_cpu_ptr(x86_cpu_to_node_map))
return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu]; return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
if (!per_cpu_offset(cpu)) { if (!cpu_possible(cpu)) {
printk(KERN_WARNING printk(KERN_WARNING
"early_cpu_to_node(%d): no per_cpu area!\n", cpu); "early_cpu_to_node(%d): no per_cpu area!\n", cpu);
dump_stack(); dump_stack();
......
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