Nicholas Piggin <npig...@gmail.com> writes: > Build an array that finds hardware CPU number from logical CPU > number in firmware CPU discovery. Use that rather than setting > paca of other CPUs directly, to begin with. Subsequent patch will > not have pacas allocated at this point. > --- > arch/powerpc/include/asm/smp.h | 1 + > arch/powerpc/kernel/prom.c | 7 +++++++ > arch/powerpc/kernel/setup-common.c | 15 ++++++++++++++- > 3 files changed, 22 insertions(+), 1 deletion(-)
Added SOB. > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c > index 4dffef947b8a..5979e34ba90e 100644 > --- a/arch/powerpc/kernel/prom.c > +++ b/arch/powerpc/kernel/prom.c > @@ -874,5 +874,12 @@ EXPORT_SYMBOL(cpu_to_chip_id); > > bool arch_match_cpu_phys_id(int cpu, u64 phys_id) > { > + /* > + * Early firmware scanning must use this rather than > + * get_hard_smp_processor_id because we don't have pacas allocated > + * until memory topology is discovered. > + */ > + if (cpu_to_phys_id != NULL) > + return (int)phys_id == cpu_to_phys_id[cpu]; This needed an #ifdef CONFIG_SMP. cheers