]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit8c3bd65f0870ba01292e4adc68438146ec8eedae
tree8d68b9f525982d3aae57d40cca9b2f6a7977c5d6
parent0fb172ae84cfb9a93563b55569f643160c8ce149
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