]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Fix reporting of kernel execute faults
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 19 Jul 2017 04:49:34 +0000 (14:49 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Aug 2017 06:06:46 +0000 (16:06 +1000)
commitb18830b36894a5ac1780d4e5376e0af83287b286
tree6e6d4013509afd0bd6d9f4bf043b34b4a95d96a5
parentccfe653f07e9e41538403ecf769d7b21855092eb
powerpc/mm: Fix reporting of kernel execute faults

We currently test for is_exec and DSISR_PROTFAULT but that doesn't
make sense as this is the wrong error bit to test for an execute
permission failure.

In fact, we had code that would return early if we had an exec
fault in kernel mode so I think that was just dead code anyway.

Finally the location of that test is awkward and prevents further
simplifications.

So instead move that test into a helper along with the existing
early test for kernel exec faults and out of range accesses,
and put it all in a "bad_kernel_fault()" helper. While at it
test the correct error bits.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/fault.c