The patch titled i386-pda: Implement smp_processor_id() with the PDA has been added to the -mm tree. Its filename is i386-pda-implement-smp_processor_id-with-the-pda.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: i386-pda: Implement smp_processor_id() with the PDA From: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Use the cpu_number in the PDA to implement raw_smp_processor_id. This is a little simpler than using thread_info, though the cpu field in thread_info cannot be removed since it is used for things other than getting the current CPU in common code. Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> Cc: Chuck Ebbert <76306.1226@xxxxxxxxxxxxxx> Cc: Zachary Amsden <zach@xxxxxxxxxx> Cc: Jan Beulich <jbeulich@xxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/i386/kernel/asm-offsets.c | 4 +++- arch/i386/kernel/cpu/common.c | 2 ++ arch/i386/kernel/entry.S | 3 +-- include/asm-i386/pda.h | 2 ++ include/asm-i386/smp.h | 3 ++- 5 files changed, 10 insertions(+), 4 deletions(-) diff -puN arch/i386/kernel/asm-offsets.c~i386-pda-implement-smp_processor_id-with-the-pda arch/i386/kernel/asm-offsets.c --- a/arch/i386/kernel/asm-offsets.c~i386-pda-implement-smp_processor_id-with-the-pda +++ a/arch/i386/kernel/asm-offsets.c @@ -51,7 +51,6 @@ void foo(void) OFFSET(TI_exec_domain, thread_info, exec_domain); OFFSET(TI_flags, thread_info, flags); OFFSET(TI_status, thread_info, status); - OFFSET(TI_cpu, thread_info, cpu); OFFSET(TI_preempt_count, thread_info, preempt_count); OFFSET(TI_addr_limit, thread_info, addr_limit); OFFSET(TI_restart_block, thread_info, restart_block); @@ -97,4 +96,7 @@ void foo(void) DEFINE(VDSO_PRELINK, VDSO_PRELINK); OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); + + BLANK(); + OFFSET(PDA_cpu, i386_pda, cpu_number); } diff -puN arch/i386/kernel/cpu/common.c~i386-pda-implement-smp_processor_id-with-the-pda arch/i386/kernel/cpu/common.c --- a/arch/i386/kernel/cpu/common.c~i386-pda-implement-smp_processor_id-with-the-pda +++ a/arch/i386/kernel/cpu/common.c @@ -650,6 +650,7 @@ __cpuinit int alloc_gdt(int cpu) /* Initial PDA used by boot CPU */ struct i386_pda boot_pda = { ._pda = &boot_pda, + .cpu_number = 0, }; static inline void set_kernel_gs(void) @@ -694,6 +695,7 @@ __cpuinit int init_gdt(int cpu, struct t memset(pda, 0, sizeof(*pda)); pda->_pda = pda; + pda->cpu_number = cpu; return 1; } diff -puN arch/i386/kernel/entry.S~i386-pda-implement-smp_processor_id-with-the-pda arch/i386/kernel/entry.S --- a/arch/i386/kernel/entry.S~i386-pda-implement-smp_processor_id-with-the-pda +++ a/arch/i386/kernel/entry.S @@ -524,8 +524,7 @@ syscall_badsys: #define FIXUP_ESPFIX_STACK \ /* since we are on a wrong stack, we cant make it a C code :( */ \ - GET_THREAD_INFO(%ebp); \ - movl TI_cpu(%ebp), %ebx; \ + movl %gs:PDA_cpu, %ebx; \ PER_CPU(cpu_gdt_descr, %ebx); \ movl GDS_address(%ebx), %ebx; \ GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ diff -puN include/asm-i386/pda.h~i386-pda-implement-smp_processor_id-with-the-pda include/asm-i386/pda.h --- a/include/asm-i386/pda.h~i386-pda-implement-smp_processor_id-with-the-pda +++ a/include/asm-i386/pda.h @@ -11,6 +11,8 @@ struct i386_pda { struct i386_pda *_pda; /* pointer to self */ + + int cpu_number; }; extern struct i386_pda *_cpu_pda[]; diff -puN include/asm-i386/smp.h~i386-pda-implement-smp_processor_id-with-the-pda include/asm-i386/smp.h --- a/include/asm-i386/smp.h~i386-pda-implement-smp_processor_id-with-the-pda +++ a/include/asm-i386/smp.h @@ -8,6 +8,7 @@ #include <linux/kernel.h> #include <linux/threads.h> #include <linux/cpumask.h> +#include <asm/pda.h> #endif #ifdef CONFIG_X86_LOCAL_APIC @@ -56,7 +57,7 @@ extern void cpu_uninit(void); * from the initial startup. We map APIC_BASE very early in page_setup(), * so this is correct in the x86 case. */ -#define raw_smp_processor_id() (current_thread_info()->cpu) +#define raw_smp_processor_id() (read_pda(cpu_number)) extern cpumask_t cpu_callout_map; extern cpumask_t cpu_callin_map; _ Patches currently in -mm which might be from jeremy@xxxxxxxx are x86-remove-default_ldt-and-simplify-ldt-setting.patch i386-use-asm-offsets-for-the-offsets-of-registers-into-the-pt_regs-struct-rather-than-having-hard-coded-constants.patch i386-pda-basic-definitions-for-i386-pda.patch i386-pda-initialize-the-per-cpu-data-area.patch i386-pda-use-%gs-as-the-pda-base-segment-in-the-kernel.patch i386-pda-fix-places-where-using-%gs-changes-the-usermode-abi.patch i386-pda-update-sys_vm86-to-cope-with-changed-pt_regs-and-%gs-usage.patch i386-pda-implement-smp_processor_id-with-the-pda.patch i386-pda-implement-current-with-the-pda.patch i386-pda-store-the-interrupt-regs-pointer-in-the-pda.patch generic-bug-implementation.patch generic-bug-for-i386.patch generic-bug-for-x86-64.patch generic-bug-for-powerpc.patch uml-add-generic-bug-support.patch use-generic-bug-for-ppc.patch bug-test-1.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html