Skip to content

Commit d2f36c7

Browse files
AmanieuChristian Brauner
authored andcommitted
parisc: 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 <[email protected]> Cc: [email protected] Cc: <[email protected]> # 5.3.x Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 167ee0b commit d2f36c7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/parisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ config PARISC
6262
select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
6363
select HAVE_KPROBES_ON_FTRACE
6464
select HAVE_DYNAMIC_FTRACE_WITH_REGS
65+
select HAVE_COPY_THREAD_TLS
6566

6667
help
6768
The PA-RISC microprocessor is designed by Hewlett-Packard and used

arch/parisc/kernel/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ arch_initcall(parisc_idle_init);
208208
* Copy architecture-specific thread state
209209
*/
210210
int
211-
copy_thread(unsigned long clone_flags, unsigned long usp,
212-
unsigned long kthread_arg, struct task_struct *p)
211+
copy_thread_tls(unsigned long clone_flags, unsigned long usp,
212+
unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
213213
{
214214
struct pt_regs *cregs = &(p->thread.regs);
215215
void *stack = task_stack_page(p);
@@ -254,9 +254,9 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
254254
cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE;
255255
cregs->kpc = (unsigned long) &child_return;
256256

257-
/* Setup thread TLS area from the 4th parameter in clone */
257+
/* Setup thread TLS area */
258258
if (clone_flags & CLONE_SETTLS)
259-
cregs->cr27 = cregs->gr[23];
259+
cregs->cr27 = tls;
260260
}
261261

262262
return 0;

0 commit comments

Comments
 (0)