diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-15 19:31:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-18 17:05:28 -0700 |
commit | 577e6a7fd50d519c201d20968b6a027a6563dc4c (patch) | |
tree | ad8e4f8a75f78b627bf7ce28aabff48cac32bb54 /tools | |
parent | 3639a535587d7aac449cdce9710dfdc97a3c8c8e (diff) |
x86: inline the 'rep movs' in user copies for the FSRM case
This does the same thing for the user copies as commit 0db7058e8e23
("x86/clear_user: Make it faster") did for clear_user(). In other
words, it inlines the "rep movs" case when X86_FEATURE_FSRM is set,
avoiding the function call entirely.
In order to do that, it makes the calling convention for the out-of-line
case ("copy_user_generic_unrolled") match the 'rep movs' calling
convention, although it does also end up clobbering a number of
additional registers.
Also, to simplify code sharing in the low-level assembly with the
__copy_user_nocache() function (that uses the normal C calling
convention), we end up with a kind of mixed return value for the
low-level asm code: it will return the result in both %rcx (to work as
an alternative for the 'rep movs' case), _and_ in %rax (for the nocache
case).
We could avoid this by wrapping __copy_user_nocache() callers in an
inline asm, but since the cost is just an extra register copy, it's
probably not worth it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/check.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index ea62a4e03f1e..44817bbe48fe 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1286,7 +1286,6 @@ static const char *uaccess_safe_builtin[] = { "ftrace_likely_update", /* CONFIG_TRACE_BRANCH_PROFILING */ "clear_user_original", "copy_user_generic_unrolled", - "copy_user_fast_string", "__copy_user_nocache", NULL }; |