From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070206047979.6105562566958; Mon, 2 Feb 2026 14:10:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25n-0004mw-HS; Mon, 02 Feb 2026 17:08:23 -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 1vn25i-0004m4-5R; Mon, 02 Feb 2026 17:08:18 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25g-0002YB-BY; Mon, 02 Feb 2026 17:08:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9F4801852AE; Tue, 03 Feb 2026 01:07:31 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 7C8F635B3C1; Tue, 03 Feb 2026 01:08:13 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Andrew Cooper , Paolo Bonzini , Michael Tokarev Subject: [Stable-10.2.1 01/56] target/i386: Fix #GP error code for INT instructions Date: Tue, 3 Feb 2026 01:07:06 +0300 Message-ID: <20260202220805.945271-1-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070208081158500 Content-Type: text/plain; charset="utf-8" From: Andrew Cooper While the (intno << shift) expression is correct for indexing the IDT based= on whether Long Mode is active, the error code itself was unchanged with AMD64, and is still the index with 3 bits of metadata in the bottom. Found when running a Xen unit test, all under QEMU. The unit test objected= to being told there was an error with IDT index 256 when INT $0x80 (128) was t= he problem instruction: ... Error: Unexpected fault 0x800d0802, #GP[IDT[256]] ... Fixes: d2fd1af76777 ("x86_64 linux user emulation") Signed-off-by: Andrew Cooper Link: https://lore.kernel.org/r/20250312000603.3666083-1-andrew.cooper3@cit= rix.com Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3160 Signed-off-by: Paolo Bonzini (cherry picked from commit 60efba3c1bff0d78632d45c2dc927c5bc7a17ba8) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/user/seg_helper.c b/target/i386/tcg/user/seg_h= elper.c index 263f59937f..28bbef1bba 100644 --- a/target/i386/tcg/user/seg_helper.c +++ b/target/i386/tcg/user/seg_helper.c @@ -63,7 +63,7 @@ static void do_interrupt_user(CPUX86State *env, int intno= , int is_int, cpl =3D env->hflags & HF_CPL_MASK; /* check privilege if software int */ if (dpl < cpl) { - raise_exception_err(env, EXCP0D_GPF, (intno << shift) + 2); + raise_exception_err(env, EXCP0D_GPF, intno * 8 + 2); } } =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070391711398.72506851062747; Mon, 2 Feb 2026 14:13:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25p-0004oC-1a; Mon, 02 Feb 2026 17:08:25 -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 1vn25j-0004mN-7b; Mon, 02 Feb 2026 17:08:22 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25h-0002YT-DK; Mon, 02 Feb 2026 17:08:18 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D5E3C1852AF; Tue, 03 Feb 2026 01:07:33 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id A9A6135B3C2; Tue, 03 Feb 2026 01:08:15 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 02/56] target/i386/tcg: ignore V3 in 32-bit mode Date: Tue, 3 Feb 2026 01:07:07 +0300 Message-ID: <20260202220805.945271-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070392654158500 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini From the manual: "In 64-bit mode all 4 bits may be used. [...] In 32-bit and 16-bit modes bit 6 must be 1 (if bit 6 is not 1, the 2-byte VEX version will generate LDS instruction and the 3-byte VEX version will ignore this bit)." Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit 0db1b556e4bcd7a51f222cda9e14850f88fe3f88) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 0f8c5d1693..dfaffec599 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2665,7 +2665,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) goto unknown_op; } } - s->vex_v =3D (~vex3 >> 3) & 0xf; + s->vex_v =3D (~vex3 >> 3) & (CODE64(s) ? 15 : 7); s->vex_l =3D (vex3 >> 2) & 1; s->prefix |=3D pp_prefix[vex3 & 3] | PREFIX_VEX; } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070146546615.1946157799633; Mon, 2 Feb 2026 14:09:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25q-0004q1-Dr; Mon, 02 Feb 2026 17:08:26 -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 1vn25l-0004mU-10; Mon, 02 Feb 2026 17:08:22 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25j-0002Z5-Kn; Mon, 02 Feb 2026 17:08:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F05561852B0; Tue, 03 Feb 2026 01:07:33 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id C347C35B3C3; Tue, 03 Feb 2026 01:08:15 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Alano Song , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 03/56] hw/i2c/imx: Fix trace func name error Date: Tue, 3 Feb 2026 01:07:08 +0300 Message-ID: <20260202220805.945271-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070149381154100 From: Alano Song Signed-off-by: Alano Song Fixes: e589c0ea9c9 ("hw/i2c/imx_i2c: Convert DPRINTF() to trace events") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251218141144.51001-1-AlanoSong@163.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 (cherry picked from commit 3fbadbb3927a92db1932baee0c1188b05c0ac6b1) Signed-off-by: Michael Tokarev diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c index d26177c85d..22b10e4166 100644 --- a/hw/i2c/imx_i2c.c +++ b/hw/i2c/imx_i2c.c @@ -151,8 +151,8 @@ static void imx_i2c_write(void *opaque, hwaddr offset, { IMXI2CState *s =3D IMX_I2C(opaque); =20 - trace_imx_i2c_read(DEVICE(s)->canonical_path, imx_i2c_get_regname(offs= et), - offset, value); + trace_imx_i2c_write(DEVICE(s)->canonical_path, imx_i2c_get_regname(off= set), + offset, value); =20 value &=3D 0xff; =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070148950760.8801104372404; Mon, 2 Feb 2026 14:09:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25o-0004oB-Re; Mon, 02 Feb 2026 17:08:25 -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 1vn25m-0004mY-3I; Mon, 02 Feb 2026 17:08:22 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25k-0002ZL-Ju; Mon, 02 Feb 2026 17:08:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 100EC1852B1; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id DEBBE35B3C4; Tue, 03 Feb 2026 01:08:15 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Ed Tanous , Patrick Williams , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 04/56] tests/functional: Fix URL of gb200nvl-bmc image Date: Tue, 3 Feb 2026 01:07:09 +0300 Message-ID: <20260202220805.945271-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070153779158500 From: C=C3=A9dric Le Goater Commit [1] moved the FW image of the gb200nvl-bmc machine and broke the associated functional test. Fix that. [1] https://github.com/legoater/qemu-aspeed-boot/commit/52451b2472eeb40aa97= e131aeea327e9d4a8a78a Cc: Ed Tanous Cc: Patrick Williams Tested-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/qemu-devel/20251222073351.166720-1-clg@redhat= .com Signed-off-by: C=C3=A9dric Le Goater (cherry picked from commit 75bcfb98a13d14beb2ea95fb3c51da01c7102325) Signed-off-by: Michael Tokarev diff --git a/tests/functional/arm/test_aspeed_gb200nvl_bmc.py b/tests/funct= ional/arm/test_aspeed_gb200nvl_bmc.py index 8e8e3f05c1..e5f2dce0f5 100755 Reviewed-by: Ed Tanous --- a/tests/functional/arm/test_aspeed_gb200nvl_bmc.py +++ b/tests/functional/arm/test_aspeed_gb200nvl_bmc.py @@ -11,7 +11,7 @@ class GB200Machine(AspeedTest): =20 ASSET_GB200_FLASH =3D Asset( - 'https://github.com/legoater/qemu-aspeed-boot/raw/refs/heads/maste= r/images/gb200nvl-obmc/obmc-phosphor-image-gb200nvl-obmc-20250702182348.sta= tic.mtd.xz', + 'https://github.com/legoater/qemu-aspeed-boot/raw/refs/heads/maste= r/images/gb200nvl-bmc/openbmc-20250702182348/obmc-phosphor-image-gb200nvl-o= bmc-20250702182348.static.mtd.xz', 'b84819317cb3dc762895ad507705978ef000bfc77c50c33a63bdd37921db0dbc') =20 def test_arm_aspeed_gb200_openbmc(self): --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070151491883.5363295725667; Mon, 2 Feb 2026 14:09:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25t-0004rV-3U; Mon, 02 Feb 2026 17:08: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 1vn25o-0004nw-5c; Mon, 02 Feb 2026 17:08:24 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25m-0002ZY-Dl; Mon, 02 Feb 2026 17:08:23 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2071A1852B2; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id F25D335B3C5; Tue, 03 Feb 2026 01:08:15 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jie Song , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Tokarev Subject: [Stable-10.2.1 05/56] monitor/qmp: cleanup SocketChardev listener sources early to avoid fd handling race Date: Tue, 3 Feb 2026 01:07:10 +0300 Message-ID: <20260202220805.945271-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070153716154100 From: Jie Song When starting a dummy QEMU process with virsh version, monitor_init_qmp() enables IOThread monitoring of the QMP fd by default. However, a race condition exists during the initialization phase: the IOThread only removes the main thread's fd watch when it reaches qio_net_listener_set_client_func= _full(), which may be delayed under high system load. This creates a window between monitor_qmp_setup_handlers_bh() and qio_net_listener_set_client_func_full() where both the main thread and IOThread are simultaneously monitoring the same fd and processing events. This race can cause either the main thread or the IOThread to hang and become unresponsive. Fix this by proactively cleaning up the listener's IO sources in monitor_init_qmp() before the IOThread initializes QMP monitoring, ensuring exclusive fd ownership and eliminating the race condition. Signed-off-by: Jie Song Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20251125140706.114197-1-mail@jiesong.me> (cherry picked from commit e714f1a3d4d1e66b9a3ff4be1ff999c32bbef29e) Signed-off-by: Michael Tokarev diff --git a/chardev/char-io.c b/chardev/char-io.c index 3be17b51ca..beac5cd245 100644 --- a/chardev/char-io.c +++ b/chardev/char-io.c @@ -182,3 +182,11 @@ int io_channel_send(QIOChannel *ioc, const void *buf, = size_t len) { return io_channel_send_full(ioc, buf, len, NULL, 0); } + +void remove_listener_fd_in_watch(Chardev *chr) +{ + ChardevClass *cc =3D CHARDEV_GET_CLASS(chr); + if (cc->chr_listener_cleanup) { + cc->chr_listener_cleanup(chr); + } +} diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 26d2f11202..3f45dd2ecd 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1570,6 +1570,15 @@ char_socket_get_connected(Object *obj, Error **errp) return s->state =3D=3D TCP_CHARDEV_STATE_CONNECTED; } =20 +static void tcp_chr_listener_cleanup(Chardev *chr) +{ + SocketChardev *s =3D SOCKET_CHARDEV(chr); + if (s->listener) { + qio_net_listener_set_client_func_full(s->listener, NULL, NULL, + NULL, chr->gcontext); + } +} + static void char_socket_class_init(ObjectClass *oc, const void *data) { ChardevClass *cc =3D CHARDEV_CLASS(oc); @@ -1587,6 +1596,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_add_client =3D tcp_chr_add_client; cc->chr_add_watch =3D tcp_chr_add_watch; cc->chr_update_read_handler =3D tcp_chr_update_read_handler; + cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; =20 object_class_property_add(oc, "addr", "SocketAddress", char_socket_get_addr, NULL, diff --git a/include/chardev/char-io.h b/include/chardev/char-io.h index ac379ea70e..540131346d 100644 --- a/include/chardev/char-io.h +++ b/include/chardev/char-io.h @@ -43,4 +43,6 @@ int io_channel_send(QIOChannel *ioc, const void *buf, siz= e_t len); int io_channel_send_full(QIOChannel *ioc, const void *buf, size_t len, int *fds, size_t nfds); =20 +void remove_listener_fd_in_watch(Chardev *chr); + #endif /* CHAR_IO_H */ diff --git a/include/chardev/char.h b/include/chardev/char.h index b65e9981c1..192cad67d4 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -307,6 +307,8 @@ struct ChardevClass { =20 /* handle various events */ void (*chr_be_event)(Chardev *s, QEMUChrEvent event); + + void (*chr_listener_cleanup)(Chardev *chr); }; =20 Chardev *qemu_chardev_new(const char *id, const char *typename, diff --git a/monitor/qmp.c b/monitor/qmp.c index cb99a12d94..7ae070dc8d 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -537,6 +537,11 @@ void monitor_init_qmp(Chardev *chr, bool pretty, Error= **errp) * e.g. the chardev is in client mode, with wait=3Don. */ remove_fd_in_watch(chr); + /* + * Clean up listener IO sources early to prevent racy fd + * handling between the main thread and the I/O thread. + */ + remove_listener_fd_in_watch(chr); /* * We can't call qemu_chr_fe_set_handlers() directly here * since chardev might be running in the monitor I/O --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070232654305.3695637463454; Mon, 2 Feb 2026 14:10:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25r-0004q6-JH; Mon, 02 Feb 2026 17:08: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 1vn25o-0004oI-RZ; Mon, 02 Feb 2026 17:08:24 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25n-0002Zx-Gs; Mon, 02 Feb 2026 17:08:24 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3D9C71852B3; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 0F0BE35B3C6; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Manos Pitsidianakis , Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 06/56] tcg/optimize: Save o_mask in fold_masks_zosa_int Date: Tue, 3 Feb 2026 01:07:11 +0300 Message-ID: <20260202220805.945271-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070234453154100 From: Richard Henderson When adding o_mask to this function, we used it in a couple of places but failed to save it for future use. Also, update a related comment. Cc: qemu-stable@nongnu.org Fixes: 56f15f67ea1 ("tcg/optimize: Add one's mask to TempOptInfo") Reported-by: Manos Pitsidianakis Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson (cherry picked from commit 7d2d577de0c72f3cf2eb43f1534e908070d3bc47) Signed-off-by: Michael Tokarev diff --git a/tcg/optimize.c b/tcg/optimize.c index f69702b26e..1f95da487b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1088,8 +1088,9 @@ static bool fold_masks_zosa_int(OptContext *ctx, TCGO= p *op, =20 ti =3D ts_info(ts); ti->z_mask =3D z_mask; + ti->o_mask =3D o_mask; =20 - /* Canonicalize s_mask and incorporate data from z_mask. */ + /* Canonicalize s_mask and incorporate data from [zo]_mask. */ rep =3D clz64(~s_mask); rep =3D MAX(rep, clz64(z_mask)); rep =3D MAX(rep, clz64(~o_mask)); --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070220474508.90054880512537; Mon, 2 Feb 2026 14:10:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn273-0005X5-IN; Mon, 02 Feb 2026 17:09:42 -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 1vn25r-0004qJ-LZ; Mon, 02 Feb 2026 17:08:27 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25p-0002aL-LJ; Mon, 02 Feb 2026 17:08:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 582A11852B4; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 2B76F35B3C7; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Pierrick Bouvier , Michael Tokarev Subject: [Stable-10.2.1 07/56] tcg/optimize: Fix a_mask computation for orc Date: Tue, 3 Feb 2026 01:07:12 +0300 Message-ID: <20260202220805.945271-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070224534154100 Content-Type: text/plain; charset="utf-8" From: Richard Henderson In computing a_mask, for or, we remove the bits from t1->o_mask which are known to be zero. For orc, the bits known to be zero are the inverse of those known to be one. Cc: qemu-stable@nongnu.org Fixes: cc4033ee47c ("tcg/optimize: Build and use zero, one and affected bit= s in fold_orc") Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson (cherry picked from commit 08b12bfb8f532dbc62e35c31d081ede1aa12098b) Signed-off-by: Michael Tokarev diff --git a/tcg/optimize.c b/tcg/optimize.c index 1f95da487b..db1d89396b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2360,7 +2360,7 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) s_mask =3D t1->s_mask & t2->s_mask; =20 /* Affected bits are those not known one, masked by those known one. */ - a_mask =3D ~t1->o_mask & t2->o_mask; + a_mask =3D ~t1->o_mask & ~t2->o_mask; =20 return fold_masks_zosa(ctx, op, z_mask, o_mask, s_mask, a_mask); } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070132320305.5534906379281; Mon, 2 Feb 2026 14:08:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn25w-0004rw-AP; Mon, 02 Feb 2026 17:08:33 -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 1vn25r-0004qL-Pz; Mon, 02 Feb 2026 17:08:27 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25q-0002ae-A1; Mon, 02 Feb 2026 17:08:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 650CD1852B5; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 4527735B3C8; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 08/56] tcg/optimize: Do use affected bits Date: Tue, 3 Feb 2026 01:07:13 +0300 Message-ID: <20260202220805.945271-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070140934154100 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini We inadvertently disabled affected bits optimizations on operations that use fold_masks_zosa. These happen relatively often in x86 code for extract/sextract; for example given the following: mov %esi, %ebp xor $0x1, %ebp the optimizer is able to simplify the "extract_i64 rbp,tmp0,$0x0,$0x20" produced by the second instruction to a move. Cc: qemu-stable@nongnu.org Fixes: 932522a9ddc ("tcg/optimize: Fold and to extract during optimize") Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251223163720.985578-1-pbonzini@redhat.com> (cherry picked from commit 23b53ec3a8a279cb5acd5e022b464a4272fe9f8c) Signed-off-by: Michael Tokarev diff --git a/tcg/optimize.c b/tcg/optimize.c index db1d89396b..5ae26e4a10 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1103,7 +1103,7 @@ static bool fold_masks_zosa_int(OptContext *ctx, TCGO= p *op, static bool fold_masks_zosa(OptContext *ctx, TCGOp *op, uint64_t z_mask, uint64_t o_mask, int64_t s_mask, uint64_t a_ma= sk) { - fold_masks_zosa_int(ctx, op, z_mask, o_mask, s_mask, -1); + fold_masks_zosa_int(ctx, op, z_mask, o_mask, s_mask, a_mask); return true; } =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070171411227.33415383665647; Mon, 2 Feb 2026 14:09:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn26M-0004x9-1C; Mon, 02 Feb 2026 17:09:01 -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 1vn25u-0004rx-JA; Mon, 02 Feb 2026 17:08:31 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25t-0002bO-2m; Mon, 02 Feb 2026 17:08:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 744831852B6; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 5326435B3C9; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Zhijin Zeng , Michael Tokarev Subject: [Stable-10.2.1 09/56] tcg/riscv: Fix TCG_REG_TMP0 clobber in tcg_gen_dup{m, i} Date: Tue, 3 Feb 2026 01:07:14 +0300 Message-ID: <20260202220805.945271-9-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070173995154100 Content-Type: text/plain; charset="utf-8" From: Richard Henderson TCG_REG_TMP0 may be used by set_vtype* to load the vtype parameter, so delay any other use of TCG_REG_TMP0 until the correct vtype has been installed. Cc: qemu-stable@nongnu.org Fixes: d4be6ee1111 ("tcg/riscv: Implement vector mov/dup{m/i}") Reported-by: Zhijin Zeng Signed-off-by: Richard Henderson (cherry picked from commit af6db3b71310ea63a018d517ba7d79e4e014db62) Signed-off-by: Michael Tokarev diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 31b9f7d87a..0967a445a3 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1074,7 +1074,7 @@ static bool tcg_out_sti(TCGContext *s, TCGType type, = TCGArg val, } =20 static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, - TCGReg dst, TCGReg src) + TCGReg dst, TCGReg src) { set_vtype_len_sew(s, type, vece); tcg_out_opc_vx(s, OPC_VMV_V_X, dst, 0, src); @@ -1082,29 +1082,34 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType = type, unsigned vece, } =20 static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, - TCGReg dst, TCGReg base, intptr_t offs= et) + TCGReg dst, TCGReg base, intptr_t offset) { + /* Note set_vtype* may clobber TMP0, so do that first. */ + set_vtype_len_sew(s, type, vece); tcg_out_ld(s, TCG_TYPE_REG, TCG_REG_TMP0, base, offset); - return tcg_out_dup_vec(s, type, vece, dst, TCG_REG_TMP0); + tcg_out_opc_vx(s, OPC_VMV_V_X, dst, 0, TCG_REG_TMP0); + return true; } =20 static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, - TCGReg dst, int64_t arg) + TCGReg dst, int64_t arg) { /* Arg is replicated by VECE; extract the highest element. */ arg >>=3D (-8 << vece) & 63; =20 + /* Note set_vtype* may clobber TMP0, so do that first. */ + if (arg =3D=3D 0 || arg =3D=3D -1) { + set_vtype_len(s, type); + } else { + set_vtype_len_sew(s, type, vece); + } + if (arg >=3D -16 && arg < 16) { - if (arg =3D=3D 0 || arg =3D=3D -1) { - set_vtype_len(s, type); - } else { - set_vtype_len_sew(s, type, vece); - } tcg_out_opc_vi(s, OPC_VMV_V_I, dst, 0, arg); - return; + } else { + tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP0, arg); + tcg_out_opc_vx(s, OPC_VMV_V_X, dst, 0, TCG_REG_TMP0); } - tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_TMP0, arg); - tcg_out_dup_vec(s, type, vece, dst, TCG_REG_TMP0); } =20 static void tcg_out_br(TCGContext *s, TCGLabel *l) --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070193711971.0464029480669; Mon, 2 Feb 2026 14:09:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn279-0005h0-IE; Mon, 02 Feb 2026 17:09:47 -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 1vn25u-0004ry-J4; Mon, 02 Feb 2026 17:08:30 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn25t-0002bS-7F; Mon, 02 Feb 2026 17:08:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8271D1852B7; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 61AD635B3CA; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Jean-Christian=20C=C3=8ERSTEA?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 10/56] linux-user: allow null `pathname` for statx()/fstatat() Date: Tue, 3 Feb 2026 01:07:15 +0300 Message-ID: <20260202220805.945271-10-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070195963158500 From: Jean-Christian C=C3=8ERSTEA Since Linux 6.11, the path argument may be NULL. Before this patch, qemu-*-linux-user failed with EFAULT when `pathname` was specified as NULL, even for Linux kernel hosts > 6.10. This patch fixes this issue by checking whether `arg2` is 0. If so, don't return EFAULT, but inst= ead perform the appropiate syscall and let the host's kernel handle null `pathn= ame`. Cc: qemu-stable@nongnu.org Signed-off-by: Jean-Christian C=C3=8ERSTEA Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251229121416.2209295-1-jean.christian.cirstea@gmail.com> (cherry picked from commit 82ae60c8b5cb98d610056a1e2d0ba72e9ef7907c) Signed-off-by: Michael Tokarev diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2060e561a2..ee7c34027e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -12141,9 +12141,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, int dirfd =3D arg1; int flags =3D arg3; =20 - p =3D lock_user_string(arg2); - if (p =3D=3D NULL) { - return -TARGET_EFAULT; + p =3D NULL; + /* Since Linux 6.11, the path argument may be NULL */ + if (arg2 !=3D 0) { + p =3D lock_user_string(arg2); + if (p =3D=3D NULL) { + return -TARGET_EFAULT; + } } #if defined(__NR_statx) { --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070403179903.2914188578399; Mon, 2 Feb 2026 14:13:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27K-00067R-Qz; Mon, 02 Feb 2026 17:09:58 -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 1vn26H-0004zC-LV; Mon, 02 Feb 2026 17:08:57 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26G-0002c0-1M; Mon, 02 Feb 2026 17:08:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9D2F91852B8; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 6FE4035B3CB; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jim MacArthur , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 11/56] linux-user/elfload.c: Correction to HWCAP2 accessor Date: Tue, 3 Feb 2026 01:07:16 +0300 Message-ID: <20260202220805.945271-11-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070404896154100 From: Jim MacArthur get_elf_hwcap was used when get_elf_hwcap2 should have been. Cc: qemu-stable@nongnu.org Fixes: fcac98d0ba8b ("linux-user: Remove ELF_HWCAP2") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3259 Signed-off-by: Jim MacArthur Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-ID: <20260106-fix-hwcap2-sve2-v1-1-1d70dff63370@linaro.org> (cherry picked from commit c333f9c4ee212297f3b9a8a6ef62396a63c48e61) Signed-off-by: Michael Tokarev diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0002d5be2f..35471c0c9a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -708,7 +708,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int arg= c, int envc, NEW_AUX_ENT(AT_EXECFN, info->file_string); =20 if (HAVE_ELF_HWCAP2) { - NEW_AUX_ENT(AT_HWCAP2, get_elf_hwcap(thread_cpu)); + NEW_AUX_ENT(AT_HWCAP2, get_elf_hwcap2(thread_cpu)); } if (u_base_platform) { NEW_AUX_ENT(AT_BASE_PLATFORM, u_base_platform); --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070207308553.6535240368634; Mon, 2 Feb 2026 14:10:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27O-0006Ng-Aj; Mon, 02 Feb 2026 17:10:02 -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 1vn26H-0004zB-G3; Mon, 02 Feb 2026 17:08:57 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26G-0002c2-39; Mon, 02 Feb 2026 17:08:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B6B0C1852B9; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 8A8D335B3CC; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 12/56] linux-user: fix mremap unmapping adjacent region Date: Tue, 3 Feb 2026 01:07:17 +0300 Message-ID: <20260202220805.945271-12-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070208150158500 Content-Type: text/plain; charset="utf-8" From: Matthew Lugg This typo meant that calls to `mremap` which shrink a mapping by some N bytes would, when the virtual address space was pre-reserved (e.g. 32-bit guest on 64-bit host), unmap the N bytes following the *original* mapping. Signed-off-by: Matthew Lugg Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251117170954.31451-2-mlugg@mlugg.co.uk> (cherry picked from commit aaed9ca1797d70a507371aea688c5cd60b074e2d) Signed-off-by: Michael Tokarev diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 423c77856a..ef3833a2bb 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1171,7 +1171,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong = old_size, errno =3D ENOMEM; host_addr =3D MAP_FAILED; } else if (reserved_va && old_size > new_size) { - mmap_reserve_or_unmap(old_addr + old_size, + /* Re-reserve pages we just shrunk out of the mapping = */ + mmap_reserve_or_unmap(old_addr + new_size, old_size - new_size); } } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070259322915.0190829075962; Mon, 2 Feb 2026 14:10:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27R-0006jo-Dg; Mon, 02 Feb 2026 17:10:05 -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 1vn26L-0004zh-0y; Mon, 02 Feb 2026 17:08:58 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26I-0002ey-TD; Mon, 02 Feb 2026 17:08:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C69241852BA; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id A430735B3CD; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 13/56] linux-user: fix mremap errors for invalid ranges Date: Tue, 3 Feb 2026 01:07:18 +0300 Message-ID: <20260202220805.945271-13-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070260993154100 Content-Type: text/plain; charset="utf-8" From: Matthew Lugg If an address range given to `mremap` is invalid (exceeds addressing bounds on the guest), we were previously returning `ENOMEM`, which is not correct. The manpage and the Linux kernel implementation both agree that if `old_addr`/`old_size` refer to an invalid address, `EFAULT` is returned, and if `new_addr`/`new_size` refer to an invalid address, `EINVAL` is returned. Signed-off-by: Matthew Lugg Signed-off-by: Richard Henderson Message-ID: <20251117170954.31451-3-mlugg@mlugg.co.uk> (cherry picked from commit 2422884ec5a12037d2378f45ca1411d3f37c7081) Signed-off-by: Michael Tokarev diff --git a/linux-user/mmap.c b/linux-user/mmap.c index ef3833a2bb..6163f1a0d1 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1110,12 +1110,15 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulon= g old_size, int prot; void *host_addr; =20 - if (!guest_range_valid_untagged(old_addr, old_size) || - ((flags & MREMAP_FIXED) && + if (((flags & MREMAP_FIXED) && !guest_range_valid_untagged(new_addr, new_size)) || ((flags & MREMAP_MAYMOVE) =3D=3D 0 && !guest_range_valid_untagged(old_addr, new_size))) { - errno =3D ENOMEM; + errno =3D EINVAL; + return -1; + } + if (!guest_range_valid_untagged(old_addr, old_size)) { + errno =3D EFAULT; return -1; } =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 177007040327321.107373807373847; Mon, 2 Feb 2026 14:13:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27V-00079j-Cj; Mon, 02 Feb 2026 17:10:09 -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 1vn26L-0004zz-Ql; Mon, 02 Feb 2026 17:09:01 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26J-0002f4-3e; Mon, 02 Feb 2026 17:08:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D4B5C1852BB; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id B3A2C35B3CE; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 14/56] linux-user: fix reserved_va page leak in do_munmap Date: Tue, 3 Feb 2026 01:07:19 +0300 Message-ID: <20260202220805.945271-14-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070404838158500 Content-Type: text/plain; charset="utf-8" From: Matthew Lugg The old logic had an off-by-one bug. For instance, assuming 4k pages on host and guest, if 'len' is '4097' (indicating to unmap 2 pages), then 'last =3D start + 4096', so 'real_last =3D start + 4095', so ultimately 'real_len =3D 4096'. I do not believe this could cause any observable bugs in guests, because `target_munmap` page-aligns the length it passes in. However, calls to this function in `target_mremap` do not page-align the length, so those calls could "drop" pages, leading to a part of the reserved region becoming unmapped. At worst, a host allocation could get mapped into that hole, then clobbered by a new guest mapping. Signed-off-by: Matthew Lugg Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251117170954.31451-4-mlugg@mlugg.co.uk> (cherry picked from commit 81ceab30492ed251addae8539f7b69a069b0f984) Signed-off-by: Michael Tokarev diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 6163f1a0d1..4bcfaf7894 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1029,9 +1029,9 @@ static int mmap_reserve_or_unmap(abi_ulong start, abi= _ulong len) void *host_start; int prot; =20 - last =3D start + len - 1; + last =3D ROUND_UP(start + len, TARGET_PAGE_SIZE) - 1; real_start =3D start & -host_page_size; - real_last =3D ROUND_UP(last, host_page_size) - 1; + real_last =3D ROUND_UP(last + 1, host_page_size) - 1; =20 /* * If guest pages remain on the first or last host pages, --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070283887636.0911559757533; Mon, 2 Feb 2026 14:11:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27Q-0006aO-G6; Mon, 02 Feb 2026 17:10:04 -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 1vn26O-00050f-0j; Mon, 02 Feb 2026 17:09:04 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26M-0002fU-CB; Mon, 02 Feb 2026 17:08:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E3F6F1852BC; Tue, 03 Feb 2026 01:07:34 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id C26E635B3CF; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 15/56] tests: add tcg coverage for fixed mremap bugs Date: Tue, 3 Feb 2026 01:07:20 +0300 Message-ID: <20260202220805.945271-15-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070285189154100 Content-Type: text/plain; charset="utf-8" From: Matthew Lugg These tests cover the first two fixes in this patch series. The final patch is not covered because the bug it fixes is not easily observable by the guest. Signed-off-by: Matthew Lugg Signed-off-by: Richard Henderson Message-ID: <20251117170954.31451-5-mlugg@mlugg.co.uk> (cherry picked from commit 9290c10ae9d0c3ff433efbb7ecb0e781966c5404) Signed-off-by: Michael Tokarev diff --git a/tests/tcg/multiarch/test-mmap.c b/tests/tcg/multiarch/test-mma= p.c index 96257f8ebe..e297f4b1e9 100644 --- a/tests/tcg/multiarch/test-mmap.c +++ b/tests/tcg/multiarch/test-mmap.c @@ -22,6 +22,7 @@ * along with this program; if not, see . */ =20 +#define _GNU_SOURCE #include #include #include @@ -41,7 +42,7 @@ do = \ } \ } while (0) =20 -unsigned char *dummybuf; +unsigned char *dummybuf; /* length is 2*pagesize */ static unsigned int pagesize; static unsigned int pagemask; int test_fd; @@ -451,9 +452,45 @@ void check_invalid_mmaps(void) fail_unless(addr =3D=3D MAP_FAILED); fail_unless(errno =3D=3D ENOMEM); =20 + /* Attempt to remap a region which exceeds the bounds of memory. */ + addr =3D mremap((void *)((uintptr_t)pagesize * 10), SIZE_MAX & ~(size_= t)pagemask, pagesize, 0); + fprintf(stdout, "%s mremap addr=3D%p", __func__, (void *)addr); + fail_unless(addr =3D=3D MAP_FAILED); + fail_unless(errno =3D=3D EFAULT); + fprintf(stdout, " passed\n"); } =20 +void check_shrink_mmaps(void) +{ + unsigned char *a, *b, *c; + a =3D mmap(NULL, pagesize * 2, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS,= -1, 0); + b =3D mmap(NULL, pagesize * 2, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS,= -1, 0); + c =3D mmap(NULL, pagesize * 2, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS,= -1, 0); + + fail_unless(a !=3D MAP_FAILED); + fail_unless(b !=3D MAP_FAILED); + fail_unless(c !=3D MAP_FAILED); + + /* Ensure we can read the full mappings */ + memcpy(dummybuf, a, 2 * pagesize); + memcpy(dummybuf, b, 2 * pagesize); + memcpy(dummybuf, c, 2 * pagesize); + + /* Shrink the middle mapping in-place; the others should be unaffected= */ + b =3D mremap(b, pagesize * 2, pagesize, 0); + fail_unless(b !=3D MAP_FAILED); + + /* Ensure we can still access all valid mappings */ + memcpy(dummybuf, a, 2 * pagesize); + memcpy(dummybuf, b, pagesize); + memcpy(dummybuf, c, 2 * pagesize); + + munmap(a, 2 * pagesize); + munmap(b, pagesize); + munmap(c, 2 * pagesize); +} + int main(int argc, char **argv) { char tempname[] =3D "/tmp/.cmmapXXXXXX"; @@ -468,7 +505,7 @@ int main(int argc, char **argv) =20 /* Assume pagesize is a power of two. */ pagemask =3D pagesize - 1; - dummybuf =3D malloc (pagesize); + dummybuf =3D malloc (pagesize * 2); printf ("pagesize=3D%u pagemask=3D%x\n", pagesize, pagemask); =20 test_fd =3D mkstemp(tempname); @@ -496,6 +533,7 @@ int main(int argc, char **argv) check_file_fixed_eof_mmaps(); check_file_unfixed_eof_mmaps(); check_invalid_mmaps(); + check_shrink_mmaps(); =20 /* Fails at the moment. */ /* check_aligned_anonymous_fixed_mmaps_collide_with_host(); */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070260930865.8701299069885; Mon, 2 Feb 2026 14:11:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27Y-0007fp-U2; Mon, 02 Feb 2026 17:10:13 -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 1vn26j-0005KB-JS; Mon, 02 Feb 2026 17:09:23 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26h-0002fb-NZ; Mon, 02 Feb 2026 17:09:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 016EB1852BD; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id D180A35B3D0; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Fabiano Rosas , Fabian Vogt , Chinmay Rath , Harsh Prateek Bora , Michael Tokarev Subject: [Stable-10.2.1 16/56] target/ppc: Fix env->quiesced migration Date: Tue, 3 Feb 2026 01:07:21 +0300 Message-ID: <20260202220805.945271-16-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070262925154100 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas The commit referenced (from QEMU 10.0) has changed the way the pseries machine marks a cpu as quiesced. Previously, the cpu->halted value from QEMU common cpu code was (incorrectly) used. With the fix, the env->quiesced variable starts being used, which improves on the original situation, but also causes a side effect after migration: The env->quiesced is set at reset and never migrated, which causes the destination QEMU to stop delivering interrupts and hang the machine. To fix the issue from this point on, start migrating the env->quiesced value. For QEMU versions < 10.0, sending the new element on the stream would cause migration to be aborted, so add the appropriate compatibility property to omit the new subsection. Independently of this patch, all migrations from QEMU versions < 10.0 would result in a hang since the older QEMU never migrates env->quiesced. This is bad because it leaves machines already running on the old QEMU without a migration path into newer versions. As a workaround, use a few heuristics to infer the new value of env->quiesced based on cpu->halted, LPCR and PSSCR bits that are usually set/cleared along with quiesced. Note that this was tested with -cpu power9 and -machine ic-mode=3Dxive due to another bug affecting migration of XICS guests. Tested both forward and backward migration and savevm/loadvm from 9.2 and 10.0. Also tested loadvm of a savevm image that contains a mix of cpus both halted and not halted. Reported-by: Fabian Vogt Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3079 Fixes: fb802acdc8b ("ppc/spapr: Fix RTAS stopped state") Acked-by: Chinmay Rath Reviewed-by: Harsh Prateek Bora Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/qemu-devel/20260109123519.28703-2-farosas@sus= e.de Signed-off-by: Harsh Prateek Bora (cherry picked from commit 628bda1ab7596a7cceb1c5356d23a92001c7a8c5) Signed-off-by: Michael Tokarev diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 99b843ba2f..9dde61a667 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4776,8 +4776,14 @@ DEFINE_SPAPR_MACHINE(10, 1); */ static void spapr_machine_10_0_class_options(MachineClass *mc) { + static GlobalProperty spapr_compat_10_0[] =3D { + { TYPE_POWERPC_CPU, "rtas-stopped-state", "false" }, + }; + spapr_machine_10_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); + compat_props_add(mc->compat_props, spapr_compat_10_0, + G_N_ELEMENTS(spapr_compat_10_0)); } =20 DEFINE_SPAPR_MACHINE(10, 0); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 787020f6f9..bbd661e96c 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1529,6 +1529,7 @@ struct ArchCPU { void *machine_data; int32_t node_id; /* NUMA node this CPU belongs to */ PPCHash64Options *hash64_opts; + bool rtas_stopped_state; =20 /* Those resources are used only during code translation */ /* opcode handlers */ diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 86ead740ee..8dac1cd812 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -55,6 +55,11 @@ /* #define PPC_DEBUG_SPR */ /* #define USE_APPLE_GDB */ =20 +static const Property powerpc_cpu_properties[] =3D { + DEFINE_PROP_BOOL("rtas-stopped-state", PowerPCCPU, + rtas_stopped_state, true), +}; + static inline void vscr_init(CPUPPCState *env, uint32_t val) { /* Altivec always uses round-to-nearest */ @@ -7529,6 +7534,8 @@ static void ppc_cpu_class_init(ObjectClass *oc, const= void *data) &pcc->parent_unrealize); pcc->pvr_match =3D ppc_pvr_match_default; =20 + device_class_set_props(dc, powerpc_cpu_properties); + resettable_class_set_parent_phases(rc, NULL, ppc_cpu_reset_hold, NULL, &pcc->parent_phases); =20 diff --git a/target/ppc/machine.c b/target/ppc/machine.c index d72e5ecb94..49cfdc6d67 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -257,6 +257,45 @@ static int cpu_post_load(void *opaque, int version_id) ppc_store_sdr1(env, env->spr[SPR_SDR1]); } =20 + if (!cpu->rtas_stopped_state) { + /* + * The source QEMU doesn't have fb802acdc8 and still uses halt + + * PM bits in LPCR to implement RTAS stopped state. The new (this) + * QEMU will have put the secondary vcpus in stopped state, + * waiting for the start-cpu RTAS call. That call will never come + * if the source cpus were already running. Try to infer the cpus + * state and set env->quiesced accordingly. + * + * env->quiesced =3D true =3D=3D> the cpu is waiting to start + * env->quiesced =3D false =3D=3D> the cpu is running (unless halt= ed) + */ + + /* + * Halted _could_ mean quiesced, but it could also be cede, + * confer_self, power management, etc. + */ + if (CPU(cpu)->halted) { + PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); + /* + * Both the PSSCR_EC bit and LPCR PM bits set at cpu reset + * and rtas_stop and cleared at rtas_start, it's a good + * heuristic. + */ + if ((env->spr[SPR_PSSCR] & PSSCR_EC) && + (env->spr[SPR_LPCR] & pcc->lpcr_pm)) { + env->quiesced =3D true; + } else { + env->quiesced =3D false; + } + } else { + /* + * Old QEMU sets halted during rtas_stop_self. Not halted, + * therefore definitely not quiesced. + */ + env->quiesced =3D false; + } + } + post_load_update_msr(env); =20 if (tcg_enabled()) { @@ -649,6 +688,28 @@ static const VMStateDescription vmstate_reservation = =3D { } }; =20 +static bool rtas_stopped_needed(void *opaque) +{ + PowerPCCPU *cpu =3D opaque; + + return cpu->rtas_stopped_state; +} + +static const VMStateDescription vmstate_rtas_stopped =3D { + .name =3D "cpu/rtas_stopped", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D rtas_stopped_needed, + .fields =3D (const VMStateField[]) { + /* + * "RTAS stopped" state, independent of halted state. For QEMU + * < 10.0, this is taken from cpu->halted at cpu_post_load() + */ + VMSTATE_BOOL(env.quiesced, PowerPCCPU), + VMSTATE_END_OF_LIST() + } +}; + #ifdef TARGET_PPC64 static bool bhrb_needed(void *opaque) { @@ -715,6 +776,7 @@ const VMStateDescription vmstate_ppc_cpu =3D { &vmstate_tlbmas, &vmstate_compat, &vmstate_reservation, + &vmstate_rtas_stopped, NULL } }; --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070408867518.9544907725588; Mon, 2 Feb 2026 14:13:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27V-0007EO-Bq; Mon, 02 Feb 2026 17:10:09 -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 1vn26k-0005L1-VP; Mon, 02 Feb 2026 17:09:25 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26j-0002fq-Fv; Mon, 02 Feb 2026 17:09:22 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1D5991852BE; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id E316E35B3D1; Tue, 03 Feb 2026 01:08:16 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Thomas Huth , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 17/56] configs: use default prefix for Windows compilation Date: Tue, 3 Feb 2026 01:07:22 +0300 Message-ID: <20260202220805.945271-17-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070411029154100 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini The update to Python 3.13 causes meson configuration to fail, see e.g.: https://gitlab.com/qemu-project/qemu/-/jobs/12672816538#L397 meson.build:1:0: ERROR: prefix value '/qemu' must be an absolute path This is https://github.com/mesonbuild/meson/issues/14303. Remove the prefix=3D'/qemu' line in configs/meson/windows.txt, since commit d17f305a264 ("configure: use a platform-neutral prefix", 2020-09-30) says that the NSIS installer doesn't care. Cc: qemu-stable@nongnu.org Cc: Thomas Huth Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Signed-off-by: Richard Henderson Message-ID: <20260112160736.1028280-1-pbonzini@redhat.com> (cherry picked from commit 894c8bd56ff1d25127efa4ba9ee8cf4dd0670b1a) Signed-off-by: Michael Tokarev diff --git a/configs/meson/windows.txt b/configs/meson/windows.txt index 55b192e71b..9ef0fb3c8f 100644 --- a/configs/meson/windows.txt +++ b/configs/meson/windows.txt @@ -3,7 +3,6 @@ =20 [built-in options] bindir =3D '' -prefix =3D '/qemu' =20 [project options] qemu_suffix =3D '' --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070296422649.7011186296479; Mon, 2 Feb 2026 14:11:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27e-00086B-Qx; Mon, 02 Feb 2026 17:10:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26m-0005LI-Ce; Mon, 02 Feb 2026 17:09:26 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26l-0002hl-0f; Mon, 02 Feb 2026 17:09:24 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2BB211852BF; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 09B5435B3D2; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Laurent Vivier , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 18/56] m68k: fix CAS2 writeback when Dc1==Dc2 Date: Tue, 3 Feb 2026 01:07:23 +0300 Message-ID: <20260202220805.945271-18-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070298495158500 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier According to Programmer's Reference Manual, if Dc1 and Dc2 specify the same data register and the comparison fails, memory operand 1 is stored in the data register. The current helpers wrote Dc1 then Dc2, leaving operand 2 in the shared register. Swap the writeback order for cas2w/cas2l so memory operand 1 wins. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-ID: <20251226213707.331741-1-laurent@vivier.eu> (cherry picked from commit 11dac41f2e830bcd7ba74969dc50f5740e3ce7e7) Signed-off-by: Michael Tokarev diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index e9c20a8e03..10266b1e0e 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -799,8 +799,8 @@ void HELPER(cas2w)(CPUM68KState *env, uint32_t regs, ui= nt32_t a1, uint32_t a2) env->cc_v =3D c2; } env->cc_op =3D CC_OP_CMPW; - env->dregs[Dc1] =3D deposit32(env->dregs[Dc1], 0, 16, l1); env->dregs[Dc2] =3D deposit32(env->dregs[Dc2], 0, 16, l2); + env->dregs[Dc1] =3D deposit32(env->dregs[Dc1], 0, 16, l1); } =20 static void do_cas2l(CPUM68KState *env, uint32_t regs, uint32_t a1, uint32= _t a2, @@ -861,8 +861,8 @@ static void do_cas2l(CPUM68KState *env, uint32_t regs, = uint32_t a1, uint32_t a2, env->cc_v =3D c2; } env->cc_op =3D CC_OP_CMPL; - env->dregs[Dc1] =3D l1; env->dregs[Dc2] =3D l2; + env->dregs[Dc1] =3D l1; } =20 void HELPER(cas2l)(CPUM68KState *env, uint32_t regs, uint32_t a1, uint32_t= a2) --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070209027651.7478721069604; Mon, 2 Feb 2026 14:10:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27M-0006L3-Pj; Mon, 02 Feb 2026 17:10:00 -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 1vn26o-0005Ml-55; Mon, 02 Feb 2026 17:09:29 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn26m-0002i0-Ax; Mon, 02 Feb 2026 17:09:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3AD9F1852C0; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 199AA35B3D3; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 19/56] target/i386/tcg: do not mark all SSE instructions as unaligned Date: Tue, 3 Feb 2026 01:07:24 +0300 Message-ID: <20260202220805.945271-19-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070209988158500 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini If the vex_special field was not initialized, it was considered to be X86_VEX_SSEUnaligned (whose value was zero). Add a new value to fix that. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit 73dd6e4a36dd8d85548292f382a4d479e2810371) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index dfaffec599..31aad730fc 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -944,15 +944,15 @@ static void decode_0F10(DisasContext *s, CPUX86State = *env, X86OpEntry *entry, ui static void decode_0F11(DisasContext *s, CPUX86State *env, X86OpEntry *ent= ry, uint8_t *b) { static const X86OpEntry opcodes_0F11_reg[4] =3D { - X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4), /* MOVUPS */ - X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4), /* MOVUPD */ + X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4_unal), /* MOVUPS= */ + X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4_unal), /* MOVUPD= */ X86_OP_ENTRY3(VMOVSS, W,x, H,x, V,x, vex5), X86_OP_ENTRY3(VMOVLPx, W,x, H,x, V,q, vex5), /* MOVSD */ }; =20 static const X86OpEntry opcodes_0F11_mem[4] =3D { - X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4), /* MOVUPS */ - X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4), /* MOVUPD */ + X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4_unal), /* MOV= UPS */ + X86_OP_ENTRY3(MOVDQ, W,x, None,None, V,x, vex4_unal), /* MOV= UPD */ X86_OP_ENTRY3(VMOVSS_st, M,ss, None,None, V,x, vex5), X86_OP_ENTRY3(VMOVLPx_st, M,sd, None,None, V,x, vex5), /* MOVSD */ }; @@ -2382,6 +2382,9 @@ static bool validate_vex(DisasContext *s, X86DecodedI= nsn *decode) X86OpEntry *e =3D &decode->e; =20 switch (e->vex_special) { + case X86_VEX_None: + break; + case X86_VEX_REPScalar: /* * Instructions which differ between 00/66 and F2/F3 in the diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h index 7f23d373ea..9282296900 100644 --- a/target/i386/tcg/decode-new.h +++ b/target/i386/tcg/decode-new.h @@ -242,6 +242,8 @@ typedef enum X86InsnSpecial { * section of the manual. */ typedef enum X86VEXSpecial { + X86_VEX_None, + /* Legacy SSE instructions that allow unaligned operands */ X86_VEX_SSEUnaligned, =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070249331767.0009249166809; Mon, 2 Feb 2026 14:10:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27X-0007UL-43; Mon, 02 Feb 2026 17:10:11 -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 1vn27A-0005qM-1h; Mon, 02 Feb 2026 17:09:48 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn278-0002iG-8j; Mon, 02 Feb 2026 17:09:47 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4AC2E1852C1; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 28B7235B3D4; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 20/56] target/i386/tcg: mask addresses for VSIB Date: Tue, 3 Feb 2026 01:07:25 +0300 Message-ID: <20260202220805.945271-20-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070250263158501 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini VSIB can have either 32-bit or 64-bit addresses, pass a constant mask to the helper and apply it before the load. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit 5e3572ef2e94608568b1a73eab9d382b250936eb) Signed-off-by: Michael Tokarev diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index a2e4d48039..853196b2bb 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -2362,42 +2362,42 @@ void glue(helper_vpmaskmovq, SUFFIX)(CPUX86State *e= nv, Reg *d, Reg *v, Reg *s) } =20 void glue(helper_vpgatherdd, SUFFIX)(CPUX86State *env, - Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale) + Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale, target_ul= ong amask) { int i; for (i =3D 0; i < (2 << SHIFT); i++) { if (v->L(i) >> 31) { target_ulong addr =3D a0 + ((target_ulong)(int32_t)s->L(i) << scale); - d->L(i) =3D cpu_ldl_data_ra(env, addr, GETPC()); + d->L(i) =3D cpu_ldl_data_ra(env, addr & amask, GETPC()); } v->L(i) =3D 0; } } =20 void glue(helper_vpgatherdq, SUFFIX)(CPUX86State *env, - Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale) + Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale, target_ul= ong amask) { int i; for (i =3D 0; i < (1 << SHIFT); i++) { if (v->Q(i) >> 63) { target_ulong addr =3D a0 + ((target_ulong)(int32_t)s->L(i) << scale); - d->Q(i) =3D cpu_ldq_data_ra(env, addr, GETPC()); + d->Q(i) =3D cpu_ldq_data_ra(env, addr & amask, GETPC()); } v->Q(i) =3D 0; } } =20 void glue(helper_vpgatherqd, SUFFIX)(CPUX86State *env, - Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale) + Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale, target_ul= ong amask) { int i; for (i =3D 0; i < (1 << SHIFT); i++) { if (v->L(i) >> 31) { target_ulong addr =3D a0 + ((target_ulong)(int64_t)s->Q(i) << scale); - d->L(i) =3D cpu_ldl_data_ra(env, addr, GETPC()); + d->L(i) =3D cpu_ldl_data_ra(env, addr & amask, GETPC()); } v->L(i) =3D 0; } @@ -2408,14 +2408,14 @@ void glue(helper_vpgatherqd, SUFFIX)(CPUX86State *e= nv, } =20 void glue(helper_vpgatherqq, SUFFIX)(CPUX86State *env, - Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale) + Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale, target_ul= ong amask) { int i; for (i =3D 0; i < (1 << SHIFT); i++) { if (v->Q(i) >> 63) { target_ulong addr =3D a0 + ((target_ulong)(int64_t)s->Q(i) << scale); - d->Q(i) =3D cpu_ldq_data_ra(env, addr, GETPC()); + d->Q(i) =3D cpu_ldq_data_ra(env, addr & amask, GETPC()); } v->Q(i) =3D 0; } diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 1a7fab9333..12e7f5f943 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -43,8 +43,8 @@ typedef void (*SSEFunc_0_pppi)(TCGv_ptr reg_a, TCGv_ptr r= eg_b, TCGv_ptr reg_c, TCGv_i32 val); typedef void (*SSEFunc_0_eppt)(TCGv_ptr env, TCGv_ptr reg_a, TCGv_ptr reg_= b, TCGv val); -typedef void (*SSEFunc_0_epppti)(TCGv_ptr env, TCGv_ptr reg_a, TCGv_ptr re= g_b, - TCGv_ptr reg_c, TCGv a0, TCGv_i32 scale); +typedef void (*SSEFunc_0_eppptit)(TCGv_ptr env, TCGv_ptr reg_a, TCGv_ptr r= eg_b, + TCGv_ptr reg_c, TCGv a0, TCGv_i32 scale, = TCGv amask); typedef void (*SSEFunc_0_eppppi)(TCGv_ptr env, TCGv_ptr reg_a, TCGv_ptr re= g_b, TCGv_ptr reg_c, TCGv_ptr reg_d, TCGv_i32= flags); typedef void (*SSEFunc_0_eppppii)(TCGv_ptr env, TCGv_ptr reg_a, TCGv_ptr r= eg_b, @@ -1098,18 +1098,19 @@ VEXW_AVX(VPMASKMOV, vpmaskmov) =20 /* Same as above, but with extra arguments to the helper. */ static inline void gen_vsib_avx(DisasContext *s, X86DecodedInsn *decode, - SSEFunc_0_epppti d_xmm, SSEFunc_0_epppti q= _xmm, - SSEFunc_0_epppti d_ymm, SSEFunc_0_epppti q= _ymm) + SSEFunc_0_eppptit d_xmm, SSEFunc_0_eppptit= q_xmm, + SSEFunc_0_eppptit d_ymm, SSEFunc_0_eppptit= q_ymm) { - SSEFunc_0_epppti d =3D s->vex_l ? d_ymm : d_xmm; - SSEFunc_0_epppti q =3D s->vex_l ? q_ymm : q_xmm; - SSEFunc_0_epppti fn =3D s->vex_w ? q : d; + SSEFunc_0_eppptit d =3D s->vex_l ? d_ymm : d_xmm; + SSEFunc_0_eppptit q =3D s->vex_l ? q_ymm : q_xmm; + SSEFunc_0_eppptit fn =3D s->vex_w ? q : d; TCGv_i32 scale =3D tcg_constant_i32(decode->mem.scale); TCGv_ptr index =3D tcg_temp_new_ptr(); + TCGv mask =3D tcg_constant_tl(MAKE_64BIT_MASK(0, 8 << s->aflag)); =20 /* Pass third input as (index, base, scale) */ tcg_gen_addi_ptr(index, tcg_env, ZMM_OFFSET(decode->mem.index)); - fn(tcg_env, OP_PTR0, OP_PTR1, index, s->A0, scale); + fn(tcg_env, OP_PTR0, OP_PTR1, index, s->A0, scale, mask); =20 /* * There are two output operands, so zero OP1's high 128 bits diff --git a/target/i386/tcg/ops_sse_header.h.inc b/target/i386/tcg/ops_sse= _header.h.inc index d92c6faf6d..bbeb7301c3 100644 --- a/target/i386/tcg/ops_sse_header.h.inc +++ b/target/i386/tcg/ops_sse_header.h.inc @@ -388,10 +388,10 @@ DEF_HELPER_4(glue(vpmaskmovd_st, SUFFIX), void, env, = Reg, Reg, tl) DEF_HELPER_4(glue(vpmaskmovq_st, SUFFIX), void, env, Reg, Reg, tl) DEF_HELPER_4(glue(vpmaskmovd, SUFFIX), void, env, Reg, Reg, Reg) DEF_HELPER_4(glue(vpmaskmovq, SUFFIX), void, env, Reg, Reg, Reg) -DEF_HELPER_6(glue(vpgatherdd, SUFFIX), void, env, Reg, Reg, Reg, tl, i32) -DEF_HELPER_6(glue(vpgatherdq, SUFFIX), void, env, Reg, Reg, Reg, tl, i32) -DEF_HELPER_6(glue(vpgatherqd, SUFFIX), void, env, Reg, Reg, Reg, tl, i32) -DEF_HELPER_6(glue(vpgatherqq, SUFFIX), void, env, Reg, Reg, Reg, tl, i32) +DEF_HELPER_7(glue(vpgatherdd, SUFFIX), void, env, Reg, Reg, Reg, tl, i32, = tl) +DEF_HELPER_7(glue(vpgatherdq, SUFFIX), void, env, Reg, Reg, Reg, tl, i32, = tl) +DEF_HELPER_7(glue(vpgatherqd, SUFFIX), void, env, Reg, Reg, Reg, tl, i32, = tl) +DEF_HELPER_7(glue(vpgatherqq, SUFFIX), void, env, Reg, Reg, Reg, tl, i32, = tl) #if SHIFT =3D=3D 2 DEF_HELPER_3(vpermd_ymm, void, Reg, Reg, Reg) DEF_HELPER_4(vpermdq_ymm, void, Reg, Reg, Reg, i32) --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070253731179.00429093275204; Mon, 2 Feb 2026 14:10:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27f-0008Gf-RW; Mon, 02 Feb 2026 17:10:20 -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 1vn27B-0005s3-8b; Mon, 02 Feb 2026 17:09:50 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn279-0002ic-Q8; Mon, 02 Feb 2026 17:09:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5906E1852C2; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 37FA835B3D5; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 21/56] target/i386/tcg: allow VEX in 16-bit protected mode Date: Tue, 3 Feb 2026 01:07:26 +0300 Message-ID: <20260202220805.945271-21-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070254765154100 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini VEX is only forbidden in real and vm86 mode; 16-bit protected mode supports it for some unfathomable reason. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit ed88bdcfbdcf9d411607cd690f93f915feff6a5b) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 31aad730fc..24dcf222f3 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2613,20 +2613,16 @@ static void disas_insn(DisasContext *s, CPUState *c= pu) case 0xc5: /* 2-byte VEX */ case 0xc4: /* 3-byte VEX */ /* - * VEX prefixes cannot be used except in 32-bit mode. - * Otherwise the instruction is LES or LDS. + * Bits 6-7 of the first byte must be set except in 64-bit mode. + * Otherwise the instruction is LES or LDS. Not allowed in real m= ode. */ - if (CODE32(s) && !VM86(s)) { + if (PE(s) && !VM86(s)) { static const int pp_prefix[4] =3D { 0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ }; int vex3, vex2 =3D x86_ldub_code(env, s); =20 if (!CODE64(s) && (vex2 & 0xc0) !=3D 0xc0) { - /* - * 4.1.4.6: In 32-bit mode, bits [7:6] must be 11b, - * otherwise the instruction is LES or LDS. - */ s->pc--; /* rewind the advance_pc() x86_ldub_code() did */ break; } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070261126866.259946254636; Mon, 2 Feb 2026 14:11:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27T-0006vv-7A; Mon, 02 Feb 2026 17:10:07 -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 1vn27D-0005vG-0p; Mon, 02 Feb 2026 17:09:51 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27B-0002ko-Dv; Mon, 02 Feb 2026 17:09:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 752F91852C3; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 472AB35B3D6; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Vulnerability Report , David Woodhouse , Paolo Bonzini , Michael Tokarev Subject: [Stable-10.2.1 22/56] hw/i386/kvm: fix PIRQ bounds check in xen_physdev_map_pirq() Date: Tue, 3 Feb 2026 01:07:27 +0300 Message-ID: <20260202220805.945271-22-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070262959154100 Content-Type: text/plain; charset="utf-8" From: Vulnerability Report Reject pirq =3D=3D s->nr_pirqs in xen_physdev_map_pirq(). Fixes: aa98ee38a5 ("hw/xen: Implement emulated PIRQ hypercall support") Fixes: CVE-2026-0665 Reported-by: DARKNAVY (@DarkNavyOrg) Reviewed-by: David Woodhouse Signed-off-by: Vulnerability Report Link: https://lore.kernel.org/r/13FE03BE60EA78D6+20260109023548.4047-1-vr@d= arknavy.com Signed-off-by: Paolo Bonzini (cherry picked from commit c7504ba2a560fd884557f6e5142f03b491aad0c7) Signed-off-by: Michael Tokarev diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index dd566c4967..173e0818c7 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -1877,7 +1877,7 @@ int xen_physdev_map_pirq(struct physdev_map_pirq *map) return pirq; } map->pirq =3D pirq; - } else if (pirq > s->nr_pirqs) { + } else if (pirq >=3D s->nr_pirqs) { return -EINVAL; } else { /* --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070613015121.35037859173622; Mon, 2 Feb 2026 14:16:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27m-0000Zw-77; Mon, 02 Feb 2026 17:10:26 -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 1vn27E-0005wV-4m; Mon, 02 Feb 2026 17:09:52 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27C-0002l3-Lc; Mon, 02 Feb 2026 17:09:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8447E1852C4; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 62E5635B3D7; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Xianglai Li , Bibo Mao , Michael Tokarev Subject: [Stable-10.2.1 23/56] hw/loongarch/virt: Modify the interrupt trigger type in fdt table Date: Tue, 3 Feb 2026 01:07:28 +0300 Message-ID: <20260202220805.945271-23-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070613735158500 Content-Type: text/plain; charset="utf-8" From: Xianglai Li In the loongarch virt fdt file, the interrupt trigger type directly uses magic numbers. Now, refer to the definitions in the linux kernel and use macro definitions. Signed-off-by: Xianglai Li Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao (cherry picked from commit 47de28a0b7fb96531271aaeaa3e7f2cad2b91221) Signed-off-by: Michael Tokarev diff --git a/hw/loongarch/virt-fdt-build.c b/hw/loongarch/virt-fdt-build.c index 1f0ba01f71..7333019cf7 100644 --- a/hw/loongarch/virt-fdt-build.c +++ b/hw/loongarch/virt-fdt-build.c @@ -16,6 +16,11 @@ #include "system/reset.h" #include "target/loongarch/cpu.h" =20 +#define FDT_IRQ_TYPE_EDGE_RISING 1 +#define FDT_IRQ_TYPE_EDGE_FALLING 2 +#define FDT_IRQ_TYPE_LEVEL_HIGH 4 +#define FDT_IRQ_TYPE_LEVEL_LOW 8 + static void create_fdt(LoongArchVirtMachineState *lvms) { MachineState *ms =3D MACHINE(lvms); @@ -415,7 +420,8 @@ static void fdt_add_uart_node(LoongArchVirtMachineState= *lvms, if (chosen) { qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodenam= e); } - qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", irq, 0x4); + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", irq, + FDT_IRQ_TYPE_LEVEL_HIGH); qemu_fdt_setprop_cell(ms->fdt, nodename, "interrupt-parent", *pch_pic_phandle); g_free(nodename); @@ -435,7 +441,8 @@ static void fdt_add_rtc_node(LoongArchVirtMachineState = *lvms, "loongson,ls7a-rtc"); qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, siz= e); qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", - VIRT_RTC_IRQ - VIRT_GSI_BASE , 0x4); + VIRT_RTC_IRQ - VIRT_GSI_BASE , + FDT_IRQ_TYPE_LEVEL_HIGH); qemu_fdt_setprop_cell(ms->fdt, nodename, "interrupt-parent", *pch_pic_phandle); g_free(nodename); --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070310250710.8617881701755; Mon, 2 Feb 2026 14:11:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27j-0000EJ-9J; Mon, 02 Feb 2026 17:10:23 -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 1vn27a-0007rh-MT; Mon, 02 Feb 2026 17:10:17 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27Y-0002lN-Kt; Mon, 02 Feb 2026 17:10:14 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 928AE1852C5; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 71CE535B3D8; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Xianglai Li , Bibo Mao , Michael Tokarev Subject: [Stable-10.2.1 24/56] hw/loongarch/virt: Fix irq allocation failure with pci device from fdt Date: Tue, 3 Feb 2026 01:07:29 +0300 Message-ID: <20260202220805.945271-24-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070310633158500 Content-Type: text/plain; charset="utf-8" From: Xianglai Li When we use the -kernel parameter to start an elf format kernel relying on fdt, we get the following error: pcieport 0000:00:01.0: of_irq_parse_pci: failed with rc=3D-22 pcieport 0000:00:01.0: enabling device (0000 -> 0003) pcieport 0000:00:01.0: PME: Signaling with IRQ 19 pcieport 0000:00:01.0: AER: enabled with IRQ 19 pcieport 0000:00:01.1: of_irq_parse_pci: failed with rc=3D-22 pcieport 0000:00:01.1: enabling device (0000 -> 0003) pcieport 0000:00:01.1: PME: Signaling with IRQ 20 pcieport 0000:00:01.1: AER: enabled with IRQ 20 pcieport 0000:00:01.2: of_irq_parse_pci: failed with rc=3D-22 pcieport 0000:00:01.2: enabling device (0000 -> 0003) pcieport 0000:00:01.2: PME: Signaling with IRQ 21 pcieport 0000:00:01.2: AER: enabled with IRQ 21 pcieport 0000:00:01.3: of_irq_parse_pci: failed with rc=3D-22 pcieport 0000:00:01.3: enabling device (0000 -> 0003) pcieport 0000:00:01.3: PME: Signaling with IRQ 22 pcieport 0000:00:01.3: AER: enabled with IRQ 22 pcieport 0000:00:01.4: of_irq_parse_pci: failed with rc=3D-22 This is because the description of interrupt-cell is missing in the pcie irq map. And there is a lack of a description of the interrupt trigger type. Now it is corrected and the correct interrupt-cell is added in the pcie irq map. Refer to the implementation in arm and add some comments. Signed-off-by: Xianglai Li Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao (cherry picked from commit ff54394eed148c642f83b45753c7898acdbd5ddb) Signed-off-by: Michael Tokarev diff --git a/hw/loongarch/virt-fdt-build.c b/hw/loongarch/virt-fdt-build.c index 7333019cf7..e597b19dc3 100644 --- a/hw/loongarch/virt-fdt-build.c +++ b/hw/loongarch/virt-fdt-build.c @@ -321,6 +321,8 @@ static void fdt_add_pcie_irq_map_node(const LoongArchVi= rtMachineState *lvms, uint32_t full_irq_map[PCI_NUM_PINS * PCI_NUM_PINS * 10] =3D {}; uint32_t *irq_map =3D full_irq_map; const MachineState *ms =3D MACHINE(lvms); + uint32_t pin_mask; + uint32_t devfn_mask; =20 /* * This code creates a standard swizzle of interrupts such that @@ -333,37 +335,45 @@ static void fdt_add_pcie_irq_map_node(const LoongArch= VirtMachineState *lvms, */ =20 for (dev =3D 0; dev < PCI_NUM_PINS; dev++) { - int devfn =3D dev * 0x8; + int devfn =3D PCI_DEVFN(dev, 0); =20 for (pin =3D 0; pin < PCI_NUM_PINS; pin++) { - int irq_nr =3D 16 + ((pin + PCI_SLOT(devfn)) % PCI_NUM_PINS); + int irq_nr =3D VIRT_DEVICE_IRQS + \ + ((pin + PCI_SLOT(devfn)) % PCI_NUM_PINS); int i =3D 0; =20 - /* Fill PCI address cells */ - irq_map[i] =3D cpu_to_be32(devfn << 8); - i +=3D 3; - - /* Fill PCI Interrupt cells */ - irq_map[i] =3D cpu_to_be32(pin + 1); - i +=3D 1; - - /* Fill interrupt controller phandle and cells */ - irq_map[i++] =3D cpu_to_be32(*pch_pic_phandle); - irq_map[i++] =3D cpu_to_be32(irq_nr); + uint32_t map[] =3D { + devfn << 8, 0, 0, /* devfn */ + pin + 1, /* PCI pin */ + *pch_pic_phandle, /* interrupt controller hand= le */ + irq_nr, /* irq number */ + FDT_IRQ_TYPE_LEVEL_HIGH }; /* irq trigger level */ =20 if (!irq_map_stride) { - irq_map_stride =3D i; + irq_map_stride =3D sizeof(map) / sizeof(uint32_t); } + + /* Convert map to big endian */ + for (i =3D 0; i < irq_map_stride; i++) { + irq_map[i] =3D cpu_to_be32(map[i]); + } + irq_map +=3D irq_map_stride; } } =20 - qemu_fdt_setprop(ms->fdt, nodename, "interrupt-map", full_irq_map, PCI_NUM_PINS * PCI_NUM_PINS * irq_map_stride * sizeof(uint32_t)); + + /* Only need to match the pci slot bit */ + devfn_mask =3D PCI_DEVFN((PCI_NUM_PINS - 1), 0) << 8; + /* The pci interrupt only needs to match the specified low bit */ + pin_mask =3D (1 << ((PCI_NUM_PINS - 1))) - 1; + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupt-map-mask", - 0x1800, 0, 0, 0x7); + devfn_mask, 0, 0, /* address cells */ + pin_mask); } =20 static void fdt_add_pcie_node(const LoongArchVirtMachineState *lvms, @@ -400,6 +410,8 @@ static void fdt_add_pcie_node(const LoongArchVirtMachin= eState *lvms, 2, base_mmio, 2, size_mmio); qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-map", 0, *pch_msi_phandle, 0, 0x10000); + + qemu_fdt_setprop_cell(ms->fdt, nodename, "#interrupt-cells", 1); fdt_add_pcie_irq_map_node(lvms, nodename, pch_pic_phandle); g_free(nodename); } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070258020845.9415686397141; Mon, 2 Feb 2026 14:10:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27h-0008N7-00; Mon, 02 Feb 2026 17:10:21 -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 1vn27b-0007vh-7Y; Mon, 02 Feb 2026 17:10:17 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27Z-0002lZ-LK; Mon, 02 Feb 2026 17:10:14 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id ACAD11852C6; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 7F74635B3D9; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.2.1 25/56] target/loongach: Fix some exceptions failure in updating CSR_BADV Date: Tue, 3 Feb 2026 01:07:30 +0300 Message-ID: <20260202220805.945271-25-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070261129154100 Content-Type: text/plain; charset="utf-8" From: Song Gao According to Volume 1 Manual 7.4.8 ,exception,SYS,BRK,INE,IPE,PPD FPE,SXD,ASXD are need't update CSR_BADV, this patch correct it. Signed-off-by: Song Gao Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao (cherry picked from commit 70cf9b7bf7aff47f8d85ccce35b688dd91335cf0) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index 9d077c56d9..ab247e82ec 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -121,8 +121,6 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) case EXCCODE_FPE: case EXCCODE_SXD: case EXCCODE_ASXD: - env->CSR_BADV =3D env->pc; - QEMU_FALLTHROUGH; case EXCCODE_BCE: case EXCCODE_ADEM: case EXCCODE_PIL: --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070372048778.0498287796729; Mon, 2 Feb 2026 14:12:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27q-0000zG-Pk; Mon, 02 Feb 2026 17:10:30 -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 1vn27f-0008DI-6f; Mon, 02 Feb 2026 17:10:19 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27c-00035O-Dq; Mon, 02 Feb 2026 17:10:18 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C5CC51852C7; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 99F6035B3DA; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.2.1 26/56] target/loongarch: Fix exception BCE missing to update CSR_BADV Date: Tue, 3 Feb 2026 01:07:31 +0300 Message-ID: <20260202220805.945271-26-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070376486154100 Content-Type: text/plain; charset="utf-8" From: Song Gao Exception BCE need update CSR_BADV, and the value is env->pc. Signed-off-by: Song Gao Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao (cherry picked from commit e4f0ef58d53eb20056f9f3ca9f21dbbbf25f2530) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index ab247e82ec..c05a06eeb5 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -113,6 +113,9 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) cause =3D cs->exception_index; update_badinstr =3D 0; break; + case EXCCODE_BCE: + env->CSR_BADV =3D env->pc; + QEMU_FALLTHROUGH; case EXCCODE_SYS: case EXCCODE_BRK: case EXCCODE_INE: @@ -121,7 +124,6 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) case EXCCODE_FPE: case EXCCODE_SXD: case EXCCODE_ASXD: - case EXCCODE_BCE: case EXCCODE_ADEM: case EXCCODE_PIL: case EXCCODE_PIS: --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070429710327.35356214101455; Mon, 2 Feb 2026 14:13:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn288-0002UK-IS; Mon, 02 Feb 2026 17:10:49 -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 1vn27f-0008D0-1m; Mon, 02 Feb 2026 17:10:19 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27d-00035Y-2z; Mon, 02 Feb 2026 17:10:18 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DFADD1852C8; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id B387235B3DB; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.2.1 27/56] target/loongarch: Fix exception ADEF/ADEM missing to update CSR_BADV Date: Tue, 3 Feb 2026 01:07:32 +0300 Message-ID: <20260202220805.945271-27-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070431288154100 Content-Type: text/plain; charset="utf-8" From: Song Gao Exception ADEM/ADEF need update CSR_BADV, the value from the virtual address. Signed-off-by: Song Gao Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao (cherry picked from commit a7be2e0a3f7d0f35bcc3b17e2b558084efc5d9fe) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index c05a06eeb5..8615e03d14 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -225,6 +225,7 @@ static void loongarch_cpu_do_transaction_failed(CPUStat= e *cs, hwaddr physaddr, { CPULoongArchState *env =3D cpu_env(cs); =20 + env->CSR_BADV =3D addr; if (access_type =3D=3D MMU_INST_FETCH) { do_raise_exception(env, EXCCODE_ADEF, retaddr); } else { --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070285032813.748315275647; Mon, 2 Feb 2026 14:11:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn27s-0001Kq-WC; Mon, 02 Feb 2026 17:10:33 -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 1vn27j-0000FG-3n; Mon, 02 Feb 2026 17:10:23 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn27h-00036i-2d; Mon, 02 Feb 2026 17:10:22 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F059C1852C9; Tue, 03 Feb 2026 01:07:35 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id CD6A735B3DC; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Yao Zi , Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 28/56] hw/loongarch/virt: Don't abort on access to unimplemented IOCSR Date: Tue, 3 Feb 2026 01:07:33 +0300 Message-ID: <20260202220805.945271-28-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070287296158500 From: Yao Zi Since commit f2e61edb2946 ("hw/loongarch/virt: Use MemTxAttrs interface for misc ops") which adds a call to g_assert_not_reached() in the path of handling unimplemented IOCSRs, QEMU would abort when the guest accesses unimplemented IOCSRs. This is too serious since there's nothing fatal happening in QEMU itself, and the guest could probably continue running if we give zero as result for these reads, which also matches the behavior observed on 3A5000M real machine. Replace the assertion with qemu_log_mask(LOG_UNIMP, ...), it's still possible to examine unimplemented IOCSR access through "-d unimp" command line arguments. Fixes: f2e61edb2946 ("hw/loongarch/virt: Use MemTxAttrs interface for misc = ops") Signed-off-by: Yao Zi Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bibo Mao (cherry picked from commit 49ee001a5b8378e9a9b3db8cbf61e7eda970ecd2) Signed-off-by: Michael Tokarev diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 49434ad182..b59645be54 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -46,6 +46,7 @@ #include "hw/block/flash.h" #include "hw/virtio/virtio-iommu.h" #include "qemu/error-report.h" +#include "qemu/log.h" #include "kvm/kvm_loongarch.h" =20 static void virt_get_dmsi(Object *obj, Visitor *v, const char *name, @@ -621,8 +622,15 @@ static MemTxResult virt_iocsr_misc_write(void *opaque,= hwaddr addr, EXTIOI_VIRT_BASE + EXTIOI_VIRT_CONFIG, features, attrs, NULL); break; + case VERSION_REG: + case FEATURE_REG: + case VENDOR_REG: + case CPUNAME_REG: + break; default: - g_assert_not_reached(); + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented IOCSR 0x%" HWADDR_PRIx= "\n", + __func__, addr); + break; } =20 return MEMTX_OK; @@ -680,7 +688,9 @@ static MemTxResult virt_iocsr_misc_read(void *opaque, h= waddr addr, } break; default: - g_assert_not_reached(); + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented IOCSR 0x%" HWADDR_PRIx= "\n", + __func__, addr); + break; } =20 *data =3D ret; --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070603137950.4909341298389; Mon, 2 Feb 2026 14:16:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn287-0002T1-Vx; Mon, 02 Feb 2026 17:10:49 -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 1vn282-000215-Ev; Mon, 02 Feb 2026 17:10:44 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn280-00036n-T9; Mon, 02 Feb 2026 17:10:42 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0E9B51852CA; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id DE32935B3DD; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Markus Armbruster , Peter Maydell , Michael Tokarev Subject: [Stable-10.2.1 29/56] hw/arm: Re-enable the MAX78000FTHR machine in qemu-system-arm/aarch64 Date: Tue, 3 Feb 2026 01:07:34 +0300 Message-ID: <20260202220805.945271-29-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070603481158500 From: Philippe Mathieu-Daud=C3=A9 Unfortunately while rebasing the series registering the ARM/Aarch64 machine interfaces and getting it merged as commit 38c5ab40031 ("hw/arm: Filter machine types for qemu-system-arm/aarch64 binaries") we missed the recent addition of the MAX78000FTHR machine in commit 51eb283dd0e. Correct that. The effect is that the machine was accidentally disabled. Cc: qemu-stable@nongnu.org Reported-by: Thomas Huth Tested-by: Thomas Huth Tested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20251218214306.63667-1-philmd@linaro.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3248 Fixes: 38c5ab40031 ("hw/arm: Filter machine types for single binary") Signed-off-by: Peter Maydell (cherry picked from commit c5712ad83fa4bf2f2a4e8fc9431ad9548bac2b06) Signed-off-by: Michael Tokarev diff --git a/hw/arm/max78000fthr.c b/hw/arm/max78000fthr.c index c4f6b5b1b0..ccef85e456 100644 --- a/hw/arm/max78000fthr.c +++ b/hw/arm/max78000fthr.c @@ -12,6 +12,7 @@ #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" #include "qemu/error-report.h" +#include "hw/arm/machines-qom.h" #include "hw/arm/max78000_soc.h" #include "hw/arm/boot.h" =20 @@ -47,4 +48,4 @@ static void max78000_machine_init(MachineClass *mc) mc->valid_cpu_types =3D valid_cpu_types; } =20 -DEFINE_MACHINE("max78000fthr", max78000_machine_init) +DEFINE_MACHINE_ARM("max78000fthr", max78000_machine_init) --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070590374537.4698809406714; Mon, 2 Feb 2026 14:16:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn28I-0003qQ-4d; Mon, 02 Feb 2026 17:10:58 -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 1vn287-0002XY-7Y; Mon, 02 Feb 2026 17:10:47 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn285-00038p-0I; Mon, 02 Feb 2026 17:10:46 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2B00E1852CB; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id F06A935B3DE; Tue, 03 Feb 2026 01:08:17 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Michael Tokarev Subject: [Stable-10.2.1 30/56] tests/functional: migrate aspeed_rainier image Date: Tue, 3 Feb 2026 01:07:35 +0300 Message-ID: <20260202220805.945271-30-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070591725154100 From: Alex Benn=C3=A9e Cedric has a host for the file which allows us to keep the name. Cc: qemu-stable@nongnu.org Signed-off-by: Alex Benn=C3=A9e Reviewed-by: C=C3=A9dric Le Goater Message-id: 20260113135941.3361163-1-alex.bennee@linaro.org Cc: C=C3=A9dric Le Goater Signed-off-by: Peter Maydell (cherry picked from commit 7cf096d609e67fd06abf6a59e592cb6de427825c) Signed-off-by: Michael Tokarev diff --git a/tests/functional/arm/test_aspeed_rainier.py b/tests/functional= /arm/test_aspeed_rainier.py index 602d6194ac..30827beca3 100755 --- a/tests/functional/arm/test_aspeed_rainier.py +++ b/tests/functional/arm/test_aspeed_rainier.py @@ -9,10 +9,8 @@ =20 class RainierMachine(AspeedTest): =20 - ASSET_RAINIER_EMMC =3D Asset( - ('https://fileserver.linaro.org/s/B6pJTwWEkzSDi36/download/' - 'mmc-p10bmc-20240617.qcow2'), - 'd523fb478d2b84d5adc5658d08502bc64b1486955683814f89c6137518acd90b') + ASSET_RAINIER_EMMC =3D Asset('https://kaod.org/qemu/aspeed/rainier/mmc= -p10bmc-20240617.qcow2', + 'd523fb478d2b84d5adc5658d08502bc64b14869556= 83814f89c6137518acd90b') =20 def test_arm_aspeed_emmc_boot(self): self.set_machine('rainier-bmc') --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070401734457.5018722616627; Mon, 2 Feb 2026 14:13:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn28G-0003eu-E4; Mon, 02 Feb 2026 17:10:56 -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 1vn285-0002Hz-L4; Mon, 02 Feb 2026 17:10:45 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn283-0003Bu-SH; Mon, 02 Feb 2026 17:10:45 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3AF271852CC; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 1862435B3DF; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 31/56] target/arm: Don't specify ID_PFR1 accessfn twice Date: Tue, 3 Feb 2026 01:07:36 +0300 Message-ID: <20260202220805.945271-31-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070402875154100 From: Peter Maydell In the definition of ID_PFR1 we have an ifdef block; we specify the accessfn once in the common part of the ifdef and once in the not-user-only part, which is redundant but harmless. The accessfn will always return success in user-only mode (because we won't trap to EL2), so specify it only in the not-user-only half of the ifdef, as was probably the intention. This is only cc'd to stable to avoid a textual conflict with the following patch, which is a bug fix. Cc: qemu-stable@nongnu.org Fixes: 0f150c8499e970bd ("target/arm: Constify ID_PFR1 on user emulation") Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-id: 20251231170858.254594-2-peter.maydell@linaro.org (cherry picked from commit 8da52b8401afa34ea8caa58e1bfb321ae142899b) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index 27ebc6f29b..ec82ea6203 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6296,7 +6296,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "ID_PFR1", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_NO_RAW, - .accessfn =3D access_aa32_tid3, #ifdef CONFIG_USER_ONLY .type =3D ARM_CP_CONST, .resetvalue =3D GET_IDREG(isar, ID_PFR1), --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070321229801.0163856100445; Mon, 2 Feb 2026 14:12:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn28D-0003I0-L4; Mon, 02 Feb 2026 17:10:53 -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 1vn28B-00031t-IS; Mon, 02 Feb 2026 17:10:51 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn288-0003Cv-AT; Mon, 02 Feb 2026 17:10:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4D7C11852CD; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 29DEB35B3E0; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 32/56] target/arm: Correctly honour HCR.TID3 for v7A cores Date: Tue, 3 Feb 2026 01:07:37 +0300 Message-ID: <20260202220805.945271-32-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070323806154100 From: Peter Maydell The HCR.TID3 bit defines that we should trap to the hypervisor for reads to a collection of ID registers. Different architecture versions have defined this differently: * v7A has a set of ID regs that definitely must trap: - ID_PFR{0,1}, ID_DFR0, ID_AFR0, ID_MMFR{0,1,2,3}, ID_ISAR{0,1,2,3,4,5}, MVFR{0,1} and somewhat vaguely says that "there is no requirement" to trap for registers that are reserved in the ID reg space (i.e. which RAZ and might be used for new ID regs in future) * v8A adds to this list: - ID_PFR2 and MVFR2 must trap - ID_MMFR4, ID_MMFR5, ID_ISAR6, ID_DFR1 and reserved registers in the ID reg space must trap if FEAT_FGT is implemented, and it is IMPDEF if they trap if FEAT_FGT is not implemented In QEMU we seem to have attempted to implement this distinction (taking the "we do trap" IMPDEF choice if no FEAT_FGT), with access_aa64_tid3() always trapping on TID3 and access_aa32_tid3() trapping only if ARM_FEATURE_V8 is set. However, we didn't apply these to the right set of registers: we use access_aa32_tid3() on all the 32-bit ID registers *except* ID_PFR2, ID_DFR1, ID_MMFR5 and the RES0 space, which means that for a v7 CPU we don't trap on a lot of registers that we should trap on, and we do trap on various things that the v7A Arm ARM says there is "no requirement" to trap on. Straighten this out by naming the access functions more clearly for their purpose, and documenting this: access_v7_tid3() is only for the fixed set of ID registers that v7A traps on HCR.TID3, and access_tid3() is for any others, including the reserved encoding spaces and any new registers we add in future. AArch32 MVFR2 access is handled differently, in check_hcr_el2_trap; there we already do not trap on TID3 on v7A cores (where MVFR2 doesn't exist), because we in the code-generation function we UNDEF if ARM_FEATURE_V8 is not set, without generating code to call check_hcr_el2_trap. This bug was causing a problem for Xen which (after a recent change to Xen) expects to be able to trap ID_PFR0 on a Cortex-A15. The result of these changes is that our v8A behaviour remains the same, and on v7A we now trap the registers the Arm ARM definitely requires us to trap, and don't trap the reserved space that "there is no requirement" to trap. Cc: qemu-stable@nongnu.org Fixes: 6a4ef4e5d1084c ("target/arm: Honor HCR_EL2.TID3 trapping requirement= s") Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-id: 20251231170858.254594-3-peter.maydell@linaro.org (cherry picked from commit 205ca535abaceda375c54797b1129a54a5ebbe96) (Mjt: trivial context fix around AA64MMFR4_EL1 definition) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index ec82ea6203..51d192f0ba 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5835,9 +5835,18 @@ static const ARMCPRegInfo ccsidr2_reginfo[] =3D { .readfn =3D ccsidr2_read, .type =3D ARM_CP_NO_RAW }, }; =20 -static CPAccessResult access_aa64_tid3(CPUARMState *env, const ARMCPRegInf= o *ri, - bool isread) +static CPAccessResult access_v7a_tid3(CPUARMState *env, const ARMCPRegInfo= *ri, + bool isread) { + /* + * Trap on TID3 always. This should be used only for the fixed set of + * registers which are defined to trap on HCR.TID3 in v7A, which is: + * ID_PFR{0,1}, ID_DFR0, ID_AFR0, ID_MMFR{0,1,2,3}, ID_ISAR{0,1,2,3,= 4,5} + * (MVFR0 and MVFR1 also trap in v7A, but this is not handled via + * this accessfn but in check_hcr_el2_trap.) + * Any other registers in the TID3 trap space should use access_tid3(), + * so that they trap on v8 and above, but not on v7. + */ if ((arm_current_el(env) < 2) && (arm_hcr_el2_eff(env) & HCR_TID3)) { return CP_ACCESS_TRAP_EL2; } @@ -5845,11 +5854,18 @@ static CPAccessResult access_aa64_tid3(CPUARMState = *env, const ARMCPRegInfo *ri, return CP_ACCESS_OK; } =20 -static CPAccessResult access_aa32_tid3(CPUARMState *env, const ARMCPRegInf= o *ri, - bool isread) +static CPAccessResult access_tid3(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) { + /* + * Trap on TID3, if we implement at least v8. For v8 and above + * the ID register space is at least IMPDEF permitted to trap, + * and must trap if FEAT_FGT is implemented. We choose to trap + * always. Use this function for any new registers that should + * trap on TID3. + */ if (arm_feature(env, ARM_FEATURE_V8)) { - return access_aa64_tid3(env, ri, isread); + return access_v7a_tid3(env, ri, isread); } =20 return CP_ACCESS_OK; @@ -6287,7 +6303,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "ID_PFR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_PFR0)}, /* * ID_PFR1 is not a plain ARM_CP_CONST because we don't know @@ -6301,7 +6317,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .resetvalue =3D GET_IDREG(isar, ID_PFR1), #else .type =3D ARM_CP_NO_RAW, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .readfn =3D id_pfr1_read, .writefn =3D arm_cp_write_ignore #endif @@ -6309,72 +6325,72 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "ID_DFR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_DFR0)}, { .name =3D "ID_AFR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_AFR0)}, { .name =3D "ID_MMFR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR0)}, { .name =3D "ID_MMFR1", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR1)}, { .name =3D "ID_MMFR2", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR2)}, { .name =3D "ID_MMFR3", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR3)}, { .name =3D "ID_ISAR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR0)}, { .name =3D "ID_ISAR1", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR1)}, { .name =3D "ID_ISAR2", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR2)}, { .name =3D "ID_ISAR3", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR3) }, { .name =3D "ID_ISAR4", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR4) }, { .name =3D "ID_ISAR5", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_v7a_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR5) }, { .name =3D "ID_MMFR4", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR4)}, { .name =3D "ID_ISAR6", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 2, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa32_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_ISAR6) }, }; define_arm_cp_regs(cpu, v6_idregs); @@ -6425,7 +6441,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .resetvalue =3D GET_IDREG(isar, ID_AA64PFR0) #else .type =3D ARM_CP_NO_RAW, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .readfn =3D id_aa64pfr0_read, .writefn =3D arm_cp_write_ignore #endif @@ -6433,172 +6449,172 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "ID_AA64PFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64PFR1)}, { .name =3D "ID_AA64PFR2_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64PFR2)}, { .name =3D "ID_AA64PFR3_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ZFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64ZFR0)}, { .name =3D "ID_AA64SMFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64SMFR0)}, { .name =3D "ID_AA64PFR6_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64PFR7_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 4, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64DFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64DFR0) }, { .name =3D "ID_AA64DFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64DFR1) }, { .name =3D "ID_AA64DFR2_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64DFR3_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64AFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64AFR0) }, { .name =3D "ID_AA64AFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64AFR1) }, { .name =3D "ID_AA64AFR2_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64AFR3_EL1_RESERVED", .state =3D ARM_CP_STAT= E_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 5, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ISAR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64ISAR0)}, { .name =3D "ID_AA64ISAR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64ISAR1)}, { .name =3D "ID_AA64ISAR2_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64ISAR2)}, { .name =3D "ID_AA64ISAR3_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ISAR4_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ISAR5_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ISAR6_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64ISAR7_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64MMFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64MMFR0)}, { .name =3D "ID_AA64MMFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64MMFR1) }, { .name =3D "ID_AA64MMFR2_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64MMFR2) }, { .name =3D "ID_AA64MMFR3_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_AA64MMFR3) }, { .name =3D "ID_AA64MMFR4_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64MMFR5_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64MMFR6_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_AA64MMFR7_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 7, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "MVFR0_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D cpu->isar.mvfr0 }, { .name =3D "MVFR1_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D cpu->isar.mvfr1 }, { .name =3D "MVFR2_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D cpu->isar.mvfr2 }, /* * "0, c0, c3, {0,1,2}" are the encodings corresponding to @@ -6609,17 +6625,17 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "RES_0_C0_C3_0", .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D 0, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "RES_0_C0_C3_1", .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D 1, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "RES_0_C0_C3_2", .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, /* * Other encodings in "0, c0, c3, ..." are STATE_BOTH because @@ -6630,27 +6646,27 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "RES_0_C0_C3_3", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, { .name =3D "ID_PFR2", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 4, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_PFR2)}, { .name =3D "ID_DFR1", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 5, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_DFR1)}, { .name =3D "ID_MMFR5", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 6, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D GET_IDREG(isar, ID_MMFR5)}, { .name =3D "RES_0_C0_C3_7", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 3, .opc2 =3D = 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }, }; #ifdef CONFIG_USER_ONLY @@ -6800,7 +6816,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 0, .crn =3D 0, .crm =3D i, .opc2 =3D= CP_ANY, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid3, + .accessfn =3D access_tid3, .resetvalue =3D 0 }; define_one_arm_cp_reg(cpu, &v8_aa32_raz_idregs); } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070338041163.30522504795692; Mon, 2 Feb 2026 14:12:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn28l-0005ZC-Qu; Mon, 02 Feb 2026 17:11:28 -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 1vn28U-0005K9-P4; Mon, 02 Feb 2026 17:11:13 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28S-0003D4-Sa; Mon, 02 Feb 2026 17:11:10 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5DA071852CE; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 3B1CE35B3E1; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 33/56] target/arm: Correctly trap HCR.TID1 registers in v7A Date: Tue, 3 Feb 2026 01:07:38 +0300 Message-ID: <20260202220805.945271-33-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070340500158500 From: Peter Maydell In v7A HCR.TID1 is defined to trap for TCMTR, TLBTR, REVIDR and AIDR. We incorrectly use an accessfn for REVIDR and AIDR that only traps on v8A cores. Fix this by collapsing access_aa64_tid1() and access_aa32_tid1() together and never doing a check for v8 vs v7. The accessfn is also used for SMIDR_EL1, which is fine as this register is AArch64 only. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-id: 20251231170858.254594-4-peter.maydell@linaro.org (cherry picked from commit b67a35622f9a816544ec094132d8af0debfac7f2) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index 51d192f0ba..633d314edf 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -924,8 +924,8 @@ static uint64_t isr_read(CPUARMState *env, const ARMCPR= egInfo *ri) return ret; } =20 -static CPAccessResult access_aa64_tid1(CPUARMState *env, const ARMCPRegInf= o *ri, - bool isread) +static CPAccessResult access_tid1(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) { if (arm_current_el(env) =3D=3D 1 && (arm_hcr_el2_eff(env) & HCR_TID1))= { return CP_ACCESS_TRAP_EL2; @@ -934,16 +934,6 @@ static CPAccessResult access_aa64_tid1(CPUARMState *en= v, const ARMCPRegInfo *ri, return CP_ACCESS_OK; } =20 -static CPAccessResult access_aa32_tid1(CPUARMState *env, const ARMCPRegInf= o *ri, - bool isread) -{ - if (arm_feature(env, ARM_FEATURE_V8)) { - return access_aa64_tid1(env, ri, isread); - } - - return CP_ACCESS_OK; -} - static const ARMCPRegInfo v7_cp_reginfo[] =3D { /* the old v6 WFI, UNPREDICTABLE in v7 but we choose to NOP */ { .name =3D "NOP", .cp =3D 15, .crn =3D 7, .crm =3D 0, .opc1 =3D 0, .o= pc2 =3D 4, @@ -969,7 +959,7 @@ static const ARMCPRegInfo v7_cp_reginfo[] =3D { { .name =3D "AIDR", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 1, .crn =3D 0, .crm =3D 0, .opc2 =3D 7, .access =3D PL1_R, .type =3D ARM_CP_CONST, - .accessfn =3D access_aa64_tid1, + .accessfn =3D access_tid1, .fgt =3D FGT_AIDR_EL1, .resetvalue =3D 0 }, /* @@ -4997,7 +4987,7 @@ static const ARMCPRegInfo sme_reginfo[] =3D { .writefn =3D smcr_write, .raw_writefn =3D raw_write }, { .name =3D "SMIDR_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 1, .crn =3D 0, .crm =3D 0, .opc2 =3D 6, - .access =3D PL1_R, .accessfn =3D access_aa64_tid1, + .access =3D PL1_R, .accessfn =3D access_tid1, /* * IMPLEMENTOR =3D 0 (software) * REVISION =3D 0 (implementation defined) @@ -7094,7 +7084,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "REVIDR_EL1", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 0, .opc2 =3D = 6, .access =3D PL1_R, - .accessfn =3D access_aa64_tid1, + .accessfn =3D access_tid1, .fgt =3D FGT_REVIDR_EL1, .type =3D ARM_CP_CONST, .resetvalue =3D cpu->revidr }, }; @@ -7118,7 +7108,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) { .name =3D "TCMTR", .cp =3D 15, .crn =3D 0, .crm =3D 0, .opc1 =3D 0, .opc2 =3D 2, .access =3D PL1_R, - .accessfn =3D access_aa32_tid1, + .accessfn =3D access_tid1, .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, }; /* TLBTR is specific to VMSA */ @@ -7126,7 +7116,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .name =3D "TLBTR", .cp =3D 15, .crn =3D 0, .crm =3D 0, .opc1 =3D 0, .opc2 =3D 3, .access =3D PL1_R, - .accessfn =3D access_aa32_tid1, + .accessfn =3D access_tid1, .type =3D ARM_CP_CONST, .resetvalue =3D 0, }; /* MPUIR is specific to PMSA V6+ */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070601069109.62207580751135; Mon, 2 Feb 2026 14:16:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29J-0006MW-In; Mon, 02 Feb 2026 17:12:03 -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 1vn28Y-0005PB-H5; Mon, 02 Feb 2026 17:11:21 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28X-0003E3-2e; Mon, 02 Feb 2026 17:11:14 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 780ED1852CF; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 4B00535B3E2; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Pierrick Bouvier , Michael Tokarev Subject: [Stable-10.2.1 34/56] accel/nvmm: Fix 'cpu' typo in nvmm_init_vcpu() Date: Tue, 3 Feb 2026 01:07:39 +0300 Message-ID: <20260202220805.945271-34-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070601499158500 From: Philippe Mathieu-Daud=C3=A9 Fix typo to avoid the following build failure: target/i386/nvmm/nvmm-all.c: In function 'nvmm_init_vcpu': target/i386/nvmm/nvmm-all.c:988:9: error: 'AccelCPUState' has no member n= amed 'vcpu_dirty' 988 | qcpu->vcpu_dirty =3D true; | ^~ Cc: qemu-stable@nongnu.org Reported-by: Thomas Huth Fixes: 2098164a6be ("accel/nvmm: Replace @dirty field by generic CPUState::= vcpu_dirty field") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Thomas Huth Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Message-ID: <20260113203924.81560-1-philmd@linaro.org> (cherry picked from commit 7be4256281f430f726366c92ffdea0b72651de8a) Signed-off-by: Michael Tokarev diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index b9bd9ed985..f808828d49 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -985,7 +985,7 @@ nvmm_init_vcpu(CPUState *cpu) } } =20 - qcpu->vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; cpu->accel =3D qcpu; =20 return 0; --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 177007042876688.23270165703934; Mon, 2 Feb 2026 14:13:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29V-00075T-9b; Mon, 02 Feb 2026 17:12:13 -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 1vn28X-0005Od-VD; Mon, 02 Feb 2026 17:11:21 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28W-0003H0-BO; Mon, 02 Feb 2026 17:11:13 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9149D1852D0; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 6593A35B3E3; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.2.1 35/56] linux-user/aarch64/target_fcntl.h: add missing TARGET_O_LARGEFILE definition Date: Tue, 3 Feb 2026 01:07:40 +0300 Message-ID: <20260202220805.945271-35-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070430779158500 From: Pierrick Bouvier This caused a failure with program using openat2, where O_LARGEFILE was replaced by O_NOFOLLOW. This issue is only visible when QEMU is compiled with musl libc, where O_LARGEFILE is different from 0 (vs glibc). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3262 Cc: qemu-stable@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit 83017c4aaa9e3ef80161443019764196dffdb654) Signed-off-by: Michael Tokarev diff --git a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_= fcntl.h index efdf6e5f05..55ab788a7c 100644 --- a/linux-user/aarch64/target_fcntl.h +++ b/linux-user/aarch64/target_fcntl.h @@ -11,6 +11,7 @@ #define TARGET_O_DIRECTORY 040000 /* must be a directory */ #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ +#define TARGET_O_LARGEFILE 0400000 =20 #include "../generic/fcntl.h" #endif --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070418569349.94540417094356; Mon, 2 Feb 2026 14:13:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29O-0006az-Cw; Mon, 02 Feb 2026 17:12:07 -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 1vn28c-0005SW-Uj; Mon, 02 Feb 2026 17:11:22 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28Z-0003HV-Oi; Mon, 02 Feb 2026 17:11:18 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id AAC1E1852D1; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 7E46F35B3E4; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Michael Tokarev Subject: [Stable-10.2.1 36/56] hw/sd/sdhci: Fix TYPE_IMX_USDHC to implement sd-spec-version 3 by default Date: Tue, 3 Feb 2026 01:07:41 +0300 Message-ID: <20260202220805.945271-36-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070421325154100 From: Bernhard Beschow Fixes TYPE_FSL_IMX6UL, TYPE_FSL_IMX7, and TYPE_FSL_IMX8MP to implement version 3 of the SD specification. Note that TYPE_FSL_IMX6 already had "sd-spec-version" set accordingly and that TYPE_FSL_IMX25 correctly sets the same property to version 2 since the real hardware is an eSDHC which is the uSDHC's predecessor. Fixes: fd1e5c817964 ("sdhci: Add i.MX specific subtype of SDHCI") cc: qemu-stable Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: BALATON Zoltan Message-ID: <20260112145418.220506-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 (cherry picked from commit 214f79fdfb43e92f6c06efb76c3ad8e932b035f8) Signed-off-by: Michael Tokarev diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 89b595ce4a..09e9ebfe09 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1884,9 +1884,11 @@ static const MemoryRegionOps usdhc_mmio_ops =3D { static void imx_usdhc_init(Object *obj) { SDHCIState *s =3D SYSBUS_SDHCI(obj); + DeviceState *dev =3D DEVICE(obj); =20 s->io_ops =3D &usdhc_mmio_ops; s->quirks =3D SDHCI_QUIRK_NO_BUSY_IRQ; + qdev_prop_set_uint8(dev, "sd-spec-version", 3); } =20 /* --- qdev Samsung s3c --- */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070430615456.7469630289854; Mon, 2 Feb 2026 14:13:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn28p-0005lP-G6; Mon, 02 Feb 2026 17:11:31 -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 1vn28d-0005SZ-W2; Mon, 02 Feb 2026 17:11:22 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28b-0003Hg-Rh; Mon, 02 Feb 2026 17:11:19 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C90261852D2; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 97EFB35B3E5; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Kyle Evans , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Michael Tokarev Subject: [Stable-10.2.1 37/56] bsd-user: Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT Date: Tue, 3 Feb 2026 01:07:42 +0300 Message-ID: <20260202220805.945271-37-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070430857158500 From: Richard Henderson The target test is TARGET_I386, not __i386__. Cc: Kyle Evans Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson (cherry picked from commit 369c1ba2b7c721341979889841772629b853092b) Signed-off-by: Michael Tokarev diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index 52f84d5dd1..c49be32bdc 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -247,7 +247,7 @@ struct target_freebsd11_stat { unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); } __packed; =20 -#if defined(__i386__) +#if defined(TARGET_I386) #define TARGET_HAS_STAT_TIME_T_EXT 1 #endif =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070437527376.4796357595403; Mon, 2 Feb 2026 14:13:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29O-0006b6-C3; Mon, 02 Feb 2026 17:12:07 -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 1vn290-000673-Ti; Mon, 02 Feb 2026 17:11:43 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn28z-0003I6-HZ; Mon, 02 Feb 2026 17:11:42 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D9C441852D3; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id B6C7635B3E6; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Warner Losh , Michael Tokarev Subject: [Stable-10.2.1 38/56] bsd-user/syscall_defs.h: define STAT_TIME_T_EXT only for 32 bits Date: Tue, 3 Feb 2026 01:07:43 +0300 Message-ID: <20260202220805.945271-38-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070438986158500 From: Pierrick Bouvier Commit 369c1ba2b changed the wrong conditional "#if defined(__i386__)" to "#if defined(TARGET_I386)". However, TARGET_I386 is defined for target x86_64 also. This commit fixes it by identifying correctly 32 bits target. Found with: $ ./build/qemu-x86_64 \ -plugin ./build/contrib/plugins/libstoptrigger,icount=3D1000000 \ -plugin ./build/tests/tcg/plugins/libinsn \ -d plugin \ ./build/qemu-system-x86_64 --version ld-elf.so.1: /lib/libz.so.6: invalid file format cpu 0 insns: 59746 total insns: 59746 Fixes: 369c1ba2b ("Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT") Fixes: dba028d1b ("Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT" in 10.= 2.x) Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Warner Losh Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit f0de58ccf6566ad5cf04948788f9b0cfb8b960b4) Signed-off-by: Michael Tokarev diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index c49be32bdc..cc4b484f3a 100644 --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -247,7 +247,7 @@ struct target_freebsd11_stat { unsigned int:(8 / 2) * (16 - (int)sizeof(struct target_freebsd_timespe= c)); } __packed; =20 -#if defined(TARGET_I386) +#if defined(TARGET_I386) && !defined(TARGET_X86_64) #define TARGET_HAS_STAT_TIME_T_EXT 1 #endif =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070386893638.704687571107; Mon, 2 Feb 2026 14:13:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29c-0007Mz-Ni; Mon, 02 Feb 2026 17:12:20 -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 1vn291-00067M-Fz; Mon, 02 Feb 2026 17:11:44 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn290-0003IG-0b; Mon, 02 Feb 2026 17:11:43 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E876E1852D4; Tue, 03 Feb 2026 01:07:36 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id C7C4D35B3E7; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Michael Tokarev Subject: [Stable-10.2.1 39/56] hw/intc: avoid byte swap fiddling in gicv3 its path Date: Tue, 3 Feb 2026 01:07:44 +0300 Message-ID: <20260202220805.945271-39-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070388626158500 From: Alex Benn=C3=A9e This allows us to keep the MSI data in plain host order all the way from the MemoryRegionOps write method to the final KVM_SIGNAL_MSI ioctl. This fixes a theoretical bug on big-endian hosts because we were using different size byte swaps which would have truncated the data. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Peter Maydell Message-id: 20260121105932.135676-5-alex.bennee@linaro.org Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell (cherry picked from commit cf10273aff8198ab1c7e2a00e7e5fe51c80b04e7) Signed-off-by: Michael Tokarev diff --git a/hw/intc/arm_gicv3_its_common.c b/hw/intc/arm_gicv3_its_common.c index e946e3fb87..b993e6d116 100644 --- a/hw/intc/arm_gicv3_its_common.c +++ b/hw/intc/arm_gicv3_its_common.c @@ -81,7 +81,7 @@ static MemTxResult gicv3_its_trans_write(void *opaque, hw= addr offset, if (offset =3D=3D 0x0040 && ((size =3D=3D 2) || (size =3D=3D 4))) { GICv3ITSState *s =3D ARM_GICV3_ITS_COMMON(opaque); GICv3ITSCommonClass *c =3D ARM_GICV3_ITS_COMMON_GET_CLASS(s); - int ret =3D c->send_msi(s, le64_to_cpu(value), attrs.requester_id); + int ret =3D c->send_msi(s, value, attrs.requester_id); =20 if (ret <=3D 0) { qemu_log_mask(LOG_GUEST_ERROR, diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 9812d50859..d5086a6407 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -58,7 +58,7 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t va= lue, uint16_t devid) =20 msi.address_lo =3D extract64(s->gits_translater_gpa, 0, 32); msi.address_hi =3D extract64(s->gits_translater_gpa, 32, 32); - msi.data =3D le32_to_cpu(value); + msi.data =3D value; msi.flags =3D KVM_MSI_VALID_DEVID; msi.devid =3D devid; memset(msi.pad, 0, sizeof(msi.pad)); --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070574253229.59053173728296; Mon, 2 Feb 2026 14:16:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29X-00077x-EF; Mon, 02 Feb 2026 17:12:16 -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 1vn294-0006Ai-KL; Mon, 02 Feb 2026 17:11:48 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn292-0003Ls-9q; Mon, 02 Feb 2026 17:11:46 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 05A341852D5; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id D72DF35B3E8; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Heinrich Schuchardt , Michael Tokarev Subject: [Stable-10.2.1 40/56] linux-user: Add termios2 support Date: Tue, 3 Feb 2026 01:07:45 +0300 Message-ID: <20260202220805.945271-40-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070577636154101 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/745f18b6-ee62-4903-9a56-dcb903b610= cf@bonslack.org Reviewed-by: Helge Deller Tested-by: Heinrich Schuchardt (cherry picked from commit e9a8a10e84c1bf6e2e8be000e4dd5c83ba0d8470) Signed-off-by: Michael Tokarev diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 2f62fd2cb9..6ecfe6306e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -1,5 +1,11 @@ /* emulated ioctl list */ =20 +#ifdef TARGET_TCGETS2 + IOCTL(TCGETS2, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETS2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETSW2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETSF2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) +#endif IOCTL(TCGETS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios))) IOCTL(TCSETS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) IOCTL(TCSETSF, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios))) diff --git a/linux-user/strace.c b/linux-user/strace.c index 758c5d32b6..18bc6c800c 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1935,6 +1935,75 @@ print_termios(void *arg) qemu_log("}"); } =20 +#ifdef TARGET_TCGETS2 +void +print_termios2(void *arg) +{ + const struct target_termios2 *target =3D arg; + + target_tcflag_t iflags =3D tswap32(target->c_iflag); + target_tcflag_t oflags =3D tswap32(target->c_oflag); + target_tcflag_t cflags =3D tswap32(target->c_cflag); + target_tcflag_t lflags =3D tswap32(target->c_lflag); + + qemu_log("{"); + + qemu_log("c_iflag =3D "); + print_flags(termios_iflags, iflags, 0); + + qemu_log("c_oflag =3D "); + target_tcflag_t oflags_clean =3D oflags & ~(TARGET_NLDLY | TARGET_CRD= LY | + TARGET_TABDLY | TARGET_BSDL= Y | + TARGET_VTDLY | TARGET_FFDLY= ); + print_flags(termios_oflags, oflags_clean, 0); + if (oflags & TARGET_NLDLY) { + print_enums(termios_oflags_NLDLY, oflags & TARGET_NLDLY, 0); + } + if (oflags & TARGET_CRDLY) { + print_enums(termios_oflags_CRDLY, oflags & TARGET_CRDLY, 0); + } + if (oflags & TARGET_TABDLY) { + print_enums(termios_oflags_TABDLY, oflags & TARGET_TABDLY, 0); + } + if (oflags & TARGET_BSDLY) { + print_enums(termios_oflags_BSDLY, oflags & TARGET_BSDLY, 0); + } + if (oflags & TARGET_VTDLY) { + print_enums(termios_oflags_VTDLY, oflags & TARGET_VTDLY, 0); + } + if (oflags & TARGET_FFDLY) { + print_enums(termios_oflags_FFDLY, oflags & TARGET_FFDLY, 0); + } + + qemu_log("c_cflag =3D "); + if (cflags & TARGET_CBAUD) { + print_enums(termios_cflags_CBAUD, cflags & TARGET_CBAUD, 0); + } + if (cflags & TARGET_CSIZE) { + print_enums(termios_cflags_CSIZE, cflags & TARGET_CSIZE, 0); + } + target_tcflag_t cflags_clean =3D cflags & ~(TARGET_CBAUD | TARGET_CSIZ= E); + print_flags(termios_cflags, cflags_clean, 0); + + qemu_log("c_lflag =3D "); + print_flags(termios_lflags, lflags, 0); + + qemu_log("c_ispeed =3D "); + print_raw_param("%u", tswap32(target->c_ispeed), 0); + + qemu_log("c_ospeed =3D "); + print_raw_param("%u", tswap32(target->c_ospeed), 0); + + qemu_log("c_cc =3D "); + qemu_log("\"%s\",", target->c_cc); + + qemu_log("c_line =3D "); + print_raw_param("\'%c\'", target->c_line, 1); + + qemu_log("}"); +} +#endif + #undef UNUSED =20 #ifdef TARGET_NR_accept diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ee7c34027e..93ac285c5e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -86,6 +86,7 @@ #endif =20 #define termios host_termios +#define termios2 host_termios2 #define winsize host_winsize #define termio host_termio #define sgttyb host_sgttyb /* same as target */ @@ -5888,6 +5889,89 @@ static const StructEntry struct_termios_def =3D { .print =3D print_termios, }; =20 +#ifdef TARGET_TCGETS2 +static void target_to_host_termios2 (void *dst, const void *src) +{ + struct host_termios2 *host =3D dst; + const struct target_termios2 *target =3D src; + + host->c_iflag =3D + target_to_host_bitmask(tswap32(target->c_iflag), iflag_tbl); + host->c_oflag =3D + target_to_host_bitmask(tswap32(target->c_oflag), oflag_tbl); + host->c_cflag =3D + target_to_host_bitmask(tswap32(target->c_cflag), cflag_tbl); + host->c_lflag =3D + target_to_host_bitmask(tswap32(target->c_lflag), lflag_tbl); + host->c_line =3D target->c_line; + host->c_ispeed =3D tswap32(target->c_ispeed); + host->c_ospeed =3D tswap32(target->c_ospeed); + + memset(host->c_cc, 0, sizeof(host->c_cc)); + host->c_cc[VINTR] =3D target->c_cc[TARGET_VINTR]; + host->c_cc[VQUIT] =3D target->c_cc[TARGET_VQUIT]; + host->c_cc[VERASE] =3D target->c_cc[TARGET_VERASE]; + host->c_cc[VKILL] =3D target->c_cc[TARGET_VKILL]; + host->c_cc[VEOF] =3D target->c_cc[TARGET_VEOF]; + host->c_cc[VTIME] =3D target->c_cc[TARGET_VTIME]; + host->c_cc[VMIN] =3D target->c_cc[TARGET_VMIN]; + host->c_cc[VSWTC] =3D target->c_cc[TARGET_VSWTC]; + host->c_cc[VSTART] =3D target->c_cc[TARGET_VSTART]; + host->c_cc[VSTOP] =3D target->c_cc[TARGET_VSTOP]; + host->c_cc[VSUSP] =3D target->c_cc[TARGET_VSUSP]; + host->c_cc[VEOL] =3D target->c_cc[TARGET_VEOL]; + host->c_cc[VREPRINT] =3D target->c_cc[TARGET_VREPRINT]; + host->c_cc[VDISCARD] =3D target->c_cc[TARGET_VDISCARD]; + host->c_cc[VWERASE] =3D target->c_cc[TARGET_VWERASE]; + host->c_cc[VLNEXT] =3D target->c_cc[TARGET_VLNEXT]; + host->c_cc[VEOL2] =3D target->c_cc[TARGET_VEOL2]; +} + +static void host_to_target_termios2 (void *dst, const void *src) +{ + struct target_termios2 *target =3D dst; + const struct host_termios2 *host =3D src; + + target->c_iflag =3D + tswap32(host_to_target_bitmask(host->c_iflag, iflag_tbl)); + target->c_oflag =3D + tswap32(host_to_target_bitmask(host->c_oflag, oflag_tbl)); + target->c_cflag =3D + tswap32(host_to_target_bitmask(host->c_cflag, cflag_tbl)); + target->c_lflag =3D + tswap32(host_to_target_bitmask(host->c_lflag, lflag_tbl)); + target->c_line =3D host->c_line; + target->c_ispeed =3D tswap32(host->c_ispeed); + target->c_ospeed =3D tswap32(host->c_ospeed); + + memset(target->c_cc, 0, sizeof(target->c_cc)); + target->c_cc[TARGET_VINTR] =3D host->c_cc[VINTR]; + target->c_cc[TARGET_VQUIT] =3D host->c_cc[VQUIT]; + target->c_cc[TARGET_VERASE] =3D host->c_cc[VERASE]; + target->c_cc[TARGET_VKILL] =3D host->c_cc[VKILL]; + target->c_cc[TARGET_VEOF] =3D host->c_cc[VEOF]; + target->c_cc[TARGET_VTIME] =3D host->c_cc[VTIME]; + target->c_cc[TARGET_VMIN] =3D host->c_cc[VMIN]; + target->c_cc[TARGET_VSWTC] =3D host->c_cc[VSWTC]; + target->c_cc[TARGET_VSTART] =3D host->c_cc[VSTART]; + target->c_cc[TARGET_VSTOP] =3D host->c_cc[VSTOP]; + target->c_cc[TARGET_VSUSP] =3D host->c_cc[VSUSP]; + target->c_cc[TARGET_VEOL] =3D host->c_cc[VEOL]; + target->c_cc[TARGET_VREPRINT] =3D host->c_cc[VREPRINT]; + target->c_cc[TARGET_VDISCARD] =3D host->c_cc[VDISCARD]; + target->c_cc[TARGET_VWERASE] =3D host->c_cc[VWERASE]; + target->c_cc[TARGET_VLNEXT] =3D host->c_cc[VLNEXT]; + target->c_cc[TARGET_VEOL2] =3D host->c_cc[VEOL2]; +} + +static const StructEntry struct_termios2_def =3D { + .convert =3D { host_to_target_termios2, target_to_host_termios2 }, + .size =3D { sizeof(struct target_termios2), sizeof(struct host_termios= 2) }, + .align =3D { __alignof__(struct target_termios2), __alignof__(struct h= ost_termios2) }, + .print =3D print_termios2, +}; +#endif + /* If the host does not provide these bits, they may be safely discarded. = */ #ifndef MAP_SYNC #define MAP_SYNC 0 diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 6dd7a80ce5..ac45705acf 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -1,4 +1,7 @@ STRUCT_SPECIAL(termios) +#ifdef TARGET_TCGETS2 +STRUCT_SPECIAL(termios2) +#endif =20 STRUCT(winsize, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 7099349ec8..067c02bb93 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -129,6 +129,9 @@ static inline uint64_t target_offset64(uint64_t word0, = uint64_t word1) #endif /* TARGET_ABI_BITS !=3D 32 */ =20 void print_termios(void *arg); +#ifdef TARGET_TCGETS2 +void print_termios2(void *arg); +#endif =20 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers= */ #ifdef TARGET_ARM --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070482353772.8886981747656; Mon, 2 Feb 2026 14:14:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29M-0006Wf-Ia; Mon, 02 Feb 2026 17:12:05 -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 1vn295-0006Aj-3J; Mon, 02 Feb 2026 17:11:48 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn293-0003M0-9q; Mon, 02 Feb 2026 17:11:46 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 13C291852D6; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id E70E735B3E9; Tue, 03 Feb 2026 01:08:18 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 41/56] linux-user: Add termios2 support to alpha target Date: Tue, 3 Feb 2026 01:07:46 +0300 Message-ID: <20260202220805.945271-41-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070484116154100 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/02dba951-1bcf-4c74-8a6a-f4f4aa5ce9= 09@bonslack.org Reviewed-by: Helge Deller (cherry picked from commit 8d8c6aeee8599a099e49ec4411f3d1e087ae40ad) Signed-off-by: Michael Tokarev diff --git a/linux-user/alpha/termbits.h b/linux-user/alpha/termbits.h index 4a4b1e96f2..b7be23ea13 100644 --- a/linux-user/alpha/termbits.h +++ b/linux-user/alpha/termbits.h @@ -17,6 +17,29 @@ struct target_termios { target_speed_t c_ospeed; /* output speed */ }; =20 +struct target_termios2 { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_cc_t c_line; /* line discipline (=3D=3D c_cc[19]) */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + +struct target_ktermios { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_cc_t c_line; /* line discipline (=3D=3D c_cc[19]) */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + + /* c_cc characters */ #define TARGET_VEOF 0 #define TARGET_VEOL 1 @@ -247,6 +270,12 @@ struct target_termios { #define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */ #define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */ +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485) #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get Pty Numb= er (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int) /* Lock/unlock Pty */ #define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) /* Safely open the sl= ave */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 177007052922120.1739101614653; Mon, 2 Feb 2026 14:15:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29h-0007Ys-Ig; Mon, 02 Feb 2026 17:12:25 -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 1vn297-0006D3-Om; Mon, 02 Feb 2026 17:11:51 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn296-0003MM-1X; Mon, 02 Feb 2026 17:11:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 229291852D7; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 0199335B3EA; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 42/56] linux-user: Add termios2 support to hppa target Date: Tue, 3 Feb 2026 01:07:47 +0300 Message-ID: <20260202220805.945271-42-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070531121154100 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/ccf1be5c-9e2e-46f6-b303-d29888371f= b0@bonslack.org Reviewed-by: Helge Deller (cherry picked from commit edc741710acedd61011f937967b960d154794258) Signed-off-by: Michael Tokarev diff --git a/linux-user/hppa/termbits.h b/linux-user/hppa/termbits.h index 11fd4eed62..645f17bf63 100644 --- a/linux-user/hppa/termbits.h +++ b/linux-user/hppa/termbits.h @@ -18,6 +18,29 @@ struct target_termios { target_cc_t c_cc[TARGET_NCCS]; /* control characters */ }; =20 +struct target_termios2 { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + +struct target_ktermios { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + + /* c_iflag bits */ #define TARGET_IGNBRK 0000001 #define TARGET_BRKINT 0000002 @@ -190,6 +213,12 @@ struct target_termios { #define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */ #define TARGET_TIOCGSID TARGET_IOR('T', 20, int) +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termio= s2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termio= s2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termio= s2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termio= s2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485) #define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int) --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070498876913.594894438922; Mon, 2 Feb 2026 14:14:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn29e-0007Vr-Kz; Mon, 02 Feb 2026 17:12:23 -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 1vn29S-0006so-7t; Mon, 02 Feb 2026 17:12:11 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29Q-0003MS-KX; Mon, 02 Feb 2026 17:12:10 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 318EC1852D8; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 106FC35B3EB; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 43/56] linux-user: Add termios2 support to mips target Date: Tue, 3 Feb 2026 01:07:48 +0300 Message-ID: <20260202220805.945271-43-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070499246158500 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/361aa9c5-4464-4d27-8a2c-9ab7673245= 30@bonslack.org Reviewed-by: Helge Deller (cherry picked from commit edf9184f4feb691b0f70dc544443db2380891598) Signed-off-by: Michael Tokarev diff --git a/linux-user/mips/termbits.h b/linux-user/mips/termbits.h index e8b4b58d87..27610f7c4d 100644 --- a/linux-user/mips/termbits.h +++ b/linux-user/mips/termbits.h @@ -18,6 +18,29 @@ struct target_termios { target_cc_t c_cc[TARGET_NCCS]; /* control characters */ }; =20 +struct target_termios2 { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + +struct target_ktermios { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + + /* c_iflag bits */ #define TARGET_IGNBRK 0000001 #define TARGET_BRKINT 0000002 @@ -227,10 +250,10 @@ struct target_termios { #define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */ #define TARGET_TIOCGSID 0x7416 /* Return the session ID of FD */ -#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct termios2) -#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct termios2) -#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct termios2) -#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct termios2) +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termio= s2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termio= s2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termio= s2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termio= s2) #define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) #define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485) #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get Pty Numb= er (of pty-mux device) */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070467106820.7557357946677; Mon, 2 Feb 2026 14:14:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AQ-0008MP-BW; Mon, 02 Feb 2026 17:13:10 -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 1vn29U-00075R-WA; Mon, 02 Feb 2026 17:12:13 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29T-0003Mm-6n; Mon, 02 Feb 2026 17:12:12 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 41B091852D9; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 1F7D235B3EC; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 44/56] linux-user: Add termios2 support to sh4 target Date: Tue, 3 Feb 2026 01:07:49 +0300 Message-ID: <20260202220805.945271-44-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070469327158500 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/642b32de-2985-45d2-bbdf-c0b2e3ea05= 51@bonslack.org Reviewed-by: Helge Deller (cherry picked from commit afbe0ff81c29d674b9c18a588bcaab34ddcb8a7b) Signed-off-by: Michael Tokarev diff --git a/linux-user/sh4/termbits.h b/linux-user/sh4/termbits.h index 28e79f2c9a..cab6b1299e 100644 --- a/linux-user/sh4/termbits.h +++ b/linux-user/sh4/termbits.h @@ -18,6 +18,28 @@ struct target_termios { target_cc_t c_cc[TARGET_NCCS]; /* control characters */ }; =20 +struct target_termios2 { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + +struct target_ktermios { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + =20 /* c_cc characters */ #define TARGET_VINTR 0 @@ -251,14 +273,17 @@ struct target_termios { #define TARGET_TIOCNOTTY TARGET_IO('T', 34) /* 0x5422 */ #define TARGET_TIOCSETD TARGET_IOW('T', 35, int) /* 0x5423 */ #define TARGET_TIOCGETD TARGET_IOR('T', 36, int) /* 0x5424 */ -#define TARGET_TCSBRKP TARGET_IOW('T', 37, int) /* 0x5425 */ /* Ne= eded for POSIX tcse -ndbreak() */ +#define TARGET_TCSBRKP TARGET_IOW('T', 37, int) /* 0x5425 */ /* Ne= eded for POSIX tcsendbreak() */ #define TARGET_TIOCSBRK TARGET_IO('T', 39) /* 0x5427 */ /* BSD comp= atibility */ #define TARGET_TIOCCBRK TARGET_IO('T', 40) /* 0x5428 */ /* BSD comp= atibility */ -#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t) /* 0x5429 */ /* = Return the session -ID of FD */ -#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get P= ty Number (of pty-m -ux device) */ +#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t) /* 0x5429 */ /* = Return the session ID of FD */ +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios= 2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios= 2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios= 2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios= 2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485) +#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get P= ty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int) /* Lock/unlock P= ty */ #define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) /* Safely open the sla= ve */ =20 @@ -270,8 +295,7 @@ ux device) */ #define TARGET_TIOCSLCKTRMIOS 0x5457 #define TARGET_TIOCSERGSTRUCT TARGET_IOR('T', 88, int) /* 0x5458 */ /* Fo= r d ebugging only */ -#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int) /* 0x5459= */ /* Get line sta -tus register */ +#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int) /* 0x5459= */ /* Get line status register */ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ # define TARGET_TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #define TARGET_TIOCSERGETMULTI TARGET_IOR('T', 90, int) /* 0x545A @@ -279,9 +303,7 @@ tus register */ #define TARGET_TIOCSERSETMULTI TARGET_IOW('T', 91, int) /* 0x545B */ /* Set multiport config */ =20 -#define TARGET_TIOCMIWAIT TARGET_IO('T', 92) /* 0x545C */ /* wa= it for a change on -serial input line(s) */ -#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int) /* 0x545D */ /* re= ad -serial port inline interrupt counts */ +#define TARGET_TIOCMIWAIT TARGET_IO('T', 92) /* 0x545C */ /* wa= it for a change on serial input line(s) */ +#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int) /* 0x545D */ /* re= ad serial port inline interrupt counts */ =20 #endif --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070480095747.1766178982713; Mon, 2 Feb 2026 14:14:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AQ-0008L7-8d; Mon, 02 Feb 2026 17:13:10 -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 1vn29V-00077L-G5; Mon, 02 Feb 2026 17:12:15 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29T-0003Oi-OF; Mon, 02 Feb 2026 17:12:13 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 50E211852DA; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 2FBAD35B3ED; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 45/56] linux-user: Add termios2 support to sparc target Date: Tue, 3 Feb 2026 01:07:50 +0300 Message-ID: <20260202220805.945271-45-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070481193158500 Content-Type: text/plain; charset="utf-8" From: Luca Bonissi Signed-off-by: Luca Bonissi Link: https://lore.kernel.org/qemu-devel/909d9d68-c6fe-4368-825c-6aa8fdbd3b= bc@bonslack.org Reviewed-by: Helge Deller (cherry picked from commit 947b971cad90375040f399899909a3f1f32b483f) Signed-off-by: Michael Tokarev diff --git a/linux-user/sparc/termbits.h b/linux-user/sparc/termbits.h index 704bee1c42..588d7e8dcd 100644 --- a/linux-user/sparc/termbits.h +++ b/linux-user/sparc/termbits.h @@ -18,6 +18,28 @@ struct target_termios { target_cc_t c_cc[TARGET_NCCS]; /* control characters */ }; =20 +struct target_termios2 { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + +struct target_ktermios { + target_tcflag_t c_iflag; /* input mode flags */ + target_tcflag_t c_oflag; /* output mode flags */ + target_tcflag_t c_cflag; /* control mode flags */ + target_tcflag_t c_lflag; /* local mode flags */ + target_cc_t c_line; /* line discipline */ + target_cc_t c_cc[TARGET_NCCS]; /* control characters */ + target_speed_t c_ispeed; /* input speed */ + target_speed_t c_ospeed; /* output speed */ +}; + =20 /* c_cc characters */ #define TARGET_VINTR 0 @@ -251,6 +273,12 @@ struct target_termios { #define TARGET_TIOCGPGRP TARGET_IOR('t', 131, int) #define TARGET_TIOCSCTTY TARGET_IO('t', 132) #define TARGET_TIOCGSID TARGET_IOR('t', 133, int) +#define TARGET_TCGETS2 TARGET_IOR('T', 12, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 13, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 14, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 15, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x41, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x42, struct serial_rs485) /* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */ #define TARGET_TIOCGPTN TARGET_IOR('t', 134, unsigned int) /* Get Pty Numb= er */ #define TARGET_TIOCSPTLCK TARGET_IOW('t', 135, int) /* Lock/unlock PTY */ --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070523404759.620665645163; Mon, 2 Feb 2026 14:15:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ab-0000qo-DI; Mon, 02 Feb 2026 17:13:21 -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 1vn29Z-0007IY-Br; Mon, 02 Feb 2026 17:12:19 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29W-0003Qk-CV; Mon, 02 Feb 2026 17:12:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6028C1852DB; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 3F13A35B3EE; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Vivian Wang , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 46/56] linux-user: Add missing termios baud rates Date: Tue, 3 Feb 2026 01:07:51 +0300 Message-ID: <20260202220805.945271-46-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070524606154100 Content-Type: text/plain; charset="utf-8" From: Vivian Wang Add several missing baud rates and inputs baud rates in cflag_tbl. Add these missing definitions in termbits.h: - TARGET_BOTHER for alpha, hppa, ppc, sh4, sparc - TARGET_IBSHIFT for hppa, mips, ppc, sh4, sparc - Missing standard baud rates for hppa These are required for the glibc test tst-termios-linux. Link: https://lore.kernel.org/qemu-devel/20251203-linux-user-higher-baud-ra= tes-v2-1-e45b35224437@iscas.ac.cn Signed-off-by: Vivian Wang Reviewed-by: Helge Deller (cherry picked from commit 4f22fcb5c67f40a36e6654f6cfaee23f9f9e93d1) Signed-off-by: Michael Tokarev diff --git a/linux-user/alpha/termbits.h b/linux-user/alpha/termbits.h index b7be23ea13..50cff34f3c 100644 --- a/linux-user/alpha/termbits.h +++ b/linux-user/alpha/termbits.h @@ -149,6 +149,7 @@ struct target_ktermios { #define TARGET_B3000000 00034 #define TARGET_B3500000 00035 #define TARGET_B4000000 00036 +#define TARGET_BOTHER 00037 =20 #define TARGET_CSIZE 00001400 #define TARGET_CS5 00000000 diff --git a/linux-user/generic/termbits.h b/linux-user/generic/termbits.h index 6675e0d1ab..6cc5995981 100644 --- a/linux-user/generic/termbits.h +++ b/linux-user/generic/termbits.h @@ -157,7 +157,7 @@ struct target_ktermios { #define TARGET_B3000000 0010015 #define TARGET_B3500000 0010016 #define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000 /* input baud rate */ #define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000 /* flow control */ =20 diff --git a/linux-user/hppa/termbits.h b/linux-user/hppa/termbits.h index 645f17bf63..9d1d1a1d12 100644 --- a/linux-user/hppa/termbits.h +++ b/linux-user/hppa/termbits.h @@ -123,14 +123,28 @@ struct target_ktermios { #define TARGET_HUPCL 0002000 #define TARGET_CLOCAL 0004000 #define TARGET_CBAUDEX 0010000 +#define TARGET_BOTHER 0010000 #define TARGET_B57600 0010001 #define TARGET_B115200 0010002 #define TARGET_B230400 0010003 #define TARGET_B460800 0010004 -#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */ +#define TARGET_B500000 0010005 +#define TARGET_B576000 0010006 +#define TARGET_B921600 0010007 +#define TARGET_B1000000 0010010 +#define TARGET_B1152000 0010011 +#define TARGET_B1500000 0010012 +#define TARGET_B2000000 0010013 +#define TARGET_B2500000 0010014 +#define TARGET_B3000000 0010015 +#define TARGET_B3500000 0010016 +#define TARGET_B4000000 0010017 +#define TARGET_CIBAUD 002003600000 /* input baud rate */ #define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000 /* flow control */ =20 +#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ + /* c_lflag bits */ #define TARGET_ISIG 0000001 #define TARGET_ICANON 0000002 diff --git a/linux-user/mips/termbits.h b/linux-user/mips/termbits.h index 27610f7c4d..56b17441ee 100644 --- a/linux-user/mips/termbits.h +++ b/linux-user/mips/termbits.h @@ -139,10 +139,12 @@ struct target_ktermios { #define TARGET_B3000000 0010015 #define TARGET_B3500000 0010016 #define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000 /* input baud rate */ #define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000 /* flow control */ =20 +#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ + /* c_lflag bits */ #define TARGET_ISIG 0000001 #define TARGET_ICANON 0000002 diff --git a/linux-user/ppc/termbits.h b/linux-user/ppc/termbits.h index eb226e0999..71b398c83a 100644 --- a/linux-user/ppc/termbits.h +++ b/linux-user/ppc/termbits.h @@ -129,6 +129,7 @@ struct target_termios { #define TARGET_B3000000 00034 #define TARGET_B3500000 00035 #define TARGET_B4000000 00036 +#define TARGET_BOTHER 00037 =20 #define TARGET_CSIZE 00001400 #define TARGET_CS5 00000000 diff --git a/linux-user/sh4/termbits.h b/linux-user/sh4/termbits.h index cab6b1299e..861f861f6d 100644 --- a/linux-user/sh4/termbits.h +++ b/linux-user/sh4/termbits.h @@ -142,6 +142,7 @@ struct target_ktermios { #define TARGET_HUPCL 0002000 #define TARGET_CLOCAL 0004000 #define TARGET_CBAUDEX 0010000 +#define TARGET_BOTHER 0010000 #define TARGET_B57600 0010001 #define TARGET_B115200 0010002 #define TARGET_B230400 0010003 @@ -157,10 +158,12 @@ struct target_ktermios { #define TARGET_B3000000 0010015 #define TARGET_B3500000 0010016 #define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000 /* input baud rate */ #define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000 /* flow control */ =20 +#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ + /* c_lflag bits */ #define TARGET_ISIG 0000001 #define TARGET_ICANON 0000002 diff --git a/linux-user/sparc/termbits.h b/linux-user/sparc/termbits.h index 588d7e8dcd..f64ea87d97 100644 --- a/linux-user/sparc/termbits.h +++ b/linux-user/sparc/termbits.h @@ -150,6 +150,7 @@ struct target_ktermios { #define TARGET_HUPCL 0x00000400 #define TARGET_CLOCAL 0x00000800 #define TARGET_CBAUDEX 0x00001000 +#define TARGET_BOTHER 0x00001000 /* We'll never see these speeds with the Zilogs, but for completeness... */ #define TARGET_B57600 0x00001001 #define TARGET_B115200 0x00001002 @@ -176,10 +177,12 @@ struct target_ktermios { #define B3000000 0x00001011 #define B3500000 0x00001012 #define B4000000 0x00001013 */ -#define TARGET_CIBAUD 0x100f0000 /* input baud rate (not used) */ +#define TARGET_CIBAUD 0x100f0000 /* input baud rate */ #define TARGET_CMSPAR 0x40000000 /* mark or space (stick) parity */ #define TARGET_CRTSCTS 0x80000000 /* flow control */ =20 +#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ + /* c_lflag bits */ #define TARGET_ISIG 0x00000001 #define TARGET_ICANON 0x00000002 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 93ac285c5e..28394961b6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5759,27 +5759,70 @@ static const bitmask_transtbl oflag_tbl[] =3D { { TARGET_FFDLY, TARGET_FF1, FFDLY, FF1 }, }; =20 +#if defined(TARGET_CIBAUD) && defined(CIBAUD) + +# define BAUD_TRANSTBL(baud) \ + { TARGET_CBAUD, TARGET_##baud, CBAUD, baud }, \ + { TARGET_CIBAUD, TARGET_##baud << TARGET_IBSHIFT, CIBAUD, baud << IBSH= IFT }, + +#else + +/* Alpha in particular does not have CIBAUD/IBSHIFT */ + +# define BAUD_TRANSTBL(baud) \ + { TARGET_CBAUD, TARGET_##baud, CBAUD, baud }, + +#endif + static const bitmask_transtbl cflag_tbl[] =3D { - { TARGET_CBAUD, TARGET_B0, CBAUD, B0 }, - { TARGET_CBAUD, TARGET_B50, CBAUD, B50 }, - { TARGET_CBAUD, TARGET_B75, CBAUD, B75 }, - { TARGET_CBAUD, TARGET_B110, CBAUD, B110 }, - { TARGET_CBAUD, TARGET_B134, CBAUD, B134 }, - { TARGET_CBAUD, TARGET_B150, CBAUD, B150 }, - { TARGET_CBAUD, TARGET_B200, CBAUD, B200 }, - { TARGET_CBAUD, TARGET_B300, CBAUD, B300 }, - { TARGET_CBAUD, TARGET_B600, CBAUD, B600 }, - { TARGET_CBAUD, TARGET_B1200, CBAUD, B1200 }, - { TARGET_CBAUD, TARGET_B1800, CBAUD, B1800 }, - { TARGET_CBAUD, TARGET_B2400, CBAUD, B2400 }, - { TARGET_CBAUD, TARGET_B4800, CBAUD, B4800 }, - { TARGET_CBAUD, TARGET_B9600, CBAUD, B9600 }, - { TARGET_CBAUD, TARGET_B19200, CBAUD, B19200 }, - { TARGET_CBAUD, TARGET_B38400, CBAUD, B38400 }, - { TARGET_CBAUD, TARGET_B57600, CBAUD, B57600 }, - { TARGET_CBAUD, TARGET_B115200, CBAUD, B115200 }, - { TARGET_CBAUD, TARGET_B230400, CBAUD, B230400 }, - { TARGET_CBAUD, TARGET_B460800, CBAUD, B460800 }, + BAUD_TRANSTBL(B0) + BAUD_TRANSTBL(B50) + BAUD_TRANSTBL(B75) + BAUD_TRANSTBL(B110) + BAUD_TRANSTBL(B134) + BAUD_TRANSTBL(B150) + BAUD_TRANSTBL(B200) + BAUD_TRANSTBL(B300) + BAUD_TRANSTBL(B600) + BAUD_TRANSTBL(B1200) + BAUD_TRANSTBL(B1800) + BAUD_TRANSTBL(B2400) + BAUD_TRANSTBL(B4800) + BAUD_TRANSTBL(B9600) + BAUD_TRANSTBL(B19200) + BAUD_TRANSTBL(B38400) + BAUD_TRANSTBL(B57600) + BAUD_TRANSTBL(B115200) + BAUD_TRANSTBL(B230400) + BAUD_TRANSTBL(B460800) + BAUD_TRANSTBL(B500000) + BAUD_TRANSTBL(B576000) + BAUD_TRANSTBL(B921600) + BAUD_TRANSTBL(B1000000) + BAUD_TRANSTBL(B1152000) + BAUD_TRANSTBL(B1500000) + BAUD_TRANSTBL(B2000000) + + BAUD_TRANSTBL(BOTHER) + + /* SPARC in particular is missing these higher baud rates */ + +#if defined(TARGET_B2500000) && defined(B2500000) + BAUD_TRANSTBL(B2500000) +#endif + +#if defined(TARGET_B3000000) && defined(B3000000) + BAUD_TRANSTBL(B3000000) +#endif + +#if defined(TARGET_B3500000) && defined(B3500000) + BAUD_TRANSTBL(B3500000) +#endif + +#if defined(TARGET_B4000000) && defined(B4000000) + BAUD_TRANSTBL(B4000000) +#endif + { TARGET_CSIZE, TARGET_CS5, CSIZE, CS5 }, { TARGET_CSIZE, TARGET_CS6, CSIZE, CS6 }, { TARGET_CSIZE, TARGET_CS7, CSIZE, CS7 }, --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070571503418.74492471535507; Mon, 2 Feb 2026 14:16:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AQ-0008My-D2; Mon, 02 Feb 2026 17:13:10 -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 1vn29t-0007ju-0e; Mon, 02 Feb 2026 17:12:40 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29r-0003Qt-Fw; Mon, 02 Feb 2026 17:12:36 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6EE241852DC; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 4DD0435B3EF; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Icenowy Zheng , Helge Deller , Michael Tokarev Subject: [Stable-10.2.1 47/56] linux-user: fixup termios2 related things on PowerPC Date: Tue, 3 Feb 2026 01:07:52 +0300 Message-ID: <20260202220805.945271-47-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070573359154100 Content-Type: text/plain; charset="utf-8" From: Icenowy Zheng The termios things on PowerPC equal to termios2 things otherwhere. Use some simple #define's to allow both termios and termios2 to map to termios on PowerPC. Signed-off-by: Icenowy Zheng Link: https://github.com/AOSC-Dev/aosc-os-abbs/blob/8d77eeaa76e9b159c3f35ad= af73c875751aa7d17/app-virtualization/qemu/01-shared/patches/0005-AOSCOS-lin= ux-user-fixup-termios2-related-things-on-P.patch Link: https://lore.kernel.org/qemu-devel/4403eb94ddbb2934f1f75d94ce921f0f10= 78ad9f.camel@icenowy.me Reviewed-by: Helge Deller (cherry picked from commit d68f0e2e906939bef076d0cd52f902d433c8c3da) Signed-off-by: Michael Tokarev diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 28394961b6..fbacbaea3a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -148,6 +148,21 @@ #include "fd-trans.h" #include "user/cpu_loop.h" =20 +#if defined(__powerpc__) +/* + * On PowerPC termios2 is lacking and termios along with ioctls w/o 2 + * behaves like termios2 and things with 2 on other architectures. + * + * Just define termios2-related things to be the same with termios-related + * ones to support PowerPC. + */ +#define host_termios2 host_termios +#define TCGETS2 TCGETS +#define TCSETS2 TCSETS +#define TCSETSW2 TCSETSW +#define TCSETSF2 TCSETSF +#endif + #ifndef CLONE_IO #define CLONE_IO 0x80000000 /* Clone io context */ #endif --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070520199202.53542092865177; Mon, 2 Feb 2026 14:15:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AY-0000X9-Gl; Mon, 02 Feb 2026 17:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29w-0007lu-NI; Mon, 02 Feb 2026 17:12:42 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29v-0003RF-7T; Mon, 02 Feb 2026 17:12:40 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7D21B1852DD; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 5C75E35B3F0; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 48/56] target/i386/tcg: fix a few instructions that do not support VEX.L=1 Date: Tue, 3 Feb 2026 01:07:53 +0300 Message-ID: <20260202220805.945271-48-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070521174158500 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Match the contents of table 2-17 ("#UD Exception and VEX.L Field Encoding") in the SDM, for instruction in exception class 5. They were incorrectly accepting 256-bit versions that do not exist. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit 2eb8d9734355ed86e162dce2a3f265ffee4005ed) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.= c.inc index 24dcf222f3..0462429cf1 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -504,7 +504,7 @@ static void decode_0F7E(DisasContext *s, CPUX86State *e= nv, X86OpEntry *entry, ui static const X86OpEntry opcodes_0F7E[4] =3D { X86_OP_ENTRY3(MOVD_from, E,y, None,None, P,y, vex5 mmx), X86_OP_ENTRY3(MOVD_from, E,y, None,None, V,y, vex5), - X86_OP_ENTRY3(MOVQ, V,x, None,None, W,q, vex5), /* wrong de= st Vy on SDM! */ + X86_OP_ENTRY3(MOVQ, V,dq,None,None, W,q, vex5), /* wrong de= st Vq on SDM! */ {}, }; *entry =3D *decode_by_prefix(s, opcodes_0F7E); @@ -569,7 +569,7 @@ static void decode_0FD6(DisasContext *s, CPUX86State *e= nv, X86OpEntry *entry, ui { static const X86OpEntry movq[4] =3D { {}, - X86_OP_ENTRY3(MOVQ, W,x, None, None, V,q, vex5), + X86_OP_ENTRY3(MOVQ, W,dq, None, None, V,q, vex5), X86_OP_ENTRY3(MOVq_dq, V,dq, None, None, N,q), X86_OP_ENTRY3(MOVq_dq, P,q, None, None, U,q), }; @@ -978,7 +978,7 @@ static void decode_0F12(DisasContext *s, CPUX86State *e= nv, X86OpEntry *entry, ui }; static const X86OpEntry opcodes_0F12_reg[4] =3D { X86_OP_ENTRY3(VMOVHLPS, V,dq, H,dq, U,dq, vex7), - X86_OP_ENTRY3(VMOVLPx, W,x, H,x, U,q, vex5), /* MOVLPD = */ + X86_OP_ENTRY3(VMOVLPx, W,dq, H,dq, U,q, vex5), /* MOVLPD = */ X86_OP_ENTRY3(VMOVSLDUP, V,x, None,None, U,x, vex4 cpuid(SSE3)), X86_OP_ENTRY3(VMOVDDUP, V,x, None,None, U,x, vex5 cpuid(SSE3)), }; @@ -1341,7 +1341,7 @@ static const X86OpEntry opcodes_0F[256] =3D { [0x6b] =3D X86_OP_ENTRY3(PACKSSDW, V,x, H,x, W,x, vex4 mmx avx2_256= p_00_66), [0x6c] =3D X86_OP_ENTRY3(PUNPCKLQDQ, V,x, H,x, W,x, vex4 p_66 avx2_25= 6), [0x6d] =3D X86_OP_ENTRY3(PUNPCKHQDQ, V,x, H,x, W,x, vex4 p_66 avx2_25= 6), - [0x6e] =3D X86_OP_ENTRY3(MOVD_to, V,x, None,None, E,y, vex5 mmx p_0= 0_66), /* wrong dest Vy on SDM! */ + [0x6e] =3D X86_OP_ENTRY3(MOVD_to, V,dq,None,None, E,y, vex5 mmx p_0= 0_66), /* wrong dest Vy on SDM! */ [0x6f] =3D X86_OP_GROUP0(0F6F), =20 [0x78] =3D X86_OP_GROUP0(0F78), --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070595981668.6701573763719; Mon, 2 Feb 2026 14:16:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ad-00017j-LQ; Mon, 02 Feb 2026 17:13:23 -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 1vn29v-0007lq-UM; Mon, 02 Feb 2026 17:12:42 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29u-0003TX-GF; Mon, 02 Feb 2026 17:12:39 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8BEFF1852DE; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 6B06835B3F1; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Michael Tokarev , Thomas Huth Subject: [Stable-10.2.1 49/56] gitlab: preserve base rules for container template Date: Tue, 3 Feb 2026 01:07:54 +0300 Message-ID: <20260202220805.945271-49-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070597706154100 From: Daniel P. Berrang=C3=A9 When extending the container template to allow scheduled pipelines in upstream context, we must ensure that all the existing rules defined by .base_job_template are preserved. Fortunately since the new rule for scheduled pipelines can come at the head of all other rules, not in the middle, we can just the obscure '!reference' syntax to pull in all the pre-existing rules as a single block. This fixes * stable branches using the wrong tag name in container images * pushes to forks unconditionally running container builds Fixes: 8bec7b9874235e60f14172618121c60fdbd39302 Signed-off-by: Daniel P. Berrang=C3=A9 Tested-by: Michael Tokarev Fixes: 8bec7b987423 ("gitlab: add a weekly container building job") Message-ID: <20260119135528.2738108-1-berrange@redhat.com> Signed-off-by: Thomas Huth (cherry picked from commit 815567b4ea35176a8f92c5f25bfb335c1cac274e) Signed-off-by: Michael Tokarev diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-t= emplate.yml index 82c1b69e8d..8c7311cca5 100644 --- a/.gitlab-ci.d/container-template.yml +++ b/.gitlab-ci.d/container-template.yml @@ -21,6 +21,5 @@ - docker logout rules: # because we want to enable this for scheduled runs we also have to re= plicate the normal rules - - if: '$CI_PIPELINE_SOURCE =3D=3D "schedule"' - - if: '$CI_PROJECT_NAMESPACE =3D=3D $QEMU_CI_UPSTREAM && $CI_COMMIT_BR= ANCH =3D~ /^staging/' - - if: '$QEMU_CI && $CI_PROJECT_NAMESPACE !=3D $QEMU_CI_UPSTREAM' + - if: '$CI_PIPELINE_SOURCE =3D=3D "schedule" && $CI_PROJECT_NAMESPACE = =3D=3D $QEMU_CI_UPSTREAM' + - !reference [.base_job_template, rules] --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070585109883.1379725668564; Mon, 2 Feb 2026 14:16:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AZ-0000dR-Fs; Mon, 02 Feb 2026 17:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2A0-0007mw-BM; Mon, 02 Feb 2026 17:12:47 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29x-0003UA-Af; Mon, 02 Feb 2026 17:12:42 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A6CE21852DF; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 7942C35B3F2; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 50/56] pc-bios/optionrom: Use 32-bit linker emulation for the optionroms Date: Tue, 3 Feb 2026 01:07:55 +0300 Message-ID: <20260202220805.945271-50-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070585576154100 From: Thomas Huth Without this linker flag, the linking fails on NetBSD v10.1 with: ld: i386 architecture of input file `multiboot.o' is incompatible with i38= 6:x86-64 output ld: i386 architecture of input file `multiboot_dma.o' is incompatible with= i386:x86-64 output Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth Message-ID: <20260121074819.29396-1-thuth@redhat.com> (cherry picked from commit e4f1a9b1dacb4d02500629056551b1db2985429c) Signed-off-by: Michael Tokarev diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 30d07026c7..e6674a76e7 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -36,7 +36,7 @@ config-cc.mak: Makefile $(call cc-option,-Wno-array-bounds)) 3> config-cc.mak -include config-cc.mak =20 -override LDFLAGS =3D -nostdlib -Wl,--build-id=3Dnone,-T,$(SRC_DIR)/flat.lds +override LDFLAGS =3D -nostdlib -Wl,--build-id=3Dnone,-T,$(SRC_DIR)/flat.ld= s,-m,elf_i386 =20 pvh.img: pvh.o pvh_main.o =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070421496603.0156553434073; Mon, 2 Feb 2026 14:13:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2AW-00009p-CE; Mon, 02 Feb 2026 17:13:17 -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 1vn2A0-0007mx-Ch; Mon, 02 Feb 2026 17:12:47 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn29y-0003UH-1t; Mon, 02 Feb 2026 17:12:43 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B7DD81852E0; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 9511535B3F3; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Michael Tokarev Subject: [Stable-10.2.1 51/56] tests/functional: migrate sbsa_ref test images Date: Tue, 3 Feb 2026 01:07:56 +0300 Message-ID: <20260202220805.945271-51-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070423181154100 From: Alex Benn=C3=A9e As the builds in codelinaro.org are going away migrate the binaries to share.linaro.org. As the hotlinks don't encode the filename we need to explicitly tell uncompress how to handle the files. Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Message-ID: <20260128105839.3487840-3-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e (cherry picked from commit d9ca273f8f31acb22d3f5aca5f063b94fb962e19) Signed-off-by: Michael Tokarev diff --git a/tests/functional/aarch64/test_sbsaref.py b/tests/functional/aa= rch64/test_sbsaref.py index d3402f5080..3ff674039e 100755 --- a/tests/functional/aarch64/test_sbsaref.py +++ b/tests/functional/aarch64/test_sbsaref.py @@ -31,10 +31,10 @@ def fetch_firmware(test): """ =20 # Secure BootRom (TF-A code) - fs0_path =3D test.uncompress(Aarch64SbsarefMachine.ASSET_FLASH0) + fs0_path =3D test.uncompress(Aarch64SbsarefMachine.ASSET_FLASH0, forma= t=3D"xz") =20 # Non-secure rom (UEFI and EFI variables) - fs1_path =3D test.uncompress(Aarch64SbsarefMachine.ASSET_FLASH1) + fs1_path =3D test.uncompress(Aarch64SbsarefMachine.ASSET_FLASH1, forma= t=3D"xz") =20 for path in [fs0_path, fs1_path]: with open(path, "ab+") as fd: @@ -54,15 +54,13 @@ class Aarch64SbsarefMachine(QemuSystemTest): =20 timeout =3D 180 =20 - ASSET_FLASH0 =3D Asset( - ('https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref= /' - '20241122-189881/edk2/SBSA_FLASH0.fd.xz'), - '76eb89d42eebe324e4395329f47447cda9ac920aabcf99aca85424609c3384a5') + # SBSA_FLASH0.fd.xz + ASSET_FLASH0 =3D Asset('https://share.linaro.org/downloadFile?id=3Dkyo= MLGC9zXa4oA7', + '76eb89d42eebe324e4395329f47447cda9ac920aabcf99ac= a85424609c3384a5') =20 - ASSET_FLASH1 =3D Asset( - ('https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref= /' - '20241122-189881/edk2/SBSA_FLASH1.fd.xz'), - 'f850f243bd8dbd49c51e061e0f79f1697546938f454aeb59ab7d93e5f0d412fc') + # SBSA_FLASH1.fd.xz + ASSET_FLASH1 =3D Asset('https://share.linaro.org/downloadFile?id=3DDj1= HRXnDnKtU6Nj', + 'f850f243bd8dbd49c51e061e0f79f1697546938f454aeb59= ab7d93e5f0d412fc') =20 def test_sbsaref_edk2_firmware(self): =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070467872341.15430050465443; Mon, 2 Feb 2026 14:14:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ae-0001Ij-Lz; Mon, 02 Feb 2026 17:13:24 -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 1vn2AO-000871-OZ; Mon, 02 Feb 2026 17:13:08 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2AM-0003Un-5J; Mon, 02 Feb 2026 17:13:07 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D011E1852E1; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id A529435B3F4; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jeuk Kim , Michael Tokarev Subject: [Stable-10.2.1 52/56] hw/ufs: Ensure DBC of PRDT uses only lower 18 bits Date: Tue, 3 Feb 2026 01:07:57 +0300 Message-ID: <20260202220805.945271-52-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070469828154100 Content-Type: text/plain; charset="utf-8" From: Jeuk Kim The UFS spec defines the PRDT data byte count as an 18-bit field. This commit masks the value to the lower 18 bits to prevent incorrect transfer lengths and ensure compliance. Signed-off-by: Jeuk Kim (cherry picked from commit 289e6a3edf5041a9f96c3fb792845b94b5b3c666) Signed-off-by: Michael Tokarev diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 0577747f46..58099a554e 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -224,7 +224,8 @@ static MemTxResult ufs_dma_read_prdt(UfsRequest *req) =20 for (uint16_t i =3D 0; i < prdt_len; ++i) { hwaddr data_dma_addr =3D le64_to_cpu(prd_entries[i].addr); - uint32_t data_byte_count =3D le32_to_cpu(prd_entries[i].size) + 1; + uint32_t data_byte_count =3D + (le32_to_cpu(prd_entries[i].size) & 0x3ffff) + 1; qemu_sglist_add(req->sg, data_dma_addr, data_byte_count); req->data_len +=3D data_byte_count; } --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070577045270.02246034951145; Mon, 2 Feb 2026 14:16:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ab-0000qb-FH; Mon, 02 Feb 2026 17:13:21 -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 1vn2AO-00087J-QI; Mon, 02 Feb 2026 17:13:08 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2AM-0003Uo-5P; Mon, 02 Feb 2026 17:13:08 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DDBBA1852E2; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id BDFCC35B3F5; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jeuk Kim , Michael Tokarev Subject: [Stable-10.2.1 53/56] hw/ufs: fix CQE endianness and UPIU length Date: Tue, 3 Feb 2026 01:07:58 +0300 Message-ID: <20260202220805.945271-53-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070577494158500 Content-Type: text/plain; charset="utf-8" From: Jeuk Kim Round-trip UTRD fields through cpu_to_le/ le_to_cpu when building MCQ CQEs = to keep BE hosts correct. Also avoid double BE conversion of response data_segment_length and document the LE round-trip. Signed-off-by: Jeuk Kim (cherry picked from commit ed621cc8e2a6dab2663ffb02e875f896f521bee2) Signed-off-by: Michael Tokarev diff --git a/hw/ufs/lu.c b/hw/ufs/lu.c index 2d8ffd72c5..3f3c9589ce 100644 --- a/hw/ufs/lu.c +++ b/hw/ufs/lu.c @@ -53,8 +53,7 @@ static void ufs_build_scsi_response_upiu(UfsRequest *req,= uint8_t *sense, response =3D UFS_COMMAND_RESULT_FAIL; } =20 - data_segment_length =3D - cpu_to_be16(sense_len + sizeof(req->rsp_upiu.sr.sense_data_len)); + data_segment_length =3D sense_len + sizeof(req->rsp_upiu.sr.sense_data= _len); ufs_build_upiu_header(req, UFS_UPIU_TRANSACTION_RESPONSE, flags, respo= nse, status, data_segment_length); } diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 58099a554e..128e2b1ea8 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -449,15 +449,24 @@ static void ufs_mcq_process_cq(void *opaque) { ufs_dma_write_rsp_upiu(req); =20 - req->cqe.utp_addr =3D - ((uint64_t)req->utrd.command_desc_base_addr_hi << 32ULL) | - req->utrd.command_desc_base_addr_lo; - req->cqe.utp_addr |=3D req->sq->sqid; - req->cqe.resp_len =3D req->utrd.response_upiu_length; - req->cqe.resp_off =3D req->utrd.response_upiu_offset; - req->cqe.prdt_len =3D req->utrd.prd_table_length; - req->cqe.prdt_off =3D req->utrd.prd_table_offset; - req->cqe.status =3D req->utrd.header.dword_2 & 0xf; + /* UTRD/CQE are LE; round-trip through host to keep BE correct. */ + uint64_t ucdba =3D + ((uint64_t)le32_to_cpu(req->utrd.command_desc_base_addr_hi) + << 32ULL) | + le32_to_cpu(req->utrd.command_desc_base_addr_lo); + uint16_t resp_len =3D le16_to_cpu(req->utrd.response_upiu_length); + uint16_t resp_off =3D le16_to_cpu(req->utrd.response_upiu_offset); + uint16_t prdt_len =3D le16_to_cpu(req->utrd.prd_table_length); + uint16_t prdt_off =3D le16_to_cpu(req->utrd.prd_table_offset); + uint8_t status =3D le32_to_cpu(req->utrd.header.dword_2) & UFS_MAS= K_OCS; + + ucdba |=3D req->sq->sqid; + req->cqe.utp_addr =3D cpu_to_le64(ucdba); + req->cqe.resp_len =3D cpu_to_le16(resp_len); + req->cqe.resp_off =3D cpu_to_le16(resp_off); + req->cqe.prdt_len =3D cpu_to_le16(prdt_len); + req->cqe.prdt_off =3D cpu_to_le16(prdt_off); + req->cqe.status =3D status; req->cqe.error =3D 0; =20 ret =3D ufs_addr_write(u, cq->addr + tail, &req->cqe, sizeof(req->= cqe)); diff --git a/include/block/ufs.h b/include/block/ufs.h index a3ee62b027..22dc379eaa 100644 --- a/include/block/ufs.h +++ b/include/block/ufs.h @@ -645,7 +645,7 @@ enum UtpOcsCodes { }; =20 enum { - UFS_MASK_OCS =3D 0x0F, + UFS_MASK_OCS =3D 0xFF, }; =20 /* --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070430267201.69319644189852; Mon, 2 Feb 2026 14:13:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ag-0001Wt-9p; Mon, 02 Feb 2026 17:13:26 -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 1vn2AS-0000BR-1D; Mon, 02 Feb 2026 17:13:14 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2AQ-0003X1-6M; Mon, 02 Feb 2026 17:13:11 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id ED1001852E3; Tue, 03 Feb 2026 01:07:37 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id CB7AF35B3F6; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Ilia Levi , Jeuk Kim , Michael Tokarev Subject: [Stable-10.2.1 54/56] hw/ufs: Fix mcq completion queue wraparound Date: Tue, 3 Feb 2026 01:07:59 +0300 Message-ID: <20260202220805.945271-54-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070430884158500 Content-Type: text/plain; charset="utf-8" From: Ilia Levi Currently, ufs_mcq_process_cq() writes to the CQ without checking whether there is available space. This can cause CQ entries to be discarded and overwritten. The solution is to stop writing when CQ is full and exert backpressure on the affected SQs. This is similar to how NVMe CQs operate. Signed-off-by: Ilia Levi Reviewed-by: Jeuk Kim Signed-off-by: Jeuk Kim (cherry picked from commit f78762a3cc81ca9842907a5fc1b2280083ac51ba) Signed-off-by: Michael Tokarev diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 128e2b1ea8..8fdc0854eb 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -447,6 +447,10 @@ static void ufs_mcq_process_cq(void *opaque) =20 QTAILQ_FOREACH_SAFE(req, &cq->req_list, entry, next) { + if (ufs_mcq_cq_full(u, cq->cqid)) { + break; + } + ufs_dma_write_rsp_upiu(req); =20 /* UTRD/CQE are LE; round-trip through host to keep BE correct. */ @@ -478,6 +482,12 @@ static void ufs_mcq_process_cq(void *opaque) tail =3D (tail + sizeof(req->cqe)) % (cq->size * sizeof(req->cqe)); ufs_mcq_update_cq_tail(u, cq->cqid, tail); =20 + if (QTAILQ_EMPTY(&req->sq->req_list) && + !ufs_mcq_sq_empty(u, req->sq->sqid)) { + /* Dequeueing from SQ was blocked due to lack of free requests= */ + qemu_bh_schedule(req->sq->bh); + } + ufs_clear_req(req); QTAILQ_INSERT_TAIL(&req->sq->req_list, req, entry); } @@ -787,10 +797,18 @@ static void ufs_write_mcq_op_reg(UfsHc *u, hwaddr off= set, uint32_t data, } opr->sq.tp =3D data; break; - case offsetof(UfsMcqOpReg, cq.hp): + case offsetof(UfsMcqOpReg, cq.hp): { + UfsCq *cq =3D u->cq[qid]; + + if (ufs_mcq_cq_full(u, qid) && !QTAILQ_EMPTY(&cq->req_list)) { + /* Enqueueing to CQ was blocked because it was full */ + qemu_bh_schedule(cq->bh); + } + opr->cq.hp =3D data; ufs_mcq_update_cq_head(u, qid, data); break; + } case offsetof(UfsMcqOpReg, cq_int.is): opr->cq_int.is &=3D ~data; break; diff --git a/hw/ufs/ufs.h b/hw/ufs/ufs.h index 3799d97f30..13d964c5ae 100644 --- a/hw/ufs/ufs.h +++ b/hw/ufs/ufs.h @@ -200,6 +200,15 @@ static inline bool ufs_mcq_cq_empty(UfsHc *u, uint32_t= qid) return ufs_mcq_cq_tail(u, qid) =3D=3D ufs_mcq_cq_head(u, qid); } =20 +static inline bool ufs_mcq_cq_full(UfsHc *u, uint32_t qid) +{ + uint32_t tail =3D ufs_mcq_cq_tail(u, qid); + uint16_t cq_size =3D u->cq[qid]->size; + + tail =3D (tail + sizeof(UfsCqEntry)) % (sizeof(UfsCqEntry) * cq_size); + return tail =3D=3D ufs_mcq_cq_head(u, qid); +} + #define TYPE_UFS "ufs" #define UFS(obj) OBJECT_CHECK(UfsHc, (obj), TYPE_UFS) =20 --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070450112264.5004844873944; Mon, 2 Feb 2026 14:14:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Ai-0001kt-Ku; Mon, 02 Feb 2026 17:13:28 -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 1vn2AS-0000Be-2D; Mon, 02 Feb 2026 17:13:12 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2AQ-0003X5-7G; Mon, 02 Feb 2026 17:13:11 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 094D81852E4; Tue, 03 Feb 2026 01:07:38 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id DAEAE35B3F7; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Ilia Levi , Fabiano Rosas , Jeuk Kim , Michael Tokarev Subject: [Stable-10.2.1 55/56] tests/qtest/ufs-test: Add test for mcq completion queue wraparound Date: Tue, 3 Feb 2026 01:08:00 +0300 Message-ID: <20260202220805.945271-55-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070451554154100 Content-Type: text/plain; charset="utf-8" From: Ilia Levi Added a test that sends 32 NOP Out commands asynchronously. Since the CQ has 31 entries by default, this tests the scenario where CQ processing needs to wait for space to become available. Additionally, added two minor fixes to existing tests: * advance CQ head after reading from CQ * initialize command descriptor slots bitmap in ufs_init() Signed-off-by: Ilia Levi Acked-by: Fabiano Rosas Reviewed-by: Jeuk Kim Signed-off-by: Jeuk Kim (cherry picked from commit 94e72135d4d657d672561b1ae02a5854421616a7) Signed-off-by: Michael Tokarev diff --git a/tests/qtest/ufs-test.c b/tests/qtest/ufs-test.c index 4867ccf08a..ff9835735c 100644 --- a/tests/qtest/ufs-test.c +++ b/tests/qtest/ufs-test.c @@ -166,6 +166,7 @@ __ufs_send_transfer_request_mcq(QUfs *ufs, uint8_t lun, cqhp =3D ufs_rreg(ufs, ufs->cqdao[TEST_QID]); cqentry_addr =3D ufs->cqlba[TEST_QID] + cqhp; qtest_memread(ufs->dev.bus->qts, cqentry_addr, &cqentry, sizeof(cqentr= y)); + cqhp =3D (cqhp + sizeof(UfsCqEntry)) % (QUEUE_SIZE * sizeof(UfsCqEntry= )); ufs_wreg(ufs, ufs->cqdao[TEST_QID], cqhp); =20 return cqentry.status; @@ -208,6 +209,81 @@ static enum UtpOcsCodes ufs_send_nop_out(QUfs *ufs, Ut= pUpiuRsp *rsp_out) return ret; } =20 +static bool ufs_mcq_sq_has_space(QUfs *ufs) +{ + uint32_t sqhp =3D ufs_rreg(ufs, ufs->sqdao[TEST_QID]); + uint32_t sqtp =3D ufs_rreg(ufs, ufs->sqdao[TEST_QID] + 0x4); + uint32_t next_sqtp =3D + (sqtp + sizeof(UfsSqEntry)) % (QUEUE_SIZE * sizeof(UfsSqEntry)); + return next_sqtp !=3D sqhp; +} + +static void +__ufs_send_transfer_request_mcq_async(QUfs *ufs, uint8_t lun, + const UtpTransferReqDesc *utrd) +{ + uint32_t sqtp; + uint64_t utrd_addr; + + /* Wait for SQ space */ + while (!ufs_mcq_sq_has_space(ufs)) { + qtest_clock_step(ufs->dev.bus->qts, 100); + } + + sqtp =3D ufs_rreg(ufs, ufs->sqdao[TEST_QID] + 0x4); + utrd_addr =3D ufs->sqlba[TEST_QID] + sqtp; + qtest_memwrite(ufs->dev.bus->qts, utrd_addr, utrd, sizeof(*utrd)); + sqtp =3D (sqtp + sizeof(UfsSqEntry)) % (QUEUE_SIZE * sizeof(UfsSqEntry= )); + ufs_wreg(ufs, ufs->sqdao[TEST_QID] + 0x4, sqtp); +} + +static int ufs_mcq_send_nop_out_async(QUfs *ufs) +{ + int cmd_desc_slot =3D alloc_cmd_desc_slot(ufs); + uint64_t req_upiu_addr =3D + ufs->cmd_desc_addr + cmd_desc_slot * UTP_COMMAND_DESCRIPTOR_SIZE; + + /* Build up request upiu */ + UtpUpiuReq req_upiu =3D { 0 }; + req_upiu.header.trans_type =3D UFS_UPIU_TRANSACTION_NOP_OUT; + req_upiu.header.task_tag =3D cmd_desc_slot; + qtest_memwrite(ufs->dev.bus->qts, req_upiu_addr, &req_upiu, + sizeof(req_upiu)); + + /* Build up utp transfer request descriptor */ + UtpTransferReqDesc utrd =3D + ufs_build_req_utrd(req_upiu_addr, UFS_UTP_NO_DATA_TRANSFER, 0); + + /* Send Transfer Request */ + __ufs_send_transfer_request_mcq_async(ufs, 0, &utrd); + + return cmd_desc_slot; +} + +static int ufs_mcq_poll_cq(QUfs *ufs, UfsCqEntry *cqe, uint16_t n_cqe) +{ + uint32_t cqhp, cqtp; + uint64_t cqe_addr; + int ix =3D 0; + + cqhp =3D ufs_rreg(ufs, ufs->cqdao[TEST_QID]); + cqtp =3D ufs_rreg(ufs, ufs->cqdao[TEST_QID] + 0x4); + + while (cqhp !=3D cqtp && ix < n_cqe) { + /* read completion entry */ + cqe_addr =3D ufs->cqlba[TEST_QID] + cqhp; + qtest_memread(ufs->dev.bus->qts, cqe_addr, &cqe[ix], sizeof(cqe[ix= ])); + + /* advance completion queue head pointer */ + cqhp =3D (cqhp + sizeof(UfsCqEntry)) % (QUEUE_SIZE * sizeof(UfsCqE= ntry)); + ix++; + } + + ufs_wreg(ufs, ufs->cqdao[TEST_QID], cqhp); + + return ix; +} + static enum UtpOcsCodes ufs_send_query(QUfs *ufs, uint8_t query_function, uint8_t query_opcode, uint8_t idn, uint8_t index, uint8_t selector, @@ -416,6 +492,7 @@ static void ufs_init(QUfs *ufs, QGuestAllocator *alloc) ufs_wreg(ufs, A_UTRIACR, 0); =20 /* Enable transfer request */ + bitmap_zero(ufs->cmd_desc_bitmap, UFS_MAX_CMD_DESC); ufs->cmd_desc_addr =3D guest_alloc(alloc, UFS_MAX_CMD_DESC * UTP_COMMAND_DESCRIPTOR_SIZE); ufs->data_buffer_addr =3D @@ -679,6 +756,53 @@ static void ufstest_read_write(void *obj, void *data, = QGuestAllocator *alloc) ufs_exit(ufs, alloc); } =20 +static void ufstest_mcq_cq_wraparound(void *obj, void *data, + QGuestAllocator *alloc) +{ + QUfs *ufs =3D obj; + UfsCqEntry cqe[QUEUE_SIZE]; + const int num_requests =3D QUEUE_SIZE; + int i, completed =3D 0; + + ufs_init(ufs, alloc); + + /* Ensure MCQ is supported */ + g_assert_true(ufs->support_mcq); + + for (i =3D 0; i < num_requests; ++i) { + ufs_mcq_send_nop_out_async(ufs); + } + + while (completed !=3D num_requests) { + int n_cqe =3D ufs_mcq_poll_cq(ufs, cqe, ARRAY_SIZE(cqe)); + if (!n_cqe) { + break; + } + + for (i =3D 0; i < n_cqe; ++i) { + uint64_t ucdba; + uint64_t rsp_upiu_addr; + UtpUpiuRsp rsp_upiu; + uint8_t tag; + + g_assert_cmpuint(cqe[i].status, =3D=3D, UFS_OCS_SUCCESS); + + ucdba =3D le64_to_cpu(cqe[i].utp_addr) & MAKE_64BIT_MASK(7, 57= ); + rsp_upiu_addr =3D ucdba + UTP_RESPONSE_UPIU_OFFSET; + qtest_memread(ufs->dev.bus->qts, rsp_upiu_addr, &rsp_upiu, + sizeof(rsp_upiu)); + + tag =3D rsp_upiu.header.task_tag; + release_cmd_desc_slot(ufs, tag); + } + + completed +=3D n_cqe; + } + + g_assert_cmpint(completed, =3D=3D, num_requests); + ufs_exit(ufs, alloc); +} + static void ufstest_query_flag_request(void *obj, void *data, QGuestAllocator *alloc) { @@ -1129,6 +1253,8 @@ static void ufs_register_nodes(void) qos_add_test("init", "ufs", ufstest_init, NULL); qos_add_test("legacy-read-write", "ufs", ufstest_read_write, &io_test_= opts); qos_add_test("mcq-read-write", "ufs", ufstest_read_write, &mcq_test_op= ts); + qos_add_test("mcq-cq-wraparound", "ufs", ufstest_mcq_cq_wraparound, + &mcq_test_opts); qos_add_test("query-flag", "ufs", ufstest_query_flag_request, &io_test_opts); qos_add_test("query-attribute", "ufs", ufstest_query_attr_request, --=20 2.47.3 From nobody Mon Feb 9 15:17:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1770070584285239.8378349939926; Mon, 2 Feb 2026 14:16:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vn2Aj-0001rV-U2; Mon, 02 Feb 2026 17:13:30 -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 1vn2AY-0000bz-31; Mon, 02 Feb 2026 17:13:18 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vn2AV-0003Xt-41; Mon, 02 Feb 2026 17:13:17 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 19E771852E5; Tue, 03 Feb 2026 01:07:38 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id EB52735B3F8; Tue, 03 Feb 2026 01:08:19 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, John Snow , Pierrick Bouvier , Richard Henderson , Michael Tokarev Subject: [Stable-10.2.1 56/56] python: fix msys64 wheel directory specification Date: Tue, 3 Feb 2026 01:08:01 +0300 Message-ID: <20260202220805.945271-56-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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-ZM-MESSAGEID: 1770070585541154100 Content-Type: text/plain; charset="utf-8" From: John Snow In python3.14, fixes were made to the file URI parsing [1] such that file URIs that used to work but were technically out of spec are now broken. As a result, our msys2 GitLab CI tests began failing. Stop using "file://" URI links in favor of simple paths (Thanks pbo) to fix parsing errors under Python 3.14 and fix the msys2 GitLab CI tests. [1] https://docs.python.org/3/whatsnew/3.14.html#urllib Reported-by: Pierrick Bouvier Suggested-by: Pierrick Bouvier Signed-off-by: John Snow Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-ID: <20260130050518.517688-2-jsnow@redhat.com> (cherry picked from commit 587f4a1805c83a4e1d59dd43cb14e0a834843d1d) Signed-off-by: Michael Tokarev diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py index a064709e6c..5cba5770d2 100644 --- a/python/scripts/mkvenv.py +++ b/python/scripts/mkvenv.py @@ -683,7 +683,7 @@ def pip_install( if not online: full_args +=3D ["--no-index"] if wheels_dir: - full_args +=3D ["--find-links", f"file://{str(wheels_dir)}"] + full_args +=3D ["--find-links", str(wheels_dir)] full_args +=3D list(args) subprocess.run( full_args, --=20 2.47.3