• Benjamin Herrenschmidt's avatar
    powerpc/mm: Fix reporting of kernel execute faults · d3ca5874
    Benjamin Herrenschmidt authored
    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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    d3ca5874
fault.c 15.9 KB