]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR
authorBalbir Singh <bsingharora@gmail.com>
Thu, 29 Jun 2017 11:57:26 +0000 (21:57 +1000)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 24 Jul 2017 12:54:17 +0000 (07:54 -0500)
commit9d3b255d35dc5a71230cef61fe1d9b4aa4ff07e5
treeac87b086805bb5e4e8769fc82b0a987e8fc791e6
parenta98b025eaacde3df18297f3ffc2856393ab11d92
powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR

BugLink: http://bugs.launchpad.net/bugs/1706067
commit 1e2a516e89fc412a754327522ab271b42f99c6b4 upstream.

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.

Commit 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of
user space") introduced the 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.

Fixes: 3b10d0095a1e ("powerpc/mm/radix: Prevent kernel execution of user space")
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/kernel/misc_64.S