diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2018-02-13 16:08:19 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-03-30 14:34:28 +0200 |
commit | 59f577743d71bf796ceac10961bf6cfa5ca26786 (patch) | |
tree | 28b1d6c5ebef21b63fb5192ee2d790f2138a2be6 /arch/powerpc/kernel/setup-common.c | |
parent | powerpc/setup: Add cpu_to_phys_id array (diff) | |
download | linux-59f577743d71bf796ceac10961bf6cfa5ca26786.tar.xz linux-59f577743d71bf796ceac10961bf6cfa5ca26786.zip |
powerpc/64: Defer paca allocation until memory topology is discovered
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Rename the dummy allocate_pacas() to fix 32-bit build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index bd79a5644c78..af7a47c8fe10 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -577,12 +577,6 @@ void __init smp_setup_cpu_maps(void) setup_nr_cpu_ids(); free_unused_pacas(); - - for_each_possible_cpu(cpu) { - if (cpu == smp_processor_id()) - continue; - set_hard_smp_processor_id(cpu, cpu_to_phys_id[cpu]); - } } #endif /* CONFIG_SMP */ @@ -848,6 +842,23 @@ static __init void print_system_info(void) pr_info("-----------------------------------------------------\n"); } +#ifdef CONFIG_SMP +static void smp_setup_pacas(void) +{ + int cpu; + + for_each_possible_cpu(cpu) { + if (cpu == smp_processor_id()) + continue; + allocate_paca(cpu); + set_hard_smp_processor_id(cpu, cpu_to_phys_id[cpu]); + } + + memblock_free(__pa(cpu_to_phys_id), nr_cpu_ids * sizeof(u32)); + cpu_to_phys_id = NULL; +} +#endif + /* * Called into from start_kernel this initializes memblock, which is used * to manage page allocation until mem_init is called. @@ -915,6 +926,7 @@ void __init setup_arch(char **cmdline_p) * so smp_release_cpus() does nothing for them. */ #ifdef CONFIG_SMP + smp_setup_pacas(); smp_release_cpus(); #endif |