x86_64: Remove the data_offset field from the pda. It is useless now since gs can always stand in for data_offset. Move active_mm into the available slot in order to not upset the established offsets. Signed-off-by: Christoph Lameter --- arch/x86/kernel/asm-offsets_64.c | 1 - arch/x86/kernel/entry_64.S | 7 ++----- arch/x86/kernel/setup64.c | 6 ------ include/asm-x86/pda.h | 4 +--- 4 files changed, 3 insertions(+), 15 deletions(-) Index: linux-2.6/arch/x86/kernel/asm-offsets_64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/asm-offsets_64.c 2007-11-17 16:28:01.655785025 -0800 +++ linux-2.6/arch/x86/kernel/asm-offsets_64.c 2007-11-17 18:16:13.529022664 -0800 @@ -56,7 +56,6 @@ int main(void) ENTRY(irqcount); ENTRY(cpunumber); ENTRY(irqstackptr); - ENTRY(data_offset); BLANK(); #undef ENTRY #ifdef CONFIG_IA32_EMULATION Index: linux-2.6/arch/x86/kernel/entry_64.S =================================================================== --- linux-2.6.orig/arch/x86/kernel/entry_64.S 2007-11-17 16:28:01.647784312 -0800 +++ linux-2.6/arch/x86/kernel/entry_64.S 2007-11-17 18:16:13.529022664 -0800 @@ -734,18 +734,15 @@ END(spurious_interrupt) swapgs xorl %ebx,%ebx 1: - .if \ist - movq %gs:pda_data_offset, %rbp - .endif movq %rsp,%rdi movq ORIG_RAX(%rsp),%rsi movq $-1,ORIG_RAX(%rsp) .if \ist - subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) + subq $EXCEPTION_STKSZ, %gs: per_cpu__init_tss + TSS_ist .endif call \sym .if \ist - addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) + addq $EXCEPTION_STKSZ, %gs: per_cpu__init_tss + TSS_ist .endif cli .if \irqtrace Index: linux-2.6/arch/x86/kernel/setup64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup64.c 2007-11-17 18:09:56.309022712 -0800 +++ linux-2.6/arch/x86/kernel/setup64.c 2007-11-17 18:16:13.529022664 -0800 @@ -105,12 +105,6 @@ void __init setup_per_cpu_areas(void) char *base_for_cpu = CPU_PTR(base, i); struct x8664_pda *pda_for_cpu; - /* - * Must setup the data offset in the boot pda first because - * we may need the data offset to calculate the per cpu address. - */ - cpu_pda(i)->data_offset = base_for_cpu - __per_cpu_start; - memcpy(base_for_cpu, __load_per_cpu_start, __per_cpu_end - __per_cpu_start); pda_for_cpu = &per_cpu(pda, i); Index: linux-2.6/include/asm-x86/pda.h =================================================================== --- linux-2.6.orig/include/asm-x86/pda.h 2007-11-17 18:09:43.705522758 -0800 +++ linux-2.6/include/asm-x86/pda.h 2007-11-17 18:16:13.544883584 -0800 @@ -10,8 +10,7 @@ /* Per processor datastructure. %gs points to it while the kernel runs */ struct x8664_pda { struct task_struct *pcurrent; /* 0 Current process */ - unsigned long data_offset; /* 8 Per cpu data offset from linker - address */ + struct mm_struct *active_mm; unsigned long kernelstack; /* 16 top of kernel stack for current */ unsigned long oldrsp; /* 24 user rsp for system call */ int irqcount; /* 32 Irq nesting counter. Starts with -1 */ @@ -27,7 +26,6 @@ struct x8664_pda { unsigned int __nmi_count; /* number of NMI on this CPUs */ short mmu_state; short isidle; - struct mm_struct *active_mm; unsigned apic_timer_irqs; unsigned irq0_irqs; unsigned irq_resched_count;