From: Michael Ellerman <michael@ellerman.id.au>
To: Matt Evans <matt@ozlabs.org>
Cc: linuxppc-dev@ozlabs.org, Milton Miller <miltonm@bga.com>
Subject: Re: [PATCH v2] powerpc/kexec: Switch to a static PACA on the way out
Date: Fri, 23 Jul 2010 23:12:03 +1000 [thread overview]
Message-ID: <1279890723.13008.2.camel@concordia> (raw)
In-Reply-To: <4C358479.1090502@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]
On Thu, 2010-07-08 at 17:55 +1000, Matt Evans wrote:
> With dynamic PACAs, the kexecing CPU's PACA won't lie within the kernel
> static data and there is a chance that something may stomp it when preparing
> to kexec. This patch switches this final CPU to a static PACA just before
> we pull the switch.
>
> Signed-off-by: Matt Evans <matt@ozlabs.org>
> ---
> v2: Changes from Milton's review:
> - Use setup_paca() and move from setup_64.c,
> - SLB cache inval. not required,
> - Adjust 'paca' (oops..), and
> - Poison data_offset/per_cpu_offset
>
> arch/powerpc/include/asm/paca.h | 2 +-
> arch/powerpc/kernel/machine_kexec_64.c | 20 ++++++++++++++++++++
> arch/powerpc/kernel/paca.c | 10 ++++++++++
> arch/powerpc/kernel/setup_64.c | 10 ----------
> 4 files changed, 31 insertions(+), 11 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
> index 8ce7963..1ff6662 100644
> --- a/arch/powerpc/include/asm/paca.h
> +++ b/arch/powerpc/include/asm/paca.h
> @@ -146,7 +146,7 @@ struct paca_struct {
> extern struct paca_struct *paca;
> extern __initdata struct paca_struct boot_paca;
> extern void initialise_paca(struct paca_struct *new_paca, int cpu);
> -
> +extern void setup_paca(struct paca_struct *new_paca);
> extern void allocate_pacas(void);
> extern void free_unused_pacas(void);
>
> diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
> index 26f9900..c4d0123 100644
> --- a/arch/powerpc/kernel/machine_kexec_64.c
> +++ b/arch/powerpc/kernel/machine_kexec_64.c
> @@ -273,6 +273,12 @@ static void kexec_prepare_cpus(void)
> static union thread_union kexec_stack __init_task_data =
> { };
>
> +/*
> + * For similar reasons to the stack above, the kexecing CPU needs to be on a
> + * static PACA; we switch to kexec_paca.
> + */
> +struct paca_struct kexec_paca;
> +
Hopelessly late probably but .. we could use boot_paca which already
exists and is static.
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2010-07-23 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-08 7:55 [PATCH v2] powerpc/kexec: Switch to a static PACA on the way out Matt Evans
2010-07-23 13:12 ` Michael Ellerman [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=1279890723.13008.2.camel@concordia \
--to=michael@ellerman.id.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=matt@ozlabs.org \
--cc=miltonm@bga.com \
/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).