powerpc/fault: Avoid heavy search_exception_tables() verification
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 9 Dec 2020 05:29:24 +0000 (05:29 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 9 Dec 2020 12:48:13 +0000 (23:48 +1100)
commitcbd7e6ca0210db05c315a27bb5db5a482f2772ce
tree8d68b9f525982d3aae57d40cca9b2f6a7977c5d6
parent3dc12dfe74300febc568c3b530c0f9bee01f2821
powerpc/fault: Avoid heavy search_exception_tables() verification

search_exception_tables() is an heavy operation, we have to avoid it.
When KUAP is selected, we'll know the fault has been blocked by KUAP.
When it is blocked by KUAP, check whether we are in an expected
userspace access place. If so, emit a warning to spot something is
going work. Otherwise, just remain silent, it will likely Oops soon.

When KUAP is not selected, it behaves just as if the address was
already in the TLBs and no fault was generated.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/9870f01e293a5a76c4f4e4ddd4a6b0f63038c591.1607491748.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/fault.c