[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/29] {linux,bsd}-user: Update ts_tid after fork()
From: |
Alex Bennée |
Subject: |
[PULL 04/29] {linux,bsd}-user: Update ts_tid after fork() |
Date: |
Wed, 6 Mar 2024 14:40:16 +0000 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Currently ts_tid contains the parent tid after fork(), which is not
correct. So far it has not affected anything, but the upcoming
follow-fork-mode child support relies on the correct value, so fix it.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20240219141628.246823-4-iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240305121005.3528075-5-alex.bennee@linaro.org>
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 512d4ab69fc..e39eef3040f 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -134,6 +134,7 @@ void fork_end(int child)
* state, so we don't need to end_exclusive() here.
*/
qemu_init_cpu_list();
+ get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
mmap_fork_end(child);
diff --git a/linux-user/main.c b/linux-user/main.c
index 551acf16619..699da773714 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -161,6 +161,7 @@ void fork_end(int child)
}
}
qemu_init_cpu_list();
+ get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
cpu_list_unlock();
--
2.39.2
- [PULL for 9.0 00/29] maintainer updates (tests, gdbstub, plugins), Alex Bennée, 2024/03/06
- [PULL 05/29] gdbstub: Introduce gdbserver_fork_start(), Alex Bennée, 2024/03/06
- [PULL 02/29] gdbstub: Support disablement in a multi-threaded process, Alex Bennée, 2024/03/06
- [PULL 10/29] gdbstub: Introduce gdb_handle_set_thread_user(), Alex Bennée, 2024/03/06
- [PULL 04/29] {linux,bsd}-user: Update ts_tid after fork(),
Alex Bennée <=
- [PULL 06/29] {linux,bsd}-user: Pass pid to fork_end(), Alex Bennée, 2024/03/06
- [PULL 09/29] gdbstub: Introduce gdb_handle_query_supported_user(), Alex Bennée, 2024/03/06
- [PULL 08/29] gdbstub: Call gdbserver_fork() both in parent and in child, Alex Bennée, 2024/03/06
- [PULL 12/29] gdbstub: Implement follow-fork-mode child, Alex Bennée, 2024/03/06
- [PULL 11/29] gdbstub: Introduce gdb_handle_detach_user(), Alex Bennée, 2024/03/06
- [PULL 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork(), Alex Bennée, 2024/03/06
- [PULL 16/29] plugins: implement inline operation relative to cpu_index, Alex Bennée, 2024/03/06
- [PULL 03/29] {linux,bsd}-user: Introduce get_task_state(), Alex Bennée, 2024/03/06
- [PULL 01/29] tests: bump QOS_PATH_MAX_ELEMENT_SIZE again, Alex Bennée, 2024/03/06