x86: Make __get_user() generate an out-of-line call
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Apr 2020 19:50:01 +0000 (12:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 12 Oct 2020 23:57:57 +0000 (16:57 -0700)
commitea6f043fc9847e670b91dfbf1ef1cdff3451c152
treeb91a008b262a787388e8bd72a511a9602ff060f8
parent53acd350503d56a73aa6c61bced1699e8396c6d0
x86: Make __get_user() generate an out-of-line call

Instead of inlining the whole stac/lfence/mov/clac sequence (which also
requires individual exception table entries and several asm instruction
alternatives entries), just generate "call __get_user_nocheck_X" for the
__get_user() cases.

We can use all the same infrastructure that we already do for the
regular "get_user()", and the end result is simpler source code, and
much simpler code generation.

It also means that when I introduce asm goto with input for
"unsafe_get_user()", there are no nasty interactions with the
__get_user() code.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/uaccess.h
arch/x86/lib/getuser.S