powerpc: Add optional smp_ops->prepare_cpu SMP callback
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 5 Apr 2017 07:54:48 +0000 (17:54 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 6 Apr 2017 09:58:53 +0000 (19:58 +1000)
commit14d4ae5c4cb89c05262fe41cb7a26f6ba949d8df
tree5aad3d800484640eb9e90df5d0d6f6039c4e7a34
parent22bd64a621cc80beeb009abec3d3df98ec0131c5
powerpc: Add optional smp_ops->prepare_cpu SMP callback

Some platforms (will) need to perform allocations before bringing
a new CPU online. Doing it from smp_ops->setup_cpu is the wrong
thing to do:

 - It has no useful failure path (too late)
 - Calling any allocator will enable interrupts prematurely
   causing problems with large decrementer among others

Instead, add a new callback that is called from __cpu_up (so from
the context trying to online the new CPU) at a point where we
can safely allocate and handle failures.

This will be used by XIVE support.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/smp.h
arch/powerpc/kernel/smp.c