diff options
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 70d846628bbf..f2f77ca494d4 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -744,52 +744,6 @@ static void __cpuinit do_fork_idle(struct work_struct *work) | |||
744 | complete(&c_idle->done); | 744 | complete(&c_idle->done); |
745 | } | 745 | } |
746 | 746 | ||
747 | #ifdef CONFIG_X86_64 | ||
748 | |||
749 | /* __ref because it's safe to call free_bootmem when after_bootmem == 0. */ | ||
750 | static void __ref free_bootmem_pda(struct x8664_pda *oldpda) | ||
751 | { | ||
752 | if (!after_bootmem) | ||
753 | free_bootmem((unsigned long)oldpda, sizeof(*oldpda)); | ||
754 | } | ||
755 | |||
756 | /* | ||
757 | * Allocate node local memory for the AP pda. | ||
758 | * | ||
759 | * Must be called after the _cpu_pda pointer table is initialized. | ||
760 | */ | ||
761 | int __cpuinit get_local_pda(int cpu) | ||
762 | { | ||
763 | struct x8664_pda *oldpda, *newpda; | ||
764 | unsigned long size = sizeof(struct x8664_pda); | ||
765 | int node = cpu_to_node(cpu); | ||
766 | |||
767 | if (cpu_pda(cpu) && !cpu_pda(cpu)->in_bootmem) | ||
768 | return 0; | ||
769 | |||
770 | oldpda = cpu_pda(cpu); | ||
771 | newpda = kmalloc_node(size, GFP_ATOMIC, node); | ||
772 | if (!newpda) { | ||
773 | printk(KERN_ERR "Could not allocate node local PDA " | ||
774 | "for CPU %d on node %d\n", cpu, node); | ||
775 | |||
776 | if (oldpda) | ||
777 | return 0; /* have a usable pda */ | ||
778 | else | ||
779 | return -1; | ||
780 | } | ||
781 | |||
782 | if (oldpda) { | ||
783 | memcpy(newpda, oldpda, size); | ||
784 | free_bootmem_pda(oldpda); | ||
785 | } | ||
786 | |||
787 | newpda->in_bootmem = 0; | ||
788 | cpu_pda(cpu) = newpda; | ||
789 | return 0; | ||
790 | } | ||
791 | #endif /* CONFIG_X86_64 */ | ||
792 | |||
793 | static int __cpuinit do_boot_cpu(int apicid, int cpu) | 747 | static int __cpuinit do_boot_cpu(int apicid, int cpu) |
794 | /* | 748 | /* |
795 | * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad | 749 | * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad |
@@ -807,16 +761,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) | |||
807 | }; | 761 | }; |
808 | INIT_WORK(&c_idle.work, do_fork_idle); | 762 | INIT_WORK(&c_idle.work, do_fork_idle); |
809 | 763 | ||
810 | #ifdef CONFIG_X86_64 | ||
811 | /* Allocate node local memory for AP pdas */ | ||
812 | if (cpu > 0) { | ||
813 | boot_error = get_local_pda(cpu); | ||
814 | if (boot_error) | ||
815 | goto restore_state; | ||
816 | /* if can't get pda memory, can't start cpu */ | ||
817 | } | ||
818 | #endif | ||
819 | |||
820 | alternatives_smp_switch(1); | 764 | alternatives_smp_switch(1); |
821 | 765 | ||
822 | c_idle.idle = get_idle_for_cpu(cpu); | 766 | c_idle.idle = get_idle_for_cpu(cpu); |
@@ -931,9 +875,7 @@ do_rest: | |||
931 | inquire_remote_apic(apicid); | 875 | inquire_remote_apic(apicid); |
932 | } | 876 | } |
933 | } | 877 | } |
934 | #ifdef CONFIG_X86_64 | 878 | |
935 | restore_state: | ||
936 | #endif | ||
937 | if (boot_error) { | 879 | if (boot_error) { |
938 | /* Try to put things back the way they were before ... */ | 880 | /* Try to put things back the way they were before ... */ |
939 | numa_remove_cpu(cpu); /* was set by numa_add_cpu */ | 881 | numa_remove_cpu(cpu); /* was set by numa_add_cpu */ |