Skip to content

Commit 7694f51

Browse files
author
Christian Brauner
committed
sparc: unconditionally enable HAVE_COPY_THREAD_TLS
Now that both sparc and sparc64 support copy_thread_tls() and don't rely on do_fork() anymore, turn on HAVE_COPY_THREAD_TLS unconditionally. Once all architectures are switched over this macro will be removed and the old do_fork() calling convention fully abandoned in favor of the cleaner struct kernel_clone_args one. Signed-off-by: Christian Brauner <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Guo Ren <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent a4261d4 commit 7694f51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/sparc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ config SPARC
4848
select LOCKDEP_SMALL if LOCKDEP
4949
select NEED_DMA_MAP_STATE
5050
select NEED_SG_DMA_LENGTH
51+
select HAVE_COPY_THREAD_TLS
5152

5253
config SPARC32
5354
def_bool !64BIT
@@ -94,7 +95,6 @@ config SPARC64
9495
select ARCH_HAS_PTE_SPECIAL
9596
select PCI_DOMAINS if PCI
9697
select ARCH_HAS_GIGANTIC_PAGE
97-
select HAVE_COPY_THREAD_TLS
9898

9999
config ARCH_PROC_KCORE_TEXT
100100
def_bool y

arch/sparc/kernel/process_32.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,9 @@ clone_stackframe(struct sparc_stackf __user *dst,
273273
extern void ret_from_fork(void);
274274
extern void ret_from_kernel_thread(void);
275275

276-
int copy_thread(unsigned long clone_flags, unsigned long sp,
277-
unsigned long arg, struct task_struct *p)
276+
int copy_thread_tls(unsigned long clone_flags, unsigned long sp,
277+
unsigned long arg, struct task_struct *p,
278+
unsigned long tls)
278279
{
279280
struct thread_info *ti = task_thread_info(p);
280281
struct pt_regs *childregs, *regs = current_pt_regs();
@@ -376,7 +377,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
376377
regs->u_regs[UREG_I1] = 0;
377378

378379
if (clone_flags & CLONE_SETTLS)
379-
childregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
380+
childregs->u_regs[UREG_G7] = tls;
380381

381382
return 0;
382383
}

0 commit comments

Comments
 (0)