From 577e6a7fd50d519c201d20968b6a027a6563dc4c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 15 Apr 2023 19:31:34 -0700 Subject: 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 --- tools/objtool/check.c | 1 - 1 file changed, 1 deletion(-) (limited to 'tools/objtool/check.c') 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 }; -- cgit v1.2.3