--- arch/x86/kernel/setup64.c | 4 +++- arch/x86/kernel/setup_64.c | 24 +++++++++++++++++++++++- arch/x86/kernel/smpboot_64.c | 16 ---------------- 3 files changed, 26 insertions(+), 18 deletions(-) Index: linux-2.6/arch/x86/kernel/setup64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup64.c 2007-11-13 16:44:04.319517916 -0800 +++ linux-2.6/arch/x86/kernel/setup64.c 2007-11-13 17:22:29.077759780 -0800 @@ -31,7 +31,9 @@ cpumask_t cpu_initialized __cpuinitdata struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; EXPORT_SYMBOL(_cpu_pda); -struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; + +/* only used for very early boot (before setup_arch has finished) */ +struct x8664_pda __initdata boot_cpu_pda[NR_CPUS]; struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; Index: linux-2.6/arch/x86/kernel/smpboot_64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/smpboot_64.c 2007-11-13 14:23:21.700000578 -0800 +++ linux-2.6/arch/x86/kernel/smpboot_64.c 2007-11-13 17:21:44.949484182 -0800 @@ -556,22 +556,6 @@ static int __cpuinit do_boot_cpu(int cpu return -1; } - /* Allocate node local memory for AP pdas */ - if (cpu_pda(cpu) == &boot_cpu_pda[cpu]) { - struct x8664_pda *newpda, *pda; - int node = cpu_to_node(cpu); - pda = cpu_pda(cpu); - newpda = kmalloc_node(sizeof (struct x8664_pda), GFP_ATOMIC, - node); - if (newpda) { - memcpy(newpda, pda, sizeof (struct x8664_pda)); - cpu_pda(cpu) = newpda; - } else - printk(KERN_ERR - "Could not allocate node local PDA for CPU %d on node %d\n", - cpu, node); - } - alternatives_smp_switch(1); c_idle.idle = get_idle_for_cpu(cpu); Index: linux-2.6/arch/x86/kernel/setup_64.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/setup_64.c 2007-11-13 14:23:21.712000237 -0800 +++ linux-2.6/arch/x86/kernel/setup_64.c 2007-11-13 17:24:01.589484716 -0800 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -405,6 +406,7 @@ void __init setup_arch(char **cmdline_p) reserve_crashkernel(); paging_init(); + #ifdef CONFIG_PCI early_quirks(); #endif @@ -434,7 +436,7 @@ void __init setup_arch(char **cmdline_p) /* * We trust e820 completely. No explicit ROM probing in memory. */ - e820_reserve_resources(); + e820_reserve_resources(); e820_mark_nosave_regions(); { @@ -453,6 +455,26 @@ void __init setup_arch(char **cmdline_p) conswitchp = &dummy_con; #endif #endif + /* + * Create the PDA area and get the one for cpu 0 operational. + * The boot pdas are no longer needed after this. + */ + { + unsigned i; + + cpu_pda(0) = boot_cpu_alloc(sizeof(struct x8664_pda)); + if (!cpu_pda(0)) + panic("Cannot allocate cpu memory\n"); + + for_each_possible_cpu(i) { + void *p = CPU_PTR(cpu_pda(0), i); + + memcpy(p, cpu_pda(i), sizeof(struct x8664_pda)); + cpu_pda(i) = p; + } + } + + pda_init(0); } static int __cpuinit get_model_name(struct cpuinfo_x86 *c)