From nobody Tue Nov 26 06:39:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709640865; cv=none; d=zohomail.com; s=zohoarc; b=NwLQKbOOVSQccqkUjM0R8QSQsU/FMtFeFVgjeVUuD9bP2esFkud2ePkcbOq+lNQf0buqriIXPx1UbKGY0fAvxVM2MOO9fVArCygPM0LS7ry+arL8dAETFHr19nKKSmybH4OjFqAvUbY1pGM9224rys1fewotLvASAlD5JcCbnL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709640865; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=z3nYyAloWCoquTZDPSpE+htB2DaRlvaFvDRPXpKYUIk=; b=Y70QeCNiANBoH1WYGyEjzqqBQ5irELN05jEzs2ZXA9d8O9g2Jy7oZVpRrbRwOxPzM8boBrHnf8g9YnYCDwSXiPqZH+QrhxvNuRFCYSIlx/F4xCKRqQ2XfAjEpqgS25KzR7M7KD3BG2fbeRegNJt7559V+5AUPLnVZojadPVNBVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709640865310718.4732208274725; Tue, 5 Mar 2024 04:14:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhTel-0005PB-It; Tue, 05 Mar 2024 07:12:27 -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 1rhTdJ-0001uW-GG for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:11:03 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhTch-0001RA-6F for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:10:48 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33e17342ea7so2937944f8f.2 for ; Tue, 05 Mar 2024 04:10:16 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i10-20020a05600011ca00b0033b60bad2fcsm14828243wrx.113.2024.03.05.04.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:10:12 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 314165F95B; Tue, 5 Mar 2024 12:10:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709640613; x=1710245413; 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=z3nYyAloWCoquTZDPSpE+htB2DaRlvaFvDRPXpKYUIk=; b=YlFCKI8D4IjhTyxkzLiRopaNtPIX37FxRBi1OzfI+a2AT1584F69fMVJ3KKOqx7QjF opGcuuKMB+fqM+Zxu14VpLoaqh5q5RwaaWRb2BewYcV48M0nbJY5cSu84AzHqw7tUxSu JfHaF8T/UJ4XsAINnvuGx1JOcIOhNd+LIbx1Ssp3SzcuTKsUWScOUn49pN62ERdQtL+9 RjkzGORywaC+fweFJP6JvoLgSzMULbFUDolRUhNQtZv0afdCtPuO9zwhPIn4fF2iWkVz Mu2OGYh23Io5P9ixAGmDNOF2kB7cYeZIkJA8Kg8rxZz1gwDq9lmq1VGYzd7msGmAlw2x bQEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709640613; x=1710245413; 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=z3nYyAloWCoquTZDPSpE+htB2DaRlvaFvDRPXpKYUIk=; b=GvOoWiKGkthPFkXKrCtnJ6VAtFfPVGjB3Mb51eAAmDkn8LvdX+DLDdIba/sCke/ht4 hi+nJUTnrf76mzAuUw823mQK80jHVTEXtZBWenqB63nFCRHdHBG4fF5XeNGk78WWxG74 4Ewb406I0M6+2H1z1mCAoVMrKoQIH4B4NGFCL0ObP5iVnrdXOZ5xnDwIGICyN0d4TNDk JkgyhMVAGfBaLDBY55v8O0t+QZOpx4pz3PU+UWBCZUGnbI8BYqAPg31FtiEA4ALNCJ2T RLGBFRHBCyMQe0GvRKaSNGsorT7fGMTgOnyHUmUwnh8vbydKZcNX0PV6XHqzu1HBevMT +v8Q== X-Gm-Message-State: AOJu0YzMsgXZQlSxWLfIMO/92H1cjy8GoCcB5+le5awOX0HqxhKJP5Dd Hj68lZkP30Ah44PhYLWoUnSGnaUE+pwTf0504zhWhEsNuQTYZMQ/d+fN3hoaWMU= X-Google-Smtp-Source: AGHT+IGxzfpc7Is8XIMk/vDb0IbU6uTaw89SmYiDYHhlZ4rm1tdamaAIUJBzXb/EBdpD9hAZjm5PWQ== X-Received: by 2002:a5d:55c4:0:b0:33e:854:8b24 with SMTP id i4-20020a5d55c4000000b0033e08548b24mr7488915wrw.12.1709640613497; Tue, 05 Mar 2024 04:10:13 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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=20Benn=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=20Le=20Goater?= , Beraldo Leal , Kyle Evans , David Hildenbrand , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alexandre Iooss , Warner Losh , qemu-riscv@nongnu.org, Ilya Leoshkevich Subject: [PATCH 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork() Date: Tue, 5 Mar 2024 12:09:43 +0000 Message-Id: <20240305121005.3528075-8-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709640866387100001 From: Ilya Leoshkevich The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20240219141628.246823-7-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e --- include/gdbstub/user.h | 2 +- bsd-user/main.c | 2 +- gdbstub/user.c | 2 +- linux-user/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gdbstub/user.h b/include/gdbstub/user.h index e33f8d9a9a6..3f9f45946e0 100644 --- a/include/gdbstub/user.h +++ b/include/gdbstub/user.h @@ -54,7 +54,7 @@ void gdbserver_fork_start(void); * gdbserver_fork() - disable gdb stub for child processes. * @cs: CPU */ -void gdbserver_fork(CPUState *cs); +void gdbserver_fork(CPUState *cs, pid_t pid); =20 /** * gdb_syscall_entry() - inform gdb of syscall entry and yield control to = it diff --git a/bsd-user/main.c b/bsd-user/main.c index fca9b302043..0dbd1cf8801 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -138,7 +138,7 @@ void fork_end(pid_t pid) */ qemu_init_cpu_list(); get_task_state(thread_cpu)->ts_tid =3D qemu_get_thread_id(); - gdbserver_fork(thread_cpu); + gdbserver_fork(thread_cpu, pid); } else { mmap_fork_end(child); cpu_list_unlock(); diff --git a/gdbstub/user.c b/gdbstub/user.c index 536fb43b03e..c61e1a0d1f6 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -375,7 +375,7 @@ static void disable_gdbstub(CPUState *thread_cpu) } =20 /* Disable gdb stub for child processes. */ -void gdbserver_fork(CPUState *cpu) +void gdbserver_fork(CPUState *cpu, pid_t pid) { if (!gdbserver_state.init || gdbserver_user_state.fd < 0) { return; diff --git a/linux-user/main.c b/linux-user/main.c index cab95f5b0aa..70314e0ab6a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -165,7 +165,7 @@ void fork_end(pid_t pid) } qemu_init_cpu_list(); get_task_state(thread_cpu)->ts_tid =3D qemu_get_thread_id(); - gdbserver_fork(thread_cpu); + gdbserver_fork(thread_cpu, pid); } else { cpu_list_unlock(); } --=20 2.39.2