--- arch/x86/kernel/setup64.c | 4 ++-- include/asm-x86/pda.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) Index: linux-2.6/arch/x86/kernel/setup64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup64.c 2007-11-17 22:11:12.855600666 -0800 +++ linux-2.6/arch/x86/kernel/setup64.c 2007-11-17 22:12:31.080350545 -0800 @@ -31,7 +31,7 @@ cpumask_t cpu_initialized __cpuinitdata struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; EXPORT_SYMBOL(_cpu_pda); -static DEFINE_PER_CPU_FIRST(struct x8664_pda, pda); +DEFINE_PER_CPU_FIRST(struct x8664_pda, pda); struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; @@ -123,7 +123,7 @@ void pda_init(int cpu) asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); /* Memory clobbers used to order PDA accessed */ mb(); - wrmsrl(MSR_GS_BASE, pda); + wrmsrl(MSR_GS_BASE, pda - __per_cpu_start); mb(); pda->cpunumber = cpu; Index: linux-2.6/include/asm-x86/pda.h =================================================================== --- linux-2.6.orig/include/asm-x86/pda.h 2007-11-17 22:11:12.855600666 -0800 +++ linux-2.6/include/asm-x86/pda.h 2007-11-17 22:12:31.080350545 -0800 @@ -34,7 +34,7 @@ struct x8664_pda { unsigned irq_thermal_count; unsigned irq_threshold_count; unsigned irq_spurious_count; -} ____cacheline_aligned_in_smp; +}; extern struct x8664_pda *_cpu_pda[]; @@ -52,7 +52,9 @@ extern void __bad_pda_field(void) __attr */ extern struct x8664_pda _proxy_pda; -#define pda_offset(field) offsetof(struct x8664_pda, field) +/* percpu.h has not been included yet so lets do it manually */ +extern struct x8664_pda per_cpu__pda; +#define pda_offset(field) ((unsigned long)&per_cpu__pda.field) #define pda_to_op(op,field,val) do { \ typedef typeof(_proxy_pda.field) T__; \