[PATCH] powerpc/powernv: Return secondary CPUs to firmware on kexec

Michael Neuling mikey at neuling.org
Fri Aug 16 11:16:16 EST 2013


> With OPAL v3 we can return secondary CPUs to firmware on kexec. This
> allows firmware to do various cleanups making things generally more
> reliable, and will enable the "new" kernel to call OPAL to perform
> some reconfiguration tasks early on that can only be done while
> all the CPUs are in firmware.

Dumb question, but isn't the point of kexec to avoid fw interactions like
this?

Mikey

> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
>
> diff --git a/arch/powerpc/platforms/powernv/setup.c
b/arch/powerpc/platforms/powernv/setup.c
> index d4459bf..b59a1da 100644
> --- a/arch/powerpc/platforms/powernv/setup.c
> +++ b/arch/powerpc/platforms/powernv/setup.c
> @@ -31,6 +31,7 @@
>  #include <asm/xics.h>
>  #include <asm/rtas.h>
>  #include <asm/opal.h>
> +#include <asm/kexec.h>
>
>  #include "powernv.h"
>
> @@ -143,6 +144,16 @@ static void pnv_shutdown(void)
>  static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
>  {
>         xics_kexec_teardown_cpu(secondary);
> +
> +       /* Return secondary CPUs to firmware on OPAL v3 */
> +       if (firmware_has_feature(FW_FEATURE_OPALv3) && secondary) {
> +               mb();
> +               get_paca()->kexec_state = KEXEC_STATE_REAL_MODE;
> +               mb();
> +
> +               /* Return the CPU to OPAL */
> +               opal_return_cpu();
> +       }
>  }
>  #endif /* CONFIG_KEXEC */
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20130816/5ec3473e/attachment.html>


More information about the Linuxppc-dev mailing list