--- arch/x86/kernel/smpboot_64.c | 8 +++----- include/asm-x86/percpu_64.h | 13 ++++--------- kernel/lockdep.c | 4 ++-- 3 files changed, 9 insertions(+), 16 deletions(-) Index: linux-2.6/arch/x86/kernel/smpboot_64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/smpboot_64.c 2007-11-17 18:09:43.705522758 -0800 +++ linux-2.6/arch/x86/kernel/smpboot_64.c 2007-11-17 18:12:51.733772900 -0800 @@ -835,11 +835,9 @@ void __init smp_set_apicids(void) { int cpu; - for_each_cpu_mask(cpu, cpu_possible_map) { - if (per_cpu_offset(cpu)) - per_cpu(x86_cpu_to_apicid, cpu) = - x86_cpu_to_apicid_init[cpu]; - } + for_each_cpu_mask(cpu, cpu_possible_map) + per_cpu(x86_cpu_to_apicid, cpu) = + x86_cpu_to_apicid_init[cpu]; /* indicate the static array will be going away soon */ x86_cpu_to_apicid_ptr = NULL; Index: linux-2.6/include/asm-x86/percpu_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/percpu_64.h 2007-11-17 18:11:39.205273576 -0800 +++ linux-2.6/include/asm-x86/percpu_64.h 2007-11-17 18:12:51.733772900 -0800 @@ -11,11 +11,6 @@ #include -#define __per_cpu_offset(cpu) CPU_OFFSET(cpu) -#define __my_cpu_offset() CPU_OFFSET(smp_processor_id()) - -#define per_cpu_offset(x) (__per_cpu_offset(x)) - /* Separate out the type, so (int[3], foo) works. */ #define DEFINE_PER_CPU(type, name) \ __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name @@ -32,20 +27,20 @@ /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) (*({ \ extern int simple_identifier_##var(void); \ - RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)); })) + CPU_PTR(&per_cpu__##var, cpu); })) #define __get_cpu_var(var) (*({ \ extern int simple_identifier_##var(void); \ - RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) + THIS_CPU(&per_cpu__##var); })) #define __raw_get_cpu_var(var) (*({ \ extern int simple_identifier_##var(void); \ - RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) + THIS_CPU(&per_cpu__##var); })) /* A macro to avoid #include hell... */ #define percpu_modcopy(pcpudst, src, size) \ do { \ unsigned int __i; \ for_each_possible_cpu(__i) \ - memcpy((pcpudst)+__per_cpu_offset(__i), \ + memcpy(CPU_PTR(pcpudst, __i), \ (src), (size)); \ } while (0) Index: linux-2.6/kernel/lockdep.c =================================================================== --- linux-2.6.orig/kernel/lockdep.c 2007-11-17 16:28:44.272034546 -0800 +++ linux-2.6/kernel/lockdep.c 2007-11-17 18:12:51.749772501 -0800 @@ -609,9 +609,9 @@ static int static_obj(void *obj) * percpu var? */ for_each_possible_cpu(i) { - start = (unsigned long) &__per_cpu_start + per_cpu_offset(i); + start = (unsigned long) &__per_cpu_start + CPU_OFFSET(i); end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM - + per_cpu_offset(i); + + CPU_OFFSET(i); if ((addr >= start) && (addr < end)) return 1;