Loading arch/arm/Kconfig +16 −0 Original line number Diff line number Diff line Loading @@ -1091,6 +1091,22 @@ config ALIGNMENT_TRAP correct operation of some network protocols. With an IP-only configuration it is safe to say N, otherwise say Y. config UACCESS_WITH_MEMCPY bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)" depends on MMU && EXPERIMENTAL default y if CPU_FEROCEON help Implement faster copy_to_user and clear_user methods for CPU cores where a 8-word STM instruction give significantly higher memory write throughput than a sequence of individual 32bit stores. A possible side effect is a slight increase in scheduling latency between threads sharing the same address space if they invoke such copy operations with large buffers. However, if the CPU data cache is using a write-allocate mode, this option is unlikely to provide any performance gain. endmenu menu "Boot options" Loading arch/arm/include/asm/uaccess.h +2 −0 Original line number Diff line number Diff line Loading @@ -386,7 +386,9 @@ do { \ #ifdef CONFIG_MMU extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n); extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n); extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n); extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n); #else #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) Loading arch/arm/lib/Makefile +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ else endif endif # using lib_ here won't override already available weak symbols obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o lib-$(CONFIG_MMU) += $(mmu-y) ifeq ($(CONFIG_CPU_32v3),y) Loading arch/arm/lib/clear_user.S +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ * : sz - number of bytes to clear * Returns : number of bytes NOT cleared */ ENTRY(__clear_user) ENTRY(__clear_user_std) WEAK(__clear_user) stmfd sp!, {r1, lr} mov r2, #0 cmp r1, #4 Loading arch/arm/lib/copy_to_user.S +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ .text ENTRY(__copy_to_user) ENTRY(__copy_to_user_std) WEAK(__copy_to_user) #include "copy_template.S" Loading Loading
arch/arm/Kconfig +16 −0 Original line number Diff line number Diff line Loading @@ -1091,6 +1091,22 @@ config ALIGNMENT_TRAP correct operation of some network protocols. With an IP-only configuration it is safe to say N, otherwise say Y. config UACCESS_WITH_MEMCPY bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)" depends on MMU && EXPERIMENTAL default y if CPU_FEROCEON help Implement faster copy_to_user and clear_user methods for CPU cores where a 8-word STM instruction give significantly higher memory write throughput than a sequence of individual 32bit stores. A possible side effect is a slight increase in scheduling latency between threads sharing the same address space if they invoke such copy operations with large buffers. However, if the CPU data cache is using a write-allocate mode, this option is unlikely to provide any performance gain. endmenu menu "Boot options" Loading
arch/arm/include/asm/uaccess.h +2 −0 Original line number Diff line number Diff line Loading @@ -386,7 +386,9 @@ do { \ #ifdef CONFIG_MMU extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n); extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n); extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n); extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n); #else #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) Loading
arch/arm/lib/Makefile +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ else endif endif # using lib_ here won't override already available weak symbols obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o lib-$(CONFIG_MMU) += $(mmu-y) ifeq ($(CONFIG_CPU_32v3),y) Loading
arch/arm/lib/clear_user.S +2 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,8 @@ * : sz - number of bytes to clear * Returns : number of bytes NOT cleared */ ENTRY(__clear_user) ENTRY(__clear_user_std) WEAK(__clear_user) stmfd sp!, {r1, lr} mov r2, #0 cmp r1, #4 Loading
arch/arm/lib/copy_to_user.S +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ .text ENTRY(__copy_to_user) ENTRY(__copy_to_user_std) WEAK(__copy_to_user) #include "copy_template.S" Loading