summaryrefslogtreecommitdiff
path: root/tools/objtool
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-04-16 18:23:06 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-04-18 17:05:28 -0700
commit427fda2c8a4977d9dbd9bc108bbe6e21ec84648d (patch)
tree4bad251e89bd015dcb0314251cafaff3183d3181 /tools/objtool
parent8c9b6a88b7e2f33c656cd667a081bfd4dc8f5005 (diff)
x86: improve on the non-rep 'copy_user' function
The old 'copy_user_generic_unrolled' function was oddly implemented for largely historical reasons: it had been largely based on the uncached copy case, which has some other concerns. For example, the __copy_user_nocache() function uses 'movnti' for the destination stores, and those want the destination to be aligned. In contrast, the regular copy function doesn't really care, and trying to align things only complicates matters. Also, like the clear_user function, the copy function had some odd handling of the repeat counts, complicating the exception handling for no really good reason. So as with clear_user, just write it to keep all the byte counts in the %rcx register, exactly like the 'rep movs' functionality that this replaces. Unlike a real 'rep movs', we do allow for this to trash a few temporary registers to not have to unnecessarily save/restore registers on the stack. And like the clearing case, rename this to what it now clearly is: 'rep_movs_alternative', and make it one coherent function, so that it shows up as such in profiles (instead of the odd split between "copy_user_generic_unrolled" and "copy_user_short_string", the latter of which was not about strings at all, and which was shared with the uncached case). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index ac96c9939cd1..50ed63f701f1 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1285,7 +1285,7 @@ static const char *uaccess_safe_builtin[] = {
"copy_mc_enhanced_fast_string",
"ftrace_likely_update", /* CONFIG_TRACE_BRANCH_PROFILING */
"rep_stos_alternative",
- "copy_user_generic_unrolled",
+ "rep_movs_alternative",
"__copy_user_nocache",
NULL
};