mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 05:26:07 +00:00
xtensa: Implement copy_thread_tls
This is required for clone3 which passes the TLS value through a struct rather than a register. Signed-off-by: Amanieu d'Antras <amanieu@gmail.com> Cc: linux-xtensa@linux-xtensa.org Cc: <stable@vger.kernel.org> # 5.3.x Link: https://lore.kernel.org/r/20200102172413.654385-7-amanieu@gmail.com Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
20bda4ed62
commit
c346b94f8c
@ -24,6 +24,7 @@ config XTENSA
|
|||||||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||||
select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
|
select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
|
||||||
select HAVE_ARCH_TRACEHOOK
|
select HAVE_ARCH_TRACEHOOK
|
||||||
|
select HAVE_COPY_THREAD_TLS
|
||||||
select HAVE_DEBUG_KMEMLEAK
|
select HAVE_DEBUG_KMEMLEAK
|
||||||
select HAVE_DMA_CONTIGUOUS
|
select HAVE_DMA_CONTIGUOUS
|
||||||
select HAVE_EXIT_THREAD
|
select HAVE_EXIT_THREAD
|
||||||
|
@ -202,8 +202,9 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
|
|||||||
* involved. Much simpler to just not copy those live frames across.
|
* involved. Much simpler to just not copy those live frames across.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
|
int copy_thread_tls(unsigned long clone_flags, unsigned long usp_thread_fn,
|
||||||
unsigned long thread_fn_arg, struct task_struct *p)
|
unsigned long thread_fn_arg, struct task_struct *p,
|
||||||
|
unsigned long tls)
|
||||||
{
|
{
|
||||||
struct pt_regs *childregs = task_pt_regs(p);
|
struct pt_regs *childregs = task_pt_regs(p);
|
||||||
|
|
||||||
@ -266,9 +267,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
|
|||||||
|
|
||||||
childregs->syscall = regs->syscall;
|
childregs->syscall = regs->syscall;
|
||||||
|
|
||||||
/* The thread pointer is passed in the '4th argument' (= a5) */
|
|
||||||
if (clone_flags & CLONE_SETTLS)
|
if (clone_flags & CLONE_SETTLS)
|
||||||
childregs->threadptr = childregs->areg[5];
|
childregs->threadptr = tls;
|
||||||
} else {
|
} else {
|
||||||
p->thread.ra = MAKE_RA_FOR_CALL(
|
p->thread.ra = MAKE_RA_FOR_CALL(
|
||||||
(unsigned long)ret_from_kernel_thread, 1);
|
(unsigned long)ret_from_kernel_thread, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user