]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/signal64: Replace setup_sigcontext() w/ unsafe_setup_sigcontext()
authorChristopher M. Riedl <cmr@codefail.de>
Sat, 27 Feb 2021 01:12:55 +0000 (19:12 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 Mar 2021 01:49:47 +0000 (12:49 +1100)
commite4e150baa10ab55c181b82060535e67c005245a1
treeb1f248e8daa0aa35ea73d7bf674c2a22723ae0b6
parentf893f2b6e88cd7a1ca3e4504b88785b3af36bce1
powerpc/signal64: Replace setup_sigcontext() w/ unsafe_setup_sigcontext()

Previously setup_sigcontext() performed a costly KUAP switch on every
uaccess operation. These repeated uaccess switches cause a significant
drop in signal handling performance.

Rewrite setup_sigcontext() to assume that a userspace write access window
is open by replacing all uaccess functions with their 'unsafe' versions.
Modify the callers to first open, call unsafe_setup_sigcontext() and
then close the uaccess window.

Signed-off-by: Christopher M. Riedl <cmr@codefail.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210227011259.11992-7-cmr@codefail.de
arch/powerpc/kernel/signal_64.c