summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-16 14:26:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-16 14:26:37 -0400
commit27ebbf9d5bc0ab0a8ca875119e0ce4cd267fa2fc (patch)
tree321883ef69804066ccdc90e3ca1c63ca0f7bcd0c
parentd396360acdf7e57edcd9e2d080343b0353d65d63 (diff)
parent6edd1dbace0e8529ed167e8a5f9da63c0cc763cc (diff)
Merge tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull nommu generic uaccess updates from Arnd Bergmann: "asm-generic: kill <asm/segment.h> and improve nommu generic uaccess helpers Christoph Hellwig writes: This is a series doing two somewhat interwinded things. It improves the asm-generic nommu uaccess helper to optionally be entirely generic and not require any arch helpers for the actual uaccess. For the generic uaccess.h to actually be generically useful I also had to kill off the mess we made of <asm/segment.h>, which really shouldn't exist on most architectures" * tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: optimize generic uaccess for 8-byte loads and stores asm-generic: provide entirely generic nommu uaccess arch: mostly remove <asm/segment.h> asm-generic: don't include <asm/segment.h> from <asm/uaccess.h>
-rw-r--r--arch/alpha/include/asm/segment.h6
-rw-r--r--arch/alpha/kernel/smc37c669.c1
-rw-r--r--arch/alpha/kernel/smc37c93x.c1
-rw-r--r--arch/arc/include/asm/uaccess.h1
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm64/include/asm/Kbuild1
-rw-r--r--arch/c6x/include/asm/Kbuild1
-rw-r--r--arch/h8300/Kconfig1
-rw-r--r--arch/h8300/include/asm/Kbuild1
-rw-r--r--arch/h8300/include/asm/uaccess.h55
-rw-r--r--arch/hexagon/include/asm/Kbuild1
-rw-r--r--arch/hexagon/include/asm/uaccess.h1
-rw-r--r--arch/ia64/include/asm/segment.h6
-rw-r--r--arch/mips/include/asm/Kbuild1
-rw-r--r--arch/nds32/include/asm/Kbuild1
-rw-r--r--arch/nios2/include/asm/Kbuild1
-rw-r--r--arch/openrisc/include/asm/Kbuild1
-rw-r--r--arch/openrisc/kernel/ptrace.c1
-rw-r--r--arch/openrisc/kernel/setup.c1
-rw-r--r--arch/openrisc/kernel/traps.c1
-rw-r--r--arch/openrisc/mm/init.c1
-rw-r--r--arch/openrisc/mm/tlb.c1
-rw-r--r--arch/parisc/include/asm/Kbuild1
-rw-r--r--arch/s390/include/asm/segment.h5
-rw-r--r--arch/s390/kernel/ptrace.c1
-rw-r--r--arch/unicore32/include/asm/Kbuild1
-rw-r--r--arch/xtensa/include/asm/segment.h16
-rw-r--r--include/asm-generic/segment.h9
-rw-r--r--include/asm-generic/uaccess.h58
-rw-r--r--lib/Kconfig4
30 files changed, 64 insertions, 117 deletions
diff --git a/arch/alpha/include/asm/segment.h b/arch/alpha/include/asm/segment.h
deleted file mode 100644
index 0453d97daae7..000000000000
--- a/arch/alpha/include/asm/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ALPHA_SEGMENT_H
2#define __ALPHA_SEGMENT_H
3
4/* Only here because we have some old header files that expect it.. */
5
6#endif
diff --git a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c
index 4dbd4e415041..bbbd34586de0 100644
--- a/arch/alpha/kernel/smc37c669.c
+++ b/arch/alpha/kernel/smc37c669.c
@@ -10,7 +10,6 @@
10 10
11#include <asm/hwrpb.h> 11#include <asm/hwrpb.h>
12#include <asm/io.h> 12#include <asm/io.h>
13#include <asm/segment.h>
14 13
15#if 0 14#if 0
16# define DBG_DEVS(args) printk args 15# define DBG_DEVS(args) printk args
diff --git a/arch/alpha/kernel/smc37c93x.c b/arch/alpha/kernel/smc37c93x.c
index 733f08966fd2..71cd7aca38ce 100644
--- a/arch/alpha/kernel/smc37c93x.c
+++ b/arch/alpha/kernel/smc37c93x.c
@@ -11,7 +11,6 @@
11 11
12#include <asm/hwrpb.h> 12#include <asm/hwrpb.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/segment.h>
15 14
16#define SMC_DEBUG 0 15#define SMC_DEBUG 0
17 16
diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h
index eabc3efa6c6d..526418543379 100644
--- a/arch/arc/include/asm/uaccess.h
+++ b/arch/arc/include/asm/uaccess.h
@@ -742,6 +742,7 @@ extern long arc_strnlen_user_noinline(const char __user *src, long n);
742 742
743#endif 743#endif
744 744
745#include <asm/segment.h>
745#include <asm-generic/uaccess.h> 746#include <asm-generic/uaccess.h>
746 747
747#endif 748#endif
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 0b2ecc98e086..60de9d13181a 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -14,7 +14,6 @@ generic-y += msi.h
14generic-y += parport.h 14generic-y += parport.h
15generic-y += preempt.h 15generic-y += preempt.h
16generic-y += seccomp.h 16generic-y += seccomp.h
17generic-y += segment.h
18generic-y += serial.h 17generic-y += serial.h
19generic-y += simd.h 18generic-y += simd.h
20generic-y += trace_clock.h 19generic-y += trace_clock.h
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index 9e977dedf193..1de6e05ce48b 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -17,7 +17,6 @@ generic-y += mmiowb.h
17generic-y += msi.h 17generic-y += msi.h
18generic-y += qrwlock.h 18generic-y += qrwlock.h
19generic-y += qspinlock.h 19generic-y += qspinlock.h
20generic-y += segment.h
21generic-y += serial.h 20generic-y += serial.h
22generic-y += set_memory.h 21generic-y += set_memory.h
23generic-y += switch_to.h 22generic-y += switch_to.h
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
index 6b168d32fbff..2162eb32dcec 100644
--- a/arch/c6x/include/asm/Kbuild
+++ b/arch/c6x/include/asm/Kbuild
@@ -30,7 +30,6 @@ generic-y += pci.h
30generic-y += percpu.h 30generic-y += percpu.h
31generic-y += pgalloc.h 31generic-y += pgalloc.h
32generic-y += preempt.h 32generic-y += preempt.h
33generic-y += segment.h
34generic-y += serial.h 33generic-y += serial.h
35generic-y += shmparam.h 34generic-y += shmparam.h
36generic-y += tlbflush.h 35generic-y += tlbflush.h
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 61c01db6c292..ecfc4b4b6373 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -23,6 +23,7 @@ config H8300
23 select HAVE_ARCH_KGDB 23 select HAVE_ARCH_KGDB
24 select HAVE_ARCH_HASH 24 select HAVE_ARCH_HASH
25 select CPU_NO_EFFICIENT_FFS 25 select CPU_NO_EFFICIENT_FFS
26 select UACCESS_MEMCPY
26 27
27config CPU_BIG_ENDIAN 28config CPU_BIG_ENDIAN
28 def_bool y 29 def_bool y
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index f2e22058e488..79cd1e605ec4 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -47,6 +47,7 @@ generic-y += timex.h
47generic-y += tlbflush.h 47generic-y += tlbflush.h
48generic-y += topology.h 48generic-y += topology.h
49generic-y += trace_clock.h 49generic-y += trace_clock.h
50generic-y += uaccess.h
50generic-y += unaligned.h 51generic-y += unaligned.h
51generic-y += vga.h 52generic-y += vga.h
52generic-y += word-at-a-time.h 53generic-y += word-at-a-time.h
diff --git a/arch/h8300/include/asm/uaccess.h b/arch/h8300/include/asm/uaccess.h
deleted file mode 100644
index bc8031949d07..000000000000
--- a/arch/h8300/include/asm/uaccess.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_UACCESS_H
3#define _ASM_UACCESS_H
4
5#include <linux/string.h>
6
7static inline __must_check unsigned long
8raw_copy_from_user(void *to, const void __user * from, unsigned long n)
9{
10 if (__builtin_constant_p(n)) {
11 switch(n) {
12 case 1:
13 *(u8 *)to = *(u8 __force *)from;
14 return 0;
15 case 2:
16 *(u16 *)to = *(u16 __force *)from;
17 return 0;
18 case 4:
19 *(u32 *)to = *(u32 __force *)from;
20 return 0;
21 }
22 }
23
24 memcpy(to, (const void __force *)from, n);
25 return 0;
26}
27
28static inline __must_check unsigned long
29raw_copy_to_user(void __user *to, const void *from, unsigned long n)
30{
31 if (__builtin_constant_p(n)) {
32 switch(n) {
33 case 1:
34 *(u8 __force *)to = *(u8 *)from;
35 return 0;
36 case 2:
37 *(u16 __force *)to = *(u16 *)from;
38 return 0;
39 case 4:
40 *(u32 __force *)to = *(u32 *)from;
41 return 0;
42 default:
43 break;
44 }
45 }
46
47 memcpy((void __force *)to, from, n);
48 return 0;
49}
50#define INLINE_COPY_FROM_USER
51#define INLINE_COPY_TO_USER
52
53#include <asm-generic/uaccess.h>
54
55#endif
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 4a3d72f76ea2..84bb1ed1b931 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -29,7 +29,6 @@ generic-y += pci.h
29generic-y += percpu.h 29generic-y += percpu.h
30generic-y += preempt.h 30generic-y += preempt.h
31generic-y += sections.h 31generic-y += sections.h
32generic-y += segment.h
33generic-y += serial.h 32generic-y += serial.h
34generic-y += shmparam.h 33generic-y += shmparam.h
35generic-y += topology.h 34generic-y += topology.h
diff --git a/arch/hexagon/include/asm/uaccess.h b/arch/hexagon/include/asm/uaccess.h
index a30e58d5f351..7a34092e8b58 100644
--- a/arch/hexagon/include/asm/uaccess.h
+++ b/arch/hexagon/include/asm/uaccess.h
@@ -24,7 +24,6 @@
24 * User space memory access functions 24 * User space memory access functions
25 */ 25 */
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <asm/segment.h>
28#include <asm/sections.h> 27#include <asm/sections.h>
29 28
30/* 29/*
diff --git a/arch/ia64/include/asm/segment.h b/arch/ia64/include/asm/segment.h
deleted file mode 100644
index b89e2b3d648f..000000000000
--- a/arch/ia64/include/asm/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_IA64_SEGMENT_H
2#define _ASM_IA64_SEGMENT_H
3
4/* Only here because we have some old header files that expect it.. */
5
6#endif /* _ASM_IA64_SEGMENT_H */
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 87b86cdf126a..a03cd4e24f37 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -19,7 +19,6 @@ generic-y += preempt.h
19generic-y += qrwlock.h 19generic-y += qrwlock.h
20generic-y += qspinlock.h 20generic-y += qspinlock.h
21generic-y += sections.h 21generic-y += sections.h
22generic-y += segment.h
23generic-y += trace_clock.h 22generic-y += trace_clock.h
24generic-y += unaligned.h 23generic-y += unaligned.h
25generic-y += user.h 24generic-y += user.h
diff --git a/arch/nds32/include/asm/Kbuild b/arch/nds32/include/asm/Kbuild
index f67a327777b5..d8ce778d0640 100644
--- a/arch/nds32/include/asm/Kbuild
+++ b/arch/nds32/include/asm/Kbuild
@@ -37,7 +37,6 @@ generic-y += pci.h
37generic-y += percpu.h 37generic-y += percpu.h
38generic-y += preempt.h 38generic-y += preempt.h
39generic-y += sections.h 39generic-y += sections.h
40generic-y += segment.h
41generic-y += serial.h 40generic-y += serial.h
42generic-y += switch_to.h 41generic-y += switch_to.h
43generic-y += timex.h 42generic-y += timex.h
diff --git a/arch/nios2/include/asm/Kbuild b/arch/nios2/include/asm/Kbuild
index d7ef3512504a..a8ffdd007f6c 100644
--- a/arch/nios2/include/asm/Kbuild
+++ b/arch/nios2/include/asm/Kbuild
@@ -33,7 +33,6 @@ generic-y += pci.h
33generic-y += percpu.h 33generic-y += percpu.h
34generic-y += preempt.h 34generic-y += preempt.h
35generic-y += sections.h 35generic-y += sections.h
36generic-y += segment.h
37generic-y += serial.h 36generic-y += serial.h
38generic-y += spinlock.h 37generic-y += spinlock.h
39generic-y += topology.h 38generic-y += topology.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 1919cc5e0f11..164be10062bc 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -34,7 +34,6 @@ generic-y += qspinlock.h
34generic-y += qrwlock_types.h 34generic-y += qrwlock_types.h
35generic-y += qrwlock.h 35generic-y += qrwlock.h
36generic-y += sections.h 36generic-y += sections.h
37generic-y += segment.h
38generic-y += shmparam.h 37generic-y += shmparam.h
39generic-y += switch_to.h 38generic-y += switch_to.h
40generic-y += topology.h 39generic-y += topology.h
diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c
index eb97a8e7c8aa..e8fb2a764f46 100644
--- a/arch/openrisc/kernel/ptrace.c
+++ b/arch/openrisc/kernel/ptrace.c
@@ -30,7 +30,6 @@
30#include <linux/elf.h> 30#include <linux/elf.h>
31 31
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33#include <asm/segment.h>
34#include <asm/page.h> 33#include <asm/page.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36 35
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index c605bdad1746..17c00d06d91b 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -39,7 +39,6 @@
39#include <linux/device.h> 39#include <linux/device.h>
40 40
41#include <asm/sections.h> 41#include <asm/sections.h>
42#include <asm/segment.h>
43#include <asm/pgtable.h> 42#include <asm/pgtable.h>
44#include <asm/types.h> 43#include <asm/types.h>
45#include <asm/setup.h> 44#include <asm/setup.h>
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c
index d8981cbb852a..6ed7293ef007 100644
--- a/arch/openrisc/kernel/traps.c
+++ b/arch/openrisc/kernel/traps.c
@@ -35,7 +35,6 @@
35#include <linux/kallsyms.h> 35#include <linux/kallsyms.h>
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37 37
38#include <asm/segment.h>
39#include <asm/io.h> 38#include <asm/io.h>
40#include <asm/pgtable.h> 39#include <asm/pgtable.h>
41#include <asm/unwinder.h> 40#include <asm/unwinder.h>
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index abe87e54e231..e63cb4a91a3e 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -32,7 +32,6 @@
32#include <linux/blkdev.h> /* for initrd_* */ 32#include <linux/blkdev.h> /* for initrd_* */
33#include <linux/pagemap.h> 33#include <linux/pagemap.h>
34 34
35#include <asm/segment.h>
36#include <asm/pgalloc.h> 35#include <asm/pgalloc.h>
37#include <asm/pgtable.h> 36#include <asm/pgtable.h>
38#include <asm/dma.h> 37#include <asm/dma.h>
diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c
index 6c253a2e86bc..7f9f50161dfe 100644
--- a/arch/openrisc/mm/tlb.c
+++ b/arch/openrisc/mm/tlb.c
@@ -26,7 +26,6 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/init.h> 27#include <linux/init.h>
28 28
29#include <asm/segment.h>
30#include <asm/tlbflush.h> 29#include <asm/tlbflush.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index ed2d8cc94909..005ee8ad0446 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -19,7 +19,6 @@ generic-y += mmiowb.h
19generic-y += percpu.h 19generic-y += percpu.h
20generic-y += preempt.h 20generic-y += preempt.h
21generic-y += seccomp.h 21generic-y += seccomp.h
22generic-y += segment.h
23generic-y += trace_clock.h 22generic-y += trace_clock.h
24generic-y += user.h 23generic-y += user.h
25generic-y += vga.h 24generic-y += vga.h
diff --git a/arch/s390/include/asm/segment.h b/arch/s390/include/asm/segment.h
deleted file mode 100644
index 97a0582b8d0f..000000000000
--- a/arch/s390/include/asm/segment.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_SEGMENT_H
3#define _ASM_SEGMENT_H
4
5#endif
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index cd3df5514552..ad71132374f0 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -24,7 +24,6 @@
24#include <linux/seccomp.h> 24#include <linux/seccomp.h>
25#include <linux/compat.h> 25#include <linux/compat.h>
26#include <trace/syscall.h> 26#include <trace/syscall.h>
27#include <asm/segment.h>
28#include <asm/page.h> 27#include <asm/page.h>
29#include <asm/pgtable.h> 28#include <asm/pgtable.h>
30#include <asm/pgalloc.h> 29#include <asm/pgalloc.h>
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index c93dc6478cb2..5fe2426bb7a5 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -28,7 +28,6 @@ generic-y += parport.h
28generic-y += percpu.h 28generic-y += percpu.h
29generic-y += preempt.h 29generic-y += preempt.h
30generic-y += sections.h 30generic-y += sections.h
31generic-y += segment.h
32generic-y += serial.h 31generic-y += serial.h
33generic-y += shmparam.h 32generic-y += shmparam.h
34generic-y += syscalls.h 33generic-y += syscalls.h
diff --git a/arch/xtensa/include/asm/segment.h b/arch/xtensa/include/asm/segment.h
deleted file mode 100644
index 98964ad15ca2..000000000000
--- a/arch/xtensa/include/asm/segment.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * include/asm-xtensa/segment.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SEGMENT_H
12#define _XTENSA_SEGMENT_H
13
14#include <linux/uaccess.h>
15
16#endif /* _XTENSA_SEGEMENT_H */
diff --git a/include/asm-generic/segment.h b/include/asm-generic/segment.h
deleted file mode 100644
index 5580eace622c..000000000000
--- a/include/asm-generic/segment.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ASM_GENERIC_SEGMENT_H
2#define __ASM_GENERIC_SEGMENT_H
3/*
4 * Only here because we have some old header files that expect it...
5 *
6 * New architectures probably don't want to have their own version.
7 */
8
9#endif /* __ASM_GENERIC_SEGMENT_H */
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index b3d2241e03f8..e935318804f8 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -9,7 +9,63 @@
9 */ 9 */
10#include <linux/string.h> 10#include <linux/string.h>
11 11
12#include <asm/segment.h> 12#ifdef CONFIG_UACCESS_MEMCPY
13static inline __must_check unsigned long
14raw_copy_from_user(void *to, const void __user * from, unsigned long n)
15{
16 if (__builtin_constant_p(n)) {
17 switch(n) {
18 case 1:
19 *(u8 *)to = *(u8 __force *)from;
20 return 0;
21 case 2:
22 *(u16 *)to = *(u16 __force *)from;
23 return 0;
24 case 4:
25 *(u32 *)to = *(u32 __force *)from;
26 return 0;
27#ifdef CONFIG_64BIT
28 case 8:
29 *(u64 *)to = *(u64 __force *)from;
30 return 0;
31#endif
32 }
33 }
34
35 memcpy(to, (const void __force *)from, n);
36 return 0;
37}
38
39static inline __must_check unsigned long
40raw_copy_to_user(void __user *to, const void *from, unsigned long n)
41{
42 if (__builtin_constant_p(n)) {
43 switch(n) {
44 case 1:
45 *(u8 __force *)to = *(u8 *)from;
46 return 0;
47 case 2:
48 *(u16 __force *)to = *(u16 *)from;
49 return 0;
50 case 4:
51 *(u32 __force *)to = *(u32 *)from;
52 return 0;
53#ifdef CONFIG_64BIT
54 case 8:
55 *(u64 __force *)to = *(u64 *)from;
56 return 0;
57#endif
58 default:
59 break;
60 }
61 }
62
63 memcpy((void __force *)to, from, n);
64 return 0;
65}
66#define INLINE_COPY_FROM_USER
67#define INLINE_COPY_TO_USER
68#endif /* CONFIG_UACCESS_MEMCPY */
13 69
14#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) 70#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
15 71
diff --git a/lib/Kconfig b/lib/Kconfig
index 3577609b61be..8d9239a4156c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -601,6 +601,10 @@ config ARCH_NO_SG_CHAIN
601config ARCH_HAS_PMEM_API 601config ARCH_HAS_PMEM_API
602 bool 602 bool
603 603
604# use memcpy to implement user copies for nommu architectures
605config UACCESS_MEMCPY
606 bool
607
604config ARCH_HAS_UACCESS_FLUSHCACHE 608config ARCH_HAS_UACCESS_FLUSHCACHE
605 bool 609 bool
606 610