From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Neuling <mikey@neuling.org>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] powerpc/powernv: Return secondary CPUs to firmware on kexec
Date: Fri, 16 Aug 2013 13:34:36 +1000 [thread overview]
Message-ID: <1376624076.4255.132.camel@pasglop> (raw)
In-Reply-To: <CAEjGV6wdjnoh__eAZ0pFh9o+-=ZpDB-Sg9CBuA2Z+FepgK1-1w@mail.gmail.com>
On Fri, 2013-08-16 at 11:16 +1000, Michael Neuling wrote:
>
> > 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?
The point of kexec is to avoid rebooting :-)
Sending secondaries back to the OPAL internal spin loop doesn't take a
noticeable amount of time.
We could avoid doing it and solve the problem of needing all CPUs in
firmware for "reconfig" differently however. We could have the "target"
kernel code take them out of kexec into a special path that goes back
into the fw ... I chose the kexec solution because it was simpler and
less code :-)
Cheers,
Ben.
> Mikey
>
>
> > Signed-off-by: Benjamin Herrenschmidt <benh@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@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
> >
>
>
prev parent reply other threads:[~2013-08-16 3:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 0:05 [PATCH] powerpc/powernv: Return secondary CPUs to firmware on kexec Benjamin Herrenschmidt
2013-08-16 1:16 ` Michael Neuling
2013-08-16 3:34 ` Benjamin Herrenschmidt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376624076.4255.132.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).