powerpc: Fix faults caused by radix patching of SLB miss handler
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Jun 2016 09:23:43 +0000 (19:23 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 22 Jun 2016 23:58:17 +0000 (09:58 +1000)
commit6e914ee629c411d9c6d160399ce7d3472d2c0ec7
treec6a926d38f595258cd713b3abb483f77a0f67ed9
parenta3aa256b7258b3d19f8b44557cc64525a993b941
powerpc: Fix faults caused by radix patching of SLB miss handler

As part of the Radix MMU support we added some feature sections in the
SLB miss handler. These are intended to catch the case that we
incorrectly take an SLB miss when Radix is enabled, and instead of
crashing weirdly they bail out to a well defined exit path and trigger
an oops.

However the way they were written meant the bailout case was enabled by
default until we did CPU feature patching.

On powermacs the early debug prints in setup_system() can cause an SLB
miss, which happens before code patching, and so the SLB miss handler
would incorrectly bailout and crash during boot.

Fix it by inverting the sense of the feature section, so that the code
which is in place at boot is correct for the hash case. Once we
determine we are using Radix - which will never happen on a powermac -
only then do we patch in the bailout case which unconditionally jumps.

Fixes: caca285e5ab4 ("powerpc/mm/radix: Use STD_MMU_64 to properly isolate hash related code")
Reported-by: Denis Kirjanov <kda@linux-powerpc.org>
Tested-by: Denis Kirjanov <kda@linux-powerpc.org>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S