powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 17 Apr 2020 11:58:36 +0000 (11:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:33:25 +0000 (16:33 +0200)
commit3160e84abaf737de27b6935843db958c23dd2af9
treea4d448ca22cf519a1d9d4cd8d3cc79efbda84631
parentb48331b52a28a52d83c503e6b6cc584b824bf072
powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32

commit feb8e960d780e170e992a70491eec9dd68f4dbf2 upstream.

CONFIG_PPC_KUAP_DEBUG is not selectable because it depends on PPC_32
which doesn't exists.

Fixing it leads to a deadlock due to a vital register getting
clobbered in _switch().

Change dependency to PPC32 and use r0 instead of r4 in _switch()

Fixes: e2fb9f544431 ("powerpc/32: Prepare for Kernel Userspace Access Protection")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/540242f7d4573f7cdf1b3bf46bb35f743b2cd68f.1587124651.git.christophe.leroy@c-s.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/entry_32.S
arch/powerpc/platforms/Kconfig.cputype