From patchwork Tue Mar 5 12:09:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777981 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp396951wrs; Tue, 5 Mar 2024 04:11:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrootzcGJdPqSwB/jXssvlK5cXkxcGEum14UBwG1bWzcYMi4g2jeZNHXxJAq235pwa9MbwtR2/i3mh2luwLqFp X-Google-Smtp-Source: AGHT+IHyWoDIERWFOe7Y0kMpRD2H7w2m0huPsQtlopNLXYtIqWZzHSxqLJBfKQjqnPl8TJHy7otk X-Received: by 2002:a05:6359:4c0e:b0:17b:b81c:f81b with SMTP id kj14-20020a0563594c0e00b0017bb81cf81bmr1871575rwc.12.1709640693746; Tue, 05 Mar 2024 04:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709640693; cv=none; d=google.com; s=arc-20160816; b=Fsp7fVdjVMSgROZhd1tYcVBQoaET+GpSHYd/cuNcSEEdoTJP1Sjt2bdR3XW57SXyUH 0nJucDsvbL3u1WC0Mmrw3o2iGMsy1d1gHpHwlB8xPEuEVfEjluWi+LxGDfBMfUVCbnzV 2cIYXqn9NciDaKyUTf+ueNwF02ZtAkems7HvRjx8rt5yQyQv3KHrYxC/X+qVhINGxJ3E DLhCLRhhO1KidUEU62064OI5dhHeIjffv3xPTSVFa+3xFCJ4yCxlJJ3bl2PqsFsJ+2LM hjIyA8AZHgxzlKPMW7tLPVomIjr0g0qoxio3ylC29JcyZhRV7YRnti8AVVV92IgeP5c1 jJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9H0BMxEgsfnIN4tKkXQ7XYD/lXb/KI0pXeZKCUMOmAM=; fh=f6avZL29XgA8xpJjruaeiY/t2FUw83MgiNvVXs1rDYg=; b=pq6nIbRX7R81YazOc2ODmyyhfEpFgvxI10XrURlqwkqiSu8y5ZBqVkbYjcWhhpJ+ki dlydC0KxqgzI7ZRaPQWV7s2jtRizfNyhb5iUu7Wm0M2y1JfoBO00p+LLEeDu04kTXqxA NmCtRkY8KmsV/SVs7B2g8WKNc/zA3Tx0Ifp6weE5/ImFVCno9NIPhKuHLrpjn4Z9aRk4 LX7imGi3o+OjN2BeoOBNnG7VkguFBmjQf7gbup6ysNDUL8krPdkoVAHRFsjr2fLqhFPV PNQsD48NR7LmqVfxZoYek0EIHTvBjcKwGw10FTUu37ZIlYAkPKq/KqYeyLAWQyBeenY3 OHeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D9I5h71K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id op8-20020a056214458800b0068c3d2d61f1si12021945qvb.120.2024.03.05.04.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2024 04:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D9I5h71K; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhTch-0001We-SH; Tue, 05 Mar 2024 07:10:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhTcb-0001TB-O1 for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:10:14 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhTcZ-0001CH-10 for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:10:13 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-412e92deb18so9313395e9.1 for ; Tue, 05 Mar 2024 04:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709640609; x=1710245409; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9H0BMxEgsfnIN4tKkXQ7XYD/lXb/KI0pXeZKCUMOmAM=; b=D9I5h71KchVGxSNvPNAFdg4kSMww74Nr7tIyWcbu/hxQZRTWSpaWLZlw2c5ZRowuqm q3SjJOeG0MhNH8zdBTtPrsWWCB5uJBPS6WHJqusVvDghR8In+GiIj8v6R7WsLuhBGOQ1 iRqUP4gukkT7UzG2t5kydDdEudD2cSVwH0ocBbgzAVITv3ZOiAUHrz98PV5zfbm2IAwJ ybgOWDS3UY7AYcwXtBKedcqF/KWoAYG7UZDHjr1qv0j5gFc8JtlvUk+Eajixj4Q2pdPz YDGW4UyUlJVQ3WZ5xZpJ4UzJZAjjoEVqhqUvKhO+mT/i2S5TnIx8MAxDbPsO/ZHH9g6L HX8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709640609; x=1710245409; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9H0BMxEgsfnIN4tKkXQ7XYD/lXb/KI0pXeZKCUMOmAM=; b=HwtZQHY4srJ2j+I9L06QOHjLlsGaDrPzlAwArCPIv0jxZTHduEkbjswiwxVdQqRGZS us7VS2ICq5HxnpeHyHtNB6HmCENeXrxUa9y7hdwJE+qCm+FidjV7e+3vhytyprbn1Ogy /uNhJ7LQcZfZvWx30mHikiGnnP629M6YrIS/hI3LHQuTeTiBJQ3EVZI34rrd+l/vy3Qr RpoXCeqT45mXiqSC3aUg85Sp+Q1RMlWfnI7CzqYzw7FM7q/FLcAiy65DQcsWsWkeGflU wjaY9MfKhMX9hJJihLzbjDlNAh7OAWRv3HhiMTDCvDKl6WS3nOv5sbRoLwW+YbaPt1ik e6mA== X-Gm-Message-State: AOJu0Yw6XbeA+6DwP6JcdHClFlzfmgrZ1q/MNe6d7ER6i6tff/fuN+EP lqnKmlgJ1030K04y4DCbrDXpk3vo+CFVgsbcGhZoTNLqT08lcm0La8y6xyh1sss= X-Received: by 2002:a5d:674b:0:b0:33d:82a9:206e with SMTP id l11-20020a5d674b000000b0033d82a9206emr8033114wrw.28.1709640608641; Tue, 05 Mar 2024 04:10:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h3-20020adfa4c3000000b0033dd2a7167fsm14970270wrb.29.2024.03.05.04.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:10:08 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DC55A5F954; Tue, 5 Mar 2024 12:10:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Alistair Francis , Nicholas Piggin , Liu Zhiwei , Richard Henderson , Yanan Wang , qemu-s390x@nongnu.org, "Edgar E. Iglesias" , Eduardo Habkost , Daniel Henrique Barboza , Michael Rolnik , Daniel Henrique Barboza , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Yoshinori Sato , Laurent Vivier , Thomas Huth , Peter Maydell , Mahmoud Mandour , Brad Smith , Alistair Francis , Brian Cain , Cleber Rosa , John Snow , Marcel Apfelbaum , Pierrick Bouvier , Palmer Dabbelt , Riku Voipio , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Weiwei Li , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Beraldo Leal , Kyle Evans , David Hildenbrand , Song Gao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alexandre Iooss , Warner Losh , qemu-riscv@nongnu.org, Ilya Leoshkevich Subject: [PATCH 04/29] {linux,bsd}-user: Update ts_tid after fork() Date: Tue, 5 Mar 2024 12:09:40 +0000 Message-Id: <20240305121005.3528075-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305121005.3528075-1-alex.bennee@linaro.org> References: <20240305121005.3528075-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich 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 Signed-off-by: Ilya Leoshkevich Reviewed-by: Warner Losh Message-Id: <20240219141628.246823-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- bsd-user/main.c | 1 + linux-user/main.c | 1 + 2 files changed, 2 insertions(+) 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();