alpha: Use new generic strncpy_from_user() and strnlen_user()
Similar to x86/sparc/powerpc implementations except: 1) we implement an extremely efficient has_zero()/find_zero() sequence with both prep_zero_mask() and create_zero_mask() no-operations. 2) Our output from prep_zero_mask() differs in that only the lowest eight bits are used to represent the zero bytes nevertheless it can be safely ORed with other similar masks from prep_zero_mask() and forms input to create_zero_mask(), the two fundamental properties prep_zero_mask() must satisfy. Tests on EV67 and EV68 CPUs revealed that the generic code is essentially as fast (to within 0.5% of CPU cycles) of the old Alpha specific code for large quadword-aligned strings, despite the 30% extra CPU instructions executed. In contrast, the generic code for unaligned strings is substantially slower (by more than a factor of 3) than the old Alpha specific code. Signed-off-by:Michael Cree <mcree@orcon.net.nz> Acked-by:
Matt Turner <mattst88@gmail.com> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
Showing
- arch/alpha/Kconfig 2 additions, 0 deletionsarch/alpha/Kconfig
- arch/alpha/include/asm/uaccess.h 5 additions, 29 deletionsarch/alpha/include/asm/uaccess.h
- arch/alpha/include/asm/word-at-a-time.h 55 additions, 0 deletionsarch/alpha/include/asm/word-at-a-time.h
- arch/alpha/kernel/alpha_ksyms.c 0 additions, 2 deletionsarch/alpha/kernel/alpha_ksyms.c
- arch/alpha/lib/Makefile 0 additions, 2 deletionsarch/alpha/lib/Makefile
- arch/alpha/lib/ev6-strncpy_from_user.S 0 additions, 424 deletionsarch/alpha/lib/ev6-strncpy_from_user.S
- arch/alpha/lib/ev67-strlen_user.S 0 additions, 107 deletionsarch/alpha/lib/ev67-strlen_user.S
- arch/alpha/lib/strlen_user.S 0 additions, 91 deletionsarch/alpha/lib/strlen_user.S
- arch/alpha/lib/strncpy_from_user.S 0 additions, 339 deletionsarch/alpha/lib/strncpy_from_user.S
Loading
Please register or sign in to comment