From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132399; cv=none; d=zohomail.com; s=zohoarc; b=n56Lmlr3ZULf6sK2SGWyfUS3HZOF3meObuMUpMO884i9ZuVrgMOKFOhRG4cWVTxQ4gy6R0F4cQgF18TBVRn+xJdUdyjJf9Grl34OpDNo830JstU25qSq/k/WTJR10NP4yhjDnz2C8SW9WBiyWkCZHt/BlHMOoffIzCviUXrpbzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132399; 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=DPG8SHg6JK+5RAU/hyfraCbSuRwVVqDUi2e3HwM6Fps=; b=eKe+NLuvjPv+EQTgSimohuly2R+2SBd/FDBGa6KC3grtDPW3nRP1C7ybPn0C/2TMyOTQkLhGgu1TnI3nrxRt6Dy2xlEoBq46npyyfsTKhxEhTZuAKOeHFLM3pKCBEEK0wsKQcAo3NSxntGMAU+rPRCvSxBBIDznqGAoGIZlBUvA= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132399339144.63381100854542; Sat, 25 Apr 2026 08:53:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIp-00087u-27; Sat, 25 Apr 2026 11:52:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIV-00080f-HF for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-00011v-Dk for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:59 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2C0CC44546; Sat, 25 Apr 2026 15:51:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 994FCC2BCB4; Sat, 25 Apr 2026 15:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132306; bh=+2xH9pwJPCdtwpTyFDhcK3JSDm0xqxczPOzOhfXaGgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRoodeA+XUYyfovZ6hASkvryNQs4/Xt04eNVLStGRhp+Jw17EmaWPLkHz5fzBMnEE +/YWe975s9whIWQOZ9SXlhglsFNrc+xPJyt4uwu68e1kEFKldw54Ttm3huMsH8Ha0r P1y0LzORHIQsrky+Rixn6BE/Gqb3YGDQ9ZTKYEna9vy7CEv8PEyvhUb6iVCkpHQiGv 2xF8aIaImQcv1Q+87N+RIgk0LHtmFYYmMDY5CwrTkiPS4HgAD0sURZLL3kwQExNKOq Fomn4Na5EnM8DJLfChu0BsNxTl7M5wqkRn4NZjmwZUqzdHo+PZ+Kyad+6JkfzxK4cO 6fKcSBa03xM1Q== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/14] MAINTAINERS: Add myself as maintainer for linux-user Date: Sat, 25 Apr 2026 17:51:27 +0200 Message-ID: <20260425155140.50186-2-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132400876154100 From: Helge Deller I'd like to step up as maintainer for linux-user. I'm actively using linux-user to emulate a HP-PARISC (hppa) linux environment on my debian buildd servers, so I'm very much interested that linux-user is running good and stable. Signed-off-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Alex Benn=C3=A9e --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index ad215eced8..e0f707a1ec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4075,6 +4075,7 @@ T: git https://github.com/qemu-bsd-user/qemu-bsd-user= bsd-user-rebase-3.1 =20 Linux user M: Laurent Vivier +M: Helge Deller R: Pierrick Bouvier S: Odd Fixes F: linux-user/ --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132346; cv=none; d=zohomail.com; s=zohoarc; b=Z1Yj3c8g9LVcm/QfmULIFpb+otjQ58uOalZa8eTSCO6C6rWTk4fkilGfCjMgnmR83WI3H+5PjWlJm9mxniH7LiBvpCX71JJau7OqzBDWtu2O9JIrMk+anOsiDMbfkhEIFBX49y0XaiWl/Wues+rAIVnmDbA0iJ1ksjyDdq5YTLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132346; 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=TCRW/JSOtOLWYOieOHflVXmryu23zYpYHlwvHWuGWmM=; b=mCO2SMSWdiYiiSKoIe+dDpBOyVXwWkS1JGL6mx7Kz7qjQRu7hjR+KMTiRTmWa83zRey95bL+Cxc2xVx0hRS4RSO6kRqInhlkGYNEwQqlpR8FB6HB0P/bvojRnkt3lfXZpVjp6RMp7H6pc3/xF0/z+YPhV/TYmIXvDB2FkhGz7Z8= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132346700416.2344335429384; Sat, 25 Apr 2026 08:52:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIi-00083p-8K; Sat, 25 Apr 2026 11:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIU-00080V-2Q for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:58 -0400 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-000127-E9 for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:57 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 2F731600CB; Sat, 25 Apr 2026 15:51:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773DEC2BCB6; Sat, 25 Apr 2026 15:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132307; bh=N0SltF6kWrhKYQvGQd+k67AMBYWPlgGMkWYMzuPa5JM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ivy2zczBHzMWbM+4FCuEJC/Ca78ks/MI9FIjvCRZPCXuPo3leVywMOb1mj1FYRDGF /Ak3b07ncGbpFC0BYAr+K78MFFwcHMVEU2v/byy6pdRvmpuZT7N0WpeMMsqi4M3pOa MiMPoPgVooMC2aSADUrfOUOgXg4w5fc1VB2Eby5XXW99Yw8bmYEVZdpEvFyj+uRKXM 4/HrGjZHZFvJ9pgvY5ZsBe1UmpxARTPOro8gJTk0h+DNZHMAV0urLXTag/5iLo1fMz ZoS3twJUL3JC/jP5SY79/hzOMllEM/tgsj8Xv/rIUyEJysLftw7EUVwMXDSNuENoHJ QFcMEq0sonNbQ== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 02/14] linux-user/ppc: Fix ppc64 rt_sigframe stack offset Date: Sat, 25 Apr 2026 17:51:28 +0200 Message-ID: <20260425155140.50186-3-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=172.105.4.254; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132348402154100 Content-Type: text/plain; charset="utf-8" From: Matt Turner The kernel's 64-bit signal delivery (signal_64.c) uses: newsp =3D frame - __SIGNAL_FRAMESIZE while the 32-bit path (signal_32.c) uses: newsp =3D frame - (__SIGNAL_FRAMESIZE + 16) The extra 16 bytes in the 32-bit case is to place siginfo and ucontext at the same offsets as older kernels (see the comment in signal_32.c). The 64-bit rt_sigframe starts with ucontext directly and does not need this adjustment. QEMU's setup_rt_frame() unconditionally used (SIGNAL_FRAMESIZE + 16) for both 32-bit and 64-bit, placing the handler's SP 16 bytes too low on ppc64. Signal delivery and return still worked because do_rt_sigreturn had the matching wrong offset, but the vDSO DWARF unwind info encodes the correct kernel offset. This caused any DWARF unwinder (libunwind, libgcc, etc.) to compute a CFA that is 16 bytes off, reading garbage register values from the signal frame. Define RT_SIGFRAME_ADJUST (0 on ppc64, 16 on ppc32) and use it in both setup_rt_frame and do_rt_sigreturn to match the kernel. This was verified by A/B testing with libunwind's test suite: ppc64le: Gtest-bt, Ltest-bt, Gtest-concurrent, Ltest-concurrent, and Ltest-sig-context all change from FAIL to PASS. ppc64be: Gtest-bt, Ltest-bt, and Ltest-sig-context all change from FAIL to PASS. Signed-off-by: Matt Turner Reviewed-by: Peter Maydell Signed-off-by: Helge Deller Cc: qemu-stable@nongnu.org --- linux-user/ppc/signal.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index 24e5a02a78..a9c10e0987 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -210,6 +210,18 @@ QEMU_BUILD_BUG_ON(offsetof(struct target_rt_sigframe, = uc.tuc_mcontext) =20 #endif =20 +#ifdef TARGET_PPC64 +#define RT_SIGFRAME_ADJUST 0 +#else +/* + * For 32-bit rt sigframes we have an extra 16 bytes of gap + * on top of __SIGNAL_FRAMESIZE; this is to get the siginfo + * and ucontext in the same positions as in older kernels. + * See Linux's arch/powerpc/kernel/signal_32.c. + */ +#define RT_SIGFRAME_ADJUST 16 +#endif + #if defined(TARGET_PPC64) =20 struct target_func_ptr { @@ -525,7 +537,7 @@ void setup_rt_frame(int sig, struct target_sigaction *k= a, env->fpscr =3D 0; =20 /* Create a stack frame for the caller of the handler. */ - newsp =3D rt_sf_addr - (SIGNAL_FRAMESIZE + 16); + newsp =3D rt_sf_addr - (SIGNAL_FRAMESIZE + RT_SIGFRAME_ADJUST); err |=3D put_user(env->gpr[1], newsp, target_ulong); =20 if (err) @@ -641,7 +653,7 @@ long do_rt_sigreturn(CPUPPCState *env) struct target_rt_sigframe *rt_sf =3D NULL; target_ulong rt_sf_addr; =20 - rt_sf_addr =3D env->gpr[1] + SIGNAL_FRAMESIZE + 16; + rt_sf_addr =3D env->gpr[1] + SIGNAL_FRAMESIZE + RT_SIGFRAME_ADJUST; if (!lock_user_struct(VERIFY_READ, rt_sf, rt_sf_addr, 1)) goto sigsegv; =20 --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132346; cv=none; d=zohomail.com; s=zohoarc; b=jjFjiYot8jjx8WEbXCr3iX+XEZ3lT/pk44bWx9v2bLnyj81/eq2FpC/yMhbbKYrA/3r0O1BLWh8p9tOcJlUlG5wStOM8IH0RUMoCx3n6IbrV7w1YXg/gKcHACyDAwKlvZcIzs0ZGcHIsEPN2kd1HUmNtyNhwjXcBzc+knk7i2fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132346; 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=hK4D6qlUrHc1besYIDLeSHAI9myyqLOFGnDJjKK88FU=; b=i/I4mQ+hunlppvBz7pHssO3VxBpET2VV6aKP4M66qx3AjOEqFmFxRIt9KGCEw0X3udKCVXK5yQ1doew88gNpYlF9z6zh9gacygrJFyLqfWUPI+n7UIH31afsW04kHoLh9OKd4kg3fTv7tKg9AK2HW518R3ukXesAJzGTfTKMAfY= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132346829942.8645737695692; Sat, 25 Apr 2026 08:52:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIk-00085A-8w; Sat, 25 Apr 2026 11:52:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIV-00080e-Gy for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-00012E-De for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:59 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id DBEBA41870; Sat, 25 Apr 2026 15:51:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55078C2BCB0; Sat, 25 Apr 2026 15:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132309; bh=qF/E4NTHGEzqRslmvhkeGAs4imRoAsHDEXNz7p4ViJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H4NIPMSBbUr009kNoUD+po6B9WSBkj6XtlRPF77vlB+o4upnfeHJilSnycAVHGxwm kPZr1bFr+qs7yC+aaIKJVdY2cCbF6gv5qWMGbiGQpGBWGlnEp76u86hFCF776PK507 LMkPfJK/nSlHTg4vNSZxhkT8HuEshQjG9+zIGO8jAai3XSMw1K7Mx1PpGufW/pd6ER Lhz8GL1J5NsIhOThqrNal3iUs6b1K/Y7bpza0eIlSrsn5VB13Ycxsa+1vT1vbW4Ilj bI6oCRiUsII7e+drYJTOmaAwEva6jCyIrpG4KVGx7BsHTQXR+QX63cf1hbsBb9BdTY C+d/LhRhfECRA== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 03/14] linux-user: fix off-by-one in host_to_target_for_each_rtattr() Date: Sat, 25 Apr 2026 17:51:29 +0200 Message-ID: <20260425155140.50186-4-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132348379154100 From: Yixin Wei host_to_target_for_each_rtattr() uses "len > sizeof(struct rtattr)" as its loop condition. When the last rtattr in a netlink message has exactly sizeof(struct rtattr) (4) bytes remaining, the loop exits without byte-swapping its rta_len and rta_type. A big-endian guest then reads rta_len in the wrong byte order and fails validation. The companion function target_to_host_for_each_rtattr() correctly uses ">=3D" (added in commit fa2229dbf8). The kernel's RTA_OK macro also uses ">=3D". Fix the host_to_target direction to match. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2485 Signed-off-by: Yixin Wei Fixes: 6c5b5645ae0 ("linux-user: add rtnetlink(7) support") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Helge Deller Cc: qemu-stable@nongnu.org --- linux-user/fd-trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 64dd0745d2..7f55a0690b 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -480,7 +480,7 @@ static abi_long host_to_target_for_each_rtattr(struct r= tattr *rtattr, unsigned short aligned_rta_len; abi_long ret; =20 - while (len > sizeof(struct rtattr)) { + while (len >=3D sizeof(struct rtattr)) { rta_len =3D rtattr->rta_len; if (rta_len < sizeof(struct rtattr) || rta_len > len) { --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132419; cv=none; d=zohomail.com; s=zohoarc; b=AH2d87r8RlYxPMEWT6OGa0ivU2/9CIPjwCOE7H61pxfKJdTEJttjUbukHtMiP331TrB5Jj5N8Am/tNNiomdmN6S6t3QUL+F9BmtYfPnLrMBux2G4uquA7QHtPnUrNXhfXTkgB2qgkO0tbJWpSpw+kJVyxgGIpfBQNyxk7OL18BY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132419; 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=irvoo5hTRqD9NWMsJQPboTPdM4S6n22UGf4ZWtz+79U=; b=P0Fv587b/RkHIJnHNwQxbmPjt5oGPEegtxthCebJRic5v2BN+oc78e0rs6qFTOGX7XdJDUkbQuPLiKaP773V9B7UsgqpdfpZjYgD/e5PidSE+dC2k4gK42tcug497+cKf69nNF8Jmdgs8lwoQSv/yHiXj60hZVai3kRqYYHKRp0= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132419775793.1099142594211; Sat, 25 Apr 2026 08:53:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIm-00086b-Q2; Sat, 25 Apr 2026 11:52:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIV-00080d-FK for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-00012M-E5 for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:59 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id B86CC4065F; Sat, 25 Apr 2026 15:51:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32EDAC2BCB0; Sat, 25 Apr 2026 15:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132311; bh=SNBeEj5KSiWYkyqRyYX2gQdrt+ivR89RyfGpq4YmrsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IDVjIsmNG3srjpOoSzAMEnjwJ/5gEb4PmigW6wWN9HnqeSo9yU4+BMiJvwpHSuCUa K3QgG8B0eEiqvno9pqHeJxxyU4F7cS0UXk1y31h4hcYEb4AubN1KfDNtGiYnKDk2Kz K/w88mVpyUFYRC0XC2nouWDfkFV54IOJybTxuXzpzw38kkMQPL++FW8Wor6q8tTbLT 25tsz2cnLIhnAhNRZ10aDXBEseebkyXuXA6sE3Dy0i0XX1YE30vcUWJz1vDSrQcmGZ iJ/wioX+UMPWHCudiozfV2MwzxgxJXitIDzG+F/nTJQLM09Ow7I7IuTm2/0O16+mg5 xS39dgloDNQ6g== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/14] linux-user: Don't define target_stat64 struct for loongarch64 Date: Sat, 25 Apr 2026 17:51:30 +0200 Message-ID: <20260425155140.50186-5-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132420120158500 Content-Type: text/plain; charset="utf-8" From: Gyorgy Tamasi The kernel defines 'struct stat64' only if __BITS_PER_LONG !=3D 64 || defined(__ARCH_WANT_STAT64). loongarch64 doesn't set __ARCH_WANT_STAT64, and it isn't 32-bit, so it won't get this struct. QEMU incorrectly does define a target_stat64 struct. However this isn't causing any guest-visible problems, because defining the target_stat64 struct and TARGET_HAS_STRUCT_STAT64 affects these syscalls: TARGET_NR_stat64 TARGET_NR_lstat64 TARGET_NR_fstat64 TARGET_NR_fstatat64 TARGET_NR_newfstatat For loongarch64 the only one of those we provide is newfstatat, and that is actually a separate QEMU bug, because the kernel does not provide that syscall for this architecture. No real guest code will be using a syscall that doesn't exist in the ABI. (Some of these syscalls are present in the loongarch64 "ABI1.0", but that ABI was never accepted in the upstream kernel, and QEMU does not model that ABI, only the "ABI2.0".) Stop defining TARGET_HAS_STRUCT_STAT64 anyway, for consistency with the kernel and to avoid confusion. Note: Commit message suggested by Peter Maydell Signed-off-by: Gyorgy Tamasi Tested-by: Gyorgy Tamasi Reviewed-by: Pierrick Bouvier Reviewed-by: Peter Maydell Signed-off-by: Helge Deller --- linux-user/syscall_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 679af640c0..6967306be4 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2005,7 +2005,7 @@ struct target_stat { abi_uint __unused5; }; =20 -#if !defined(TARGET_RISCV64) +#if !defined(TARGET_RISCV64) && !defined(TARGET_LOONGARCH64) #define TARGET_HAS_STRUCT_STAT64 struct target_stat64 { abi_ullong st_dev; --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132390; cv=none; d=zohomail.com; s=zohoarc; b=i9TenrF2oy6TSw3JcjTNAhTOCn9xjo0BLxsHFy/8On22W/SBb/O87XVCOQ5p4egAZJxIdALn5Y+ZNUUk4Yz0qTmqzfUZnKIB7xZTUmBpmKDDsJRNmQZXtJ+Ghd1CsdQGNrVE9t7M47Tiu+pNX+B1ICckwbvDb+YSKDGvkO0GE3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132390; 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=QLgfdkSK8cCWnaX38iYPlxYsaVb9zqrB+9pqkNWh1+8=; b=mwxUPXHxLaOYWK5KS9i/RU8o15zMUdfoCSs7pW2yE6gThr08lUwN1wV/LKlocx0S690LIMdLYcryA2voave+/1mD8JSH5wI8WP8gno1a6L9urnXo3E0IIRkTvJXaNu5F9qgFjEH+1rZAIOsn+3622FD04n06N2JbyvUwn43LSOo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132390165265.4661335584169; Sat, 25 Apr 2026 08:53:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIn-00086g-DN; Sat, 25 Apr 2026 11:52:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIV-00080g-Id for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-00012S-Eh for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:59 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id BF9F36011F; Sat, 25 Apr 2026 15:51:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12733C2BCB0; Sat, 25 Apr 2026 15:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132313; bh=QIFtf3dqQlSgmjSkVvwlhh3G2J8OJkshPhuv1bYI+XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W/wXxi6GPNWlBF2vwGQ2mInU1zcNbHELKUz6F3mGR1p0e+ahF3jPQQAL3oKx1YxdW aCvwjSckA4E00F52MBoKAwA1yaEORWNZ5WrC2i8CgS3RWiv9GcoE7FEqMDKGQx8cKF mJQW3iuEAC7JV4xqTDsVvNE+1ZpnZOVzPTX0AC8goFTLf+qohYN993xKhortbQAqMm LrLbyafmspdR4834ChsCYXFFTpxHW1GDFED7JbnCpA3bk88c01W0kRenhGAEfwMTlQ AZ54t0MaOvsgubvg8d7JW4e+lWjtlB9+kuVI69g19WtGFD0OcyWIpRymiGuxf807Hc ttMGGAgMXHFpA== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/14] linux-user/arm/nwfpe: Replace user_registers with current_cpu Date: Sat, 25 Apr 2026 17:51:31 +0200 Message-ID: <20260425155140.50186-6-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.105.4.254; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132391106154100 From: Richard Henderson Use the thread-local variable current_cpu instead of a global variable to access the general registers. This also means we don't need to pass env to EmulateAll. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Helge Deller --- linux-user/arm/cpu_loop.c | 2 +- linux-user/arm/nwfpe/fpa11.c | 9 +-------- linux-user/arm/nwfpe/fpa11.h | 23 +++++++---------------- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index 19874f4c72..262ab5cc41 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -215,7 +215,7 @@ static bool insn_is_linux_bkpt(uint32_t opcode, bool is= _thumb) static bool emulate_arm_fpa11(CPUARMState *env, uint32_t opcode) { TaskState *ts =3D get_task_state(env_cpu(env)); - int rc =3D EmulateAll(opcode, &ts->fpa, env); + int rc =3D EmulateAll(opcode, &ts->fpa); int raise, enabled; =20 if (rc =3D=3D 0) { diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c index 0f1afbd91d..44783934b2 100644 --- a/linux-user/arm/nwfpe/fpa11.c +++ b/linux-user/arm/nwfpe/fpa11.c @@ -30,7 +30,6 @@ =20 =20 FPA11* qemufpa =3D NULL; -CPUARMState* user_registers; =20 /* Reset the FPA11 chip. Called to initialize and reset the emulator. */ void resetFPA11(void) @@ -156,7 +155,7 @@ void SetRoundingPrecision(const unsigned int opcode) =20 /* Emulate the instruction in the opcode. */ /* ??? This is not thread safe. */ -unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qre= gs) +unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa) { unsigned int nRc =3D 0; // unsigned long flags; @@ -173,12 +172,6 @@ unsigned int EmulateAll(unsigned int opcode, FPA11* qf= pa, CPUARMState* qregs) } =20 qemufpa=3Dqfpa; - user_registers=3Dqregs; - -#if 0 - fprintf(stderr,"emulating FP insn 0x%08x, PC=3D0x%08x\n", - opcode, qregs[ARM_REG_PC]); -#endif fpa11 =3D GET_FPA11(); =20 if (fpa11->initflag =3D=3D 0) /* good place for __builtin_expect */ diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h index d459c5da02..20f9d2eb81 100644 --- a/linux-user/arm/nwfpe/fpa11.h +++ b/linux-user/arm/nwfpe/fpa11.h @@ -25,15 +25,6 @@ =20 #define GET_FPA11() (qemufpa) =20 -/* - * The processes registers are always at the very top of the 8K - * stack+task struct. Use the same method as 'current' uses to - * reach them. - */ -extern CPUARMState *user_registers; - -#define GET_USERREG() (user_registers) - /* Need task_struct */ //#include =20 @@ -91,25 +82,25 @@ void SetRoundingPrecision(const unsigned int); =20 static inline unsigned int readRegister(unsigned int reg) { - return (user_registers->regs[(reg)]); + CPUARMState *env =3D cpu_env(current_cpu); + return env->regs[reg]; } =20 static inline void writeRegister(unsigned int x, unsigned int y) { -#if 0 - printf("writing %d to r%d\n",y,x); -#endif - user_registers->regs[(x)]=3D(y); + CPUARMState *env =3D cpu_env(current_cpu); + env->regs[x] =3D y; } =20 static inline void writeConditionCodes(unsigned int x) { - cpsr_write(user_registers, x, CPSR_NZCV, CPSRWriteByInstr); + CPUARMState *env =3D cpu_env(current_cpu); + cpsr_write(env, x, CPSR_NZCV, CPSRWriteByInstr); } =20 #define ARM_REG_PC 15 =20 -unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qre= gs); +unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa); =20 unsigned int EmulateCPDO(const unsigned int); unsigned int EmulateCPDT(const unsigned int); --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132433; cv=none; d=zohomail.com; s=zohoarc; b=frK8g/BF9TyoVDBgPQboQ+Fb8ZEEVNKL6NLSqLXcYnug659wrsAcp6O0NdhTRNzuu6mivL4o7wWg95r6EjYkxH8VkXsHms0lvcqtgiktdYTdmb8guV+0e4sUcDDirju+LZi/2EaTUA7PHDc0AoU1otBBMh6uIi6ABz5xYXhpfpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132433; 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=BUf4zjJmLeuQ9h21FN4/btHO8MJymeV2N9cZXKMb/qY=; b=gb8p0YiknxKM9Por4G2nQK5w2+44/lOuPKwaym/F0kCmseScHvzATfkHRg6CFnxqyy3XgNDbviJBdL1yCFL6z+PZVkGSG39STWds5mNRpaQwBM0TgGxJxZ3biRELfbGGk6hkaWhqCqz3cb+dwqezyuH+ihYLUEQ6b62Q9X0I64k= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177713243361926.41965299451624; Sat, 25 Apr 2026 08:53:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIm-00085q-BF; Sat, 25 Apr 2026 11:52:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIV-00080c-8A for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIS-00012i-EA for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:51:58 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 9DCBE600AE; Sat, 25 Apr 2026 15:51:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5973C2BCB0; Sat, 25 Apr 2026 15:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132315; bh=WKjvKh3WS9aFV3WDMKRIHdU/l7XY2HCHrBoFujAWcmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IuK9+2/Kzv45kxn55JGrCq2cK4wb6wfaKmO2Zt3ZifjomNPOXTKPSltJ7/5zeEA6c NYgV1Dc7mnTo6TGRrc9730Nhd6GYYITELtdgFEGQ6nDnHchwr6ZHqqKZfbYH4XeLkX kYS2ofre6hPRXDuahN+rRSRojBdrVh5Grcastj5HrchKMsbZtzkhYUm2GMGXPqeyBV rM6Rz7n4aFevTHG5GxRq1dCMVqLm/Tp4CNwFlCWsZwLEAUAf1bNuk3WLZMgAINf1LO PYTb2N6e9wWQLC4om8b5mYhloRx8OBPJrVFN1FA0359MtjJ06HaLJwdpNg3n5Jb3Fe NFwZkhkM6qkmg== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 06/14] linux-user/arm/nwfpe: Use thread-local storage for qemufpa Date: Sat, 25 Apr 2026 17:51:32 +0200 Message-ID: <20260425155140.50186-7-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.105.4.254; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132435402154100 From: Richard Henderson Fix the thread safety of the emulation by not storing a pointer in global storage. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Helge Deller --- linux-user/arm/nwfpe/fpa11.c | 3 +-- linux-user/arm/nwfpe/fpa11.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c index 44783934b2..15888463f7 100644 --- a/linux-user/arm/nwfpe/fpa11.c +++ b/linux-user/arm/nwfpe/fpa11.c @@ -29,7 +29,7 @@ //#include =20 =20 -FPA11* qemufpa =3D NULL; +__thread FPA11* qemufpa =3D NULL; =20 /* Reset the FPA11 chip. Called to initialize and reset the emulator. */ void resetFPA11(void) @@ -154,7 +154,6 @@ void SetRoundingPrecision(const unsigned int opcode) } =20 /* Emulate the instruction in the opcode. */ -/* ??? This is not thread safe. */ unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa) { unsigned int nRc =3D 0; diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h index 20f9d2eb81..659d38ae3a 100644 --- a/linux-user/arm/nwfpe/fpa11.h +++ b/linux-user/arm/nwfpe/fpa11.h @@ -74,7 +74,7 @@ typedef struct tagFPA11 { float_status fp_status; /* QEMU float emulator status */ } FPA11; =20 -extern FPA11* qemufpa; +extern __thread FPA11* qemufpa; =20 void resetFPA11(void); void SetRoundingMode(const unsigned int); --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132401; cv=none; d=zohomail.com; s=zohoarc; b=MU7/kO5vVXgd/x+ajOCAFVJ9KIKBleb/NHVqn61hVE6cl2u8cBn2nI92j/hoYmYgxP4s/eg98lhlvvQ7HJIg/J0uEzZsfNeCNIa7zFViPyeIKrVpPDe5z5rPIXS0KyLa/zxG+z7ia16KTviKd1LEF85PTnMtOwgC7kTM5ikADnA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132401; 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=7nxzd6lhlL4G63Vg6wkHD2EFfDYs0ZikecNfZHj7pCE=; b=nvCvAUVgG5FUnEzdpVgNkfgP3kOb7qlYV6CWpaHe7GHHOej1VrTptk0pOs6N+6ZNX0Y/drnBrD5jjQ3k+5t60foXLyVHmuvkUzodyOiGUPORDlVjM1b9yKEOB7vgajXCcDSAUvdTUrtpyaCqUwMS4UXvv+tSq5zQNTbSH60OuA4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132401388827.8609396416708; Sat, 25 Apr 2026 08:53:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIn-00086n-Tj; Sat, 25 Apr 2026 11:52:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIW-00081D-T7 for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:04 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIU-000134-6u for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:00 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 54E404042F; Sat, 25 Apr 2026 15:51:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C58D1C2BCB4; Sat, 25 Apr 2026 15:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132317; bh=wru9oPkln2hoGe2ulS/uGq6EqHcd0/+fKmWJSpYsnvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1RsGV8oo/rAr1UgOsZOiITn3jOafcV0/Z4nmwUEkDV6KNM0OqlO5v/g0dtJtGMy0 h/PHZRDsT++8XE2v396WSTDBzNSa8I2FMmEeaaTr4eQwH8jKm01F9emeIH8YjnstHO sGVObbtreD0g0IEdo60JrnZfEhCGL6YYjF/S37czPu5pVY193GyN96LM+UYBG/I+GL FCXDngOGd9X7Za/T8pQrLt8QkzaFNiZ+juC8G2V+F+yeAlsaWp6ctSxbS7FIOcFHK0 TICBSULdH8PugUGUHycoCqjC+YmclQJbmWWc6aMZXIfS285vN6PmLYANU0bwTcntl1 1xO5Nsm67uIZA== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 07/14] linux-user/strace: Use pointer type for read and write values Date: Sat, 25 Apr 2026 17:51:33 +0200 Message-ID: <20260425155140.50186-8-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132402024158500 Content-Type: text/plain; charset="utf-8" From: Alistair Francis The stack pointer is being truncated as 32-bits for qemu-riscv64, so let's use %p to print the syscall pointer argument. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3238 Signed-off-by: Alistair Francis Reviewed-by: Nutty Liu Signed-off-by: Helge Deller --- linux-user/strace.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index 35f001fecd..6162a407f9 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1114,7 +1114,7 @@ { TARGET_NR_quotactl, "quotactl" , NULL, NULL, NULL }, #endif #ifdef TARGET_NR_read -{ TARGET_NR_read, "read" , "%s(%d,%#x,%d)", NULL, NULL }, +{ TARGET_NR_read, "read" , "%s(%d,%p,%d)", NULL, NULL }, #endif #ifdef TARGET_NR_readahead { TARGET_NR_readahead, "readahead" , NULL, NULL, NULL }, @@ -1674,7 +1674,7 @@ print_syscall_ret_waitpid }, #endif #ifdef TARGET_NR_write -{ TARGET_NR_write, "write" , "%s(%d,%#x,%d)", NULL, NULL }, +{ TARGET_NR_write, "write" , "%s(%d,%p,%d)", NULL, NULL }, #endif #ifdef TARGET_NR_writev { TARGET_NR_writev, "writev" , "%s(%d,%p,%#x)", NULL, NULL }, --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132380; cv=none; d=zohomail.com; s=zohoarc; b=CBv3VuGlH4N+JI7mI5qd1jHVr9Ai98mWhOZ/cY5iuGaq0QrcigaaVNMVDNZkCpVjY65jcxbfM/hBUNo7m49gl5aVz+6SSqP911/u7c5Uim7iUVENuTEXayxDF68uXcd0jwUWi4XjkMq5dJKyeA2HfWAVqpjP8OCS4jVWZpZ1ivw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132380; 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=d77C33jIzCXQQlj+XrIcHnofLm5IvIkaCI0ccUq1HII=; b=icoG7lIe+wiSLLU3Oh3If5r2/9PaKMY82eRLlTYFaBHnOk9DopCAlni9dyDfZJUWbA5W7YZmbK6M2LSu522lnvzYapyRCMo9YFXG37aQf0dUHHg6Tdsl4KpiqhDSIX9MrD2aNh5YsgnjGMd0C2Y2ZAAhARlG0LNmudZIsMZmqtk= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132380129654.0189662716346; Sat, 25 Apr 2026 08:53:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIs-0008Lk-Ex; Sat, 25 Apr 2026 11:52:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIX-00081E-To for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:04 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIW-00014i-8s for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:01 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 5A3F5600AE; Sat, 25 Apr 2026 15:51:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3326C2BCB0; Sat, 25 Apr 2026 15:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132319; bh=ZCgbefl3znT//LnX5C+F02YXGLn7Vtw2haVvLrZdTz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRw2oF8uSH0zjRPXG4XK9EQXZHrPQSjX7RTnD1M3w5fwPKAMhEOpzIip/KZwOLgX4 4+8vV/sFJruvkp8JTUTBIgtmWY6q6E/QgSHkPBzJDYuH9w2kvMHiYK5bA9knmyTp+w LTdxO3FYmb4rDPiyUZSp8qx9B12GgohGXr0RKwAHAPug64Zt54DjQ7/R/atvpBsjO8 Y096AHkKWlnSVscZPI+TlkBfyqrNyQXIBq+xIqW3e0JeciufYOEn3CGU3MQAnUO8zO KS4gX64pDiB3zfBdGCG07Bm5oybkfQlpLqx8nUJZgs54Ow5axUpaW5X6MgcKP4s1Se LigpZSBxZp33A== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 08/14] linux-user/mips: sync k0 TLS for EF_MIPS_MACH_OCTEON userlands Date: Sat, 25 Apr 2026 17:51:34 +0200 Message-ID: <20260425155140.50186-9-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132380715154101 Content-Type: text/plain; charset="utf-8" From: James Hilliard Cavium Octeon userspace is not following a generic MIPS Linux TLS ABI rule here. Older Octeon glibc uses the k0 register as the fast thread pointer, while newer Octeon2 and Octeon3 glibc variants use the normal rdhwr $29 path. linux-user already updates CP0_UserLocal for cpu_set_tls() and TARGET_NR_set_thread_area, but it does not keep gpr[26] synchronized. That leaves EF_MIPS_MACH_OCTEON userlands able to complete set_thread_area() and still reach pthread startup or pthread_self() with a stale k0 value. Use the existing MIPS ELF machine flags from linux-user/elfload.c and mirror CP0_UserLocal into gpr[26] only for EF_MIPS_MACH_OCTEON. Signed-off-by: James Hilliard Reviewed-by: Richard Henderson Signed-off-by: Helge Deller --- linux-user/elfload.c | 3 +++ linux-user/mips/target_cpu.h | 5 +++++ linux-user/qemu.h | 1 + linux-user/syscall.c | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 59b543f740..0e757787d2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1476,6 +1476,9 @@ static void load_elf_image(const char *image_name, co= nst ImageSource *src, /* Usual start for brk is after all sections of the main executable. */ info->brk =3D TARGET_PAGE_ALIGN(hiaddr + load_bias); info->elf_flags =3D ehdr->e_flags; +#ifdef TARGET_MIPS + info->use_k0_tls =3D (ehdr->e_flags & EF_MIPS_MACH) =3D=3D EF_MIPS_MAC= H_OCTEON; +#endif =20 prot_exec =3D PROT_EXEC; #ifdef TARGET_AARCH64 diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index c375616c55..2bbd0a81c5 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -35,7 +35,12 @@ static inline void cpu_clone_regs_parent(CPUMIPSState *e= nv, unsigned flags) =20 static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls) { + TaskState *ts =3D get_task_state(env_cpu(env)); + env->active_tc.CP0_UserLocal =3D newtls; + if (ts->info->use_k0_tls) { + env->active_tc.gpr[26] =3D newtls; + } } =20 static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index cfe5f45fc4..7f98fb2607 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -65,6 +65,7 @@ struct image_info { uint32_t note_flags; =20 #ifdef TARGET_MIPS + bool use_k0_tls; int fp_abi; int interp_fp_abi; #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f4b74ad350..8e96cc26db 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -13216,7 +13216,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, #ifdef TARGET_NR_set_thread_area case TARGET_NR_set_thread_area: #if defined(TARGET_MIPS) - cpu_env->active_tc.CP0_UserLocal =3D arg1; + cpu_set_tls(cpu_env, arg1); return 0; #elif defined(TARGET_I386) && defined(TARGET_ABI32) return do_set_thread_area(cpu_env, arg1); --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132408; cv=none; d=zohomail.com; s=zohoarc; b=ksrdgtZCCsXjohWfgMH2Hkcyk+lqfgzzdCOaKp4gCO6BRavbQYrGmArm299tP6PJVQQFDQ25Asd/+k4MJTIM/A8MDfVpb7oE4DZqMPnSbokoM1JwK7OzZn54W/rJBQ+yxffcyxK/jfBdbYLxff5NuYn+yarfE4IUMyjSmZigyOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132408; 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=k8wB79k77jfiScPuqo400Ox7fQ3uCc5qqOQvfhlFdAQ=; b=OSFQkTyKAEjHP2wr6c1pD6A4+H+SzxpBU7DbmzFyPIwx0YU4+RfUgP/inlJzRmgRqIy/MO9iLB4E/LavX9M2zSK88kaxFyLBy4FBE8IXuC8IP8tukAcaixSc2jXI9rhqU1pIcypZWW+PEUW617WoQpU/7LK2TWcHhA+vqKFT5DQ= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177713240865956.131341063089735; Sat, 25 Apr 2026 08:53:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIo-00086p-2C; Sat, 25 Apr 2026 11:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIa-00081O-Ca for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:08 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIY-00016s-78 for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:04 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 11CFD41843; Sat, 25 Apr 2026 15:52:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80C8AC2BCB4; Sat, 25 Apr 2026 15:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132320; bh=KG2fwHQvDISByslvVy41WuAySIFV/sri4ZntnBzQCgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uYvaS7ALkpAWjUdgrOOZBg0yir2DziDyj5/pZKfqtaECMFbd8hvFEPnrVzUdENcCg 4ZvnjVf0OlxTcUZyM7zWOEY3AnqdEGb7gBg1MM/EZTQckKutVpE3Z908A1N2PjGpkM vlDyZNYzRHYz1aLyu9a6rFeR0OchegkW4VOUvlQewsJfJjjkmxv6FmElw/pMVUvMJp 0mQb8da5v0Cvin2PKryOxCBCNKT4cnfsd3KuoM1kkgWOr8oZfN/tXOoAoEVuGWBUaz ZYZZe0//USeI2olhSNwqiawdnc0rvPdIvNupJ8D10weq/0+7abvoVIXmMcuh99qPXq eJNgwgRARU1xA== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 09/14] linux-user: Define SO_TIMESTAMP*_NEW and SO_RCVTIMEIO_NEW Date: Sat, 25 Apr 2026 17:51:35 +0200 Message-ID: <20260425155140.50186-10-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132410029158500 Content-Type: text/plain; charset="utf-8" From: Helge Deller Define the entries which always use the 64-bit timestamps. Signed-off-by: Helge Deller --- linux-user/alpha/sockbits.h | 7 +++++++ linux-user/generic/sockbits.h | 8 ++++++++ linux-user/hppa/sockbits.h | 7 +++++++ linux-user/mips/sockbits.h | 7 +++++++ linux-user/sparc/sockbits.h | 7 +++++++ 5 files changed, 36 insertions(+) diff --git a/linux-user/alpha/sockbits.h b/linux-user/alpha/sockbits.h index d54dc98c09..0201ab9374 100644 --- a/linux-user/alpha/sockbits.h +++ b/linux-user/alpha/sockbits.h @@ -75,6 +75,13 @@ /* Instruct lower device to use last 4-bytes of skb data as FCS */ #define TARGET_SO_NOFCS 43 =20 +#define TARGET_SO_TIMESTAMP_NEW 63 +#define TARGET_SO_TIMESTAMPNS_NEW 64 +#define TARGET_SO_TIMESTAMPING_NEW 65 + +#define TARGET_SO_RCVTIMEO_NEW 66 +#define TARGET_SO_SNDTIMEO_NEW 67 + /* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefo= re we * have to define SOCK_NONBLOCK to a different value here. */ diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index b3b4a8e44c..33e6c3a572 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -58,4 +58,12 @@ =20 #define TARGET_SO_PROTOCOL 38 #define TARGET_SO_DOMAIN 39 + +#define TARGET_SO_TIMESTAMP_NEW 63 +#define TARGET_SO_TIMESTAMPNS_NEW 64 +#define TARGET_SO_TIMESTAMPING_NEW 65 + +#define TARGET_SO_RCVTIMEO_NEW 66 +#define TARGET_SO_SNDTIMEO_NEW 67 + #endif diff --git a/linux-user/hppa/sockbits.h b/linux-user/hppa/sockbits.h index 23f69a3293..2304dbbf79 100644 --- a/linux-user/hppa/sockbits.h +++ b/linux-user/hppa/sockbits.h @@ -67,6 +67,13 @@ =20 #define TARGET_SO_CNX_ADVICE 0x402E =20 +#define TARGET_SO_TIMESTAMP_NEW 0x4038 +#define TARGET_SO_TIMESTAMPNS_NEW 0x4039 +#define TARGET_SO_TIMESTAMPING_NEW 0x403A + +#define TARGET_SO_RCVTIMEO_NEW 0x4040 +#define TARGET_SO_SNDTIMEO_NEW 0x4041 + /* TARGET_O_NONBLOCK clashes with the bits used for socket types. Therefo= re we * have to define SOCK_NONBLOCK to a different value here. */ diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 562cad88e2..1f479d54aa 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -71,6 +71,13 @@ #define TARGET_SO_RCVBUFFORCE 33 #define TARGET_SO_PASSSEC 34 =20 +#define TARGET_SO_TIMESTAMP_NEW 63 +#define TARGET_SO_TIMESTAMPNS_NEW 64 +#define TARGET_SO_TIMESTAMPING_NEW 65 + +#define TARGET_SO_RCVTIMEO_NEW 66 +#define TARGET_SO_SNDTIMEO_NEW 67 + /** sock_type - Socket types * * Please notice that for binary compat reasons MIPS has to diff --git a/linux-user/sparc/sockbits.h b/linux-user/sparc/sockbits.h index 0a822e3e1f..42ecfdc8f9 100644 --- a/linux-user/sparc/sockbits.h +++ b/linux-user/sparc/sockbits.h @@ -61,6 +61,13 @@ #define TARGET_SO_TIMESTAMPING 0x0023 #define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING =20 +#define TARGET_SO_TIMESTAMP_NEW 0x0046 +#define TARGET_SO_TIMESTAMPNS_NEW 0x0042 +#define TARGET_SO_TIMESTAMPING_NEW 0x0043 + +#define TARGET_SO_RCVTIMEO_NEW 0x0044 +#define TARGET_SO_SNDTIMEO_NEW 0x0045 + #define TARGET_SO_RXQ_OVFL 0x0024 =20 #define TARGET_SO_WIFI_STATUS 0x0025 --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132365; cv=none; d=zohomail.com; s=zohoarc; b=hNSPBlUJ8bYqNMWFJno/kvkrWAdjhIfY3wjfYSW3AVYzAYslqlPznG9p9G+lkgkH0D07J4Yc/+SeT9QLbTh4RVpEYyWEb3tt+nLsvAZRIIXzHGmOprlcKhGPclEPwrOsDF2zTCEKon6rKvT8zo3+cT1dhPjlslvyAazOVgs6Ei8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132365; 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=UoCl3WIROChkNJUr+WLkhWYMlBYiLW8U1i1t5meFcE4=; b=OD9BiRWcmQWKGwp/daFR4VA5nTs7NYLiagSeqUW8NnmPCF/a2kLsnA4xO2qKycboWYLFQfCRnt24HRSxcOJyAgG9JAh3H3M8amle9/3aYMxfvYwgTj/UQu4F13JrRSJDgvyqF28xD/AtaRVP5zcbvMX33+gkrJwC6b/Cxw4P4+8= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132365359289.82973769967725; Sat, 25 Apr 2026 08:52:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIt-0008N0-0H; Sat, 25 Apr 2026 11:52:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIb-00081P-Ej for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:08 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIa-000172-0E for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:05 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 1717C600AE; Sat, 25 Apr 2026 15:52:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EDC3C2BCB0; Sat, 25 Apr 2026 15:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132322; bh=vV5gAp6A1fV7/G4QQ1bgHmKV5IUIINSjN34lG8oX+zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZDmHNiZxF2b2V/Iu+W/EmrnnRzgYHf9LXQqdTpD5FjH25/yHkP5+xyUNolE9VxRe4 HhdGxj8pvBVp699a0PRSz996tq1PT0FcvatIN/N73TBp+8wsP1udJl8iPbw3BugRwL gmn1L2nIR9NHakFIZyQEymzGDhbD6ESuMNAXHVKxWecVP6E7GH67xyK9jN3WUTCtTj bAMQZptSt3ainM2q/IrB0rTz1Z+IPeyDqF6eKn/FQN3vs5Wg/IuqPH6trq5z103oPE xk6l/8twNjaA7aqPVt8LUbVx6m2ofblAhbA/FJUQVBqVWEAU7OzrSfyA77wJ9F1aUC mh6YoIopL0CLg== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/14] linux-user: Add setsockopt() for SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW Date: Sat, 25 Apr 2026 17:51:36 +0200 Message-ID: <20260425155140.50186-11-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132366120158501 Content-Type: text/plain; charset="utf-8" From: Helge Deller Add handlers for both sockopts which use 64-bit time_t from userspace. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/885 Signed-off-by: Helge Deller --- linux-user/syscall.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8e96cc26db..751e6eabe5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1143,7 +1143,6 @@ static inline abi_long copy_to_user_timeval(abi_ulong= target_tv_addr, return 0; } =20 -#if defined(TARGET_NR_clock_adjtime64) && defined(CONFIG_CLOCK_ADJTIME) static inline abi_long copy_from_user_timeval64(struct timeval *tv, abi_ulong target_tv_addr) { @@ -1160,7 +1159,6 @@ static inline abi_long copy_from_user_timeval64(struc= t timeval *tv, =20 return 0; } -#endif =20 static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr, const struct timeval *tv) @@ -2391,6 +2389,25 @@ static abi_long do_setsockopt(int sockfd, int level,= int optname, &tv, sizeof(tv))); return ret; } + case TARGET_SO_RCVTIMEO_NEW: + case TARGET_SO_SNDTIMEO_NEW: + { + struct timeval tv; + + if (optlen !=3D sizeof(struct target__kernel_sock_timeval)= ) { + return -TARGET_EINVAL; + } + + if (copy_from_user_timeval64(&tv, optval_addr)) { + return -TARGET_EFAULT; + } + + ret =3D get_errno(setsockopt(sockfd, SOL_SOCKET, + optname =3D=3D TARGET_SO_RCVTIMEO_NEW ? + SO_RCVTIMEO : SO_SNDTIMEO, + &tv, sizeof(tv))); + return ret; + } case TARGET_SO_ATTACH_FILTER: { struct target_sock_fprog *tfprog; --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132397; cv=none; d=zohomail.com; s=zohoarc; b=jOTuwXtjddTcfXNgyhatK4GnU7u4n8WqeshtH43ndb9eHpvyI1Y+rxhYf4iZxvJvzsq9vAzt/xuLRp98mBSsdrK0onCuvP5I9KknxBMGjLctBfbANrYX2IbFRdSDo2iHS6UoYcRhCfTzeIO/G2p4kDG5XmLCVqwjV62Q40RtM50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132397; 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=4YmrgKweIhOywPMn7gGpQ4iHsV9AZmpQkpUFAZcfOFc=; b=NNcfBIaRD2zexOh0L2MgffS7zCYbjIbyWK3tzSEwHbgefey+YiKPSDKIbDuxu7Qz3cFkg7YgPhkBlcGKFtwH7Pn+cjTabNWjqMoHDvp1KDpADTpZUU1qWZQW88/kwd2SYZA98/aWZs8W06cYcEx6xlZ50Bln89Z9raSSmfw5bRU= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132397003330.0686979703912; Sat, 25 Apr 2026 08:53:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIs-0008LI-9i; Sat, 25 Apr 2026 11:52:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfId-00081S-5h for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:08 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIb-00017D-Ki for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:06 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id C0FA443D22; Sat, 25 Apr 2026 15:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DFA4C2BCB0; Sat, 25 Apr 2026 15:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132324; bh=9XG9CSjH8eRrdK70JCXl+tYP+K497/Yv9bzjW1OONfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFMs8c9IhZuZNcUxy9mJf7CvYCrnJGI1/Dp9TCzeTDeuJ9gRAw7vfyKN80libJCXK kcH/9Z/R4+YVi6pLHbT+B7znM3uhoUX9ix2CbXkSnDRM1lVXK3sE0YnfJhg32HaYbj S5TN9pEPVPkSP5ByD201vC2NoVdy+ZPASS1uB3AFWa6WSjiTZ7tlrBbGcK4YGEsZeE Yi4Mp2U1FR1zjZeozIjpuE81LHUhVxwrdoWUDR5vczWu+jvPiDruBulI9w7wa7cxdZ fnIaX13Lyw7cfCCOvIL0hRblYMn9Sbvjgxm8eUbJwF1SXULQgGbkLiF7JCBCysSKk7 xn06BhJYd5ymg== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/14] linux-user: Add getsockopt() for SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW Date: Sat, 25 Apr 2026 17:51:37 +0200 Message-ID: <20260425155140.50186-12-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132397956158500 Content-Type: text/plain; charset="utf-8" From: Helge Deller Add handlers for both sockopts which use 64-bit time_t from userspace. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/885 Signed-off-by: Helge Deller --- linux-user/syscall.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 751e6eabe5..d0390e04b4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2621,7 +2621,8 @@ static abi_long do_getsockopt(int sockfd, int level, = int optname, /* These don't just return a single integer */ case TARGET_SO_PEERNAME: goto unimplemented; - case TARGET_SO_RCVTIMEO: { + case TARGET_SO_RCVTIMEO: + case TARGET_SO_RCVTIMEO_NEW: { struct timeval tv; socklen_t tvlen; =20 @@ -2641,11 +2642,17 @@ get_timeout: if (ret < 0) { return ret; } - if (len > sizeof(struct target_timeval)) { - len =3D sizeof(struct target_timeval); - } - if (copy_to_user_timeval(optval_addr, &tv)) { - return -TARGET_EFAULT; + if (len =3D=3D sizeof(struct target__kernel_sock_timeval)) { + if (copy_to_user_timeval64(optval_addr, &tv)) { + return -TARGET_EFAULT; + } + } else { + if (len >=3D sizeof(struct target_timeval)) { + len =3D sizeof(struct target_timeval); + if (copy_to_user_timeval(optval_addr, &tv)) { + return -TARGET_EFAULT; + } + } } if (put_user_u32(len, optlen)) { return -TARGET_EFAULT; @@ -2653,6 +2660,7 @@ get_timeout: break; } case TARGET_SO_SNDTIMEO: + case TARGET_SO_SNDTIMEO_NEW: optname =3D SO_SNDTIMEO; goto get_timeout; case TARGET_SO_PEERCRED: { --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132393; cv=none; d=zohomail.com; s=zohoarc; b=U/HpxMDALXdWHfITbm520DqZzwxyplfxbr60qOOgaaTjYEQfrWMr4lKa2ZvKpeLtJo0U1WdPICHCWjyN6REFK9aourNF1+uo9exGQf2mZXqbLwl7XFgt+UtK3/dFTiSIuWaVJpJxPuLOYDFnFlrn7zRoqCSH+uNnkOs7vXF5bUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132393; 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=iAUeb3Q/JSVu719SIBCxc6dUbkhvHmKTvGScRw3PFus=; b=aJ74U/K3Du0Pp0ekTAzLv2gF/aZjTItFM3Uhoo4cBrRv8Z82xDn5dxgxu8v4iJWFGrBUqEiTGM2Dpbf6AObb0vFRDdDfcg2LJ7nSW00NiDZfWfWlYdUDbwbvO2jUyvqwFDaDrcHQJbWyR8cihvHs8Tmuy9VzR8zZ8GR27yaieho= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17771323938731010.8437036287784; Sat, 25 Apr 2026 08:53:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIo-00087F-Gq; Sat, 25 Apr 2026 11:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIf-00083q-8B for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:12 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfId-00017Q-P7 for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:09 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C861B600AE; Sat, 25 Apr 2026 15:52:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B8C1C2BCB0; Sat, 25 Apr 2026 15:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132326; bh=z9prjR+BocYciwsUKoSOvL3HoAICSfSydNGV4GRnsv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KqWvbJHl80trkUc/MsAqtszv5fo7gAGlaSVduhY/iPvFSfQ8nJo5UOYCdE0mYdh7H eZEQ6mJ+jVUFsw+TskVH6Id+g+Edz2mmqv/K8cEHe6OBJvOZX+c1a/MjT87pAZnx8e JuDzsiliLJnS7nsfv58tNJXGB1ejf1ij001nwqnZUM7D9/MKAs8Sc0oE6aMyWPHogN nxRPnh8SFpqf7afqQHeHLAz4Sh+8ecRCrIUGJi4pCnm8+01CaNiZmGN9BOrK5e5b6u 28Ybpvi1D4YkotnvNfRRviGtR29tsDHzt96mLG9zae3xXjHiu0nO3cUFVDWC2hp1OB SrqP+Cs/vtP+g== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 12/14] linux-user: Fix CLONE_PARENT_SETTID when using fork-like clone Date: Sat, 25 Apr 2026 17:51:38 +0200 Message-ID: <20260425155140.50186-13-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132397048154100 Content-Type: text/plain; charset="utf-8" From: Helge Deller The CLONE_PARENT_SETTID option requires the implementation to store the child thread ID at the location pointed to by parent_tid in the parent's memory. Fix our implementation and move the code from the client side (where fork returned 0), to the parent side and store the return value from the fork call (which is the client TID) in the parent_tid pointer. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3340 Signed-off-by: Helge Deller Reviewed-by: Peter Maydell --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d0390e04b4..910a4da0a6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7050,8 +7050,6 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, the child process gets its own copy of the lock. */ if (flags & CLONE_CHILD_SETTID) put_user_u32(sys_gettid(), child_tidptr); - if (flags & CLONE_PARENT_SETTID) - put_user_u32(sys_gettid(), parent_tidptr); ts =3D get_task_state(cpu); if (flags & CLONE_SETTLS) cpu_set_tls (env, newtls); @@ -7059,6 +7057,8 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, ts->child_tidptr =3D child_tidptr; } else { cpu_clone_regs_parent(env, flags); + if (flags & CLONE_PARENT_SETTID) + put_user_u32(ret, parent_tidptr); if (flags & CLONE_PIDFD) { int pid_fd =3D 0; #if defined(__NR_pidfd_open) && defined(TARGET_NR_pidfd_open) --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132376; cv=none; d=zohomail.com; s=zohoarc; b=KNcynC9Hoz2qXgg/zVuG79xa8y1oQQPizWz/8adt4zSBXUU7M/oejUentgcz673gH2xWDhHQi+xYnM5QHceu6iezCxqj0RpWPErhR9dQfc4yphTWwJKeVYN0KBWEmEcU5ly1Ce+eLDYdGUTrWs39FCG5o2HBktFc4pw9eDIVLso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132376; 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=dwCdhjBe1u2enLQ7GE8O074qf3LgsuZ4K2Vt21ZZfms=; b=R/g3HAZDiFkHchB+ARi4ngHH2aSeJYMFIEBM7lXtljkXDdCqJLi363iWA+VvksthBwyuhhhAp8iQ5kEnGrFzDBgctJLPERtZh87gEloHrjzqDGEoDUbs9YP1E50Whpycoi2X5jxg4yu5Azeg3Bst8nd0xt0hburGm7gGt8dEuJE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777132376112521.2933508796986; Sat, 25 Apr 2026 08:52:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIn-00086m-Lg; Sat, 25 Apr 2026 11:52:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIi-000844-2m for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:12 -0400 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIg-00017d-7A for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:11 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A687D600CB; Sat, 25 Apr 2026 15:52:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDC63C2BCB0; Sat, 25 Apr 2026 15:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132328; bh=srPndtwvrTUYJ7OM9qm9DxiqBEi9dXm+PHtlQXIamDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVUgxrIqCXvRTxOCZubUbaR2+OGtt/yhIBc/0TJc0laKxyuQh1uIuXOTrA0QTbIF2 dpsjt+4xYPMsW/USokswPOvHgZbuiP/jnLwIpdYdRVOaNYAj39wSXucHF4OnyMGDuF 5PG8aZaIiwNPxOboi+Yw1IhoJwhbNHsPlWB91K49yFKDnlYOZiBXQAie0qADOzWlzy 5oZgoMW2WdFbDHW+IUYF/pYaiKRBlGMev46TP2l7d2egPZfKaIPIE/ylkDyPwIQve+ tbKYkb4I3Bc/aIN+d3yUC4eCxnqOF7N2WTwg487olB7kTqkf/Osh1+x9cboB5CRBPY 4El9FqU4ohBEA== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 13/14] linux-user: Use abi_int for imr_ifindex in ip_mreqn struct Date: Sat, 25 Apr 2026 17:51:39 +0200 Message-ID: <20260425155140.50186-14-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=172.105.4.254; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132376610154100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Peter Hartley noticed, that in the qemu code the imr_ifindex member of struct target_ip_mreq needs to be of type "int" instead of "long", which is what the Linux kernel uses on all architectures. Adjust the type accordingly, and add a QEMU_BUILD_BUG_ON() checker to prevent such issues in the future. This change should fix multicast issues when using hosts and guests with different endianess or bit size. Reported-by: Peter Hartley Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2553 Signed-off-by: Helge Deller --- linux-user/syscall.c | 2 ++ linux-user/syscall_defs.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 910a4da0a6..4594909242 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2161,6 +2161,8 @@ static abi_long do_setsockopt(int sockfd, int level, = int optname, =20 QEMU_BUILD_BUG_ON(sizeof(struct ip_mreq) !=3D sizeof(struct target_ip_mreq)); + QEMU_BUILD_BUG_ON(sizeof(struct ip_mreqn) !=3D + sizeof(struct target_ip_mreqn)); =20 if (optname =3D=3D IP_MULTICAST_IF) { min_size =3D sizeof(struct in_addr); diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 6967306be4..5799769f83 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -210,7 +210,7 @@ struct target_ip_mreq { struct target_ip_mreqn { struct target_in_addr imr_multiaddr; struct target_in_addr imr_address; - abi_long imr_ifindex; + abi_int imr_ifindex; }; =20 struct target_ip_mreq_source { --=20 2.53.0 From nobody Mon May 25 13:47:55 2026 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1777132375; cv=none; d=zohomail.com; s=zohoarc; b=IPE/Twt+L5CrarwW/0R7knfv98uaZ13Zunvhp28o1wCxN7BlC0Y5VGmpSUnJXRKL8KnhfhOrNOIZS1VOATch4WOohk9IlAUQJdPfkG0XSCv0C1264wFwKRJ8FqJb368X6r4h7ZBBhD8ivPYi5wjVvOH/f1zdlpddPVYNEV6shmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777132375; 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=VdslDAgwKLUM3XSx1yPnR4k9zQngtoTduY8JCxrOAzY=; b=W7nOsC1RvYtOX/TV9F3UxBTd8ER/0b6n6tdJHnII6vl2DQgBSs2UcbCZdND7D3jRMG3eC2msaQH2Y+ChW942lxjI0b0NOPqwm5dOFWWvVmm29yenvZQOPVh5iB9jyFvv1gVLBjMkHR/eIgAWizcSA80wajW5qf5kLhq1LQHbYeE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177713237551761.629251207128846; Sat, 25 Apr 2026 08:52:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wGfIp-0008BU-Oz; Sat, 25 Apr 2026 11:52:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIj-000859-8w for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:14 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wGfIh-00017q-SA for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:13 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 86198600AE; Sat, 25 Apr 2026 15:52:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD6E8C2BCB4; Sat, 25 Apr 2026 15:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777132330; bh=Y2jfW2n5SXWlVYI4a1aoFFMe9VI36vJwyPaPM10gar0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnxSsUqIuyFwofMX9yI4tfuVxCbT5qSbnIIoHms5dAdDdr1YGquNqVSz7HmPhnNjh AQFIlIywA7ATqHLup4F4F9UyHCctMEgl5F5fMIZhqMbAqE1trbyg/TGnv9ca74SIoe 2bAAMkCoUV+30/HICDOiX6TZHlJYBGeArYaLpgfUcikJkXCee+9HWSfrgThJGCZbPD OPc6J35y+tWqYs8Zu3P/1HX0i2BIltmIrsBMRilEYbYRL6G6HJP0q4NY0UNv1cb6Rl F/M0EBanaE1bI1sdivYeJCNFnnJBs73ntGOhc/gVdrqXhoyIkcwYe+Czm/t/54aQag QrCev55gAVnzw== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Jiaxun Yang , Laurent Vivier , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 14/14] linux-user: Flush errors by using exit() instead of _exit() in error path Date: Sat, 25 Apr 2026 17:51:40 +0200 Message-ID: <20260425155140.50186-15-deller@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260425155140.50186-1-deller@kernel.org> References: <20260425155140.50186-1-deller@kernel.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development 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 @kernel.org) X-ZM-MESSAGEID: 1777132375866158500 Content-Type: text/plain; charset="utf-8" From: Helge Deller Qemu user mode does not properly flushes error messages related to bad arguments when exiting (at least when the output is piped to a file instead of running on a terminal). Ensure that we always flush by using exit() instead of _exit(). Reported by: Tobias Bergkvist Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2544 Signed-off-by: Helge Deller --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index c49d1e91d2..84e110dfe9 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -767,7 +767,7 @@ int main(int argc, char **argv, char **envp) execfd =3D open(exec_path, O_RDONLY); if (execfd < 0) { printf("Error while loading %s: %s\n", exec_path, strerror(err= no)); - _exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } =20 --=20 2.53.0