X86_64: Relocate cpu_area to be reachable via 32 bit offset from kernel text. There is only a 32 bit offset evailable to reach the per cpu data. If we want the loader to put cpu_area base pointers in the code then we need to move the cpu area near the text segment. So relocate the cpu area to be located after the modules. This gives us almost 2 GB of possible cpu area space. Signed-off-by: Christoph Lameter --- arch/x86/kernel/vmlinux_64.lds.S | 4 +++- include/asm-x86/pgtable_64.h | 4 +++- 2 files changed, 6 insertions(+), 2 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 07:01:59.607166417 -0800 +++ linux-2.6/arch/x86/kernel/vmlinux_64.lds.S 2007-11-16 07:41:23.723166254 -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); /* R__ */ 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) + FIXED_ADDR_PERCPU(CPU_AREA_BASE, 4096) . = ALIGN(4096); __init_end = .; Index: linux-2.6/include/asm-x86/pgtable_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/pgtable_64.h 2007-11-16 07:01:59.627166995 -0800 +++ linux-2.6/include/asm-x86/pgtable_64.h 2007-11-16 07:40:33.055654819 -0800 @@ -138,7 +138,9 @@ 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) +/* CPU_AREA_BASE is used by the linker */ +#define CPU_AREA_BASE 0xffffffffc0000000 +#define CPU_AREA_END _AC(0xffffffff88000000, UL) #define MODULES_VADDR _AC(0xffffffff88000000, UL) #define MODULES_END _AC(0xfffffffffff00000, UL) #define MODULES_LEN (MODULES_END - MODULES_VADDR)