]> Gentwo Git Trees - linux/.git/commit
x86/asm: Introduce inline memcpy and memset
authorPeter Zijlstra (Intel) <peterz@infradead.org>
Tue, 18 Nov 2025 18:29:05 +0000 (10:29 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 18 Nov 2025 18:38:26 +0000 (10:38 -0800)
commitd9a96cc18bec65c39822ee0a1672d7dc3fda150a
tree4a4a15dc431ab6930817b81398a2e886f262d614
parente39c5387adebf2839aaf5779cdd09a3506963fc5
x86/asm: Introduce inline memcpy and memset

Provide inline memcpy and memset functions that can be used instead of
the GCC builtins when necessary. The immediate use case is for the text
poking functions to avoid the standard memcpy()/memset() calls because
objtool complains about such dynamic calls within an AC=1 region. See
tools/objtool/Documentation/objtool.txt, warning #9, regarding function
calls with UACCESS enabled.

Some user copy functions such as copy_user_generic() and __clear_user()
have similar rep_{movs,stos} usages. But, those are highly specialized
and hard to combine or reuse for other things. Define these new helpers
for all other usages that need a completely unoptimized, strictly inline
version of memcpy() or memset().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://patch.msgid.link/20251118182911.2983253-4-sohil.mehta%40intel.com
arch/x86/include/asm/string.h