[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200102180241.ialbcdhaikqltkfm@wittgenstein>
Date: Thu, 2 Jan 2020 19:02:43 +0100
From: Christian Brauner <christian.brauner@...ntu.com>
To: Amanieu d'Antras <amanieu@...il.com>, will.deacon@....com
Cc: linux-kernel@...r.kernel.org,
Christian Brauner <christian@...uner.io>,
stable@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 3/7] arm: Implement copy_thread_tls
On Thu, Jan 02, 2020 at 06:24:09PM +0100, Amanieu d'Antras wrote:
> This is required for clone3 which passes the TLS value through a
> struct rather than a register.
>
> Signed-off-by: Amanieu d'Antras <amanieu@...il.com>
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: <stable@...r.kernel.org> # 5.3.x
Again, looks good to me but I'd like an ack from someone closer to the
architecture itself.
Acked-by: Christian Brauner <christian.brauner@...ntu.com>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/kernel/process.c | 6 +++---
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index ba75e3661a41..96dab76da3b3 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -72,6 +72,7 @@ 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
> select HAVE_DMA_CONTIGUOUS if MMU
> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> index cea1c27c29cb..46e478fb5ea2 100644
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -226,8 +226,8 @@ void release_thread(struct task_struct *dead_task)
> asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
>
> int
> -copy_thread(unsigned long clone_flags, unsigned long stack_start,
> - unsigned long stk_sz, struct task_struct *p)
> +copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
> + unsigned long stk_sz, struct task_struct *p, unsigned long tls)
> {
> struct thread_info *thread = task_thread_info(p);
> struct pt_regs *childregs = task_pt_regs(p);
> @@ -261,7 +261,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
> clear_ptrace_hw_breakpoint(p);
>
> if (clone_flags & CLONE_SETTLS)
> - thread->tp_value[0] = childregs->ARM_r3;
> + thread->tp_value[0] = tls;
> thread->tp_value[1] = get_tpuser();
>
> thread_notify(THREAD_NOTIFY_COPY, thread);
> --
> 2.24.1
>
Powered by blists - more mailing lists