Remove _cpu_pda() pda->dataoffset = cpu_pda(cpu) - __per_cpu_start We could now setup __per_cpu_offset[i] = cpu_pda(cpu) - __per_cpu_start Thus cpu_pda(cpu) = __per_cpu_offset[i] + __per_cpu_start --- arch/x86/kernel/head64.c | 2 +- arch/x86/kernel/setup64.c | 3 --- include/asm-x86/pda.h | 4 +--- include/asm-x86/percpu.h | 3 --- 4 files changed, 2 insertions(+), 10 deletions(-) Index: linux-2.6/arch/x86/kernel/head64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/head64.c 2007-11-27 20:57:30.784463105 -0800 +++ linux-2.6/arch/x86/kernel/head64.c 2007-11-27 20:58:34.999962527 -0800 @@ -69,7 +69,7 @@ void __init x86_64_start_kernel(char * r early_printk("Kernel alive\n"); for (i = 0; i < NR_CPUS; i++) - cpu_pda(i) = &boot_cpu_pda[i]; + __per_cpu_offset[i] = ((char *)&boot_cpu_pda[i]) - __per_cpu_start; pda_init(0); copy_bootdata(__va(real_mode_data)); Index: linux-2.6/arch/x86/kernel/setup64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup64.c 2007-11-27 20:56:44.464963338 -0800 +++ linux-2.6/arch/x86/kernel/setup64.c 2007-11-27 21:04:20.791963047 -0800 @@ -28,9 +28,6 @@ struct boot_params __initdata boot_param cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; -struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; -EXPORT_SYMBOL(_cpu_pda); - DEFINE_PER_CPU_FIRST(struct x8664_pda, pda); EXPORT_PER_CPU_SYMBOL(pda); Index: linux-2.6/include/asm-x86/pda.h =================================================================== --- linux-2.6.orig/include/asm-x86/pda.h 2007-11-27 20:55:04.088463061 -0800 +++ linux-2.6/include/asm-x86/pda.h 2007-11-27 20:56:10.276712996 -0800 @@ -38,9 +38,7 @@ struct x8664_pda { unsigned irq_spurious_count; } ____cacheline_aligned_in_smp; -extern struct x8664_pda *_cpu_pda[]; - -#define cpu_pda(i) (_cpu_pda[i]) +#define cpu_pda(i) ((struct x8664_pda *)(__per_cpu_start + __per_cpu_offset[i])) /* * There is no fast way to get the base address of the PDA, all the accesses Index: linux-2.6/include/asm-x86/percpu.h =================================================================== --- linux-2.6.orig/include/asm-x86/percpu.h 2007-11-27 20:59:15.732713119 -0800 +++ linux-2.6/include/asm-x86/percpu.h 2007-11-27 20:59:59.468213018 -0800 @@ -12,11 +12,8 @@ #ifdef CONFIG_SMP #include -#define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) #define __my_cpu_offset read_pda(data_offset) -#define per_cpu_offset(x) (__per_cpu_offset(x)) - #endif #include