diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-15 11:46:30 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-03-18 15:53:25 -0400 |
commit | 4b842e4e25b12951fa10dedb4bc16bc47e3b850c (patch) | |
tree | f8ef35539d2ff303275d19182770732d4e053d0e /arch/x86/include/asm/uaccess_32.h | |
parent | 71c3313a38aa09339a2442809e658fd233ab0757 (diff) | |
download | linux-stable-4b842e4e25b12951fa10dedb4bc16bc47e3b850c.tar.gz linux-stable-4b842e4e25b12951fa10dedb4bc16bc47e3b850c.tar.bz2 linux-stable-4b842e4e25b12951fa10dedb4bc16bc47e3b850c.zip |
x86: get rid of small constant size cases in raw_copy_{to,from}_user()
Very few call sites where that would be triggered remain, and none
of those is anywhere near hot enough to bother.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/include/asm/uaccess_32.h')
-rw-r--r-- | arch/x86/include/asm/uaccess_32.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h index ba2dc1930630..388a40660c7b 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h @@ -23,33 +23,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) static __always_inline unsigned long raw_copy_from_user(void *to, const void __user *from, unsigned long n) { - if (__builtin_constant_p(n)) { - unsigned long ret; - - switch (n) { - case 1: - ret = 0; - __uaccess_begin_nospec(); - __get_user_asm_nozero(*(u8 *)to, from, ret, - "b", "b", "=q", 1); - __uaccess_end(); - return ret; - case 2: - ret = 0; - __uaccess_begin_nospec(); - __get_user_asm_nozero(*(u16 *)to, from, ret, - "w", "w", "=r", 2); - __uaccess_end(); - return ret; - case 4: - ret = 0; - __uaccess_begin_nospec(); - __get_user_asm_nozero(*(u32 *)to, from, ret, - "l", "k", "=r", 4); - __uaccess_end(); - return ret; - } - } return __copy_user_ll(to, (__force const void *)from, n); } |