--- arch/x86/Kconfig | 2 +- arch/x86/kernel/vmlinux_64.lds.S | 4 +++- include/asm-x86/percpu_64.h | 15 +++++++-------- include/asm-x86/pgtable_64.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) Index: linux-2.6/arch/x86/kernel/vmlinux_64.lds.S =================================================================== --- linux-2.6.orig/arch/x86/kernel/vmlinux_64.lds.S 2007-11-16 14:58:14.961430000 -0800 +++ linux-2.6/arch/x86/kernel/vmlinux_64.lds.S 2007-11-16 21:20:51.033107407 -0800 @@ -6,6 +6,7 @@ #include #include +#include #undef i386 /* in case the preprocessor is a 32bit one */ @@ -16,6 +17,7 @@ jiffies_64 = jiffies; _proxy_pda = 1; PHDRS { text PT_LOAD FLAGS(5); /* R_E */ + percpu PT_LOAD FLAGS(4); data PT_LOAD FLAGS(7); /* RWE */ user PT_LOAD FLAGS(7); /* RWE */ data.init PT_LOAD FLAGS(7); /* RWE */ @@ -203,7 +205,7 @@ SECTIONS __initramfs_end = .; #endif - PERCPU(4096) + VIRT_PERCPU(CPU_AREA_BASE, 4096) . = ALIGN(4096); __init_end = .; Index: linux-2.6/include/asm-x86/percpu_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/percpu_64.h 2007-11-16 20:59:43.153106834 -0800 +++ linux-2.6/include/asm-x86/percpu_64.h 2007-11-16 21:20:51.033107407 -0800 @@ -11,10 +11,10 @@ #include -#define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) -#define __my_cpu_offset() read_pda(data_offset) +#define __per_cpu_offset(cpu) CPU_OFFSET(cpu) +#define __my_cpu_offset() THIS_CPU_OFFSET -#define per_cpu_offset(x) (__per_cpu_offset(x)) +#define per_cpu_offset(x) __per_cpu_offset(x) /* Separate out the type, so (int[3], foo) works. */ #define DEFINE_PER_CPU(type, name) \ @@ -32,21 +32,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), \ - (src), (size)); \ + memcpy(CPU_PTR(pcpudst, __i), (src), (size)); \ } while (0) extern void setup_per_cpu_areas(void); Index: linux-2.6/include/asm-x86/pgtable_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/pgtable_64.h 2007-11-16 18:47:13.148585999 -0800 +++ linux-2.6/include/asm-x86/pgtable_64.h 2007-11-16 21:20:51.033107407 -0800 @@ -138,8 +138,8 @@ static inline pte_t ptep_get_and_clear_f #define VMALLOC_START _AC(0xffffc20000000000, UL) #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) #define VMEMMAP_START _AC(0xffffe20000000000, UL) -#define CPU_AREA_BASE _AC(0xfffff20000000000, UL) #define MODULES_VADDR _AC(0xffffffff88000000, UL) +#define CPU_AREA_BASE 0xffffffffc0000000 #define MODULES_END _AC(0xfffffffffff00000, UL) #define MODULES_LEN (MODULES_END - MODULES_VADDR) Index: linux-2.6/arch/x86/Kconfig =================================================================== --- linux-2.6.orig/arch/x86/Kconfig 2007-11-16 18:47:13.148585999 -0800 +++ linux-2.6/arch/x86/Kconfig 2007-11-16 21:20:51.037107787 -0800 @@ -170,7 +170,7 @@ config CPU_AREA_VIRTUAL config CPU_AREA_ORDER int - default "16" if X86_64 + default "9" if X86_64 default "6" if X86_32 config CPU_AREA_ALLOC_ORDER