From nobody Mon Feb 9 17:26:31 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 1770061752960469.7756615272318; Mon, 2 Feb 2026 11:49:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt2-0000FT-Tw; Mon, 02 Feb 2026 14:47: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 1vmzso-0000B0-QA; Mon, 02 Feb 2026 14:46:53 -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 1vmzsl-0003B4-QT; Mon, 02 Feb 2026 14:46:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 85B44185093; Mon, 02 Feb 2026 22:46:02 +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 2F1BB35B275; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Michael Tokarev Subject: [Stable-10.0.8 01/69] tests/vm: bump FreeBSD image to 14.3 Date: Mon, 2 Feb 2026 22:45:24 +0300 Message-ID: <20260202194638.939438-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: 1770061755041158501 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Signed-off-by: Paolo Bonzini (cherry picked from commit c8958b7eb494d06a209b1befb6c34edfbce68867) Signed-off-by: Michael Tokarev diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 74b3b1e520..2e96c9eba5 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -28,8 +28,8 @@ class FreeBSDVM(basevm.BaseVM): name =3D "freebsd" arch =3D "x86_64" =20 - link =3D "https://download.freebsd.org/releases/CI-IMAGES/14.1-RELEASE= /amd64/Latest/FreeBSD-14.1-RELEASE-amd64-BASIC-CI.raw.xz" - csum =3D "202fe27a05427f0a86d3ebb97712745186f2776ccc4f70d95466dd99a023= 8ba5" + link =3D "https://download.freebsd.org/releases/CI-IMAGES/14.3-RELEASE= /amd64/Latest/FreeBSD-14.3-RELEASE-amd64-BASIC-CI.raw.xz" + csum =3D "ec0f5a4bbe63aa50a725d9fee0f1931f850e9a21cbebdadb991df00f168d= 6805" size =3D "20G" =20 BUILD_SCRIPT =3D """ --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061882921103.58891069620222; Mon, 2 Feb 2026 11:51:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt3-0000G5-T1; Mon, 02 Feb 2026 14:47:06 -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 1vmzso-0000B1-R3; Mon, 02 Feb 2026 14:46:53 -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 1vmzsn-0003Bs-8A; Mon, 02 Feb 2026 14:46:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A0E26185094; Mon, 02 Feb 2026 22:46:02 +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 47FD735B276; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Michael Tokarev , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [Stable-10.0.8 02/69] gitlab-ci.d/cirrus: Update the FreeBSD job to v14.3 Date: Mon, 2 Feb 2026 22:45:25 +0300 Message-ID: <20260202194638.939438-2-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: 1770061903595158500 The FreeBSD 14.2 job fails since the image disappeared from the cloud. We already bumped FreeBSD image to 14.3 in tests/vm in c8958b7eb4 (part of v10.1.0). Signed-off-by: Michael Tokarev Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Message-ID: <20251204205025.2423326-1-mjt@tls.msk.ru> Signed-off-by: Alex Benn=C3=A9e (cherry picked from commit 7e71b8e7f2f658999fd6d0871cab3acad53150e7) Signed-off-by: Michael Tokarev diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml index 75b611418e..a8faaf8d08 100644 --- a/.gitlab-ci.d/cirrus.yml +++ b/.gitlab-ci.d/cirrus.yml @@ -37,7 +37,7 @@ x64-freebsd-14-build: NAME: freebsd-14 CIRRUS_VM_INSTANCE_TYPE: freebsd_instance CIRRUS_VM_IMAGE_SELECTOR: image_family - CIRRUS_VM_IMAGE_NAME: freebsd-14-2 + CIRRUS_VM_IMAGE_NAME: freebsd-14-3 CIRRUS_VM_CPUS: 8 CIRRUS_VM_RAM: 8G UPDATE_COMMAND: pkg update; pkg upgrade -y --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061779342211.33637573290662; Mon, 2 Feb 2026 11:49:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt2-0000Ev-6B; Mon, 02 Feb 2026 14:47: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 1vmzst-0000CR-P4; Mon, 02 Feb 2026 14:46:59 -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 1vmzsq-0003CY-5H; Mon, 02 Feb 2026 14:46:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B650C185095; Mon, 02 Feb 2026 22:46:02 +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 6408B35B277; Mon, 02 Feb 2026 22:46:44 +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?= , Richard Henderson , Thomas Huth , Michael Tokarev Subject: [Stable-10.0.8 03/69] gitlab: move custom runners to Ubuntu 24.04 Date: Mon, 2 Feb 2026 22:45:26 +0300 Message-ID: <20260202194638.939438-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: 1770061781949154100 From: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Alex Benn=C3=A9e Message-ID: <20251001170947.2769296-7-alex.bennee@linaro.org> (cherry picked from commit eafc5f69e621725dcdcedcc1955d820af7abfc82) Signed-off-by: Michael Tokarev diff --git a/.gitlab-ci.d/custom-runners.yml b/.gitlab-ci.d/custom-runners.= yml index 1aa3c60efe..f6330c1614 100644 --- a/.gitlab-ci.d/custom-runners.yml +++ b/.gitlab-ci.d/custom-runners.yml @@ -29,6 +29,6 @@ junit: build/meson-logs/testlog.junit.xml =20 include: - - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml' - - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml' - - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml' + - local: '/.gitlab-ci.d/custom-runners/ubuntu-24.04-s390x.yml' + - local: '/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml' + - local: '/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch32.yml' diff --git a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml b/.gitlab= -ci.d/custom-runners/ubuntu-24.04-aarch32.yml similarity index 78% rename from .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml rename to .gitlab-ci.d/custom-runners/ubuntu-24.04-aarch32.yml index 8727687e2b..75029c9187 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch32.yml @@ -1,13 +1,13 @@ -# All ubuntu-22.04 jobs should run successfully in an environment +# All ubuntu-24.04 jobs should run successfully in an environment # setup by the scripts/ci/setup/ubuntu/build-environment.yml task -# "Install basic packages to build QEMU on Ubuntu 22.04" +# "Install basic packages to build QEMU on Ubuntu 24.04" =20 -ubuntu-22.04-aarch32-all: +ubuntu-24.04-aarch32-all: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch32 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' diff --git a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml b/.gitlab= -ci.d/custom-runners/ubuntu-24.04-aarch64.yml similarity index 89% rename from .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml rename to .gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml index ca2f140471..d26c7827f4 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml @@ -1,13 +1,13 @@ -# All ubuntu-22.04 jobs should run successfully in an environment +# All ubuntu-24.04 jobs should run successfully in an environment # setup by the scripts/ci/setup/ubuntu/build-environment.yml task -# "Install basic packages to build QEMU on Ubuntu 22.04" +# "Install basic packages to build QEMU on Ubuntu 24.04" =20 -ubuntu-22.04-aarch64-all-linux-static: +ubuntu-24.04-aarch64-all-linux-static: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -23,12 +23,12 @@ ubuntu-22.04-aarch64-all-linux-static: - make check-tcg - make --output-sync -j`nproc --ignore=3D40` check =20 -ubuntu-22.04-aarch64-all: +ubuntu-24.04-aarch64-all: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -45,12 +45,12 @@ ubuntu-22.04-aarch64-all: - make --output-sync -j`nproc --ignore=3D40` - make --output-sync -j`nproc --ignore=3D40` check =20 -ubuntu-22.04-aarch64-without-defaults: +ubuntu-24.04-aarch64-without-defaults: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -67,12 +67,12 @@ ubuntu-22.04-aarch64-without-defaults: - make --output-sync -j`nproc --ignore=3D40` - make --output-sync -j`nproc --ignore=3D40` check =20 -ubuntu-22.04-aarch64-alldbg: +ubuntu-24.04-aarch64-alldbg: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -86,12 +86,12 @@ ubuntu-22.04-aarch64-alldbg: - make --output-sync -j`nproc --ignore=3D40` - make --output-sync -j`nproc --ignore=3D40` check =20 -ubuntu-22.04-aarch64-clang: +ubuntu-24.04-aarch64-clang: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -108,11 +108,11 @@ ubuntu-22.04-aarch64-clang: - make --output-sync -j`nproc --ignore=3D40` - make --output-sync -j`nproc --ignore=3D40` check =20 -ubuntu-22.04-aarch64-tci: +ubuntu-24.04-aarch64-tci: needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -128,12 +128,12 @@ ubuntu-22.04-aarch64-tci: || { cat config.log meson-logs/meson-log.txt; exit 1; } - make --output-sync -j`nproc --ignore=3D40` =20 -ubuntu-22.04-aarch64-notcg: +ubuntu-24.04-aarch64-notcg: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - aarch64 rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' diff --git a/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml b/.gitlab-c= i.d/custom-runners/ubuntu-24.04-s390x.yml similarity index 88% rename from .gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml rename to .gitlab-ci.d/custom-runners/ubuntu-24.04-s390x.yml index ca374acb8c..6f6bea41cf 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-24.04-s390x.yml @@ -1,13 +1,13 @@ -# All ubuntu-22.04 jobs should run successfully in an environment +# All ubuntu-24.04 jobs should run successfully in an environment # setup by the scripts/ci/setup/ubuntu/build-environment.yml task -# "Install basic packages to build QEMU on Ubuntu 22.04" +# "Install basic packages to build QEMU on Ubuntu 24.04" =20 -ubuntu-22.04-s390x-all-linux: +ubuntu-24.04-s390x-all-linux: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -21,12 +21,12 @@ ubuntu-22.04-s390x-all-linux: - make --output-sync check-tcg - make --output-sync -j`nproc` check =20 -ubuntu-22.04-s390x-all-system: +ubuntu-24.04-s390x-all-system: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x timeout: 75m rules: @@ -40,12 +40,12 @@ ubuntu-22.04-s390x-all-system: - make --output-sync -j`nproc` - make --output-sync -j`nproc` check =20 -ubuntu-22.04-s390x-alldbg: +ubuntu-24.04-s390x-alldbg: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -63,12 +63,12 @@ ubuntu-22.04-s390x-alldbg: - make --output-sync -j`nproc` - make --output-sync -j`nproc` check =20 -ubuntu-22.04-s390x-clang: +ubuntu-24.04-s390x-clang: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -85,11 +85,11 @@ ubuntu-22.04-s390x-clang: - make --output-sync -j`nproc` - make --output-sync -j`nproc` check =20 -ubuntu-22.04-s390x-tci: +ubuntu-24.04-s390x-tci: needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' @@ -105,12 +105,12 @@ ubuntu-22.04-s390x-tci: || { cat config.log meson-logs/meson-log.txt; exit 1; } - make --output-sync -j`nproc` =20 -ubuntu-22.04-s390x-notcg: +ubuntu-24.04-s390x-notcg: extends: .custom_runner_template needs: [] stage: build tags: - - ubuntu_22.04 + - ubuntu_24.04 - s390x rules: - if: '$CI_PROJECT_NAMESPACE =3D=3D "qemu-project" && $CI_COMMIT_BRANCH = =3D~ /^staging/' --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061723363817.0396860091486; Mon, 2 Feb 2026 11:48:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt5-0000Gv-2e; Mon, 02 Feb 2026 14:47: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 1vmzsr-0000BL-Pz; Mon, 02 Feb 2026 14:46:54 -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 1vmzsq-0003Ca-6v; Mon, 02 Feb 2026 14:46:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D39E1185096; Mon, 02 Feb 2026 22:46:02 +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 7985635B278; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , Michael Tokarev Subject: [Stable-10.0.8 04/69] tests/docker: add --arch-only to qemu deps for all-test-cross Date: Mon, 2 Feb 2026 22:45:27 +0300 Message-ID: <20260202194638.939438-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: 1770061726730158500 From: Alex Benn=C3=A9e If we want to build this container on non-x86 systems we might not have all the cross-compilers needed for the ROM blobs we don't actually build. Use --arch-only to avoid stalling on these missing bits. Reviewed-by: Manos Pitsidianakis Signed-off-by: Alex Benn=C3=A9e Message-ID: <20250725154517.3523095-13-alex.bennee@linaro.org> (cherry picked from commit 408c8629105f32aa1d02d3004998ea453f69809b) Signed-off-by: Michael Tokarev diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/= docker/dockerfiles/debian-all-test-cross.docker index 8ab244e018..5aa43749eb 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -15,7 +15,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ apt-get update && \ apt-get install -y eatmydata && \ eatmydata apt-get dist-upgrade -y && \ - apt build-dep -yy qemu + apt build-dep -yy --arch-only qemu =20 # Add extra build tools and as many cross compilers as we can for testing RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061657751705.4945479996527; Mon, 2 Feb 2026 11:47:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt5-0000IS-VZ; Mon, 02 Feb 2026 14:47:08 -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 1vmzsv-0000Ce-EH; Mon, 02 Feb 2026 14:46:59 -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 1vmzst-0003D3-R6; Mon, 02 Feb 2026 14:46:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E3A9D185097; Mon, 02 Feb 2026 22:46:02 +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 9605135B279; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , Michael Tokarev Subject: [Stable-10.0.8 05/69] tests/docker: handle host-arch selection for all-test-cross Date: Mon, 2 Feb 2026 22:45:28 +0300 Message-ID: <20260202194638.939438-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: 1770061670597158500 From: Alex Benn=C3=A9e When building on non-x86 we get a bunch but not all of the compilers. Handle this in the Dockerfile by probing the arch and expanding the list available. Reviewed-by: Manos Pitsidianakis Signed-off-by: Alex Benn=C3=A9e Message-ID: <20250725154517.3523095-14-alex.bennee@linaro.org> (cherry picked from commit 6da616bb17004f9332b2798353ebef88cac61cc2) Signed-off-by: Michael Tokarev diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/= docker/dockerfiles/debian-all-test-cross.docker index 5aa43749eb..ef69bbc8a5 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -23,7 +23,9 @@ RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ bison \ ccache \ clang \ + dpkg-dev \ flex \ + gcc \ git \ libclang-rt-dev \ ninja-build \ @@ -33,16 +35,11 @@ RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ python3-venv \ python3-wheel =20 -RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ - apt install -y --no-install-recommends \ - gcc-aarch64-linux-gnu \ +# All the generally available compilers +ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \ libc6-dev-arm64-cross \ gcc-arm-linux-gnueabihf \ libc6-dev-armhf-cross \ - gcc-hppa-linux-gnu \ - libc6-dev-hppa-cross \ - gcc-m68k-linux-gnu \ - libc6-dev-m68k-cross \ gcc-mips-linux-gnu \ libc6-dev-mips-cross \ gcc-mips64-linux-gnuabi64 \ @@ -51,18 +48,25 @@ RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ libc6-dev-mips64el-cross \ gcc-mipsel-linux-gnu \ libc6-dev-mipsel-cross \ - gcc-powerpc-linux-gnu \ - libc6-dev-powerpc-cross \ - gcc-powerpc64-linux-gnu \ - libc6-dev-ppc64-cross \ gcc-powerpc64le-linux-gnu \ libc6-dev-ppc64el-cross \ gcc-riscv64-linux-gnu \ libc6-dev-riscv64-cross \ gcc-s390x-linux-gnu \ - libc6-dev-s390x-cross \ - gcc-sparc64-linux-gnu \ - libc6-dev-sparc64-cross && \ + libc6-dev-s390x-cross + +RUN if dpkg-architecture -e amd64; then \ + export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu = libc6-dev-hppa-cross"; \ + export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu = libc6-dev-m68k-cross"; \ + export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-powerpc-linux-g= nu libc6-dev-powerpc-cross"; \ + export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-powerpc64-linux= -gnu libc6-dev-ppc64-cross"; \ + export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-sparc64-linux-g= nu libc6-dev-sparc64-cross"; \ + fi && \ + echo "compilers: ${AVAILABLE_COMPILERS}" + +RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ + apt install -y --no-install-recommends \ + ${AVAILABLE_COMPILERS} && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' = --show > /packages.txt =20 =20 --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 177006184342998.33155842754138; Mon, 2 Feb 2026 11:50:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt3-0000Fb-7a; Mon, 02 Feb 2026 14:47: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 1vmzsx-0000DR-Pq; Mon, 02 Feb 2026 14:47:03 -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 1vmzsw-0003DL-79; Mon, 02 Feb 2026 14:46:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F4099185098; Mon, 02 Feb 2026 22:46:02 +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 A65B335B27A; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Manos Pitsidianakis , Michael Tokarev Subject: [Stable-10.0.8 06/69] tests/docker: fix debian-all-test-cross Date: Mon, 2 Feb 2026 22:45:29 +0300 Message-ID: <20260202194638.939438-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: 1770061846400154100 From: Alex Benn=C3=A9e It turns out you can't easily expand an ENV var across multiple steps in a dockerfile. This meant we silently dropped the architectures we should have even on amd64 hosts. As the updated AVAILABLE_COMPILERS is only needed for the following apt install line just merge them. Fixes: 6da616bb170 (tests/docker: handle host-arch selection for all-test-c= ross) Reviewed-by: Manos Pitsidianakis Signed-off-by: Alex Benn=C3=A9e Message-ID: <20250804104308.250949-1-alex.bennee@linaro.org> (cherry picked from commit 61432e805e5028df0a3df5a76915cdc3007ecd41) Signed-off-by: Michael Tokarev diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/= docker/dockerfiles/debian-all-test-cross.docker index ef69bbc8a5..420a4e33e6 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -62,9 +62,7 @@ RUN if dpkg-architecture -e amd64; then \ export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-powerpc64-linux= -gnu libc6-dev-ppc64-cross"; \ export AVAILABLE_COMPILERS=3D"${AVAILABLE_COMPILERS} gcc-sparc64-linux-g= nu libc6-dev-sparc64-cross"; \ fi && \ - echo "compilers: ${AVAILABLE_COMPILERS}" - -RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ + DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ apt install -y --no-install-recommends \ ${AVAILABLE_COMPILERS} && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' = --show > /packages.txt --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061969564952.4057604505182; Mon, 2 Feb 2026 11:52:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt4-0000GJ-9H; Mon, 02 Feb 2026 14:47:06 -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 1vmzsy-0000Dh-UN; Mon, 02 Feb 2026 14:47:03 -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 1vmzsx-0003DT-1Z; Mon, 02 Feb 2026 14:47:00 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 10009185099; Mon, 02 Feb 2026 22:46:03 +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 B713635B27B; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 07/69] tcg: Zero extend 32-bit addresses for TCI Date: Mon, 2 Feb 2026 22:45:30 +0300 Message-ID: <20260202194638.939438-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: 1770061972245154100 Content-Type: text/plain; charset="utf-8" From: Richard Henderson For native code generation, zero-extending 32-bit addresses for the slow path helpers happens in tcg_out_{ld,st}_helper_args, but there isn't really a slow path for TCI, so that didn't happen. Make the extension for TCI explicit in the opcode stream, much like we already do for plugins and atomic helpers. Cc: qemu-stable@nongnu.org Fixes: 24e46e6c9d9 ("accel/tcg: Widen tcg-ldst.h addresses to uint64_t") Signed-off-by: Richard Henderson (cherry picked from commit 41706d3e72d651edb03b4a06b02b490bec8a3ddf) (Mjt: backport to before v10.0.0-521-gaae2456ac0b4 "tcg: Merge INDEX_op_{ld= ,st}_{i32,i64,i128}") Signed-off-by: Michael Tokarev diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 73838e2701..a8f35e1970 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -118,6 +118,30 @@ static void tcg_gen_req_mo(TCGBar type) } } =20 +static TCGTemp *tci_extend_addr(TCGTemp *addr) +{ +#ifdef CONFIG_TCG_INTERPRETER + /* + * 64-bit interpreter requires 64-bit addresses. + * Compare to the extension performed by tcg_out_{ld,st}_helper_args + * for native code generation. + */ + if (TCG_TARGET_REG_BITS =3D=3D 64 && tcg_ctx->addr_type =3D=3D TCG_TYP= E_I32) { + TCGv_i64 temp =3D tcg_temp_ebb_new_i64(); + tcg_gen_extu_i32_i64(temp, temp_tcgv_i32(addr)); + return tcgv_i64_temp(temp); + } +#endif + return addr; +} + +static void maybe_free_addr(TCGTemp *addr, TCGTemp *copy) +{ + if (addr !=3D copy) { + tcg_temp_free_internal(copy); + } +} + /* Only required for loads, where value might overlap addr. */ static TCGv_i64 plugin_maybe_preserve_addr(TCGTemp *addr) { @@ -217,6 +241,7 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCGTe= mp *addr, MemOp orig_memop; MemOpIdx orig_oi, oi; TCGv_i64 copy_addr; + TCGTemp *addr_new; =20 tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); orig_memop =3D memop =3D tcg_canonicalize_memop(memop, 0, 0); @@ -231,11 +256,13 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCG= Temp *addr, oi =3D make_memop_idx(memop, idx); } =20 + addr_new =3D tci_extend_addr(addr); copy_addr =3D plugin_maybe_preserve_addr(addr); gen_ldst(INDEX_op_qemu_ld_i32, TCG_TYPE_I32, - tcgv_i32_temp(val), NULL, addr, oi); + tcgv_i32_temp(val), NULL, addr_new, oi); plugin_gen_mem_callbacks_i32(val, copy_addr, addr, orig_oi, QEMU_PLUGIN_MEM_R); + maybe_free_addr(addr, addr_new); =20 if ((orig_memop ^ memop) & MO_BSWAP) { switch (orig_memop & MO_SIZE) { @@ -267,6 +294,7 @@ static void tcg_gen_qemu_st_i32_int(TCGv_i32 val, TCGTe= mp *addr, TCGv_i32 swap =3D NULL; MemOpIdx orig_oi, oi; TCGOpcode opc; + TCGTemp *addr_new; =20 tcg_gen_req_mo(TCG_MO_LD_ST | TCG_MO_ST_ST); memop =3D tcg_canonicalize_memop(memop, 0, 1); @@ -294,8 +322,10 @@ static void tcg_gen_qemu_st_i32_int(TCGv_i32 val, TCGT= emp *addr, } else { opc =3D INDEX_op_qemu_st_i32; } - gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr, oi); + addr_new =3D tci_extend_addr(addr); + gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr_new, oi); plugin_gen_mem_callbacks_i32(val, NULL, addr, orig_oi, QEMU_PLUGIN_MEM= _W); + maybe_free_addr(addr, addr_new); =20 if (swap) { tcg_temp_free_i32(swap); @@ -316,6 +346,7 @@ static void tcg_gen_qemu_ld_i64_int(TCGv_i64 val, TCGTe= mp *addr, MemOp orig_memop; MemOpIdx orig_oi, oi; TCGv_i64 copy_addr; + TCGTemp *addr_new; =20 if (TCG_TARGET_REG_BITS =3D=3D 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_ld_i32_int(TCGV_LOW(val), addr, idx, memop); @@ -340,10 +371,12 @@ static void tcg_gen_qemu_ld_i64_int(TCGv_i64 val, TCG= Temp *addr, oi =3D make_memop_idx(memop, idx); } =20 + addr_new =3D tci_extend_addr(addr); copy_addr =3D plugin_maybe_preserve_addr(addr); - gen_ldst_i64(INDEX_op_qemu_ld_i64, val, addr, oi); + gen_ldst_i64(INDEX_op_qemu_ld_i64, val, addr_new, oi); plugin_gen_mem_callbacks_i64(val, copy_addr, addr, orig_oi, QEMU_PLUGIN_MEM_R); + maybe_free_addr(addr, addr_new); =20 if ((orig_memop ^ memop) & MO_BSWAP) { int flags =3D (orig_memop & MO_SIGN @@ -378,6 +411,7 @@ static void tcg_gen_qemu_st_i64_int(TCGv_i64 val, TCGTe= mp *addr, { TCGv_i64 swap =3D NULL; MemOpIdx orig_oi, oi; + TCGTemp *addr_new; =20 if (TCG_TARGET_REG_BITS =3D=3D 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_st_i32_int(TCGV_LOW(val), addr, idx, memop); @@ -408,8 +442,10 @@ static void tcg_gen_qemu_st_i64_int(TCGv_i64 val, TCGT= emp *addr, oi =3D make_memop_idx(memop, idx); } =20 - gen_ldst_i64(INDEX_op_qemu_st_i64, val, addr, oi); + addr_new =3D tci_extend_addr(addr); + gen_ldst_i64(INDEX_op_qemu_st_i64, val, addr_new, oi); plugin_gen_mem_callbacks_i64(val, NULL, addr, orig_oi, QEMU_PLUGIN_MEM= _W); + maybe_free_addr(addr, addr_new); =20 if (swap) { tcg_temp_free_i64(swap); @@ -520,6 +556,7 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCG= Temp *addr, { MemOpIdx orig_oi; TCGv_i64 ext_addr =3D NULL; + TCGTemp *addr_new; =20 check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); @@ -547,8 +584,10 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TC= GTemp *addr, hi =3D TCGV128_HIGH(val); } =20 + addr_new =3D tci_extend_addr(addr); gen_ldst(INDEX_op_qemu_ld_i128, TCG_TYPE_I128, tcgv_i64_temp(lo), - tcgv_i64_temp(hi), addr, oi); + tcgv_i64_temp(hi), addr_new, oi); + maybe_free_addr(addr, addr_new); =20 if (need_bswap) { tcg_gen_bswap64_i64(lo, lo); @@ -576,8 +615,10 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TC= GTemp *addr, y =3D TCGV128_LOW(val); } =20 - gen_ldst_i64(INDEX_op_qemu_ld_i64, x, addr, + addr_new =3D tci_extend_addr(addr); + gen_ldst_i64(INDEX_op_qemu_ld_i64, x, addr_new, make_memop_idx(mop[0], idx)); + maybe_free_addr(addr, addr_new); =20 if (need_bswap) { tcg_gen_bswap64_i64(x, x); @@ -593,8 +634,10 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TC= GTemp *addr, addr_p8 =3D tcgv_i64_temp(t); } =20 - gen_ldst_i64(INDEX_op_qemu_ld_i64, y, addr_p8, + addr_new =3D tci_extend_addr(addr_p8); + gen_ldst_i64(INDEX_op_qemu_ld_i64, y, addr_new, make_memop_idx(mop[1], idx)); + maybe_free_addr(addr_p8, addr_new); tcg_temp_free_internal(addr_p8); =20 if (need_bswap) { @@ -628,6 +671,7 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCG= Temp *addr, { MemOpIdx orig_oi; TCGv_i64 ext_addr =3D NULL; + TCGTemp *addr_new; =20 check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_ST_LD | TCG_MO_ST_ST); @@ -658,8 +702,10 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TC= GTemp *addr, hi =3D TCGV128_HIGH(val); } =20 + addr_new =3D tci_extend_addr(addr); gen_ldst(INDEX_op_qemu_st_i128, TCG_TYPE_I128, - tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr, oi); + tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr_new, oi); + maybe_free_addr(addr, addr_new); =20 if (need_bswap) { tcg_temp_free_i64(lo); @@ -686,8 +732,10 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TC= GTemp *addr, x =3D b; } =20 - gen_ldst_i64(INDEX_op_qemu_st_i64, x, addr, + addr_new =3D tci_extend_addr(addr); + gen_ldst_i64(INDEX_op_qemu_st_i64, x, addr_new, make_memop_idx(mop[0], idx)); + maybe_free_addr(addr, addr_new); =20 if (tcg_ctx->addr_type =3D=3D TCG_TYPE_I32) { TCGv_i32 t =3D tcg_temp_ebb_new_i32(); @@ -699,15 +747,17 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, T= CGTemp *addr, addr_p8 =3D tcgv_i64_temp(t); } =20 + addr_new =3D tci_extend_addr(addr_p8); if (b) { tcg_gen_bswap64_i64(b, y); - gen_ldst_i64(INDEX_op_qemu_st_i64, b, addr_p8, + gen_ldst_i64(INDEX_op_qemu_st_i64, b, addr_new, make_memop_idx(mop[1], idx)); tcg_temp_free_i64(b); } else { - gen_ldst_i64(INDEX_op_qemu_st_i64, y, addr_p8, + gen_ldst_i64(INDEX_op_qemu_st_i64, y, addr_new, make_memop_idx(mop[1], idx)); } + maybe_free_addr(addr_p8, addr_new); tcg_temp_free_internal(addr_p8); } else { if (tcg_ctx->addr_type =3D=3D TCG_TYPE_I32) { --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770062254962654.9535909103216; Mon, 2 Feb 2026 11:57:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt7-0000Iy-0G; Mon, 02 Feb 2026 14:47: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 1vmzt0-0000Dp-QU; Mon, 02 Feb 2026 14:47:03 -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 1vmzsz-0003Do-4d; Mon, 02 Feb 2026 14:47:02 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2278318509A; Mon, 02 Feb 2026 22:46:03 +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 C6A6435B27C; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jessica Clarke , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 08/69] target/arm: handle unaligned PC during tlb probe Date: Mon, 2 Feb 2026 22:45:31 +0300 Message-ID: <20260202194638.939438-8-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: 1770062256678154100 From: Alex Benn=C3=A9e PC alignment faults have priority over instruction aborts and we have code to deal with this in the translation front-ends. However during tb_lookup we can see a potentially faulting probe which doesn't get a MemOp set. If the page isn't available this results in EC_INSNABORT (0x20) instead of EC_PCALIGNMENT (0x22). As there is no easy way to set the appropriate MemOp in the instruction fetch probe path lets just detect it in arm_cpu_tlb_fill_align() ahead of the main alignment check. We also teach arm_deliver_fault to deliver the right syndrome for MMU_INST_FETCH alignment issues. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3233 Tested-by: Jessica Clarke Reviewed-by: Richard Henderson Message-ID: <20251209092459.1058313-5-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e (cherry picked from commit dd77ef99aa0280c467fe8442b4238122899ae6cf) Signed-off-by: Michael Tokarev diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c index 8841f039bc..912b98f272 100644 --- a/target/arm/tcg/tlb_helper.c +++ b/target/arm/tcg/tlb_helper.c @@ -243,7 +243,11 @@ void arm_deliver_fault(ARMCPU *cpu, vaddr addr, fsr =3D compute_fsr_fsc(env, fi, target_el, mmu_idx, &fsc); =20 if (access_type =3D=3D MMU_INST_FETCH) { - syn =3D syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc); + if (fi->type =3D=3D ARMFault_Alignment) { + syn =3D syn_pcalignment(); + } else { + syn =3D syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc); + } exc =3D EXCP_PREFETCH_ABORT; } else { syn =3D merge_syn_data_abort(env->exception.syndrome, fi, target_e= l, @@ -338,11 +342,18 @@ bool arm_cpu_tlb_fill_align(CPUState *cs, CPUTLBEntry= Full *out, vaddr address, } =20 /* - * Per R_XCHFJ, alignment fault not due to memory type has - * highest precedence. Otherwise, walk the page table and - * and collect the page description. + * PC alignment faults should be dealt with at translation time + * but we also need to catch them while being probed. + * + * Then per R_XCHFJ, alignment fault not due to memory type take + * precedence. Otherwise, walk the page table and and collect the + * page description. + * */ - if (address & ((1 << memop_alignment_bits(memop)) - 1)) { + if (access_type =3D=3D MMU_INST_FETCH && !cpu->env.thumb && + (address & 3)) { + fi->type =3D ARMFault_Alignment; + } else if (address & ((1 << memop_alignment_bits(memop)) - 1)) { fi->type =3D ARMFault_Alignment; } else if (!get_phys_addr(&cpu->env, address, access_type, memop, core_to_arm_mmu_idx(&cpu->env, mmu_idx), --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061829843968.894087460919; Mon, 2 Feb 2026 11:50:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt4-0000G8-1M; Mon, 02 Feb 2026 14:47:06 -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 1vmzt2-0000Ew-2F; Mon, 02 Feb 2026 14:47: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 1vmzt0-0003Dy-Dm; Mon, 02 Feb 2026 14:47:03 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2FCFD18509B; Mon, 02 Feb 2026 22:46:03 +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 D7F7A35B27D; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Hanna Czenczek , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.8 09/69] vhost: Always initialize cached vring data Date: Mon, 2 Feb 2026 22:45:32 +0300 Message-ID: <20260202194638.939438-9-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: 1770061831233158500 From: Hanna Czenczek vhost_virtqueue_start() can exit early if the descriptor ring address is 0, assuming the virtqueue isn=E2=80=99t ready to start. In this case, all cached vring information (size, physical address, pointer) is left as-is. This is OK at first startup, when that info is still initialized to 0, but after a reset, it will retain old (outdated) information. vhost_virtqueue_start() must make sure these values are (re-)set properly before exiting. (When using an IOMMU, these outdated values can stall the device: vhost_dev_start() deliberately produces an IOMMU miss event for each used vring. If used_phys contains an outdated value, the resulting lookup may fail, forcing the device to be stopped.) Cc: qemu-stable@nongnu.org Signed-off-by: Hanna Czenczek Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251208113008.153249-1-hreitz@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 (cherry picked from commit 46228925edd53bb0569519538b94e10b85f9c001) Signed-off-by: Michael Tokarev diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index e72d991c55..971460eb2a 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1245,7 +1245,7 @@ int vhost_virtqueue_start(struct vhost_dev *dev, BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); VirtioBusState *vbus =3D VIRTIO_BUS(qbus); VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(vbus); - hwaddr s, l, a; + hwaddr l; int r; int vhost_vq_index =3D dev->vhost_ops->vhost_get_vq_index(dev, idx); struct vhost_vring_file file =3D { @@ -1256,8 +1256,17 @@ int vhost_virtqueue_start(struct vhost_dev *dev, }; struct VirtQueue *vvq =3D virtio_get_queue(vdev, idx); =20 - a =3D virtio_queue_get_desc_addr(vdev, idx); - if (a =3D=3D 0) { + vq->desc_size =3D virtio_queue_get_desc_size(vdev, idx); + vq->desc_phys =3D virtio_queue_get_desc_addr(vdev, idx); + vq->desc =3D NULL; + vq->avail_size =3D virtio_queue_get_avail_size(vdev, idx); + vq->avail_phys =3D virtio_queue_get_avail_addr(vdev, idx); + vq->avail =3D NULL; + vq->used_size =3D virtio_queue_get_used_size(vdev, idx); + vq->used_phys =3D virtio_queue_get_used_addr(vdev, idx); + vq->used =3D NULL; + + if (vq->desc_phys =3D=3D 0) { /* Queue might not be ready for start */ return 0; } @@ -1285,24 +1294,23 @@ int vhost_virtqueue_start(struct vhost_dev *dev, } } =20 - vq->desc_size =3D s =3D l =3D virtio_queue_get_desc_size(vdev, idx); - vq->desc_phys =3D a; - vq->desc =3D vhost_memory_map(dev, a, &l, false); - if (!vq->desc || l !=3D s) { + l =3D vq->desc_size; + vq->desc =3D vhost_memory_map(dev, vq->desc_phys, &l, false); + if (!vq->desc || l !=3D vq->desc_size) { r =3D -ENOMEM; goto fail_alloc_desc; } - vq->avail_size =3D s =3D l =3D virtio_queue_get_avail_size(vdev, idx); - vq->avail_phys =3D a =3D virtio_queue_get_avail_addr(vdev, idx); - vq->avail =3D vhost_memory_map(dev, a, &l, false); - if (!vq->avail || l !=3D s) { + + l =3D vq->avail_size; + vq->avail =3D vhost_memory_map(dev, vq->avail_phys, &l, false); + if (!vq->avail || l !=3D vq->avail_size) { r =3D -ENOMEM; goto fail_alloc_avail; } - vq->used_size =3D s =3D l =3D virtio_queue_get_used_size(vdev, idx); - vq->used_phys =3D a =3D virtio_queue_get_used_addr(vdev, idx); - vq->used =3D vhost_memory_map(dev, a, &l, true); - if (!vq->used || l !=3D s) { + + l =3D vq->used_size; + vq->used =3D vhost_memory_map(dev, vq->used_phys, &l, true); + if (!vq->used || l !=3D vq->used_size) { r =3D -ENOMEM; goto fail_alloc_used; } --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061678573747.5072771572092; Mon, 2 Feb 2026 11:47:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzt9-0000LG-PY; Mon, 02 Feb 2026 14:47: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 1vmzt3-0000G7-Oc; Mon, 02 Feb 2026 14:47:05 -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 1vmzt2-0003EB-97; Mon, 02 Feb 2026 14:47:05 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 48EAE18509C; Mon, 02 Feb 2026 22:46:03 +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 E542435B27E; Mon, 02 Feb 2026 22:46:44 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Stefan Weil , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.8 10/69] scripts/nsis.py: Tell makensis that WoA is 64 bit Date: Mon, 2 Feb 2026 22:45:33 +0300 Message-ID: <20260202194638.939438-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: 1770061684115154100 From: Stefan Weil This fixes some settings like the default installation path for the QEMU installation on Windows on ARM (WoA). Signed-off-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251209130212.764443-1-sw@weilnetz.de> Signed-off-by: Philippe Mathieu-Daud=C3=A9 (cherry picked from commit e742b7bdc244499761a21bc1965580c6261a74bf) Signed-off-by: Michael Tokarev diff --git a/scripts/nsis.py b/scripts/nsis.py index 8f469634eb..33069f4a86 100644 --- a/scripts/nsis.py +++ b/scripts/nsis.py @@ -114,7 +114,7 @@ def main(): "-DSRCDIR=3D" + args.srcdir, "-DBINDIR=3D" + destdir + prefix, ] - if args.cpu =3D=3D "x86_64": + if args.cpu =3D=3D "aarch64" or args.cpu =3D=3D "x86_64": makensis +=3D ["-DW64"] makensis +=3D ["-DDLLDIR=3D" + dlldir] =20 --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061734504530.4078195763908; Mon, 2 Feb 2026 11:48:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmztT-0000Oi-C1; Mon, 02 Feb 2026 14:47: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 1vmztO-0000MJ-V0; Mon, 02 Feb 2026 14:47: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 1vmztN-0003ER-HD; Mon, 02 Feb 2026 14:47:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5957E18509D; Mon, 02 Feb 2026 22:46:03 +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 0AD9735B27F; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Kevin Wolf , Thomas Huth , Stefan Hajnoczi , Michael Tokarev Subject: [Stable-10.0.8 11/69] block: Fix BDS use after free during shutdown Date: Mon, 2 Feb 2026 22:45:34 +0300 Message-ID: <20260202194638.939438-11-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: 1770061736876158500 Content-Type: text/plain; charset="utf-8" From: Kevin Wolf During shutdown, blockdev_close_all_bdrv_states() drops any block node references that are still owned by the monitor (i.e. the user). However, in doing so, it forgot to also remove the node from monitor_bdrv_states (which qmp_blockdev_del() correctly does), which means that later calls of bdrv_first()/bdrv_next() will still return the (now stale) pointer to the node. Usually there is no such call after this point, but in some cases it can happen. In the reported case, there was an ongoing migration, and the migration thread wasn't shut down yet: migration_shutdown() called by qemu_cleanup() doesn't actually wait for the migration to be shut down, but may just move it to MIGRATION_STATUS_CANCELLING. The next time migration_iteration_finish() runs, it sees the status and tries to re-activate all block devices that migration may have previously inactivated. This is where bdrv_first()/bdrv_next() get called and the access to the already freed node happens. It is debatable if migration_shutdown() should really return before migration has settled, but leaving a dangling pointer in the list of monitor-owned block nodes is clearly a bug either way and fixing it solves the immediate problem, so fix it. Cc: qemu-stable@nongnu.org Reported-by: Thomas Huth Signed-off-by: Kevin Wolf Message-ID: <20251215150714.130214-1-kwolf@redhat.com> Reviewed-by: Thomas Huth Tested-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 307bc43095b8ab1765fd66c26003d5da06681c05) Signed-off-by: Michael Tokarev diff --git a/blockdev.c b/blockdev.c index 1d1f27cfff..d4b36fa7a9 100644 --- a/blockdev.c +++ b/blockdev.c @@ -685,6 +685,7 @@ void blockdev_close_all_bdrv_states(void) =20 GLOBAL_STATE_CODE(); QTAILQ_FOREACH_SAFE(bs, &monitor_bdrv_states, monitor_list, next_bs) { + QTAILQ_REMOVE(&monitor_bdrv_states, bs, monitor_list); bdrv_unref(bs); } } --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061752452353.7273289880644; Mon, 2 Feb 2026 11:49:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmztV-0000Py-6w; Mon, 02 Feb 2026 14:47: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 1vmztR-0000Nu-9S; Mon, 02 Feb 2026 14:47: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 1vmztP-0003Ee-7B; Mon, 02 Feb 2026 14:47:29 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6A54318509E; Mon, 02 Feb 2026 22:46:03 +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 1BABA35B280; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Hanna Czenczek , Kevin Wolf , Stefan Hajnoczi , Michael Tokarev Subject: [Stable-10.0.8 12/69] nvme: Note in which AioContext some functions run Date: Mon, 2 Feb 2026 22:45:35 +0300 Message-ID: <20260202194638.939438-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: 1770061753177158500 Content-Type: text/plain; charset="utf-8" From: Hanna Czenczek Sprinkle comments throughout block/nvme.c noting for some functions (where it may not be obvious) that they require a certain AioContext, or in which AioContext they do happen to run (for callbacks, BHs, event notifiers). Suggested-by: Kevin Wolf Signed-off-by: Hanna Czenczek Message-ID: <20251110154854.151484-10-hreitz@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf (cherry picked from commit ac3520f599fedee05945ce06bb0f71820a7b2ffc) (Mjt: pick this comments-only, no-code-changes commit to 10.0.x so the next change applies cleanly) Signed-off-by: Michael Tokarev diff --git a/block/nvme.c b/block/nvme.c index 2e93abdb4b..bef515e903 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -64,6 +64,7 @@ typedef struct { } NVMeQueue; =20 typedef struct { + /* Called from nvme_process_completion() in the BDS's main AioContext = */ BlockCompletionFunc *cb; void *opaque; int cid; @@ -83,6 +84,7 @@ typedef struct { uint8_t *prp_list_pages; =20 /* Fields protected by @lock */ + /* Coroutines in this queue are woken in their own context */ CoQueue free_req_queue; NVMeQueue sq, cq; int cq_phase; @@ -91,7 +93,7 @@ typedef struct { int need_kick; int inflight; =20 - /* Thread-safe, no lock necessary */ + /* Thread-safe, no lock necessary; runs in the BDS's main context */ QEMUBH *completion_bh; } NVMeQueuePair; =20 @@ -205,11 +207,13 @@ static void nvme_free_queue_pair(NVMeQueuePair *q) g_free(q); } =20 +/* Runs in the BDS's main AioContext */ static void nvme_free_req_queue_cb(void *opaque) { NVMeQueuePair *q =3D opaque; =20 qemu_mutex_lock(&q->lock); + /* qemu_co_enter_next() wakes the coroutine in its own AioContext */ while (q->free_req_head !=3D -1 && qemu_co_enter_next(&q->free_req_queue, &q->lock)) { /* Retry waiting requests */ @@ -280,7 +284,7 @@ fail: return NULL; } =20 -/* With q->lock */ +/* With q->lock, must be run in the BDS's main AioContext */ static void nvme_kick(NVMeQueuePair *q) { BDRVNVMeState *s =3D q->s; @@ -307,7 +311,10 @@ static NVMeRequest *nvme_get_free_req_nofail_locked(NV= MeQueuePair *q) return req; } =20 -/* Return a free request element if any, otherwise return NULL. */ +/* + * Return a free request element if any, otherwise return NULL. + * May be run from any AioContext. + */ static NVMeRequest *nvme_get_free_req_nowait(NVMeQueuePair *q) { QEMU_LOCK_GUARD(&q->lock); @@ -320,6 +327,7 @@ static NVMeRequest *nvme_get_free_req_nowait(NVMeQueueP= air *q) /* * Wait for a free request to become available if necessary, then * return it. + * May be called in any AioContext. */ static coroutine_fn NVMeRequest *nvme_get_free_req(NVMeQueuePair *q) { @@ -327,20 +335,21 @@ static coroutine_fn NVMeRequest *nvme_get_free_req(NV= MeQueuePair *q) =20 while (q->free_req_head =3D=3D -1) { trace_nvme_free_req_queue_wait(q->s, q->index); + /* nvme_free_req_queue_cb() wakes us in our own AioContext */ qemu_co_queue_wait(&q->free_req_queue, &q->lock); } =20 return nvme_get_free_req_nofail_locked(q); } =20 -/* With q->lock */ +/* With q->lock, may be called in any AioContext */ static void nvme_put_free_req_locked(NVMeQueuePair *q, NVMeRequest *req) { req->free_req_next =3D q->free_req_head; q->free_req_head =3D req - q->reqs; } =20 -/* With q->lock */ +/* With q->lock, may be called in any AioContext */ static void nvme_wake_free_req_locked(NVMeQueuePair *q) { if (!qemu_co_queue_empty(&q->free_req_queue)) { @@ -349,7 +358,7 @@ static void nvme_wake_free_req_locked(NVMeQueuePair *q) } } =20 -/* Insert a request in the freelist and wake waiters */ +/* Insert a request in the freelist and wake waiters (from any AioContext)= */ static void nvme_put_free_req_and_wake(NVMeQueuePair *q, NVMeRequest *req) { qemu_mutex_lock(&q->lock); @@ -380,7 +389,7 @@ static inline int nvme_translate_error(const NvmeCqe *c) } } =20 -/* With q->lock */ +/* With q->lock, must be run in the BDS's main AioContext */ static bool nvme_process_completion(NVMeQueuePair *q) { BDRVNVMeState *s =3D q->s; @@ -450,6 +459,7 @@ static bool nvme_process_completion(NVMeQueuePair *q) return progress; } =20 +/* As q->completion_bh, runs in the BDS's main AioContext */ static void nvme_process_completion_bh(void *opaque) { NVMeQueuePair *q =3D opaque; @@ -480,6 +490,7 @@ static void nvme_trace_command(const NvmeCmd *cmd) } } =20 +/* Must be run in the BDS's main AioContext */ static void nvme_kick_and_check_completions(void *opaque) { NVMeQueuePair *q =3D opaque; @@ -489,6 +500,7 @@ static void nvme_kick_and_check_completions(void *opaqu= e) nvme_process_completion(q); } =20 +/* Runs in nvme_submit_command()'s AioContext */ static void nvme_deferred_fn(void *opaque) { NVMeQueuePair *q =3D opaque; @@ -501,6 +513,7 @@ static void nvme_deferred_fn(void *opaque) } } =20 +/* May be run in any AioContext */ static void nvme_submit_command(NVMeQueuePair *q, NVMeRequest *req, NvmeCmd *cmd, BlockCompletionFunc cb, void *opaque) @@ -522,6 +535,7 @@ static void nvme_submit_command(NVMeQueuePair *q, NVMeR= equest *req, defer_call(nvme_deferred_fn, q); } =20 +/* Put into NVMeRequest.cb, so runs in the BDS's main AioContext */ static void nvme_admin_cmd_sync_cb(void *opaque, int ret) { int *pret =3D opaque; @@ -529,6 +543,7 @@ static void nvme_admin_cmd_sync_cb(void *opaque, int re= t) aio_wait_kick(); } =20 +/* Must be run in the BDS's or qemu's main AioContext */ static int nvme_admin_cmd_sync(BlockDriverState *bs, NvmeCmd *cmd) { BDRVNVMeState *s =3D bs->opaque; @@ -637,6 +652,7 @@ out: return ret; } =20 +/* Must be run in the BDS's main AioContext */ static void nvme_poll_queue(NVMeQueuePair *q) { const size_t cqe_offset =3D q->cq.head * NVME_CQ_ENTRY_BYTES; @@ -659,6 +675,7 @@ static void nvme_poll_queue(NVMeQueuePair *q) qemu_mutex_unlock(&q->lock); } =20 +/* Must be run in the BDS's main AioContext */ static void nvme_poll_queues(BDRVNVMeState *s) { int i; @@ -668,6 +685,7 @@ static void nvme_poll_queues(BDRVNVMeState *s) } } =20 +/* Run as an event notifier in the BDS's main AioContext */ static void nvme_handle_event(EventNotifier *n) { BDRVNVMeState *s =3D container_of(n, BDRVNVMeState, @@ -721,6 +739,7 @@ out_error: return false; } =20 +/* Run as an event notifier in the BDS's main AioContext */ static bool nvme_poll_cb(void *opaque) { EventNotifier *e =3D opaque; @@ -744,6 +763,7 @@ static bool nvme_poll_cb(void *opaque) return false; } =20 +/* Run as an event notifier in the BDS's main AioContext */ static void nvme_poll_ready(EventNotifier *e) { BDRVNVMeState *s =3D container_of(e, BDRVNVMeState, @@ -1045,7 +1065,7 @@ static int nvme_probe_blocksizes(BlockDriverState *bs= , BlockSizes *bsz) return 0; } =20 -/* Called with s->dma_map_lock */ +/* Called with s->dma_map_lock, may be run in any AioContext */ static coroutine_fn int nvme_cmd_unmap_qiov(BlockDriverState *bs, QEMUIOVector *qiov) { @@ -1056,13 +1076,17 @@ static coroutine_fn int nvme_cmd_unmap_qiov(BlockDr= iverState *bs, if (!s->dma_map_count && !qemu_co_queue_empty(&s->dma_flush_queue)) { r =3D qemu_vfio_dma_reset_temporary(s->vfio); if (!r) { + /* + * Queue access is protected by the dma_map_lock, and all + * coroutines are woken in their own AioContext + */ qemu_co_queue_restart_all(&s->dma_flush_queue); } } return r; } =20 -/* Called with s->dma_map_lock */ +/* Called with s->dma_map_lock, may be run in any AioContext */ static coroutine_fn int nvme_cmd_map_qiov(BlockDriverState *bs, NvmeCmd *c= md, NVMeRequest *req, QEMUIOVector *= qiov) { @@ -1175,6 +1199,7 @@ typedef struct { int ret; } NVMeCoData; =20 +/* Put into NVMeRequest.cb, so runs in the BDS's main AioContext */ static void nvme_rw_cb(void *opaque, int ret) { NVMeCoData *data =3D opaque; --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061722487652.9186484978502; Mon, 2 Feb 2026 11:48:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmztZ-0000Sn-PY; Mon, 02 Feb 2026 14:47:37 -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 1vmztT-0000Oy-F3; Mon, 02 Feb 2026 14:47: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 1vmztQ-0003FW-IV; Mon, 02 Feb 2026 14:47:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7B83A18509F; Mon, 02 Feb 2026 22:46:03 +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 2C81D35B281; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Hanna Czenczek , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Stefan Hajnoczi , Michael Tokarev Subject: [Stable-10.0.8 13/69] Revert "nvme: Fix coroutine waking" Date: Mon, 2 Feb 2026 22:45:36 +0300 Message-ID: <20260202194638.939438-13-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: 1770061726820158500 From: Hanna Czenczek This reverts commit 0f142cbd919fcb6cea7aa176f7e4939925806dd9. (this is commit 361bd4a6c8ca57f48dd5a9e590d2c69a87e7dda1 in 10.0.7) Said commit changed the replay_bh_schedule_oneshot_event() in nvme_rw_cb() to aio_co_wake(), allowing the request coroutine to be entered directly (instead of only being scheduled for later execution). This can cause the device to become stalled like so: It is possible that after completion the request coroutine goes on to submit another request without yielding, e.g. a flush after a write to emulate FUA. This will likely cause a nested nvme_process_completion() call because nvme_rw_cb() itself is called from there. (After submitting a request, we invoke nvme_process_completion() through defer_call(); but the fact that nvme_process_completion() ran in the first place indicates that we are not in a call-deferring section, so defer_call() will call nvme_process_completion() immediately.) If this inner nvme_process_completion() loop then processes any completions, it will write the final completion queue (CQ) head index to the CQ head doorbell, and subsequently execution will return to the outer nvme_process_completion() loop. Even if this loop now finds no further completions, it still processed at least one completion before, or it would not have called the nvme_rw_cb() which led to nesting. Therefore, it will now write the exact same CQ head index value to the doorbell, which effectively is an unrecoverable error[1]. Therefore, nesting of nvme_process_completion() does not work at this point. Reverting said commit removes the nesting (by scheduling the request coroutine instead of entering it immediately), and so fixes the stall. On the downside, reverting said commit breaks multiqueue for nvme, but better to have single-queue working than neither. For 11.0, we will have a solution that makes both work. A side note: There is a comment in nvme_process_completion() above qemu_bh_schedule() that claims nesting works, as long as it is done through the completion_bh. I am quite sure that is not true, for two reasons: - The problem described above, which is even worse when going through nvme_process_completion_bh() because that function unconditionally writes to the CQ head doorbell, - nvme_process_completion_bh() never takes q->lock, so nvme_process_completion() unlocking it will likely abort. Given the lack of reports of such aborts, I believe that completion_bh simply is unused in practice. [1] See the NVMe Base Specification revision 2.3, page 180, figure 152: =E2=80=9CInvalid Doorbell Write Value: A host attempted to write an inv= alid doorbell value. Some possible causes of this error are: [...] the value written is the same as the previously written doorbell value.=E2= =80=9D To even be notified of this error, we would need to send an Asynchronous Event Request to the admin queue (p. 178ff), which we don=E2=80=99t do, and then to handle it, we would need to delete and recreate the queue (p. 88, section 3.3.1.2 Queue Usage). Cc: qemu-stable@nongnu.org Reported-by: Luk=C3=A1=C5=A1 Doktor Tested-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Hanna Czenczek Message-id: 20251215141540.88915-1-hreitz@redhat.com Signed-off-by: Stefan Hajnoczi (cherry picked from commit b002acacc1d72521351501fa0af81d146106c9ed) Signed-off-by: Michael Tokarev diff --git a/block/nvme.c b/block/nvme.c index bef515e903..5bf6480af7 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1195,36 +1195,26 @@ fail: =20 typedef struct { Coroutine *co; - bool skip_yield; int ret; + AioContext *ctx; } NVMeCoData; =20 +static void nvme_rw_cb_bh(void *opaque) +{ + NVMeCoData *data =3D opaque; + qemu_coroutine_enter(data->co); +} + /* Put into NVMeRequest.cb, so runs in the BDS's main AioContext */ static void nvme_rw_cb(void *opaque, int ret) { NVMeCoData *data =3D opaque; - data->ret =3D ret; - - if (data->co =3D=3D qemu_coroutine_self()) { - /* - * Fast path: We are inside of the request coroutine (through - * nvme_submit_command, nvme_deferred_fn, nvme_process_completion). - * We can set data->skip_yield here to keep the coroutine from - * yielding, and then we don't need to schedule a BH to wake it. - */ - data->skip_yield =3D true; - } else { - /* - * Safe to call: The case where we run in the request coroutine is - * handled above, so we must be independent of it; and without - * skip_yield set, the coroutine will yield. - * No need to release NVMeQueuePair.lock (we are called without it - * held). (Note: If we enter the coroutine here, @data will - * probably be dangling once aio_co_wake() returns.) - */ - aio_co_wake(data->co); + if (!data->co) { + /* The rw coroutine hasn't yielded, don't try to enter. */ + return; } + replay_bh_schedule_oneshot_event(data->ctx, nvme_rw_cb_bh, data); } =20 static coroutine_fn int nvme_co_prw_aligned(BlockDriverState *bs, @@ -1248,7 +1238,7 @@ static coroutine_fn int nvme_co_prw_aligned(BlockDriv= erState *bs, .cdw12 =3D cpu_to_le32(cdw12), }; NVMeCoData data =3D { - .co =3D qemu_coroutine_self(), + .ctx =3D bdrv_get_aio_context(bs), .ret =3D -EINPROGRESS, }; =20 @@ -1265,7 +1255,9 @@ static coroutine_fn int nvme_co_prw_aligned(BlockDriv= erState *bs, return r; } nvme_submit_command(ioq, req, &cmd, nvme_rw_cb, &data); - if (!data.skip_yield) { + + data.co =3D qemu_coroutine_self(); + while (data.ret =3D=3D -EINPROGRESS) { qemu_coroutine_yield(); } =20 @@ -1361,7 +1353,7 @@ static coroutine_fn int nvme_co_flush(BlockDriverStat= e *bs) .nsid =3D cpu_to_le32(s->nsid), }; NVMeCoData data =3D { - .co =3D qemu_coroutine_self(), + .ctx =3D bdrv_get_aio_context(bs), .ret =3D -EINPROGRESS, }; =20 @@ -1369,7 +1361,9 @@ static coroutine_fn int nvme_co_flush(BlockDriverStat= e *bs) req =3D nvme_get_free_req(ioq); assert(req); nvme_submit_command(ioq, req, &cmd, nvme_rw_cb, &data); - if (!data.skip_yield) { + + data.co =3D qemu_coroutine_self(); + if (data.ret =3D=3D -EINPROGRESS) { qemu_coroutine_yield(); } =20 @@ -1410,7 +1404,7 @@ static coroutine_fn int nvme_co_pwrite_zeroes(BlockDr= iverState *bs, }; =20 NVMeCoData data =3D { - .co =3D qemu_coroutine_self(), + .ctx =3D bdrv_get_aio_context(bs), .ret =3D -EINPROGRESS, }; =20 @@ -1430,7 +1424,9 @@ static coroutine_fn int nvme_co_pwrite_zeroes(BlockDr= iverState *bs, assert(req); =20 nvme_submit_command(ioq, req, &cmd, nvme_rw_cb, &data); - if (!data.skip_yield) { + + data.co =3D qemu_coroutine_self(); + while (data.ret =3D=3D -EINPROGRESS) { qemu_coroutine_yield(); } =20 @@ -1458,7 +1454,7 @@ static int coroutine_fn nvme_co_pdiscard(BlockDriverS= tate *bs, }; =20 NVMeCoData data =3D { - .co =3D qemu_coroutine_self(), + .ctx =3D bdrv_get_aio_context(bs), .ret =3D -EINPROGRESS, }; =20 @@ -1503,7 +1499,9 @@ static int coroutine_fn nvme_co_pdiscard(BlockDriverS= tate *bs, trace_nvme_dsm(s, offset, bytes); =20 nvme_submit_command(ioq, req, &cmd, nvme_rw_cb, &data); - if (!data.skip_yield) { + + data.co =3D qemu_coroutine_self(); + while (data.ret =3D=3D -EINPROGRESS) { qemu_coroutine_yield(); } =20 --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061723514626.3282165745561; Mon, 2 Feb 2026 11:48:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmztf-0000Vn-Sg; Mon, 02 Feb 2026 14:47:44 -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 1vmztV-0000QN-WE; Mon, 02 Feb 2026 14:47:34 -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 1vmztT-0003Fp-Gv; Mon, 02 Feb 2026 14:47:32 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8C1EF1850A0; Mon, 02 Feb 2026 22:46:03 +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 3DC2435B282; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Kostiantyn Kostiuk , Michael Tokarev Subject: [Stable-10.0.8 14/69] qga: Fix ubsan warning Date: Mon, 2 Feb 2026 22:45:37 +0300 Message-ID: <20260202194638.939438-14-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: 1770061726743158500 From: Thomas Huth When compiling QEMU with --enable-ubsan there is a undefined behavior warning when running "make check": .../qga/commands-linux.c:452:15: runtime error: applying non-zero offset 5= to null pointer #0 0x55ea7b89450c in build_guest_fsinfo_for_pci_dev ..../qga/commands-linu= x.c:452:15 Fix it by avoiding the additional pointer variable here and use an "offset" integer variable instead. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Kostiantyn Kostiuk Link: https://lore.kernel.org/qemu-devel/20250730072709.27077-1-thuth@redha= t.com Signed-off-by: Kostiantyn Kostiuk (cherry picked from commit 83f6dceb8f5c0a1efe806a9a4905cbc743a8a378) Signed-off-by: Michael Tokarev diff --git a/qga/commands-linux.c b/qga/commands-linux.c index 9dc0c82503..4a09ddc760 100644 --- a/qga/commands-linux.c +++ b/qga/commands-linux.c @@ -400,10 +400,10 @@ static bool build_guest_fsinfo_for_pci_dev(char const= *syspath, Error **errp) { unsigned int pci[4], host, hosts[8], tgt[3]; - int i, nhosts =3D 0, pcilen; + int i, offset, nhosts =3D 0, pcilen; GuestPCIAddress *pciaddr =3D disk->pci_controller; bool has_ata =3D false, has_host =3D false, has_tgt =3D false; - char *p, *q, *driver =3D NULL; + char *p, *driver =3D NULL; bool ret =3D false; =20 p =3D strstr(syspath, "/devices/pci"); @@ -445,13 +445,13 @@ static bool build_guest_fsinfo_for_pci_dev(char const= *syspath, =20 p =3D strstr(syspath, "/ata"); if (p) { - q =3D p + 4; + offset =3D 4; has_ata =3D true; } else { p =3D strstr(syspath, "/host"); - q =3D p + 5; + offset =3D 5; } - if (p && sscanf(q, "%u", &host) =3D=3D 1) { + if (p && sscanf(p + offset, "%u", &host) =3D=3D 1) { has_host =3D true; nhosts =3D build_hosts(syspath, p, has_ata, hosts, ARRAY_SIZE(hosts), errp); --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061771600659.4885979200726; Mon, 2 Feb 2026 11:49:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmztg-0000bl-Ov; Mon, 02 Feb 2026 14:47:44 -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 1vmztY-0000Sw-Gx; Mon, 02 Feb 2026 14:47:37 -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 1vmztW-0003G8-25; Mon, 02 Feb 2026 14:47:36 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9ED0A1850A1; Mon, 02 Feb 2026 22:46:03 +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 4E26735B283; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Laurent Vivier , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.8 15/69] Fix const qualifier build errors with recent glibc Date: Mon, 2 Feb 2026 22:45:38 +0300 Message-ID: <20260202194638.939438-15-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: 1770061772999158500 From: C=C3=A9dric Le Goater A recent change in glibc 2.42.9000 [1] changes the return type of strstr() and other string functions to be 'const char *' when the input is a 'const char *'. This breaks the build in various files with errors such as : error: initialization discards 'const' qualifier from pointer target type= [-Werror=3Ddiscarded-qualifiers] 208 | char *pidstr =3D strstr(filename, "%"); | ^~~~~~ Fix this by changing the type of the variables that store the result of these functions to 'const char *'. [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dcd748a63ab1a7a= e846175c532a3daab341c62690 Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20251209174328.698774-1-clg@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 (cherry picked from commit 326e620fc0145686124f754194cdc6d0d9b3400d) Signed-off-by: Michael Tokarev diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c index 09a6abf02d..fd37a871b7 100644 --- a/backends/tpm/tpm_passthrough.c +++ b/backends/tpm/tpm_passthrough.c @@ -211,7 +211,7 @@ static size_t tpm_passthrough_get_buffer_size(TPMBacken= d *tb) static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt) { int fd =3D -1; - char *dev; + const char *dev; char path[PATH_MAX]; =20 if (tpm_pt->options->cancel_path) { diff --git a/block/vmdk.c b/block/vmdk.c index 2adec49912..5a53c4624a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1089,7 +1089,7 @@ vmdk_open_vmdk4(BlockDriverState *bs, BdrvChild *file= , int flags, static int vmdk_parse_description(const char *desc, const char *opt_name, char *buf, int buf_size) { - char *opt_pos, *opt_end; + const char *opt_pos, *opt_end; const char *end =3D desc + strlen(desc); =20 opt_pos =3D strstr(desc, opt_name); diff --git a/block/vvfat.c b/block/vvfat.c index 91d69b3cc8..7dcded6da8 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1826,7 +1826,7 @@ cluster_was_modified(BDRVVVFATState *s, uint32_t clus= ter_num) =20 static const char* get_basename(const char* path) { - char* basename =3D strrchr(path, '/'); + const char *basename =3D strrchr(path, '/'); if (basename =3D=3D NULL) return path; else diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 282e13e163..95c82d7e08 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -361,7 +361,7 @@ static const char *get_feature_xml(const char *p, const= char **newp, * qXfer:features:read:ANNEX:OFFSET,LENGTH' * ^p ^newp */ - char *term =3D strchr(p, ':'); + const char *term =3D strchr(p, ':'); *newp =3D term + 1; len =3D term - p; =20 diff --git a/qga/commands-linux.c b/qga/commands-linux.c index 4a09ddc760..c639a60a94 100644 --- a/qga/commands-linux.c +++ b/qga/commands-linux.c @@ -403,7 +403,8 @@ static bool build_guest_fsinfo_for_pci_dev(char const *= syspath, int i, offset, nhosts =3D 0, pcilen; GuestPCIAddress *pciaddr =3D disk->pci_controller; bool has_ata =3D false, has_host =3D false, has_tgt =3D false; - char *p, *driver =3D NULL; + const char *p; + char *driver =3D NULL; bool ret =3D false; =20 p =3D strstr(syspath, "/devices/pci"); @@ -543,7 +544,7 @@ static bool build_guest_fsinfo_for_nonpci_virtio(char c= onst *syspath, Error **errp) { unsigned int tgt[3]; - char *p; + const char *p; =20 if (!strstr(syspath, "/virtio") || !strstr(syspath, "/block")) { g_debug("Unsupported virtio device '%s'", syspath); @@ -575,7 +576,7 @@ static bool build_guest_fsinfo_for_ccw_dev(char const *= syspath, Error **errp) { unsigned int cssid, ssid, subchno, devno; - char *p; + const char *p; =20 p =3D strstr(syspath, "/devices/css"); if (!p || sscanf(p + 12, "%*x/%x.%x.%x/%*x.%*x.%x/", diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c index 980a8bbc51..6c93d452c9 100644 --- a/ui/ui-hmp-cmds.c +++ b/ui/ui-hmp-cmds.c @@ -418,7 +418,7 @@ err_out: void sendkey_completion(ReadLineState *rs, int nb_args, const char *str) { int i; - char *sep; + const char *sep; size_t len; =20 if (nb_args !=3D 2) { diff --git a/util/log.c b/util/log.c index b87d399e4c..adab3149b1 100644 --- a/util/log.c +++ b/util/log.c @@ -185,7 +185,7 @@ static ValidFilenameTemplateResult valid_filename_template(const char *filename, bool per_thread, Error **err= p) { if (filename) { - char *pidstr =3D strstr(filename, "%"); + const char *pidstr =3D strstr(filename, "%"); =20 if (pidstr) { /* We only accept one %d, no other format strings */ --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061830253313.723486554652; Mon, 2 Feb 2026 11:50:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzu1-0000s9-Bu; Mon, 02 Feb 2026 14:48:06 -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 1vmztt-0000q4-ME; Mon, 02 Feb 2026 14:47: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 1vmztr-0003GL-Ut; Mon, 02 Feb 2026 14:47:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B094C1850A2; Mon, 02 Feb 2026 22:46:03 +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 60FB035B284; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-10.0.8 16/69] i386: Fix const qualifier build errors with recent glibc Date: Mon, 2 Feb 2026 22:45:39 +0300 Message-ID: <20260202194638.939438-16-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: 1770061832207154100 From: C=C3=A9dric Le Goater A recent change in glibc 2.42.9000 [1] changes the return type of strstr() and other string functions to be 'const char *' when the input is a 'const char *'. This breaks the build in : ../hw/i386/x86-common.c:827:11: error: assignment discards =E2=80=98const= =E2=80=99 qualifier from pointer target type [-Werror=3Ddiscarded-qualifier= s] 827 | vmode =3D strstr(kernel_cmdline, "vga=3D"); | ^ Fix this by changing the type of the variables that store the result of these functions to 'const char *'. [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dcd748a63ab1a7a= e846175c532a3daab341c62690 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-2-clg@redhat= .com Signed-off-by: C=C3=A9dric Le Goater (cherry picked from commit 2f5c96d53409160b11f031b22f2d947f75ab06ab) Signed-off-by: Michael Tokarev diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 0ab27c053f..8a841d9d06 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -653,7 +653,7 @@ void x86_load_linux(X86MachineState *x86ms, uint8_t header[8192], *setup, *kernel; hwaddr real_addr, prot_addr, cmdline_addr, initrd_addr =3D 0; FILE *f; - char *vmode; + const char *vmode; MachineState *machine =3D MACHINE(x86ms); struct setup_data *setup_data; const char *kernel_filename =3D machine->kernel_filename; --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061781340473.9312808798661; Mon, 2 Feb 2026 11:49:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzua-0001WO-85; Mon, 02 Feb 2026 14:48:40 -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 1vmztw-0000tl-7i; Mon, 02 Feb 2026 14:48:05 -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 1vmztt-0003Gc-Vh; Mon, 02 Feb 2026 14:47:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C377F1850A3; Mon, 02 Feb 2026 22:46:03 +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 72C4835B285; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Yodel Eldar , Thomas Huth , Michael Tokarev Subject: [Stable-10.0.8 17/69] tests/vhost-user-bridge.c: Fix const qualifier build errors with recent glibc Date: Mon, 2 Feb 2026 22:45:40 +0300 Message-ID: <20260202194638.939438-17-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: 1770061785742154100 From: C=C3=A9dric Le Goater A recent change in glibc 2.42.9000 [1] changes the return type of strstr() and other string functions to be 'const char *' when the input is a 'const char *'. This breaks the build in : ../tests/vhost-user-bridge.c: In function =E2=80=98vubr_parse_host_port=E2= =80=99: ../tests/vhost-user-bridge.c:749:15: error: initialization discards =E2=80= =98const=E2=80=99 qualifier from pointer target type [-Werror=3Ddiscarded-q= ualifiers] 749 | char *p =3D strchr(buf, ':'); | ^~~~~~ Fix this by using the glib g_strsplit() routine instead of strdup(). [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dcd748a63ab1a7a= e846175c532a3daab341c62690 Suggested-by: Peter Maydell Acked-by: Yodel Eldar Tested-by: Yodel Eldar Reviewed-by: Thomas Huth Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-3-clg@redhat= .com Signed-off-by: C=C3=A9dric Le Goater (cherry picked from commit e37a0d514a17a660434ea20c0dd84bc6c20ca517) Signed-off-by: Michael Tokarev diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index a5c711b1de..ce4c3426d3 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -746,14 +746,12 @@ vubr_run(VubrDev *dev) static int vubr_parse_host_port(const char **host, const char **port, const char *buf) { - char *p =3D strchr(buf, ':'); - - if (!p) { + g_auto(GStrv) tokens =3D g_strsplit(buf, ":", 2); + if (!tokens[0] || !tokens[1]) { return -1; } - *p =3D '\0'; - *host =3D strdup(buf); - *port =3D strdup(p + 1); + *host =3D g_steal_pointer(&tokens[0]); + *port =3D g_steal_pointer(&tokens[1]); return 0; } =20 --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 17700617226001018.0610033408476; Mon, 2 Feb 2026 11:48:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuT-0001JE-Gq; Mon, 02 Feb 2026 14:48:35 -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 1vmztx-0000wm-MU; Mon, 02 Feb 2026 14:48:05 -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 1vmztv-0003Jh-Hr; Mon, 02 Feb 2026 14:48:01 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D500E1850A4; Mon, 02 Feb 2026 22:46:03 +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 8578C35B286; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.8 18/69] monitor: Fix const qualifier build errors with recent glibc Date: Mon, 2 Feb 2026 22:45:41 +0300 Message-ID: <20260202194638.939438-18-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: 1770061724731158500 From: C=C3=A9dric Le Goater A recent change in glibc 2.42.9000 [1] changes the return type of strchr() and other string functions to be 'const char *' when the input is a 'const char *'. This breaks the build in : ../monitor/hmp.c:589:7: error: assignment discards =E2=80=98const=E2=80=99 = qualifier from pointer target type [-Werror=3Ddiscarded-qualifiers] 589 | p =3D strchr(type, ':'); | ^ Fix this by changing the type of the variables that store the result of these functions to 'const char *'. [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dcd748a63ab1a7a= e846175c532a3daab341c62690 Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-4-clg@redhat= .com Signed-off-by: C=C3=A9dric Le Goater (cherry picked from commit dfe87815ba450228811f3abc633d7dc02757922e) Signed-off-by: Michael Tokarev diff --git a/monitor/hmp.c b/monitor/hmp.c index 34e2b8f748..a3ee02e52c 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -577,10 +577,11 @@ static const char *get_command_name(const char *cmdli= ne, * Read key of 'type' into 'key' and return the current * 'type' pointer. */ -static char *key_get_info(const char *type, char **key) +static const char *key_get_info(const char *type, char **key) { size_t len; - char *p, *str; + const char *p; + char *str; =20 if (*type =3D=3D ',') { type++; --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061718586753.9065502146785; Mon, 2 Feb 2026 11:48:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuH-0001Eu-E7; Mon, 02 Feb 2026 14:48: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 1vmztz-0000wq-AF; Mon, 02 Feb 2026 14:48:05 -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 1vmztx-0003KD-Nx; Mon, 02 Feb 2026 14:48:03 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E54331850A5; Mon, 02 Feb 2026 22:46:03 +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 9708235B287; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.8 19/69] gdbstub: Fix const qualifier build errors with recent glibc Date: Mon, 2 Feb 2026 22:45:42 +0300 Message-ID: <20260202194638.939438-19-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: 1770061722828154100 From: C=C3=A9dric Le Goater A recent change in glibc 2.42.9000 [1] changes the return type of strstr() and other string functions to be 'const char *' when the input is a 'const char *'. This breaks the build in : ../gdbstub/user.c:322:21: error: assignment discards =E2=80=98const=E2=80= =99 qualifier from pointer target type [-Werror=3Ddiscarded-qualifiers] 322 | pid_placeholder =3D strstr(path, "%d"); | ^ Fix this by changing the type of the variables that store the result of these functions to 'const char *'. [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommit;h=3Dcd748a63ab1a7a= e846175c532a3daab341c62690 Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-5-clg@redhat= .com Signed-off-by: C=C3=A9dric Le Goater (cherry picked from commit d7e1df769910da9d832dda86b01fe1363e4f4a3c) Signed-off-by: Michael Tokarev diff --git a/gdbstub/user.c b/gdbstub/user.c index 67403e5a25..27d3df6c74 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -319,7 +319,7 @@ static bool gdb_accept_socket(int gdb_fd) static int gdbserver_open_socket(const char *path, Error **errp) { g_autoptr(GString) buf =3D g_string_new(""); - char *pid_placeholder; + const char *pid_placeholder; =20 pid_placeholder =3D strstr(path, "%d"); if (pid_placeholder !=3D NULL) { --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770062208391315.1704529766315; Mon, 2 Feb 2026 11:56:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuD-00016G-3a; Mon, 02 Feb 2026 14:48: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 1vmzu0-0000wu-Iv; Mon, 02 Feb 2026 14:48:05 -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 1vmztz-0003KU-3t; Mon, 02 Feb 2026 14:48:04 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 00EE11850A6; Mon, 02 Feb 2026 22:46:04 +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 A77DF35B288; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Zesen Liu , Markus Armbruster , Michael Tokarev Subject: [Stable-10.0.8 20/69] qdev: fix error handling in set_uint64_checkmask Date: Mon, 2 Feb 2026 22:45:43 +0300 Message-ID: <20260202194638.939438-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: 1770062209042158500 Content-Type: text/plain; charset="utf-8" From: Zesen Liu When specifying lbr_fmt=3DVALUE in cpu options with an invalid VALUE, error= _setg() gets triggered twice, causing an assertion failure in error_setv() = which requires *errp to be NULL, preventing meaningful error messages from = being displayed. Fix this by checking visit_type_uint64()'s return value and returning early= on failure, consistent with other property setters like set_string(). Fixes: 18c22d7112a7 (qdev-properties: Add a new macro with bitmask check fo= r uint64_t property) Cc: qemu-stable@nongnu.org Signed-off-by: Zesen Liu Message-ID: <20251217-qdev-fix-v1-1-bd33ea463220@gmail.com> Reviewed-by: Markus Armbruster [Add Fixes: and Cc:] Signed-off-by: Markus Armbruster (cherry picked from commit 00829ae3845fd11e56239390924e3e74c3a4c144) Signed-off-by: Michael Tokarev diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 147b3ffd16..05e1fae183 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -429,7 +429,9 @@ static void set_uint64_checkmask(Object *obj, Visitor *= v, const char *name, const Property *prop =3D opaque; uint64_t *ptr =3D object_field_prop_ptr(obj, prop); =20 - visit_type_uint64(v, name, ptr, errp); + if (!visit_type_uint64(v, name, ptr, errp)) { + return; + } if (*ptr & ~prop->bitmask) { error_setg(errp, "Property value for '%s' has bits outside mask '0= x%" PRIx64 "'", name, prop->bitmask); --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061980344805.102282045976; Mon, 2 Feb 2026 11:53:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzub-0001i6-7F; Mon, 02 Feb 2026 14:48:41 -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 1vmzuM-0001Iq-FL; Mon, 02 Feb 2026 14:48:28 -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 1vmzuK-0003Kr-Pj; Mon, 02 Feb 2026 14:48:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 12AA91850A7; Mon, 02 Feb 2026 22:46:04 +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 B731F35B289; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Andrew Cooper , Paolo Bonzini , Michael Tokarev Subject: [Stable-10.0.8 21/69] target/i386: Fix #GP error code for INT instructions Date: Mon, 2 Feb 2026 22:45:44 +0300 Message-ID: <20260202194638.939438-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: 1770061981981158500 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 c45f2ac2ba..ff328b2a95 100644 --- a/target/i386/tcg/user/seg_helper.c +++ b/target/i386/tcg/user/seg_helper.c @@ -64,7 +64,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 17:26:31 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 1770061738567776.9998085067706; Mon, 2 Feb 2026 11:48:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuZ-0001Sv-RB; Mon, 02 Feb 2026 14:48:39 -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 1vmzuN-0001J1-Ua; Mon, 02 Feb 2026 14:48: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 1vmzuM-0003LA-Cx; Mon, 02 Feb 2026 14:48:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2E5C81850A8; Mon, 02 Feb 2026 22:46:04 +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 C94D035B28A; Mon, 02 Feb 2026 22:46:45 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 22/69] target/i386/tcg: ignore V3 in 32-bit mode Date: Mon, 2 Feb 2026 22:45:45 +0300 Message-ID: <20260202194638.939438-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: 1770061738779158500 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 61303232b7..0e981af9e4 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2657,7 +2657,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 17:26:31 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 1770061778777505.23020156871223; Mon, 2 Feb 2026 11:49:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzud-0001zR-Ex; Mon, 02 Feb 2026 14:48:43 -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 1vmzuP-0001Je-Hw; Mon, 02 Feb 2026 14:48:32 -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 1vmzuO-0003N9-2p; Mon, 02 Feb 2026 14:48:29 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4926F1850A9; Mon, 02 Feb 2026 22:46:04 +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 E434635B28B; Mon, 02 Feb 2026 22:46:45 +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.0.8 23/69] hw/i2c/imx: Fix trace func name error Date: Mon, 2 Feb 2026 22:45:46 +0300 Message-ID: <20260202194638.939438-23-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: 1770061783357158500 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 f33ca93c3e..9047845d96 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 17:26:31 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 17700619901641000.2346042988565; Mon, 2 Feb 2026 11:53:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuc-0001qE-9x; Mon, 02 Feb 2026 14:48: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 1vmzuR-0001Lz-4Q; Mon, 02 Feb 2026 14:48:32 -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 1vmzuP-0003NN-DH; Mon, 02 Feb 2026 14:48:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 59E371850AA; Mon, 02 Feb 2026 22:46:04 +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 0B8CB35B28C; Mon, 02 Feb 2026 22:46:46 +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.0.8 24/69] monitor/qmp: cleanup SocketChardev listener sources early to avoid fd handling race Date: Mon, 2 Feb 2026 22:45:47 +0300 Message-ID: <20260202194638.939438-24-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: 1770061992189158500 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 2f842f9f88..b81d6905fb 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1581,6 +1581,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, void *data) { ChardevClass *cc =3D CHARDEV_CLASS(oc); @@ -1598,6 +1607,7 @@ static void char_socket_class_init(ObjectClass *oc, v= oid *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 429852f8d9..c57f4b7329 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 2f46cf9e49..ef47ecef20 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -536,6 +536,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 17:26:31 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 1770062038233308.5720594317046; Mon, 2 Feb 2026 11:53:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuo-0003So-Ph; Mon, 02 Feb 2026 14:48:54 -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 1vmzum-0003JV-Mt; Mon, 02 Feb 2026 14:48: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 1vmzul-0003Nj-0Q; Mon, 02 Feb 2026 14:48:52 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 696721850AB; Mon, 02 Feb 2026 22:46:04 +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 1C25635B28D; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Zhijin Zeng , Michael Tokarev Subject: [Stable-10.0.8 25/69] tcg/riscv: Fix TCG_REG_TMP0 clobber in tcg_gen_dup{m, i} Date: Mon, 2 Feb 2026 22:45:48 +0300 Message-ID: <20260202194638.939438-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: 1770062040388158500 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 f7e1ca5a56..ec13d8fee9 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1151,7 +1151,7 @@ static void tcg_out_addsub2(TCGContext *s, } =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); @@ -1159,29 +1159,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 const struct { --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061958659124.52124082281648; Mon, 2 Feb 2026 11:52:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzup-0003Xp-Ph; Mon, 02 Feb 2026 14:48:55 -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 1vmzuo-0003R9-9o; Mon, 02 Feb 2026 14:48:54 -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 1vmzum-0003Nw-KN; Mon, 02 Feb 2026 14:48:54 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 79AF81850AC; Mon, 02 Feb 2026 22:46:04 +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 2BB5335B28E; Mon, 02 Feb 2026 22:46:46 +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.0.8 26/69] linux-user: allow null `pathname` for statx()/fstatat() Date: Mon, 2 Feb 2026 22:45:49 +0300 Message-ID: <20260202194638.939438-26-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: 1770061959822158500 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 dcca90cfee..77bdbf20ae 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11908,9 +11908,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 17:26:31 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 1770062139589888.8038099552732; Mon, 2 Feb 2026 11:55:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzur-0003eo-Be; Mon, 02 Feb 2026 14:48:57 -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 1vmzuq-0003a2-Cq; Mon, 02 Feb 2026 14:48:56 -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 1vmzuo-0003SB-6U; Mon, 02 Feb 2026 14:48:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9468C1850AD; Mon, 02 Feb 2026 22:46:04 +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 3C39335B28F; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 27/69] linux-user: fix mremap unmapping adjacent region Date: Mon, 2 Feb 2026 22:45:50 +0300 Message-ID: <20260202194638.939438-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: 1770062140783158500 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 d1f36e6f16..703f8ca3cd 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1169,7 +1169,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 17:26:31 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 1770062250205964.7582273866545; Mon, 2 Feb 2026 11:57:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzus-0003kH-IT; Mon, 02 Feb 2026 14:48: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 1vmzur-0003fq-Ik; Mon, 02 Feb 2026 14:48: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 1vmzup-0003Sg-Qb; Mon, 02 Feb 2026 14:48:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A57121850AE; Mon, 02 Feb 2026 22:46:04 +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 56C5735B290; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 28/69] linux-user: fix mremap errors for invalid ranges Date: Mon, 2 Feb 2026 22:45:51 +0300 Message-ID: <20260202194638.939438-28-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: 1770062251380158500 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 703f8ca3cd..dc28470054 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1108,12 +1108,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 17:26:31 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 1770061754760637.1830431975557; Mon, 2 Feb 2026 11:49:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzuw-00045q-6t; Mon, 02 Feb 2026 14:49: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 1vmzut-0003tF-JM; Mon, 02 Feb 2026 14:48:59 -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 1vmzus-0003TU-1M; Mon, 02 Feb 2026 14:48:59 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B3D761850AF; Mon, 02 Feb 2026 22:46:04 +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 6704935B291; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 29/69] linux-user: fix reserved_va page leak in do_munmap Date: Mon, 2 Feb 2026 22:45:52 +0300 Message-ID: <20260202194638.939438-29-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: 1770061757317154100 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 dc28470054..568538d833 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -1027,9 +1027,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 17:26:31 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 1770062018449838.0829557517552; Mon, 2 Feb 2026 11:53:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzvZ-0004wD-Gy; Mon, 02 Feb 2026 14:49:43 -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 1vmzvF-0004oQ-08; Mon, 02 Feb 2026 14:49: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 1vmzvD-0003Ti-28; Mon, 02 Feb 2026 14:49:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C4D9A1850B0; Mon, 02 Feb 2026 22:46:04 +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 7676D35B292; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Matthew Lugg , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 30/69] tests: add tcg coverage for fixed mremap bugs Date: Mon, 2 Feb 2026 22:45:53 +0300 Message-ID: <20260202194638.939438-30-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: 1770062020303158500 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 17:26:31 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 1770061946251892.0408780739172; Mon, 2 Feb 2026 11:52:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzvg-00056o-Bl; Mon, 02 Feb 2026 14:49:52 -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 1vmzvG-0004of-QZ; Mon, 02 Feb 2026 14:49: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 1vmzvF-0003UE-2B; Mon, 02 Feb 2026 14:49:22 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E229F1850B1; Mon, 02 Feb 2026 22:46:04 +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 873D235B293; Mon, 02 Feb 2026 22:46:46 +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.0.8 31/69] configs: use default prefix for Windows compilation Date: Mon, 2 Feb 2026 22:45:54 +0300 Message-ID: <20260202194638.939438-31-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: 1770061947761158500 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 17:26:31 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 177006182937565.09169759767565; Mon, 2 Feb 2026 11:50:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzw6-0005Rc-Ng; Mon, 02 Feb 2026 14:50: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 1vmzvI-0004ow-80; Mon, 02 Feb 2026 14:49: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 1vmzvG-0003Xk-SK; Mon, 02 Feb 2026 14:49:24 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F369B1850B2; Mon, 02 Feb 2026 22:46:04 +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 A429435B294; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Laurent Vivier , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 32/69] m68k: fix CAS2 writeback when Dc1==Dc2 Date: Mon, 2 Feb 2026 22:45:55 +0300 Message-ID: <20260202194638.939438-32-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: 1770061832184154100 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 15bad5dd46..eeb61f940a 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -778,8 +778,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, @@ -840,8 +840,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 17:26:31 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 1770062219496735.3561588664681; Mon, 2 Feb 2026 11:56:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzvv-0005Fv-80; Mon, 02 Feb 2026 14:50: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 1vmzvJ-0004pD-Po; Mon, 02 Feb 2026 14:49: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 1vmzvI-0003YN-8t; Mon, 02 Feb 2026 14:49:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 108F71850B3; Mon, 02 Feb 2026 22:46:05 +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 B639635B295; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 33/69] target/i386/tcg: do not mark all SSE instructions as unaligned Date: Mon, 2 Feb 2026 22:45:56 +0300 Message-ID: <20260202194638.939438-33-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: 1770062220061154100 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 0e981af9e4..ca9e70dcad 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 17:26:31 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 1770061867840881.9194851232265; Mon, 2 Feb 2026 11:51:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwJ-0005od-4v; Mon, 02 Feb 2026 14:50: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 1vmzvf-0005Bi-FO; Mon, 02 Feb 2026 14:49: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 1vmzvd-0003Yj-Mo; Mon, 02 Feb 2026 14:49:47 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 22F681850B4; Mon, 02 Feb 2026 22:46:05 +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 C7B7E35B296; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 34/69] target/i386/tcg: mask addresses for VSIB Date: Mon, 2 Feb 2026 22:45:57 +0300 Message-ID: <20260202194638.939438-34-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: 1770061869391158500 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 f0aa1894aa..870c70b66d 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 b4dcb46e81..a22673e4b4 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -53,8 +53,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, @@ -1108,18 +1108,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 17:26:31 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 1770062138500834.5911366141784; Mon, 2 Feb 2026 11:55:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwP-0006S6-3L; Mon, 02 Feb 2026 14:50: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 1vmzvi-0005Bo-C2; Mon, 02 Feb 2026 14:49:54 -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 1vmzvf-0003Yx-7d; Mon, 02 Feb 2026 14:49:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 344CB1850B5; Mon, 02 Feb 2026 22:46:05 +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 DA0AB35B297; Mon, 02 Feb 2026 22:46:46 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 35/69] target/i386/tcg: allow VEX in 16-bit protected mode Date: Mon, 2 Feb 2026 22:45:58 +0300 Message-ID: <20260202194638.939438-35-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: 1770062138602158500 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 ca9e70dcad..3cb709f78f 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2608,20 +2608,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 17:26:31 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 177006203719951.64213451115495; Mon, 2 Feb 2026 11:53:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwM-00069J-OX; Mon, 02 Feb 2026 14:50: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 1vmzvi-0005Bp-EK; Mon, 02 Feb 2026 14:49:54 -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 1vmzvg-0003b3-UH; Mon, 02 Feb 2026 14:49:50 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 869A21850B6; Mon, 02 Feb 2026 22:46:05 +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 EB28335B298; Mon, 02 Feb 2026 22:46:46 +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.0.8 36/69] hw/i386/kvm: fix PIRQ bounds check in xen_physdev_map_pirq() Date: Mon, 2 Feb 2026 22:45:59 +0300 Message-ID: <20260202194638.939438-36-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: 1770062039362154100 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 9b8b092bc2..4618daaa30 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 17:26:31 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 1770061832378955.8673291788075; Mon, 2 Feb 2026 11:50:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwG-0005j9-Ub; Mon, 02 Feb 2026 14:50: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 1vmzvq-0005HA-3V; Mon, 02 Feb 2026 14:50:02 -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 1vmzvm-0003bQ-8E; Mon, 02 Feb 2026 14:49:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 965171850B7; Mon, 02 Feb 2026 22:46:05 +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 4853335B299; Mon, 02 Feb 2026 22:46:47 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Xianglai Li , Bibo Mao , Michael Tokarev Subject: [Stable-10.0.8 37/69] hw/loongarch/virt: Modify the interrupt trigger type in fdt table Date: Mon, 2 Feb 2026 22:46:00 +0300 Message-ID: <20260202194638.939438-37-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: 1770061834506154100 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 728ce46699..d00e974d4e 100644 --- a/hw/loongarch/virt-fdt-build.c +++ b/hw/loongarch/virt-fdt-build.c @@ -17,6 +17,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); @@ -416,7 +421,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); @@ -436,7 +442,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 17:26:31 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 1770062094509336.4257468755992; Mon, 2 Feb 2026 11:54:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwL-0005xF-Ug; Mon, 02 Feb 2026 14:50: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 1vmzvn-0005G7-DB; Mon, 02 Feb 2026 14:50:02 -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 1vmzvl-0003bS-LB; Mon, 02 Feb 2026 14:49:55 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A67D41850B8; Mon, 02 Feb 2026 22:46:05 +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 57E8835B29A; Mon, 02 Feb 2026 22:46:47 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Xianglai Li , Bibo Mao , Michael Tokarev Subject: [Stable-10.0.8 38/69] hw/loongarch/virt: Fix irq allocation failure with pci device from fdt Date: Mon, 2 Feb 2026 22:46:01 +0300 Message-ID: <20260202194638.939438-38-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: 1770062096451158500 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 d00e974d4e..b61977808a 100644 --- a/hw/loongarch/virt-fdt-build.c +++ b/hw/loongarch/virt-fdt-build.c @@ -322,6 +322,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 @@ -334,37 +336,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, @@ -401,6 +411,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 17:26:31 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 1770061976545444.80863675374496; Mon, 2 Feb 2026 11:52:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwR-0006Wc-7D; Mon, 02 Feb 2026 14:50:35 -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 1vmzwE-0005hU-MB; Mon, 02 Feb 2026 14:50: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 1vmzwA-0003bo-6U; Mon, 02 Feb 2026 14:50:22 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C15C91850B9; Mon, 02 Feb 2026 22:46:05 +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 6914135B29B; Mon, 02 Feb 2026 22:46:47 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.0.8 39/69] target/loongach: Fix some exceptions failure in updating CSR_BADV Date: Mon, 2 Feb 2026 22:46:02 +0300 Message-ID: <20260202194638.939438-39-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: 1770061978732154100 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) (Mjt: the changes are in target/loongarch/cpu.h in 10.0) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index fc439d0090..9937fb5ace 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -209,8 +209,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 17:26:31 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 1770062203707740.0741263207226; Mon, 2 Feb 2026 11:56:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwP-0006Ua-G3; Mon, 02 Feb 2026 14:50: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 1vmzwF-0005kJ-UY; Mon, 02 Feb 2026 14:50: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 1vmzwD-0003cC-Cp; Mon, 02 Feb 2026 14:50:23 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DDBD21850BA; Mon, 02 Feb 2026 22:46:05 +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 838A735B29C; Mon, 02 Feb 2026 22:46:47 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.0.8 40/69] target/loongarch: Fix exception BCE missing to update CSR_BADV Date: Mon, 2 Feb 2026 22:46:03 +0300 Message-ID: <20260202194638.939438-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: 1770062205823154100 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) (Mjt: the changes are in target/loongarch/cpu.c in 10.0) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 9937fb5ace..897a3bfca2 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -201,6 +201,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: @@ -209,7 +212,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 17:26:31 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 1770062031717262.9422335280609; Mon, 2 Feb 2026 11:53:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwX-00070L-Mf; Mon, 02 Feb 2026 14:50:44 -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 1vmzwH-0005o4-TL; Mon, 02 Feb 2026 14:50: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 1vmzwG-0003qx-6V; Mon, 02 Feb 2026 14:50:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 03ED31850BB; Mon, 02 Feb 2026 22:46:06 +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 9FC4735B29D; Mon, 02 Feb 2026 22:46:47 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Song Gao , Bibo Mao , Michael Tokarev Subject: [Stable-10.0.8 41/69] target/loongarch: Fix exception ADEF/ADEM missing to update CSR_BADV Date: Mon, 2 Feb 2026 22:46:04 +0300 Message-ID: <20260202194638.939438-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: 1770062033194154100 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) (Mjt: the changes are in target/loongarch/cpu.c in 10.0) Signed-off-by: Michael Tokarev diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 897a3bfca2..364db7fab8 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -311,6 +311,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 17:26:31 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 1770061932471389.0457906492853; Mon, 2 Feb 2026 11:52:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwn-0007jd-Q2; Mon, 02 Feb 2026 14:50:57 -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 1vmzwJ-0005q1-1q; Mon, 02 Feb 2026 14:50: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 1vmzwH-0003rO-AE; Mon, 02 Feb 2026 14:50:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4D9DA1850BC; Mon, 02 Feb 2026 22:46:06 +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 BA83835B29E; Mon, 02 Feb 2026 22:46:47 +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.0.8 42/69] hw/loongarch/virt: Don't abort on access to unimplemented IOCSR Date: Mon, 2 Feb 2026 22:46:05 +0300 Message-ID: <20260202194638.939438-42-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: 1770061934277154100 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) (Mjt: trivial context fix for 10.0) Signed-off-by: Michael Tokarev diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 65c9027feb..63771782de 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -45,6 +45,7 @@ #include "hw/block/flash.h" #include "hw/virtio/virtio-iommu.h" #include "qemu/error-report.h" +#include "qemu/log.h" =20 static void virt_get_veiointc(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) @@ -532,8 +533,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; @@ -580,7 +588,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 17:26:31 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 1770061934139515.4000492366903; Mon, 2 Feb 2026 11:52:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwk-0007J2-FL; Mon, 02 Feb 2026 14:50:54 -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 1vmzwL-00065O-9Z; Mon, 02 Feb 2026 14:50: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 1vmzwJ-0003rp-DH; Mon, 02 Feb 2026 14:50:28 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6E3701850BD; Mon, 02 Feb 2026 22:46:06 +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 0FCD335B29F; Mon, 02 Feb 2026 22:46:48 +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.0.8 43/69] tests/functional: migrate aspeed_rainier image Date: Mon, 2 Feb 2026 22:46:06 +0300 Message-ID: <20260202194638.939438-43-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: 1770061935881154100 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/test_arm_aspeed_rainier.py b/tests/functional= /test_arm_aspeed_rainier.py index 602d6194ac..30827beca3 100755 --- a/tests/functional/test_arm_aspeed_rainier.py +++ b/tests/functional/test_arm_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 17:26:31 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 1770062043896992.9903021476321; Mon, 2 Feb 2026 11:54:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwn-0007gi-7H; Mon, 02 Feb 2026 14:50:57 -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 1vmzwg-0007Db-2o; Mon, 02 Feb 2026 14:50: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 1vmzwe-0003s0-Iz; Mon, 02 Feb 2026 14:50:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7F75F1850BE; Mon, 02 Feb 2026 22:46:06 +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 309B935B2A0; Mon, 02 Feb 2026 22:46:48 +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.0.8 44/69] target/arm: Don't specify ID_PFR1 accessfn twice Date: Mon, 2 Feb 2026 22:46:07 +0300 Message-ID: <20260202194638.939438-44-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: 1770062045489154100 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 f694b266d9..ff1b7509df 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7812,7 +7812,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 cpu->isar.id_pfr1, --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770061990189371.2033950820405; Mon, 2 Feb 2026 11:53:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwt-0008Nc-DV; Mon, 02 Feb 2026 14:51: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 1vmzwk-0007KG-8b; Mon, 02 Feb 2026 14:50:54 -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 1vmzwg-0003sM-PU; Mon, 02 Feb 2026 14:50:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 926531850BF; Mon, 02 Feb 2026 22:46:06 +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 4239035B2A1; Mon, 02 Feb 2026 22:46:48 +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.0.8 45/69] target/arm: Correctly honour HCR.TID3 for v7A cores Date: Mon, 2 Feb 2026 22:46:08 +0300 Message-ID: <20260202194638.939438-45-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: 1770061992012158500 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: back-port to 10.0.x) Signed-off-by: Michael Tokarev diff --git a/target/arm/helper.c b/target/arm/helper.c index ff1b7509df..002d5701b0 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7599,9 +7599,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; } @@ -7609,11 +7618,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; @@ -7803,7 +7819,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 cpu->isar.id_pfr0 }, /* * ID_PFR1 is not a plain ARM_CP_CONST because we don't know @@ -7817,7 +7833,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .resetvalue =3D cpu->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 @@ -7825,72 +7841,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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->isar.id_isar6 }, }; define_arm_cp_regs(cpu, v6_idregs); @@ -7945,7 +7961,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .resetvalue =3D cpu->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 @@ -7953,172 +7969,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 cpu->isar.id_aa64pfr1}, { .name =3D "ID_AA64PFR2_EL1_RESERVED", .state =3D ARM_CP_STAT= E_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 0 }, { .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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 cpu->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 @@ -8129,17 +8145,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 @@ -8150,27 +8166,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 cpu->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 cpu->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 cpu->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 }, { .name =3D "PMCEID0", .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 0, .crn =3D 9, .crm =3D 12, .opc2 =3D = 6, @@ -8345,7 +8361,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 17:26:31 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 1770062162863930.5864531271995; Mon, 2 Feb 2026 11:56:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwr-00089P-3I; Mon, 02 Feb 2026 14:51: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 1vmzwj-0007G5-EJ; Mon, 02 Feb 2026 14:50:53 -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 1vmzwh-0003vC-QC; Mon, 02 Feb 2026 14:50:53 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A38F21850C0; Mon, 02 Feb 2026 22:46:06 +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 550B535B2A2; Mon, 02 Feb 2026 22:46:48 +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.0.8 46/69] target/arm: Correctly trap HCR.TID1 registers in v7A Date: Mon, 2 Feb 2026 22:46:09 +0300 Message-ID: <20260202194638.939438-46-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: 1770062164845158500 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 002d5701b0..9df41f7248 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1863,8 +1863,8 @@ static uint64_t isr_read(CPUARMState *env, const ARMC= PRegInfo *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; @@ -1873,16 +1873,6 @@ static CPAccessResult access_aa64_tid1(CPUARMState *= env, 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, @@ -2068,7 +2058,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 }, /* @@ -6740,7 +6730,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) @@ -8648,7 +8638,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 }, }; @@ -8672,7 +8662,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 */ @@ -8680,7 +8670,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 17:26:31 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 1770061926998471.28897874230074; Mon, 2 Feb 2026 11:52:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwp-0007yF-Nx; Mon, 02 Feb 2026 14:50:59 -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 1vmzwm-0007fm-SK; Mon, 02 Feb 2026 14:50:56 -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 1vmzwk-0003w5-S6; Mon, 02 Feb 2026 14:50:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B5EDA1850C1; Mon, 02 Feb 2026 22:46:06 +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 65F9335B2A3; Mon, 02 Feb 2026 22:46:48 +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 , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 47/69] tests/functional: Mark the MIPS replay tests as flaky Date: Mon, 2 Feb 2026 22:46:10 +0300 Message-ID: <20260202194638.939438-47-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: 1770061927878154100 From: Philippe Mathieu-Daud=C3=A9 MIPS test_replay.py often times out (likely hang) under GitLab CI: 2/21 qemu:func-thorough+func-mips64el-thorough+thorough / func-mips64el-r= eplay TIMEOUT 180.12s killed by signal 15 SIGTERM The console.log file is empty, and recording.logs only shows: qemu-system-mips64el: terminating on signal 15 from pid 344 Since this is a long term issue affecting our CI, disable the tests. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251031094118.28440-2-philmd@linaro.org> (cherry picked from commit 1c11aa180714e8fb1df87923b6ddd0b17aa26204) Signed-off-by: Michael Tokarev diff --git a/tests/functional/test_mips64el_replay.py b/tests/functional/te= st_mips64el_replay.py index 26a6ccff3f..05cc585f85 100755 --- a/tests/functional/test_mips64el_replay.py +++ b/tests/functional/test_mips64el_replay.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 from qemu_test import Asset, skipUntrustedTest +from qemu_test import skipFlakyTest from replay_kernel import ReplayKernelBase =20 =20 @@ -16,6 +17,7 @@ class Mips64elReplay(ReplayKernelBase): 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb'), '35eb476f03be589824b0310358f1c447d85e645b88cbcd2ac02b97ef560f9f8d') =20 + @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2013") def test_replay_mips64el_malta(self): self.set_machine('malta') kernel_path =3D self.archive_extract(self.ASSET_KERNEL_2_63_2, diff --git a/tests/functional/test_mips_replay.py b/tests/functional/test_m= ips_replay.py index 4327481e35..747835bf00 100755 --- a/tests/functional/test_mips_replay.py +++ b/tests/functional/test_mips_replay.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 from qemu_test import Asset, skipSlowTest +from qemu_test import skipFlakyTest from replay_kernel import ReplayKernelBase =20 =20 @@ -16,6 +17,7 @@ class MipsReplay(ReplayKernelBase): 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb'), '16ca524148afb0626f483163e5edf352bc1ab0e4fc7b9f9d473252762f2c7a43') =20 + @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2013") def test_replay_mips_malta(self): self.set_machine('malta') kernel_path =3D self.archive_extract(self.ASSET_KERNEL_2_63_2, --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770062144050209.84949673645815; Mon, 2 Feb 2026 11:55:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzwx-0008Uw-8w; Mon, 02 Feb 2026 14:51: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 1vmzwn-0007mR-Op; Mon, 02 Feb 2026 14:50: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 1vmzwl-0003wF-MF; Mon, 02 Feb 2026 14:50:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D0A561850C2; Mon, 02 Feb 2026 22:46:06 +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 7840335B2A4; Mon, 02 Feb 2026 22:46:48 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 48/69] tests/functional: Mark another MIPS replay test as flaky Date: Mon, 2 Feb 2026 22:46:11 +0300 Message-ID: <20260202194638.939438-48-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: 1770062144651158500 From: Philippe Mathieu-Daud=C3=A9 When disabling MIPS tests on commit 1c11aa18071 ("tests/functional: Mark the MIPS replay tests as flaky") we missed the 5KEc test. Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20251104145955.84091-1-philmd@linaro.org> (cherry picked from commit 290e4e7de7a579be7457bfbc338b697b8eea638f) Signed-off-by: Michael Tokarev diff --git a/tests/functional/test_mips64el_replay.py b/tests/functional/te= st_mips64el_replay.py index 05cc585f85..e9318448fa 100755 --- a/tests/functional/test_mips64el_replay.py +++ b/tests/functional/test_mips64el_replay.py @@ -40,6 +40,7 @@ def test_replay_mips64el_malta(self): '75ba10cd35fb44e32948eeb26974f061b703c81c4ba2fab1ebcacf1d1bec3b61') =20 @skipUntrustedTest() + @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2013") def test_replay_mips64el_malta_5KEc_cpio(self): self.set_machine('malta') self.cpu =3D '5KEc' --=20 2.47.3 From nobody Mon Feb 9 17:26:31 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 1770062051918830.1786751196007; Mon, 2 Feb 2026 11:54:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxq-0001Uj-03; Mon, 02 Feb 2026 14:52: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 1vmzxC-0000KZ-7A; Mon, 02 Feb 2026 14:51: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 1vmzx8-0003wi-AL; Mon, 02 Feb 2026 14:51:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id EA1461850C3; Mon, 02 Feb 2026 22:46:06 +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 9271335B2A5; Mon, 02 Feb 2026 22:46:48 +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.0.8 49/69] linux-user/aarch64/target_fcntl.h: add missing TARGET_O_LARGEFILE definition Date: Mon, 2 Feb 2026 22:46:12 +0300 Message-ID: <20260202194638.939438-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: 1770062052203158500 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 17:26:31 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 1770061986519548.9781198477739; Mon, 2 Feb 2026 11:53:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxN-0000k5-D4; Mon, 02 Feb 2026 14:51: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 1vmzxC-0000KY-6p; Mon, 02 Feb 2026 14:51: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 1vmzx9-0003ww-Kh; Mon, 02 Feb 2026 14:51:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1468E1850C4; Mon, 02 Feb 2026 22:46:07 +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 AC50135B2A6; Mon, 02 Feb 2026 22:46:48 +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.0.8 50/69] hw/sd/sdhci: Fix TYPE_IMX_USDHC to implement sd-spec-version 3 by default Date: Mon, 2 Feb 2026 22:46:13 +0300 Message-ID: <20260202194638.939438-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: 1770061988105158500 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 69baf73ae9..bebbf6e5e0 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1888,9 +1888,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 17:26:31 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 1770061959867839.7295286077034; Mon, 2 Feb 2026 11:52:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxm-0001Ao-8y; Mon, 02 Feb 2026 14:51: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 1vmzxH-0000X8-Po; Mon, 02 Feb 2026 14:51: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 1vmzxD-00040o-P2; Mon, 02 Feb 2026 14:51:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 357C31850C5; Mon, 02 Feb 2026 22:46:07 +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 CBA7835B2A7; Mon, 02 Feb 2026 22:46:48 +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.0.8 51/69] bsd-user: Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT Date: Mon, 2 Feb 2026 22:46:14 +0300 Message-ID: <20260202194638.939438-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: 1770061961929158501 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 17:26:31 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 1770062248302644.806185379244; Mon, 2 Feb 2026 11:57:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxo-0001Fz-AX; Mon, 02 Feb 2026 14:52: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 1vmzxH-0000Vl-7O; Mon, 02 Feb 2026 14:51: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 1vmzxD-00040q-MO; Mon, 02 Feb 2026 14:51:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 48A011850C6; Mon, 02 Feb 2026 22:46:07 +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 EBE5235B2A8; Mon, 02 Feb 2026 22:46:48 +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.0.8 52/69] bsd-user/syscall_defs.h: define STAT_TIME_T_EXT only for 32 bits Date: Mon, 2 Feb 2026 22:46:15 +0300 Message-ID: <20260202194638.939438-52-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: 1770062249273158500 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: 83b0cf4c0 ("Fix __i386__ test for TARGET_HAS_STAT_TIME_T_EXT" in 10.= 0.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 17:26:31 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 1770061964309823.2012535111545; Mon, 2 Feb 2026 11:52:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxr-0001mr-N1; Mon, 02 Feb 2026 14:52: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 1vmzxP-0000zr-OR; Mon, 02 Feb 2026 14:51:39 -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 1vmzxL-00041m-54; Mon, 02 Feb 2026 14:51:33 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 593E51850C7; Mon, 02 Feb 2026 22:46:07 +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 0B47635B2A9; Mon, 02 Feb 2026 22:46:49 +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.0.8 53/69] hw/intc: avoid byte swap fiddling in gicv3 its path Date: Mon, 2 Feb 2026 22:46:16 +0300 Message-ID: <20260202194638.939438-53-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: 1770061965857158502 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 70dbee83a6..6a8fb0e4f8 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 e198974560..362b0a5cc0 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 17:26:31 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 177006203362829.17351132150702; Mon, 2 Feb 2026 11:53:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxw-0002QS-1g; Mon, 02 Feb 2026 14:52:08 -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 1vmzxj-0001Ek-FV; Mon, 02 Feb 2026 14:51: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 1vmzxf-00041x-4J; Mon, 02 Feb 2026 14:51:54 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6C5571850C8; Mon, 02 Feb 2026 22:46:07 +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 1BBB535B2AA; Mon, 02 Feb 2026 22:46:49 +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.0.8 54/69] linux-user: Add termios2 support Date: Mon, 2 Feb 2026 22:46:17 +0300 Message-ID: <20260202194638.939438-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: 1770062034557158500 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 85b956fdfb..13c88dd0bb 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1929,6 +1929,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 77bdbf20ae..7baea2bb96 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -87,6 +87,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 */ @@ -5889,6 +5890,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 4aa253b566..ccbd495cc1 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -128,6 +128,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 17:26:31 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 1770062039442616.0077652017152; Mon, 2 Feb 2026 11:53:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxu-0002Dq-OM; Mon, 02 Feb 2026 14:52:06 -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 1vmzxg-00019A-W5; Mon, 02 Feb 2026 14:51:54 -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 1vmzxb-00043P-3M; Mon, 02 Feb 2026 14:51:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E36F01850C9; Mon, 02 Feb 2026 22:46:07 +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 61ED835B2AB; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 55/69] linux-user: Add termios2 support to alpha target Date: Mon, 2 Feb 2026 22:46:18 +0300 Message-ID: <20260202194638.939438-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: 1770062040355158500 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 17:26:31 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 1770062048186989.7337420034138; Mon, 2 Feb 2026 11:54:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxt-0001xL-3g; Mon, 02 Feb 2026 14:52: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 1vmzxm-0001FH-1R; Mon, 02 Feb 2026 14:51: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 1vmzxj-00044d-HC; Mon, 02 Feb 2026 14:51:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F28E11850CA; Mon, 02 Feb 2026 22:46:07 +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 A4FDE35B2AC; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 56/69] linux-user: Add termios2 support to hppa target Date: Mon, 2 Feb 2026 22:46:19 +0300 Message-ID: <20260202194638.939438-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: 1770062050360158500 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 17:26:31 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 1770062038004352.0742037005572; Mon, 2 Feb 2026 11:53:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxw-0002dp-SH; Mon, 02 Feb 2026 14:52: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 1vmzxo-0001Lg-FU; Mon, 02 Feb 2026 14:52:00 -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 1vmzxk-00045M-Qc; Mon, 02 Feb 2026 14:51:58 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0F8FA1850CB; Mon, 02 Feb 2026 22:46:08 +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 B41DD35B2AD; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 57/69] linux-user: Add termios2 support to mips target Date: Mon, 2 Feb 2026 22:46:20 +0300 Message-ID: <20260202194638.939438-57-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: 1770062039482154100 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 17:26:31 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 1770062051566966.9957993345178; Mon, 2 Feb 2026 11:54:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzxu-0002EL-RU; Mon, 02 Feb 2026 14:52: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 1vmzxq-0001hi-Io; Mon, 02 Feb 2026 14:52:02 -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 1vmzxo-00045r-Hv; Mon, 02 Feb 2026 14:52:02 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1F8B51850CC; Mon, 02 Feb 2026 22:46:08 +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 C567635B2AE; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 58/69] linux-user: Add termios2 support to sh4 target Date: Mon, 2 Feb 2026 22:46:21 +0300 Message-ID: <20260202194638.939438-58-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: 1770062053863158500 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 17:26:31 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 1770062088699507.1773736996149; Mon, 2 Feb 2026 11:54:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyE-0003PW-HS; Mon, 02 Feb 2026 14:52: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 1vmzyB-0003Kf-GE; Mon, 02 Feb 2026 14:52: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 1vmzy9-00046T-UL; Mon, 02 Feb 2026 14:52:23 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2F8611850CD; Mon, 02 Feb 2026 22:46:08 +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 D5B9535B2AF; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Luca Bonissi , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 59/69] linux-user: Add termios2 support to sparc target Date: Mon, 2 Feb 2026 22:46:22 +0300 Message-ID: <20260202194638.939438-59-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: 1770062090084154100 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 17:26:31 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 1770062164038606.9835488082639; Mon, 2 Feb 2026 11:56:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyH-0003Ut-2G; Mon, 02 Feb 2026 14:52: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 1vmzyE-0003RK-VS; Mon, 02 Feb 2026 14:52: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 1vmzyC-00046v-4M; Mon, 02 Feb 2026 14:52:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3ECEF1850CE; Mon, 02 Feb 2026 22:46:08 +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 E5C7635B2B0; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Vivian Wang , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 60/69] linux-user: Add missing termios baud rates Date: Mon, 2 Feb 2026 22:46:23 +0300 Message-ID: <20260202194638.939438-60-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: 1770062165426158500 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 7baea2bb96..68c2a222eb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5760,27 +5760,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 17:26:32 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 1770062190898366.49824831306137; Mon, 2 Feb 2026 11:56:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyH-0003Uk-06; Mon, 02 Feb 2026 14:52: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 1vmzyE-0003RI-Th; Mon, 02 Feb 2026 14:52: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 1vmzyD-0004F3-AF; Mon, 02 Feb 2026 14:52:26 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4F96B1850CF; Mon, 02 Feb 2026 22:46:08 +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 0114E35B2B1; Mon, 02 Feb 2026 22:46:49 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Icenowy Zheng , Helge Deller , Michael Tokarev Subject: [Stable-10.0.8 61/69] linux-user: fixup termios2 related things on PowerPC Date: Mon, 2 Feb 2026 22:46:24 +0300 Message-ID: <20260202194638.939438-61-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: 1770062191655154100 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 68c2a222eb..fd98ccc92e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -149,6 +149,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 17:26:32 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 1770062202318754.7371076862543; Mon, 2 Feb 2026 11:56:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyK-0003cy-FV; Mon, 02 Feb 2026 14:52:32 -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 1vmzyJ-0003Zo-7Y; Mon, 02 Feb 2026 14:52: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 1vmzyG-0004Fk-CN; Mon, 02 Feb 2026 14:52:30 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5F2511850D0; Mon, 02 Feb 2026 22:46:08 +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 1196C35B2B2; Mon, 02 Feb 2026 22:46:50 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini , Richard Henderson , Michael Tokarev Subject: [Stable-10.0.8 62/69] target/i386/tcg: fix a few instructions that do not support VEX.L=1 Date: Mon, 2 Feb 2026 22:46:25 +0300 Message-ID: <20260202194638.939438-62-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: 1770062203109158500 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 3cb709f78f..a3dffec692 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 17:26:32 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 1770062050992176.69199184848912; Mon, 2 Feb 2026 11:54:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyh-0004aI-Un; Mon, 02 Feb 2026 14:52:57 -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 1vmzyb-0004Of-Rr; Mon, 02 Feb 2026 14:52:49 -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 1vmzya-0004Fn-Cw; Mon, 02 Feb 2026 14:52:49 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7BBBC1850D1; Mon, 02 Feb 2026 22:46:08 +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 2142135B2B3; Mon, 02 Feb 2026 22:46:50 +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.0.8 63/69] pc-bios/optionrom: Use 32-bit linker emulation for the optionroms Date: Mon, 2 Feb 2026 22:46:26 +0300 Message-ID: <20260202194638.939438-63-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: 1770062053521154100 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 17:26:32 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 1770062248575951.8530121767345; Mon, 2 Feb 2026 11:57:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyo-0005O9-W7; Mon, 02 Feb 2026 14:53: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 1vmzyg-0004fG-FH; Mon, 02 Feb 2026 14:52:55 -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 1vmzye-0004H3-M2; Mon, 02 Feb 2026 14:52:54 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8D5F81850D2; Mon, 02 Feb 2026 22:46:08 +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 3D8B935B2B4; Mon, 02 Feb 2026 22:46:50 +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.0.8 64/69] tests/functional: migrate sbsa_ref test images Date: Mon, 2 Feb 2026 22:46:27 +0300 Message-ID: <20260202194638.939438-64-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: 1770062250511154100 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/test_aarch64_sbsaref.py b/tests/functional/te= st_aarch64_sbsaref.py index e6a55aecfa..da28aab3e3 100755 --- a/tests/functional/test_aarch64_sbsaref.py +++ b/tests/functional/test_aarch64_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: @@ -56,15 +56,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 17:26:32 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 1770062016241197.2431863023428; Mon, 2 Feb 2026 11:53:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyl-0004tm-Jn; Mon, 02 Feb 2026 14:53: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 1vmzyf-0004df-4w; Mon, 02 Feb 2026 14:52:53 -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 1vmzyd-0004Jr-AW; Mon, 02 Feb 2026 14:52:52 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A5C091850D3; Mon, 02 Feb 2026 22:46:08 +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 4F83535B2B5; Mon, 02 Feb 2026 22:46:50 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jeuk Kim , Michael Tokarev Subject: [Stable-10.0.8 65/69] hw/ufs: Ensure DBC of PRDT uses only lower 18 bits Date: Mon, 2 Feb 2026 22:46:28 +0300 Message-ID: <20260202194638.939438-65-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: 1770062018047158500 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 542f13b10e..4482d7827b 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 17:26:32 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 1770062249075892.6739817915202; Mon, 2 Feb 2026 11:57:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzyn-0005F1-Oo; Mon, 02 Feb 2026 14:53: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 1vmzyj-0004ii-1T; Mon, 02 Feb 2026 14:52: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 1vmzyg-0004KH-If; Mon, 02 Feb 2026 14:52:56 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B31CC1850D4; Mon, 02 Feb 2026 22:46:08 +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 674A835B2B6; Mon, 02 Feb 2026 22:46:50 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jeuk Kim , Michael Tokarev Subject: [Stable-10.0.8 66/69] hw/ufs: fix CQE endianness and UPIU length Date: Mon, 2 Feb 2026 22:46:29 +0300 Message-ID: <20260202194638.939438-66-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: 1770062249242158500 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 1c3794b2d4..a16fe34e50 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 4482d7827b..f8ceb4508e 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 17:26:32 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 1770062038557913.9265965466328; Mon, 2 Feb 2026 11:53:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzym-00053I-Bk; Mon, 02 Feb 2026 14:53: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 1vmzyk-0004lD-8o; Mon, 02 Feb 2026 14:52: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 1vmzyh-0004Kc-Sn; Mon, 02 Feb 2026 14:52:57 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C32821850D5; Mon, 02 Feb 2026 22:46:08 +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 7520335B2B7; Mon, 02 Feb 2026 22:46:50 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Ilia Levi , Jeuk Kim , Michael Tokarev Subject: [Stable-10.0.8 67/69] hw/ufs: Fix mcq completion queue wraparound Date: Mon, 2 Feb 2026 22:46:30 +0300 Message-ID: <20260202194638.939438-67-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: 1770062041122158500 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 f8ceb4508e..202dae20f7 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 17:26:32 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 1770062132287449.0484871358933; Mon, 2 Feb 2026 11:55:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzzH-0007MQ-Ee; Mon, 02 Feb 2026 14:53: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 1vmzz6-00075k-Sz; Mon, 02 Feb 2026 14:53: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 1vmzz4-0004LB-GR; Mon, 02 Feb 2026 14:53:20 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D44511850D6; Mon, 02 Feb 2026 22:46:08 +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 8520F35B2B8; Mon, 02 Feb 2026 22:46:50 +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.0.8 68/69] tests/qtest/ufs-test: Add test for mcq completion queue wraparound Date: Mon, 2 Feb 2026 22:46:31 +0300 Message-ID: <20260202194638.939438-68-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: 1770062134721154100 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 17:26:32 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 1770062145802398.443744456323; Mon, 2 Feb 2026 11:55:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vmzzH-0007LF-EG; Mon, 02 Feb 2026 14:53: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 1vmzz7-00075l-B8; Mon, 02 Feb 2026 14:53: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 1vmzz5-0004LV-Mb; Mon, 02 Feb 2026 14:53:21 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E6A141850D7; Mon, 02 Feb 2026 22:46:08 +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 96ECA35B2B9; Mon, 02 Feb 2026 22:46:50 +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.0.8 69/69] python: fix msys64 wheel directory specification Date: Mon, 2 Feb 2026 22:46:32 +0300 Message-ID: <20260202194638.939438-69-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: 1770062147018154100 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 9aed266df1..826c4ad58d 100644 --- a/python/scripts/mkvenv.py +++ b/python/scripts/mkvenv.py @@ -675,7 +675,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