arch: remove HAVE_COPY_THREAD_TLS
All architectures support copy_thread_tls() now, so remove the legacy copy_thread() function and the HAVE_COPY_THREAD_TLS config option. Everyone uses the same process creation calling convention based on copy_thread_tls() and struct kernel_clone_args. This will make it easier to maintain the core process creation code under kernel/, simplifies the callpaths and makes the identical for all architectures. Cc: linux-arch@vger.kernel.org Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Greentime Hu <green.hu@gmail.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
8496da092a
commit
140c8180eb
|
@ -754,13 +754,6 @@ config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
|
|||
depends on MMU
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
|
||||
config HAVE_COPY_THREAD_TLS
|
||||
bool
|
||||
help
|
||||
Architecture provides copy_thread_tls to accept tls argument via
|
||||
normal C parameter passing, rather than extracting the syscall
|
||||
argument from pt_regs.
|
||||
|
||||
config HAVE_STACK_VALIDATION
|
||||
bool
|
||||
help
|
||||
|
|
|
@ -38,7 +38,6 @@ config ALPHA
|
|||
select OLD_SIGSUSPEND
|
||||
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
|
||||
select MMU_GATHER_NO_RANGE
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
help
|
||||
The Alpha is a 64-bit general-purpose processor designed and
|
||||
marketed by the Digital Equipment Corporation of blessed memory,
|
||||
|
|
|
@ -29,7 +29,6 @@ config ARC
|
|||
select GENERIC_SMP_IDLE_THREAD
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_STACKOVERFLOW
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
|
|
|
@ -72,7 +72,6 @@ config ARM
|
|||
select HAVE_ARM_SMCCC if CPU_V7
|
||||
select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
|
||||
select HAVE_DMA_CONTIGUOUS if MMU
|
||||
|
|
|
@ -148,7 +148,6 @@ config ARM64
|
|||
select HAVE_CMPXCHG_DOUBLE
|
||||
select HAVE_CMPXCHG_LOCAL
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
|
|
|
@ -22,7 +22,6 @@ config C6X
|
|||
select GENERIC_CLOCKEVENTS
|
||||
select MODULES_USE_ELF_RELA
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
config MMU
|
||||
def_bool n
|
||||
|
|
|
@ -38,7 +38,6 @@ config CSKY
|
|||
select GX6605S_TIMER if CPU_CK610
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_ARCH_AUDITSYSCALL
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_DYNAMIC_FTRACE
|
||||
select HAVE_DYNAMIC_FTRACE_WITH_REGS
|
||||
|
|
|
@ -26,7 +26,6 @@ config H8300
|
|||
select HAVE_ARCH_HASH
|
||||
select CPU_NO_EFFICIENT_FFS
|
||||
select UACCESS_MEMCPY
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
def_bool y
|
||||
|
|
|
@ -31,7 +31,6 @@ config HEXAGON
|
|||
select GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select MODULES_USE_ELF_RELA
|
||||
select GENERIC_CPU_DEVICES
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
help
|
||||
Qualcomm Hexagon is a processor architecture designed for high
|
||||
performance and low power across a wide variety of applications.
|
||||
|
|
|
@ -55,7 +55,6 @@ config IA64
|
|||
select HAVE_ARCH_AUDITSYSCALL
|
||||
select NEED_DMA_MAP_STATE
|
||||
select NEED_SG_DMA_LENGTH
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select NUMA if !FLATMEM
|
||||
default y
|
||||
help
|
||||
|
|
|
@ -14,7 +14,6 @@ config M68K
|
|||
select HAVE_AOUT if MMU
|
||||
select HAVE_ASM_MODVERSIONS
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_ATOMIC64
|
||||
select HAVE_UID16
|
||||
|
|
|
@ -46,7 +46,6 @@ config MICROBLAZE
|
|||
select CPU_NO_EFFICIENT_FFS
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select SPARSE_IRQ
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
# Endianness selection
|
||||
choice
|
||||
|
|
|
@ -51,7 +51,6 @@ config MIPS
|
|||
select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_TIF_NOHZ
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DEBUG_STACKOVERFLOW
|
||||
|
|
|
@ -48,7 +48,6 @@ config NDS32
|
|||
select HAVE_FUNCTION_GRAPH_TRACER
|
||||
select HAVE_FTRACE_MCOUNT_RECORD
|
||||
select HAVE_DYNAMIC_FTRACE
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
help
|
||||
Andes(nds32) Linux support.
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ config NIOS2
|
|||
select USB_ARCH_HAS_HCD if USB_SUPPORT
|
||||
select CPU_NO_EFFICIENT_FFS
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
config GENERIC_CSUM
|
||||
def_bool y
|
||||
|
|
|
@ -16,7 +16,6 @@ config OPENRISC
|
|||
select HANDLE_DOMAIN_IRQ
|
||||
select GPIOLIB
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select SPARSE_IRQ
|
||||
select GENERIC_IRQ_CHIP
|
||||
select GENERIC_IRQ_PROBE
|
||||
|
|
|
@ -62,7 +62,6 @@ config PARISC
|
|||
select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
|
||||
select HAVE_KPROBES_ON_FTRACE
|
||||
select HAVE_DYNAMIC_FTRACE_WITH_REGS
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
help
|
||||
The PA-RISC microprocessor is designed by Hewlett-Packard and used
|
||||
|
|
|
@ -186,7 +186,6 @@ config PPC
|
|||
select HAVE_STACKPROTECTOR if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
|
||||
select HAVE_CONTEXT_TRACKING if PPC64
|
||||
select HAVE_TIF_NOHZ if PPC64
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DEBUG_STACKOVERFLOW
|
||||
select HAVE_DYNAMIC_FTRACE
|
||||
|
|
|
@ -52,7 +52,6 @@ config RISCV
|
|||
select HAVE_ARCH_SECCOMP_FILTER
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_ASM_MODVERSIONS
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DMA_CONTIGUOUS if MMU
|
||||
select HAVE_EBPF_JIT if MMU
|
||||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
|
|
|
@ -136,7 +136,6 @@ config S390
|
|||
select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
|
||||
select HAVE_CMPXCHG_DOUBLE
|
||||
select HAVE_CMPXCHG_LOCAL
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
select HAVE_DYNAMIC_FTRACE
|
||||
|
|
|
@ -70,7 +70,6 @@ config SUPERH
|
|||
select ARCH_HIBERNATION_POSSIBLE if MMU
|
||||
select SPARSE_IRQ
|
||||
select HAVE_STACKPROTECTOR
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
help
|
||||
The SuperH is a RISC processor targeted for use in embedded systems
|
||||
and consumer electronics; it was also used in the Sega Dreamcast
|
||||
|
|
|
@ -48,7 +48,6 @@ config SPARC
|
|||
select LOCKDEP_SMALL if LOCKDEP
|
||||
select NEED_DMA_MAP_STATE
|
||||
select NEED_SG_DMA_LENGTH
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
|
||||
config SPARC32
|
||||
def_bool !64BIT
|
||||
|
|
|
@ -14,7 +14,6 @@ config UML
|
|||
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_CPU_DEVICES
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
|
|
@ -22,7 +22,6 @@ config UNICORE32
|
|||
select MODULES_USE_ELF_REL
|
||||
select NEED_DMA_MAP_STATE
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
help
|
||||
UniCore-32 is 32-bit Instruction Set Architecture,
|
||||
including a series of low-power-consumption RISC chip
|
||||
|
|
|
@ -161,7 +161,6 @@ config X86
|
|||
select HAVE_CMPXCHG_DOUBLE
|
||||
select HAVE_CMPXCHG_LOCAL
|
||||
select HAVE_CONTEXT_TRACKING if X86_64
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_C_RECORDMCOUNT
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
|
|
|
@ -24,7 +24,6 @@ config XTENSA
|
|||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||
select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_COPY_THREAD_TLS
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_CONTIGUOUS
|
||||
select HAVE_EXIT_THREAD
|
||||
|
|
|
@ -65,22 +65,9 @@ extern void fork_init(void);
|
|||
|
||||
extern void release_task(struct task_struct * p);
|
||||
|
||||
#ifdef CONFIG_HAVE_COPY_THREAD_TLS
|
||||
extern int copy_thread_tls(unsigned long, unsigned long, unsigned long,
|
||||
struct task_struct *, unsigned long);
|
||||
#else
|
||||
extern int copy_thread(unsigned long, unsigned long, unsigned long,
|
||||
struct task_struct *);
|
||||
|
||||
/* Architectures that haven't opted into copy_thread_tls get the tls argument
|
||||
* via pt_regs, so ignore the tls argument passed via C. */
|
||||
static inline int copy_thread_tls(
|
||||
unsigned long clone_flags, unsigned long sp, unsigned long arg,
|
||||
struct task_struct *p, unsigned long tls)
|
||||
{
|
||||
return copy_thread(clone_flags, sp, arg, p);
|
||||
}
|
||||
#endif
|
||||
extern void flush_thread(void);
|
||||
|
||||
#ifdef CONFIG_HAVE_EXIT_THREAD
|
||||
|
|
|
@ -2577,15 +2577,6 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
|
|||
|
||||
#ifdef __ARCH_WANT_SYS_CLONE3
|
||||
|
||||
/*
|
||||
* copy_thread implementations handle CLONE_SETTLS by reading the TLS value from
|
||||
* the registers containing the syscall arguments for clone. This doesn't work
|
||||
* with clone3 since the TLS value is passed in clone_args instead.
|
||||
*/
|
||||
#ifndef CONFIG_HAVE_COPY_THREAD_TLS
|
||||
#error clone3 requires copy_thread_tls support in arch
|
||||
#endif
|
||||
|
||||
noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
|
||||
struct clone_args __user *uargs,
|
||||
size_t usize)
|
||||
|
|
Loading…
Reference in New Issue