From 7de0816f699553514016f52a76e26d1c2ae14034 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Tue, 14 Feb 2023 15:08:26 +0100 Subject: linux-user: Always exit from exclusive state in fork_end() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fork()ed processes currently start with current_cpu->in_exclusive_context set, which is, strictly speaking, not correct, but does not cause problems (even assertion failures). With one of the next patches, the code begins to rely on this value, so fix it by always calling end_exclusive() in fork_end(). Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230214140829.45392-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-user/syscall.c') diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1e868e9b0e..a6c426d73c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6752,6 +6752,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, cpu_clone_regs_parent(env, flags); fork_end(0); } + g_assert(!cpu_in_exclusive_context(cpu)); } return ret; } -- cgit 1.4.1