From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Balbir Singh <bsingharora@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: Anton Blanchard <anton@au1.ibm.com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [RFC/PATCH 2/4] powerpc/64/kexec: Fix MMU cleanup on radix
Date: Fri, 08 Jul 2016 13:36:55 +1000 [thread overview]
Message-ID: <1467949015.2874.7.camel@kernel.crashing.org> (raw)
In-Reply-To: <4b35285e-88c3-7b96-2991-8b42ed50f267@gmail.com>
On Fri, 2016-07-08 at 12:55 +1000, Balbir Singh wrote:
> +
> > +/* For use by kexec */
> > +void mmu_cleanup_all(void)
> > +{
> > + if (radix_enabled())
> > + radix__mmu_cleanup_all();
>
>
> Should this be more than just radix -- cpu_has_feature(CPU_FTR_ARCH_300)?
I don't understand... We need to cleanup the radix if we use a radix, otherwise
we cleanup the hash ...
Basically this will switch back to hash mode before kexec.
> > + else if (mmu_hash_ops.hpte_clear_all)
> > + mmu_hash_ops.hpte_clear_all();
> > +}
> > diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> > index 3ababda..f127baa 100644
> > --- a/arch/powerpc/mm/pgtable-radix.c
> > +++ b/arch/powerpc/mm/pgtable-radix.c
> > @@ -366,6 +366,16 @@ void radix__early_init_mmu_secondary(void)
> > }
> > }
> >
> > +void radix__mmu_cleanup_all(void)
> > +{
> > + unsigned long lpcr;
> > + if (!firmware_has_feature(FW_FEATURE_LPAR)) {
> > + lpcr = mfspr(SPRN_LPCR);
> > + mtspr(SPRN_LPCR, lpcr & ~LPCR_UPRT);
> > + mtspr(SPRN_PTCR, 0);
>
> Free up the patb data structure here?
Why do we care freeing it ? We're about to kexec.
> We also need tlbie's to invalidate any caches pointing to the patb entries
Yes, that would be definitely a useful addition, I shuld have mentioned this
is a stub so we don't crash due to a NULL pointer, but more work is needed
to properly support kexec, which I'll let Aneesh do.
On the other hand for safety, the new kernel should also flush its TLB on
entry I reckon. Especially since I don't think we do the cleanup on crashdump.
Cheers,
Ben.
prev parent reply other threads:[~2016-07-08 3:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 4:34 [RFC/PATCH 2/4] powerpc/64/kexec: Fix MMU cleanup on radix Benjamin Herrenschmidt
2016-07-08 2:55 ` Balbir Singh
2016-07-08 3:36 ` 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=1467949015.2874.7.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=anton@au1.ibm.com \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.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).