Skip to content

Commit a7a08b2

Browse files
arndbtorvalds
authored andcommitted
arch: remove compat_alloc_user_space
All users of compat_alloc_user_space() and copy_in_user() have been removed from the kernel, only a few functions in sparc remain that can be changed to calling arch_copy_in_user() instead. Link: https://lkml.kernel.org/r/20210727144859.4150043-7-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Feng Tang <feng.tang@intel.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Helge Deller <deller@gmx.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 59ab844 commit a7a08b2

File tree

24 files changed

+12
-333
lines changed

24 files changed

+12
-333
lines changed

arch/arm64/include/asm/compat.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ struct compat_statfs {
107107
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
108108
#define COMPAT_MINSIGSTKSZ 2048
109109

110-
static inline void __user *arch_compat_alloc_user_space(long len)
111-
{
112-
return (void __user *)compat_user_stack_pointer() - len;
113-
}
114-
115110
struct compat_ipc64_perm {
116111
compat_key_t key;
117112
__compat_uid32_t uid;

arch/arm64/include/asm/uaccess.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -430,17 +430,6 @@ extern unsigned long __must_check __arch_copy_to_user(void __user *to, const voi
430430
__actu_ret; \
431431
})
432432

433-
extern unsigned long __must_check __arch_copy_in_user(void __user *to, const void __user *from, unsigned long n);
434-
#define raw_copy_in_user(to, from, n) \
435-
({ \
436-
unsigned long __aciu_ret; \
437-
uaccess_ttbr0_enable(); \
438-
__aciu_ret = __arch_copy_in_user(__uaccess_mask_ptr(to), \
439-
__uaccess_mask_ptr(from), (n)); \
440-
uaccess_ttbr0_disable(); \
441-
__aciu_ret; \
442-
})
443-
444433
#define INLINE_COPY_TO_USER
445434
#define INLINE_COPY_FROM_USER
446435

arch/arm64/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
lib-y := clear_user.o delay.o copy_from_user.o \
3-
copy_to_user.o copy_in_user.o copy_page.o \
3+
copy_to_user.o copy_page.o \
44
clear_page.o csum.o insn.o memchr.o memcpy.o \
55
memset.o memcmp.o strcmp.o strncmp.o strlen.o \
66
strnlen.o strchr.o strrchr.o tishift.o

arch/arm64/lib/copy_in_user.S

Lines changed: 0 additions & 77 deletions
This file was deleted.

arch/mips/cavium-octeon/octeon-memcpy.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ FEXPORT(__raw_copy_from_user)
154154
EXPORT_SYMBOL(__raw_copy_from_user)
155155
FEXPORT(__raw_copy_to_user)
156156
EXPORT_SYMBOL(__raw_copy_to_user)
157-
FEXPORT(__raw_copy_in_user)
158-
EXPORT_SYMBOL(__raw_copy_in_user)
159157
/*
160158
* Note: dst & src may be unaligned, len may be 0
161159
* Temps

arch/mips/include/asm/compat.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ struct compat_statfs {
9696

9797
#define COMPAT_OFF_T_MAX 0x7fffffff
9898

99-
static inline void __user *arch_compat_alloc_user_space(long len)
100-
{
101-
struct pt_regs *regs = (struct pt_regs *)
102-
((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
103-
104-
return (void __user *) (regs->regs[29] - len);
105-
}
106-
10799
struct compat_ipc64_perm {
108100
compat_key_t key;
109101
__compat_uid32_t uid;

arch/mips/include/asm/uaccess.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ do { \
428428

429429
extern size_t __raw_copy_from_user(void *__to, const void *__from, size_t __n);
430430
extern size_t __raw_copy_to_user(void *__to, const void *__from, size_t __n);
431-
extern size_t __raw_copy_in_user(void *__to, const void *__from, size_t __n);
432431

433432
static inline unsigned long
434433
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
@@ -480,31 +479,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
480479
#define INLINE_COPY_FROM_USER
481480
#define INLINE_COPY_TO_USER
482481

483-
static inline unsigned long
484-
raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
485-
{
486-
register void __user *__cu_to_r __asm__("$4");
487-
register const void __user *__cu_from_r __asm__("$5");
488-
register long __cu_len_r __asm__("$6");
489-
490-
__cu_to_r = to;
491-
__cu_from_r = from;
492-
__cu_len_r = n;
493-
494-
__asm__ __volatile__(
495-
".set\tnoreorder\n\t"
496-
__MODULE_JAL(__raw_copy_in_user)
497-
".set\tnoat\n\t"
498-
__UA_ADDU "\t$1, %1, %2\n\t"
499-
".set\tat\n\t"
500-
".set\treorder"
501-
: "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r)
502-
:
503-
: "$8", "$9", "$10", "$11", "$12", "$14", "$15", "$24", "$31",
504-
DADDI_SCRATCH, "memory");
505-
return __cu_len_r;
506-
}
507-
508482
extern __kernel_size_t __bzero(void __user *addr, __kernel_size_t size);
509483

510484
/*

arch/mips/lib/memcpy.S

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,6 @@ FEXPORT(__raw_copy_from_user)
666666
EXPORT_SYMBOL(__raw_copy_from_user)
667667
FEXPORT(__raw_copy_to_user)
668668
EXPORT_SYMBOL(__raw_copy_to_user)
669-
FEXPORT(__raw_copy_in_user)
670-
EXPORT_SYMBOL(__raw_copy_in_user)
671669
#endif
672670
/* Legacy Mode, user <-> user */
673671
__BUILD_COPY_USER LEGACY_MODE USEROP USEROP
@@ -703,13 +701,4 @@ EXPORT_SYMBOL(__raw_copy_to_user)
703701
__BUILD_COPY_USER EVA_MODE KERNELOP USEROP
704702
END(__raw_copy_to_user)
705703

706-
/*
707-
* __copy_in_user (EVA)
708-
*/
709-
710-
LEAF(__raw_copy_in_user)
711-
EXPORT_SYMBOL(__raw_copy_in_user)
712-
__BUILD_COPY_USER EVA_MODE USEROP USEROP
713-
END(__raw_copy_in_user)
714-
715704
#endif

arch/parisc/include/asm/compat.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ struct compat_shmid64_ds {
163163
#define COMPAT_ELF_NGREG 80
164164
typedef compat_ulong_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
165165

166-
static __inline__ void __user *arch_compat_alloc_user_space(long len)
167-
{
168-
struct pt_regs *regs = &current->thread.regs;
169-
return (void __user *)regs->gr[30];
170-
}
171-
172166
static inline int __is_compat_task(struct task_struct *t)
173167
{
174168
return test_tsk_thread_flag(t, TIF_32BIT);

arch/parisc/include/asm/uaccess.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ unsigned long __must_check raw_copy_to_user(void __user *dst, const void *src,
215215
unsigned long len);
216216
unsigned long __must_check raw_copy_from_user(void *dst, const void __user *src,
217217
unsigned long len);
218-
unsigned long __must_check raw_copy_in_user(void __user *dst, const void __user *src,
219-
unsigned long len);
220218
#define INLINE_COPY_TO_USER
221219
#define INLINE_COPY_FROM_USER
222220

0 commit comments

Comments
 (0)