x86: fix abuse of per_cpu_offset
authorBrian Gerst <brgerst@gmail.com>
Sun, 8 Feb 2009 14:58:40 +0000 (09:58 -0500)
committerIngo Molnar <mingo@elte.hu>
Mon, 9 Feb 2009 09:30:30 +0000 (10:30 +0100)
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: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/numa_64.c

index 08d140fbc31b760b419c721e6c174b6d679e4f79..deb1c1ab7868db9c3ce40843356b492f5ff44245 100644 (file)
@@ -702,7 +702,7 @@ void __cpuinit numa_set_node(int cpu, int node)
        }
 
 #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);
                dump_stack();
                return;
@@ -790,7 +790,7 @@ int early_cpu_to_node(int cpu)
        if (early_per_cpu_ptr(x86_cpu_to_node_map))
                return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
 
-       if (!per_cpu_offset(cpu)) {
+       if (!cpu_possible(cpu)) {
                printk(KERN_WARNING
                        "early_cpu_to_node(%d): no per_cpu area!\n", cpu);
                dump_stack();