From: Michael Ellerman <mpe@ellerman.id.au>
To: Balbir Singh <bsingharora@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/kexec: Fix radix to hash kexec
Date: Thu, 29 Jun 2017 19:29:58 +1000 [thread overview]
Message-ID: <87mv8r9m5l.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170629082734.4195-1-bsingharora@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
> This patch fixes a crash seen while doing a kexec from
> radix mode to hash mode. Key 0 is special in hash and
> used in the RPN by default, we set the key values to 0
> today. In radix mode key 0 is used to control
> supervisor<->user access. In hash key 0 is used by default,
> so the first instruction after the switch causes a crash on
> kexec.
>
> This patch fixes
> (3b10d00 powerpc/mm/radix: Prevent kernel execution of user space)
> The commit above introduced setting of IAMR and AMOR values to
> prevent execution of user mode instructions from supervisor mode.
> We need to clean up these SPR's on kexec.
>
> Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> ---
>
> NOTES:
> This patch can be made power9 specific, but I've chosen not
> to do so, I could add it in a feature section if recommended.
Well neither register existed in the architecture prior to Power8.
Possibly they were defined in BookIV or they were nops, but most likely
it will just explode on old CPUs.
And probably Book3E as well.
So it should be in a CPU_FTR_ARCH_207S section at a minimum.
But maybe it should just be done in C earlier in the call chain.
cheers
next prev parent reply other threads:[~2017-06-29 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 8:27 [PATCH] powerpc/kexec: Fix radix to hash kexec Balbir Singh
2017-06-29 9:29 ` Michael Ellerman [this message]
2017-06-29 11:54 ` Balbir Singh
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=87mv8r9m5l.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--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