From nobody Sat Nov 23 20:11:47 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 ARC-Seal: i=1; a=rsa-sha256; t=1730778271; cv=none; d=zohomail.com; s=zohoarc; b=XWuMiVfnpNWygp/2DVoEbk/GznM9nGpx/sDL5pYW8j6yx89Lzz8Z5Ysi2BRjCiuQ7IVR3G3lbj7bsmr9KIRWHmjH768s7plizR5H2ptLZArfuv/a0h2gpdQRyL/3PeooJsGtyaCHZ+Iog+tr9DmZBHpz5i/UYpo+26CynipbXWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730778271; h=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=rxupo8oFWODoy3tJk0gzDbcDaAczcX8zGzXaJjAP0cI=; b=jm+4cEN+F8IIcCZMpOv0LgcmMiGQ4loTOU6QNxMuhRdKrD+vvFscJtCZE2esKAUW70cDtsMieIxRWXhdVkLLjaw+l6yzmm7RRdPa0H7EVMvZ6EDmlcxGUdwaZC9iKvzwTCoXv5cP044MlIR2tHCEo4eWnrL5/c0BUxL/yc0iiv4= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730778271149707.8159048871117; Mon, 4 Nov 2024 19:44:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8ATX-0002be-FQ; Mon, 04 Nov 2024 22:43: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 1t8ATV-0002au-I1 for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:25 -0500 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8ATT-0000zz-PX for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:25 -0500 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3a6ad7c5827so15387255ab.0 for ; Mon, 04 Nov 2024 19:43:23 -0800 (PST) Received: from dune.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a6bddcdcd8sm17162665ab.37.2024.11.04.19.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 19:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1730778202; x=1731383002; 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=rxupo8oFWODoy3tJk0gzDbcDaAczcX8zGzXaJjAP0cI=; b=UDa/0pnwXA3cMOQhz7N1A7goXY6J6jE5YcK7PRvmvY69/inAlLVXTbofTTygfRABYx gaRCP9rrYNWCXBwHhFgWsntG2oSg6x8gA1OvD77IrpEQlNArY1rS4HVIVrpJXVDupdS7 IXf1y7LKsNMxpfuQV7opQtR3jDcms7u6ujx+/miw2+Gy7QcftVKK8fx6MMRk/h84pEef eDR3BKRH0YVYvE/pwMA7e8pPw0Z/V5u4vpj0zpzT1VsTuTrEYuWGk0Mka8qDygMq5Fbi yzGvlBXSQ/sAksQO4DLFObTbHfMO3Z0Ci4G07IqMDgtnaJfTlJCDCzJPABzb+lbIFMlT YtUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730778202; x=1731383002; 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=rxupo8oFWODoy3tJk0gzDbcDaAczcX8zGzXaJjAP0cI=; b=fMG+ti+tIOcEIS2PrTweE7OPxwbnEWhZQGuiCnD1Rdm2llC1z7zdRjfHyy2hSnU7z3 MeWvOkjScCpGEMYJyhHeU+pQ+GKZR2m9hFavgGHWJUSFP1pCOnRQyxWr+/iqukkNSJw+ sAB1NWQaOgLdq9eEeR3ejatPLExpjigey7Din5z1JRnJr8LkFH6uZarafu4BU3YGsVEL 4qfA+WL6xPArW6w4Uuol4rCusSihCzh0Y1yibLE4aW/LmuulGrz7XwvQLp7jSK2oFzV1 zFZ59rtTmdhe178XW3lAs5TVX7BXBVKOElwTm6+/YrnN/H6fqfqXIpNS1o/SWlSgcUxS MRTA== X-Gm-Message-State: AOJu0YzdmPbz/AQVXKIgEd+Fqfm1uE1Cov/JNQecaGPsLWRy9qD6h4qs O/5wZjNBbUGFCoZb6SfpeOJLBizGhhil84agQ0MJ5smb9G1RSiybvAKjL3/gYV/WtBCnPl81Vba 6yi0jHQ== X-Google-Smtp-Source: AGHT+IG4IVy0HfrBY+gYmPrRTeKxg/rQWyud+UCaPvy/I2jdAEnPWhDH9NmtkGB6vS6iUjnjisYEDA== X-Received: by 2002:a05:6e02:12ce:b0:3a4:ec4b:92f0 with SMTP id e9e14a558f8ab-3a6b031c94cmr156516725ab.19.1730778201964; Mon, 04 Nov 2024 19:43:21 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Jessica Clarke , Kyle Evans , Ilya Leoshkevich , Richard Henderson Subject: [PULL 1/3] bsd-user/x86_64/target_arch_thread.h: Align stack Date: Mon, 4 Nov 2024 20:40:37 -0700 Message-ID: <20241105034039.31143-2-imp@bsdimp.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241105034039.31143-1-imp@bsdimp.com> References: <20241105034039.31143-1-imp@bsdimp.com> MIME-Version: 1.0 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: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1730778273128116600 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich bsd-user qemu-x86_64 almost immediately dies with: qemu: 0x4002201a68: unhandled CPU exception 0xd - aborting on FreeBSD 14.1-RELEASE. This is an instruction that requires alignment: (gdb) x/i 0x4002201a68 0x4002201a68: movaps %xmm0,-0x40(%rbp) and the argument is not aligned: (gdb) p/x env->regs[5] $1 =3D 0x822443b58 A quick experiment shows that the userspace entry point expects misaligned rsp: (gdb) starti (gdb) p/x $rsp $1 =3D 0x7fffffffeaa8 Emulate this behavior in bsd-user. [[ applied Richard's suggestion ]] Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/x86_64/target_arch_thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/x86_64/target_arch_thread.h b/bsd-user/x86_64/target_= arch_thread.h index 52c28906d6d..7739bb2154b 100644 --- a/bsd-user/x86_64/target_arch_thread.h +++ b/bsd-user/x86_64/target_arch_thread.h @@ -31,7 +31,7 @@ static inline void target_thread_init(struct target_pt_re= gs *regs, struct image_info *infop) { regs->rax =3D 0; - regs->rsp =3D infop->start_stack; + regs->rsp =3D ((infop->start_stack - 8) & ~0xfUL) + 8; regs->rip =3D infop->entry; regs->rdi =3D infop->start_stack; } --=20 2.46.1 From nobody Sat Nov 23 20:11:47 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 ARC-Seal: i=1; a=rsa-sha256; t=1730778263; cv=none; d=zohomail.com; s=zohoarc; b=klzzhDPVOXb7VDEdH4lxCuRfY3soV7z/+7IAAWTsxCNGg6RFUy6hXz3XxrTktJl/cDePQ61kebffC8Kn0gDad19wiw3w933Z+ePj2m/QTRUF3FHQ3o1PmawyzjBfmwLHQvX9Iw97HFHRN81Xfrdsku3N/JmbQN1mRVPIwPcCdl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730778263; 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=85Mpl5vChgiCfZpQSnWPYrEeOfjpu0W0D/cphYsgEtE=; b=T+o1Rtf/rOjkbGzkmo4qVBZgMvXzuudjc1D/vJCQaXpgkjF9NlA7tWqqabOjXBEdqPhe5TO7eK75OGqZnfclQz8a/iWp7QvJ9mbnbaDd/Ltdl/hPWvrM7LsiGh+G0R0peUgJD3BwLRtY0g5yXKM+sMToskGyK84gdMdRCPh+jjM= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730778263039282.4720867862894; Mon, 4 Nov 2024 19:44:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8ATX-0002bg-VW; Mon, 04 Nov 2024 22:43: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 1t8ATW-0002bI-Mk for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:26 -0500 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8ATV-00010A-8r for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:26 -0500 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3a6bf539cabso9139155ab.3 for ; Mon, 04 Nov 2024 19:43:24 -0800 (PST) Received: from dune.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a6bddcdcd8sm17162665ab.37.2024.11.04.19.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 19:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1730778204; x=1731383004; 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=85Mpl5vChgiCfZpQSnWPYrEeOfjpu0W0D/cphYsgEtE=; b=RC1LNlnEy65ZwJF5ks7bVFH0TMutXhfH5dJ28pv19CcL4a1izHPO5gpH2ybSQBdj8v RYCNDwbeENZSLuRyBIuCqzrb+ulSQabYh5+IHS7gG+mpjHsvnuwZIRaKasZbS/krKhGj BrcKOLicyDg29v68oE5h/2jDEfhUzxSi4zARs64UE71OotMbcV88kkMychJsFkUO2p8L cqhXAog4oEUD4Z4chjIR0UMFkYnrTqZFe5KZSP9o7i08NQ3sIXzTY73u0+POJFFdOmas w6g5V7011/kJqY90gU+KXhJYac3TFzedqvQNWPHEyxx0rBl4O3mWIGgB3wB5IyIaewtj LDag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730778204; x=1731383004; 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=85Mpl5vChgiCfZpQSnWPYrEeOfjpu0W0D/cphYsgEtE=; b=K1gDwOGsDq+BoWOyhX+I876fC3jQr2OXN75QVol98SdfO57jj+6DxofZzNkCR0c+Qt sZwsKCRo3UjDnYVBzBtKspaSo034nm8ZjdSTNXbZUx71dDBM0+un52kE0V0tDzLP+E5q y2Cx9aaZnxgP/jFZQT1dftgu/q5gXF8OnTsv/1WRVX5Ac5jln7RHBrwO13Ct5kvNya6t Eiia8NBKo+sITD1PzjcNjiwqIlTjCiKPiF6tt7hv84o5z8R9CJ1GNiIaxKP0zpCDQRxe gOrcC8QssHaBHbvJ8MRx22K2zovHp/AVa3bFJfUCK+0eaHev6ufFQ7Yaq+PNtAo6wJQA kugA== X-Gm-Message-State: AOJu0YyQ1eUYFYbdH9//OTpLmLkgJ/b60cK3YBOwCoNiwYCF49u/WzgO pZv8q4ZHVwaE3V1O/vDatg62Ye/UnD6v+gutzTQL+xrFtqLXF1sj4f6benYv61H3Vxv/9/9voKB wFzLuqA== X-Google-Smtp-Source: AGHT+IGLEv1S6KBPJDUvQ2bEhJlknm2hKBR91N/2En/MYuUg6fGK5Ci30K+P8j/S009XEXj+N5URzQ== X-Received: by 2002:a05:6e02:1c07:b0:3a6:cac0:1299 with SMTP id e9e14a558f8ab-3a6cac01324mr63912075ab.14.1730778203892; Mon, 04 Nov 2024 19:43:23 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Jessica Clarke , Kyle Evans , Ilya Leoshkevich , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 2/3] bsd-user/main: Allow setting tb-size Date: Mon, 4 Nov 2024 20:40:38 -0700 Message-ID: <20241105034039.31143-3-imp@bsdimp.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241105034039.31143-1-imp@bsdimp.com> References: <20241105034039.31143-1-imp@bsdimp.com> 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: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1730778265200116600 From: Ilya Leoshkevich While qemu-system can set tb-size using -accel tcg,tb-size=3Dn, there is no similar knob for qemu-bsd-user. Add one in a way similar to how one-insn-per-tb is already handled. Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index cc980e6f401..7c230b0c7a5 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -60,6 +60,7 @@ uintptr_t qemu_host_page_size; intptr_t qemu_host_page_mask; =20 static bool opt_one_insn_per_tb; +static unsigned long opt_tb_size; uintptr_t guest_base; bool have_guest_base; /* @@ -169,6 +170,7 @@ static void usage(void) " (use '-d help' for a list of log items)\n" "-D logfile write logs to 'logfile' (default stderr)\n" "-one-insn-per-tb run with one guest instruction per emulated = TB\n" + "-tb-size size TCG translation block cache size\n" "-strace log system calls\n" "-trace [[enable=3D]][,events=3D][,fi= le=3D]\n" " specify tracing options\n" @@ -387,6 +389,11 @@ int main(int argc, char **argv) seed_optarg =3D optarg; } else if (!strcmp(r, "one-insn-per-tb")) { opt_one_insn_per_tb =3D true; + } else if (!strcmp(r, "tb-size")) { + r =3D argv[optind++]; + if (qemu_strtoul(r, NULL, 0, &opt_tb_size)) { + usage(); + } } else if (!strcmp(r, "strace")) { do_strace =3D 1; } else if (!strcmp(r, "trace")) { @@ -452,6 +459,8 @@ int main(int argc, char **argv) accel_init_interfaces(ac); object_property_set_bool(OBJECT(accel), "one-insn-per-tb", opt_one_insn_per_tb, &error_abort); + object_property_set_int(OBJECT(accel), "tb-size", + opt_tb_size, &error_abort); ac->init_machine(NULL); } =20 --=20 2.46.1 From nobody Sat Nov 23 20:11:47 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 ARC-Seal: i=1; a=rsa-sha256; t=1730778249; cv=none; d=zohomail.com; s=zohoarc; b=AmTMzg/hYiSOo/Ba+Nbtijx0Zw+X3T4VAnmQFGitkqzUyltEP4v0VY5ro8tsPDBSlosrKw5sPrhRRCOChb0VPbxCHXSwiTIAbLInNcbyzor89JPKTZSW9PmVZRzlETHpmncTNts8Nm2joVqtkEuzqvQChqzUw4dP0vKxhqOYMdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730778249; h=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=Jo91p9Lq7o7wujm4a8/ClY5doXjvtmdnC3dXQPZG4wk=; b=oDOdDSBUgZ73TGXHLXmdGlRijkH3GjFQ6UNKH6PSdw5Zh7cTr3ekDr9BXw74HmnUfm6KTO5JtuXbORdo3xU7lSS4NwmK3RiUxpbm9WKSpYC5Z6kOXX21JlRyJl1uB2UhGpdds07csZ1BUTk85bm1Tw354GoTGgGpqfCvmLMz+1o= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730778249332259.1920744173028; Mon, 4 Nov 2024 19:44:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8ATZ-0002c5-Co; Mon, 04 Nov 2024 22:43:29 -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 1t8ATY-0002bh-8y for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:28 -0500 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8ATW-00010N-Ry for qemu-devel@nongnu.org; Mon, 04 Nov 2024 22:43:28 -0500 Received: by mail-il1-x144.google.com with SMTP id e9e14a558f8ab-3a4c303206eso17309735ab.3 for ; Mon, 04 Nov 2024 19:43:26 -0800 (PST) Received: from dune.bsdimp.com ([50.253.99.174]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a6bddcdcd8sm17162665ab.37.2024.11.04.19.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 19:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1730778205; x=1731383005; 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=Jo91p9Lq7o7wujm4a8/ClY5doXjvtmdnC3dXQPZG4wk=; b=NgAdW4S9TFqQISfYEStbo2jLLXNrGWPbdTTJ8RmKHObx4H/Am3ZUb+zCkmeVi5CO6h KZRSp5PJrQ21WJUOW/4oG2qME1jFT0pE+6HAmZLVacP/d5PrR/SQXzY+fsvSBYhZl+uY EZQyOJg4jUDT64WgET+5ShBoclFS5MXZy2qZIDKhPeWll/+9e8l92j1l5H+qc7BhEJM9 QN60Ukylrl+x/jDHvSB5Vdkg+MjiAvqe4gei8eh14OQJg0UfaiAIAsMuW3137cUdGbPO EJe25hs9U8GIesneRfEiQmfXRQmoGH+2mqbmEvfp0KOF7IsDsbN2vVyk3eZd3iD05SHP zDQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730778205; x=1731383005; 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=Jo91p9Lq7o7wujm4a8/ClY5doXjvtmdnC3dXQPZG4wk=; b=fXU1oL0jekUhED3+OJKx4bObAAXnkcQ/f8KhPmHuvuQwzYEGt7/GNgB7AXAKeCIBA7 lD7HayYPAUiypnSGXCJYw0p+DWGHtkR6do7B4gJmfk3t8w1eMmex03ghwG6VM9wSjTXU BpEk0BCOe45+7Y6tjKIavkfIEh2KLZFu+mtiyOL88HVhlExsFcQpo1Ft41aFFOoEe4H8 NKuLk/lXKtDCBvRZ3YVFTDYO0AyrOkOqKPOPhclGfG1IdZyB7dBBgCp/RylWoVVeZoM/ rt6QoEsryPZMhjAQkkumh5FokV1EVZEGL7pkSYR0yf8aEUkne6PjWysciA7jZ6uD+AKP zG4w== X-Gm-Message-State: AOJu0Yw3o22N2E/p3f/i4MD0twPJIQfBRUisq5ln/w9Qji2lm7tPiSKA Gmz++Lt+1MTToSNdhidJpoCiypDlJ3l7L5kHM+M+qku7UkvHTdLCqAqfWGEFoljbYkmVnD4Auv3 dQba/I0YK X-Google-Smtp-Source: AGHT+IET7Xn/m7FvBXt6a8PFNDoASQW8hDS/v2cpCtnpgPT4iOV1MwTFG6MSVMpTgQc6TL0zEm9Ipg== X-Received: by 2002:a05:6e02:1c82:b0:3a0:9c99:32d6 with SMTP id e9e14a558f8ab-3a6b03cce83mr165094575ab.24.1730778205548; Mon, 04 Nov 2024 19:43:25 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Cc: Warner Losh , Jessica Clarke , Kyle Evans Subject: [PULL 3/3] bsd-user: Set TaskState ts_tid for initial threads Date: Mon, 4 Nov 2024 20:40:39 -0700 Message-ID: <20241105034039.31143-4-imp@bsdimp.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241105034039.31143-1-imp@bsdimp.com> References: <20241105034039.31143-1-imp@bsdimp.com> MIME-Version: 1.0 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: none client-ip=2607:f8b0:4864:20::144; envelope-from=imp@bsdimp.com; helo=mail-il1-x144.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1730778251005116600 Content-Type: text/plain; charset="utf-8" From: Jessica Clarke Currently we only set it on fork. Note: Upstream (blitz) commit also did new threads, but that code isn't in qemu project repo yet. Signed-off-by: Jessica Clarke Pull-Request: https://github.com/qemu-bsd-user/qemu-bsd-user/pull/52 Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index 7c230b0c7a5..61ca73c4781 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -610,6 +610,7 @@ int main(int argc, char **argv) init_task_state(ts); ts->info =3D info; ts->bprm =3D &bprm; + ts->ts_tid =3D qemu_get_thread_id(); cpu->opaque =3D ts; =20 target_set_brk(info->brk); --=20 2.46.1