linux/arch/x86/lib
Linus Torvalds fdcbb1bc06 Merge branch 'nocache-cleanup'
This series cleans up some of the special user copy functions naming and
semantics.  In particular, get rid of the (very traditional) double
underscore names and behavior: the whole "optimize away the range check"
model has been largely excised from the other user accessors because
it's so subtle and can be unsafe, but also because it's just not a
relevant optimization any more.

To do that, a couple of drivers that misused the "user" copies as kernel
copies in order to get non-temporal stores had to be fixed up, but that
kind of code should never have been allowed anyway.

The x86-only "nocache" version was also renamed to more accurately
reflect what it actually does.

This was all done because I looked at this code due to a report by Jann
Horn, and I just couldn't stand the inconsistent naming, the horrible
semantics, and the random misuse of these functions.  This code should
probably be cleaned up further, but it's at least slightly closer to
normal semantics.

I had a more intrusive series that went even further in trying to
normalize the semantics, but that ended up hitting so many other
inconsistencies between different architectures in this area (eg
'size_t' vs 'unsigned long' vs 'int' as size arguments, and various
iovec check differences that Vasily Gorbik pointed out) that I ended up
with this more limited version that fixed the worst of the issues.

Reported-by: Jann Horn <jannh@google.com>
Tested-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/all/CAHk-=wgg1QVWNWG-UCFo1hx0zqrPnB3qhPzUTrWNft+MtXQXig@mail.gmail.com/

* nocache-cleanup:
  x86-64/arm64/powerpc: clean up and rename __copy_from_user_flushcache
  x86: rename and clean up __copy_from_user_inatomic_nocache()
  x86-64: rename misleadingly named '__copy_user_nocache()' function
2026-04-13 08:39:51 -07:00
..
.gitignore lib/crypto: x86: Move arch/x86/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
atomic64_32.c
atomic64_386_32.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
atomic64_cx8_32.S locking/atomic/x86: Introduce the read64_nonatomic macro to x86_32 with cx8 2024-07-17 16:28:11 +02:00
bhi.S x86,ibt: Use UDB instead of 0xEA 2025-09-04 21:59:09 +02:00
cache-smp.c x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
checksum_32.S x86/headers: Replace #include <asm/export.h> with #include <linux/export.h> 2023-10-03 10:38:07 +02:00
clear_page_64.S x86/mm: simplify clear_page_* 2026-01-20 19:24:40 -08:00
cmdline.c x86/setup: Parse the builtin command line before merging 2024-07-31 21:46:35 +02:00
cmpxchg8b_emu.S x86/cpufeatures: Rename X86_CMPXCHG64 to X86_CX8 2025-02-28 11:42:34 +01:00
cmpxchg16b_emu.S x86/percpu: Introduce %rip-relative addressing to PER_CPU_VAR() 2023-10-20 12:19:51 +02:00
copy_mc_64.S x86/copy_mc_64: Remove .fixup usage 2021-12-11 09:09:46 +01:00
copy_mc.c x86: call instrumentation hooks from copy_mc.c 2024-04-25 21:07:02 -07:00
copy_page_64.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
copy_user_64.S x86/uaccess: Improve performance by aligning writes to 8 bytes in copy_user_generic(), on non-FSRM/ERMS CPUs 2025-03-28 22:57:44 +01:00
copy_user_uncached_64.S x86-64: rename misleadingly named '__copy_user_nocache()' function 2026-03-30 15:05:56 -07:00
cpu.c
csum-copy_64.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
csum-partial_64.c x86/csum: clean up `csum_partial' further 2024-01-04 15:42:30 -08:00
csum-wrappers_64.c x86/lib: Inline csum_ipv6_magic() 2026-01-05 10:14:05 -08:00
delay.c x86/asm: Rename rep_nop() to native_pause() 2025-04-18 10:19:26 +02:00
error-inject.c objtool: Remove newlines and tabs from annotation macros 2025-12-03 19:42:37 +01:00
getuser.S x86/runtime-const: Add the RUNTIME_CONST_PTR assembly macro 2025-03-19 11:26:24 +01:00
hweight.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
inat.c x86/insn: Add XOP prefix instructions decoder support 2025-08-18 17:15:02 +02:00
insn-eval.c x86/insn: Simplify for_each_insn_prefix() 2025-10-16 11:13:48 +02:00
insn.c x86/insn: Add XOP prefix instructions decoder support 2025-08-18 17:15:02 +02:00
iomem.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
kaslr.c x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled() 2025-11-11 16:42:31 +01:00
Makefile Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
memcpy_32.c x86/mem: Move memmove to out of line assembler 2022-11-01 15:44:07 -07:00
memcpy_64.S x86/boot: Add a bunch of PIC aliases 2025-05-04 15:59:43 +02:00
memmove_32.S x86/headers: Replace #include <asm/export.h> with #include <linux/export.h> 2023-10-03 10:38:07 +02:00
memmove_64.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
memset_64.S x86/boot: Add a bunch of PIC aliases 2025-05-04 15:59:43 +02:00
misc.c x86/lib: Fix overflow when counting digits 2023-11-17 06:26:14 -08:00
msr-reg-export.c
msr-reg.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
msr-smp.c x86/msr: Rename 'wrmsrl_on_cpu()' to 'wrmsrq_on_cpu()' 2025-04-10 11:59:05 +02:00
msr.c x86: Restrict KVM-induced symbol exports to KVM modules where obvious/possible 2025-11-12 15:29:38 -08:00
pc-conf-reg.c x86: Add support for 0x22/0x23 port I/O configuration space 2021-08-10 23:31:43 +02:00
putuser.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
retpoline.S - Remove a bunch of asm implementing condition flags testing in KVM's 2025-10-11 11:19:16 -07:00
string_32.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
strstr_32.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
usercopy_32.c x86: rename and clean up __copy_from_user_inatomic_nocache() 2026-03-30 15:05:57 -07:00
usercopy_64.c x86-64/arm64/powerpc: clean up and rename __copy_from_user_flushcache 2026-03-30 15:05:57 -07:00
usercopy.c x86/uaccess: instrument copy_from_user_nmi() 2022-11-08 15:57:24 -08:00
x86-opcode-map.txt x86/insn: Add XOP prefix instructions decoder support 2025-08-18 17:15:02 +02:00