git: 2b8b37c8f516 - main - thr_new: pass params.flags to cpu_set_user_tls()

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sat, 31 May 2025 14:55:57 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b8b37c8f516a5955f81a6fc35c7aac01ddf4a3a

commit 2b8b37c8f516a5955f81a6fc35c7aac01ddf4a3a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-05-30 11:24:12 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-05-31 14:55:24 +0000

    thr_new: pass params.flags to cpu_set_user_tls()
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/amd64/amd64/vm_machdep.c       | 2 +-
 sys/arm/arm/vm_machdep.c           | 2 +-
 sys/arm64/arm64/vm_machdep.c       | 2 +-
 sys/arm64/linux/linux_machdep.c    | 2 +-
 sys/i386/i386/vm_machdep.c         | 2 +-
 sys/kern/kern_thr.c                | 2 +-
 sys/powerpc/powerpc/exec_machdep.c | 2 +-
 sys/riscv/riscv/vm_machdep.c       | 2 +-
 sys/sys/proc.h                     | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 4001f40554af..275ab1a54e52 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -655,7 +655,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags)
 {
 	struct pcb *pcb;
 
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index d31d36ba807d..5f478b54cd66 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -228,7 +228,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags __unused)
 {
 
 	td->td_pcb->pcb_regs.sf_tpidrurw = (register_t)tls_base;
diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c
index 9869ce6cae0b..38a126ff602f 100644
--- a/sys/arm64/arm64/vm_machdep.c
+++ b/sys/arm64/arm64/vm_machdep.c
@@ -225,7 +225,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags __unused)
 {
 	struct pcb *pcb;
 
diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c
index 3bc2923b9d4d..9f370f04b5c5 100644
--- a/sys/arm64/linux/linux_machdep.c
+++ b/sys/arm64/linux/linux_machdep.c
@@ -64,7 +64,7 @@ linux_set_cloned_tls(struct thread *td, void *desc)
 	if ((uint64_t)desc >= VM_MAXUSER_ADDRESS)
 		return (EPERM);
 
-	return (cpu_set_user_tls(td, desc));
+	return (cpu_set_user_tls(td, desc, 0));
 }
 
 void
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index c64f19a30cbd..80b45070d896 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -501,7 +501,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags __unused)
 {
 	struct segment_descriptor sd;
 	uint32_t base;
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 0ab4cb5f7970..afd016ec9e75 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -169,7 +169,7 @@ thr_new_initthr(struct thread *td, void *thunk)
 	if (error != 0)
 		return (error);
 	/* Setup user TLS address and TLS pointer register. */
-	return (cpu_set_user_tls(td, param->tls_base));
+	return (cpu_set_user_tls(td, param->tls_base, param->flags));
 }
 
 int
diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c
index 3586c01d6652..1893d79f29a8 100644
--- a/sys/powerpc/powerpc/exec_machdep.c
+++ b/sys/powerpc/powerpc/exec_machdep.c
@@ -1091,7 +1091,7 @@ cpu_thread_free(struct thread *td)
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags __unused)
 {
 
 	if (SV_PROC_FLAG(td->td_proc, SV_LP64))
diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c
index cf9b85493e39..e5a5cf31af15 100644
--- a/sys/riscv/riscv/vm_machdep.c
+++ b/sys/riscv/riscv/vm_machdep.c
@@ -200,7 +200,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 }
 
 int
-cpu_set_user_tls(struct thread *td, void *tls_base)
+cpu_set_user_tls(struct thread *td, void *tls_base, int thr_flags __unused)
 {
 
 	if ((uintptr_t)tls_base >= VM_MAXUSER_ADDRESS)
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index eb0b66618a9d..fcacfec4442b 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1236,7 +1236,7 @@ int	cpu_procctl(struct thread *td, int idtype, id_t id, int com,
 void	cpu_set_syscall_retval(struct thread *, int);
 int	cpu_set_upcall(struct thread *, void (*)(void *), void *,
 	    stack_t *);
-int	cpu_set_user_tls(struct thread *, void *tls_base);
+int	cpu_set_user_tls(struct thread *, void *tls_base, int flags);
 void	cpu_thread_alloc(struct thread *);
 void	cpu_thread_clean(struct thread *);
 void	cpu_thread_exit(struct thread *);