[PATCH] ALSA: pcm: Convert multiple {get/put}_user to user_access_begin/user_access_end()

David Laight david.laight.linux at gmail.com
Wed Jun 11 05:53:58 AEST 2025


On Sat,  7 Jun 2025 13:37:42 +0200
Christophe Leroy <christophe.leroy at csgroup.eu> wrote:

> With user access protection (Called SMAP on x86 or KUAP on powerpc)
> each and every call to get_user() or put_user() performs heavy
> operations to unlock and lock kernel access to userspace.
> 
> To avoid that, perform user accesses by blocks using
> user_access_begin/user_access_end() and unsafe_get_user()/
> unsafe_put_user() and alike.

Did you consider using masked_user_access_begin() ?
It removes a conditional branch and lfence as well.

	David


More information about the Linuxppc-dev mailing list