From patchwork Wed Oct 11 10:33:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=fou8euu/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LC6nzBz1yqN for ; Wed, 11 Oct 2023 21:35:31 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXE-0001UC-Ob; Wed, 11 Oct 2023 06:33:48 -0400 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 1qqWX4-0001IF-L4 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:38 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX0-0005AD-IB for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:37 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-32799639a2aso6389339f8f.3 for ; Wed, 11 Oct 2023 03:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020411; x=1697625211; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nNLSv//wR6uRCDovOJDJ5d1PCh7jcwjttvZeRMsQErI=; b=fou8euu/hWCUrenPxikhQbXrfaEHl7cdfOImoO0llOeY2iy83TLdoxDITcMldlVdTj xGE8aPKRPd0rH8mteEq+73iJ8KaPenshhNt2iYQUVLR6Va4fw7WTZv8EH9tqE+ZMNdET rqdt4DrBpw1OwarRe7dGN/78ijoH4QIyw4gwiMyHvYPPhA9aQcW9/eRP1Nc1ZAt1w4j5 bKQ7oiA5fY2Hx5UDrQITZIOYWq8wm8JmbpSZzqGbz+L2XtM2z5+5mI+Yct7/q0hfERsX 2UQN6UzKYu/74G6RO5un5WcsDCp68tRwFkNEjaCYRKsZTD1x8UIF1Yhr67OHTdAXKGJY A/zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020411; x=1697625211; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nNLSv//wR6uRCDovOJDJ5d1PCh7jcwjttvZeRMsQErI=; b=jq90kBSmX8gS3P9dt6IXh+qMFXNv4SqIa2VpU++b8mOcgw4I5rNWXpplYDZaHf3hMv 1NJHJlikG5EdJNNgJjpR8xJWt/jtE3quUtdat2P0Gj5j7IaK0JEGF3fNSr/PvFHTBWCv Zp6Js4CLdEoJbPb4q8IU8u9HDEnU8CbOJmJvxaGo8Xm1jiWg0eJ9hLHfQ+/Pa5+OlV9k 8yI+4UUZLbqVkYEeDqqPi/Ea3a0QOJ5RlntK9udQIN81fuqqDeUaLNt4wvKjnbnIG8OP DDEP0KoybLUEEmV0Q/tEnaV5J3lTFwWEbPxN3Se/XyXQbgOUv3NN1PcB/rg2A9ohNP/V 5iLQ== X-Gm-Message-State: AOJu0YzsTCkiZteIhy1pkQ/RD77Eh2v8kXA7xSjTbvqzK9C7/AZP4RJg j0/YG0NwllQTmpXJL3Iz97oz8w== X-Google-Smtp-Source: AGHT+IERdxUixou9cUeyAxW2i/kkobT8A9hLjEFKWeGuehBvsGbD0qSeVtnGj5CtdVp26t+FGnFYtw== X-Received: by 2002:a5d:5c0e:0:b0:32c:c35c:2eea with SMTP id cc14-20020a5d5c0e000000b0032cc35c2eeamr4243920wrb.6.1697020410899; Wed, 11 Oct 2023 03:33:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m12-20020a056000024c00b0032d88e370basm950574wrz.34.2023.10.11.03.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 346BB1FFBC; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Marcin Juszkiewicz , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal , Brad Smith , qemu-arm@nongnu.org (open list:SBSA-REF) Subject: [PULL 01/25] tests/avocado: update firmware to enable OpenBSD test on sbsa-ref Date: Wed, 11 Oct 2023 11:33:05 +0100 Message-Id: <20231011103329.670525-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marcin Juszkiewicz Update prebuilt firmware images: - Neoverse V1/N2 cpu support - non-secure EL2 virtual timer - XHCI controller in DSDT With those changes we can now run OpenBSD as part of sbsa-ref tests. Signed-off-by: Marcin Juszkiewicz Message-Id: <20230927120050.210187-2-marcin.juszkiewicz@linaro.org> [AJB: fix whitespace and longline] Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-2-alex.bennee@linaro.org> diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index a794245e7e..b272053eaf 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -28,33 +28,33 @@ def fetch_firmware(self): """ Flash volumes generated using: - - Fedora GNU Toolchain version 13.1.1 20230511 (Red Hat 13.1.1-2) + - Fedora GNU Toolchain version 13.2.1 20230728 (Red Hat 13.2.1-1) - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee38 + https://github.com/ARM-software/arm-trusted-firmware/tree/7c3ff62d - Tianocore EDK II https://github.com/tianocore/edk2/tree/0f9283429dd4 - https://github.com/tianocore/edk2-non-osi/tree/f0bb00937ad6 - https://github.com/tianocore/edk2-platforms/tree/7880b92e2a04 + https://github.com/tianocore/edk2/tree/ad1c0394b177 + https://github.com/tianocore/edk2-platforms/tree/d03a60523a60 """ # Secure BootRom (TF-A code) fs0_xz_url = ( - "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" + "https://fileserver.linaro.org/s/rE43RJyTfxPtBkc/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash = "447eff64a90b84ce47703c6ec41fbfc25befaaea" + fs0_xz_hash = "cdb8e4ffdaaa79292b7b465693f9e5fae6b7062d" tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash) archive.extract(tar_xz_path, self.workdir) fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd") # Non-secure rom (UEFI and EFI variables) fs1_xz_url = ( - "https://fileserver.linaro.org/s/t8foNnMPz74DZZy/" + "https://fileserver.linaro.org/s/AGWPDXbcqJTKS4R/" "download/SBSA_FLASH1.fd.xz" ) - fs1_xz_hash = "13a9a262953787c7fc5a9155dfaa26e703631e02" + fs1_xz_hash = "411155ae6984334714dff08d5d628178e790c875" tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash) archive.extract(tar_xz_path, self.workdir) fs1_path = os.path.join(self.workdir, "SBSA_FLASH1.fd") @@ -144,7 +144,7 @@ def test_sbsaref_alpine_linux_cortex_a57(self): def test_sbsaref_alpine_linux_neoverse_n1(self): """ - :avocado: tags=cpu:max + :avocado: tags=cpu:neoverse-n1 """ self.boot_alpine_linux("neoverse-n1") @@ -152,4 +152,54 @@ def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=cpu:max """ - self.boot_alpine_linux("max,pauth-impdef=on") + self.boot_alpine_linux("max") + + + # This tests the whole boot chain from EFI to Userspace + # We only boot a whole OS for the current top level CPU and GIC + # Other test profiles should use more minimal boots + def boot_openbsd73(self, cpu): + self.fetch_firmware() + + img_url = ( + "https://cdn.openbsd.org/pub/OpenBSD/7.3/arm64/miniroot73.img" + ) + + img_hash = "7fc2c75401d6f01fbfa25f4953f72ad7d7c18650056d30755c44b9c129b707e5" + img_path = self.fetch_asset(img_url, algorithm="sha256", asset_hash=img_hash) + + self.vm.set_console() + self.vm.add_args( + "-cpu", + cpu, + "-drive", + f"file={img_path},format=raw", + "-device", + "virtio-rng-pci,rng=rng0", + "-object", + "rng-random,id=rng0,filename=/dev/urandom", + ) + + self.vm.launch() + wait_for_console_pattern(self, + "Welcome to the OpenBSD/arm64" + " 7.3 installation program.") + + def test_sbsaref_openbsd73_cortex_a57(self): + """ + :avocado: tags=cpu:cortex-a57 + """ + self.boot_openbsd73("cortex-a57") + + def test_sbsaref_openbsd73_neoverse_n1(self): + """ + :avocado: tags=cpu:neoverse-n1 + """ + self.boot_openbsd73("neoverse-n1") + + def test_sbsaref_openbsd73_max(self): + """ + :avocado: tags=cpu:max + """ + self.boot_openbsd73("max") + From patchwork Wed Oct 11 10:33:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ErkbigTC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Lz2Vfzz1yqN for ; Wed, 11 Oct 2023 21:36:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXE-0001Tz-Lz; Wed, 11 Oct 2023 06:33:48 -0400 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 1qqWX4-0001IU-MX for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:38 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX0-0005AS-Iw for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:36 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405524e6769so4807975e9.1 for ; Wed, 11 Oct 2023 03:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020411; x=1697625211; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PYNRmoxNI53oOIjLqN4U1LCzFirqfr049WCu+bQeo6Q=; b=ErkbigTCTo/1gZ7vUGft2RWzZJa5lEheVzkp3zoN16RmMIiaWCcz5vMFZc9O+7362O gDlgBzetu8bBxFnbvT4k98ObHkSljGVF+1w+TRyHlh5Pu22DTNd8e3npQxKjr4owSelj Ht2Lpjg79kJfe3Ap0mwUD1RnQSyAuT6U2/japPTL1bkgVB0XcET0TADfJRrgxiJxJ/yL rSjbwXyQUN1URqkq2ISEJt6pwHFB3hwbpCCQ0GmvQIqzSKEQT1tbFEM+2mFG7vHwXGOo 30YNAuHGwpL0UQdTuHOMD/W9PUblk6+rpG69Q4c57A1K82Aj6fawJU6LwYH8BkbYIhIf 93Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020411; x=1697625211; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PYNRmoxNI53oOIjLqN4U1LCzFirqfr049WCu+bQeo6Q=; b=oVST2TSsSo2pgteLvjKk6UIs/EU/BBtuRLhDLJxXeW366CFtBsWfptSOkOD4exRjbg EIUx4RAG6t+RaSo+RfOif1hB5zXynypZZXq8OC5MI/6TzDP89j/f+4p8tpY7bJEJzVKq Nh1hmhbbtuJm2AMlRUmEQZIOiGp5UL+XFZ7k/vkwkuaXnkPe3dcQ6rDKLRZNiP3RDVmn 9SPaubGbB3OBC8kFwLfPjy90RqMftGhIlPVdcVgtkGSKZpqm9lgm2fV+19J7PbwjL/yt 465xpLxMS7KYCRTVz4XmVQmCVfYeb+PIXORuDakHcWsI6jyubbu5OAcqcMaXeLzbt6et oTCw== X-Gm-Message-State: AOJu0YyjPrCTs7v7mSzVMUxrdgGn2NC+IjonDoViUWcALbzIVkjwz2+G +aDDsaVe/zMeRm8+RyVndHMvgQ== X-Google-Smtp-Source: AGHT+IFbJxRnxS37fJS8SmyT91t+08/ZLTwxaP0tQsja5KoVtGRM4cqxx3WSxzjo7FmFY5bcHiIRFQ== X-Received: by 2002:a05:600c:220a:b0:405:251f:8455 with SMTP id z10-20020a05600c220a00b00405251f8455mr13973069wml.7.1697020411322; Wed, 11 Oct 2023 03:33:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y8-20020a7bcd88000000b00406447b798bsm18773359wmj.37.2023.10.11.03.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4BB7D1FFBD; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Marcin Juszkiewicz , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal , qemu-arm@nongnu.org (open list:SBSA-REF) Subject: [PULL 02/25] tests/avocado: remove flaky test marking for test_sbsaref_edk2_firmware Date: Wed, 11 Oct 2023 11:33:06 +0100 Message-Id: <20231011103329.670525-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org After testing locally I decided to revert a5754847e0 (tests/avocado: Disable the test_sbsaref_edk2_firmware by default) as the test seems pretty stable: env QEMU_TEST_FLAKY_TESTS=1 retry.py -n 50 -c -- \ ./tests/venv/bin/avocado run \ ./tests/avocado/machine_aarch64_sbsaref.py:Aarch64SbsarefMachine.test_sbsaref_edk2_firmware yields: Results summary: 0: 50 times (100.00%), avg time 2.064 (0.04 varience/0.19 deviation) Ran command 50 times, 50 passes Maybe f0ec14c78c (tests/avocado: Fix console data loss) has made it more reliable? Cc: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-3-alex.bennee@linaro.org> diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index b272053eaf..bdd1efc768 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -75,7 +75,6 @@ def fetch_firmware(self): "sbsa-ref", ) - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is not reliable') def test_sbsaref_edk2_firmware(self): """ :avocado: tags=cpu:cortex-a57 From patchwork Wed Oct 11 10:33:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Z7nQaGm2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LQ2pSDz1yqN for ; Wed, 11 Oct 2023 21:35:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXM-0001e1-6F; Wed, 11 Oct 2023 06:33:56 -0400 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 1qqWX5-0001Kt-9u for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX0-0005Ad-IM for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:38 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32483535e51so6415818f8f.0 for ; Wed, 11 Oct 2023 03:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020412; x=1697625212; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dCeiBmwJ0znzL5+0oomSpJsnl+/in8TKJzyri18rbQw=; b=Z7nQaGm23GamYfklZv5XadE+73j9I8LQ7Um4ANb9KLi0vXw4sdcm7iDxhua/cooJOs 8mnAjfFRaeN0rRD8E2aU6845aqzuHhzle2g2QBg0KkRroouVC/vGMdFPHrvUGujSlTtW xmERIrlqSdZ+WaZIpBJr/2VZ9YGl4mMWW0smp7/fPXrb6PoOcxpofiAzhLrEfghVDBdn 494UA1p605SF3/ewaiEeUBAyzVTcycYnTsSJe68PpWUAgyIDZUV9h9g+91vnbzZxrt+l QWYtUOeywR0fWuWuMzEDJQyQxm+dw0uL4wyhXiAWFpBSpLLUPcIWsVLNtAO2xYr/khwA TAzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020412; x=1697625212; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dCeiBmwJ0znzL5+0oomSpJsnl+/in8TKJzyri18rbQw=; b=jmn6DUT0FWuPB8zPOiRVhXY18wQAeJpni3eUdsjxk8hb27ihsL7cR4H6pHcPN4YFT7 /eonUFDHN2U8cV2jC5UyRscovUcUYmK5g2XFlhZgzdyu/tqvOgogPiOLipKeIgl+wUw8 ztMrxheE1kluCUrrZHWBi/LOrCUhaFv7C4lV5x+f6AG+bfOtOvDCkMy4+X++Nk/VRLDo /ouQbxb5snRii2FK99W+KVPvgYv5QB2Hjc9Tov2XzqlXwV68HjXzVEO+4mf/JM5on+RW IvnwT/x+MNaapHnYyHU/77Rqp/MErBBXYgh+YcZsiAAbzmm55EFdyxmBLq/Xdud14Ngl AFtQ== X-Gm-Message-State: AOJu0Yw+BHEXnI1F5nDgU66OXy4jRFGwmOaQoH2VZvnz4Gsi36slOcIR C/LSGT53acK59/Bv5eax4k7+1myD3xcUXR6UNrA= X-Google-Smtp-Source: AGHT+IEyhIo3nHyEsR4hipygRKiWy7Cgeq0RySnhLJHzhMCfVqh3EaF+5IJwc2JtcRTbH1HBSJdIAw== X-Received: by 2002:adf:fa12:0:b0:321:685f:e0a7 with SMTP id m18-20020adffa12000000b00321685fe0a7mr17950491wrr.3.1697020412516; Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t4-20020a5d6904000000b0032710f5584fsm14989523wru.25.2023.10.11.03.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 873121FFBE; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Daniel_?= =?utf-8?q?P=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 03/25] tests/lcitool: add swtpm to the package list Date: Wed, 11 Oct 2023 11:33:07 +0100 Message-Id: <20231011103329.670525-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We need this to test some TPM stuff. Reviewed-by: "Daniel P. Berrangé" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-4-alex.bennee@linaro.org> diff --git a/.gitlab-ci.d/cirrus/macos-12.vars b/.gitlab-ci.d/cirrus/macos-12.vars index 80eadaab29..5f3fb346d1 100644 --- a/.gitlab-ci.d/cirrus/macos-12.vars +++ b/.gitlab-ci.d/cirrus/macos-12.vars @@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol tesseract usbredir vde vte3 xorriso zlib zstd' +PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol swtpm tesseract usbredir vde vte3 xorriso zlib zstd' PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme tomli' PYTHON='/opt/homebrew/bin/python3' diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker index d25649cb4f..42f6928627 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -100,6 +100,7 @@ RUN apk update && \ sparse \ spice-dev \ spice-protocol \ + swtpm \ tar \ tesseract-ocr \ usbredir-dev \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker index 68bfe606f5..d97c30e96a 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -107,6 +107,7 @@ RUN dnf distro-sync -y && \ socat \ spice-protocol \ spice-server-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker index 0991938595..00bdc06021 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker index 61dbc3ff24..9b50fb2f63 100644 --- a/tests/docker/dockerfiles/debian-amd64.docker +++ b/tests/docker/dockerfiles/debian-amd64.docker @@ -124,6 +124,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ systemtap-sdt-dev \ tar \ tesseract-ocr \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker index 74eabb274e..2dae3777f7 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker index 1ebd6ebd00..180ed836e6 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker index 59091fed02..d6be2f0cc5 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker index 48b2f28310..ec0041d6aa 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker index afa988574f..08799219f9 100644 --- a/tests/docker/dockerfiles/fedora-win32-cross.docker +++ b/tests/docker/dockerfiles/fedora-win32-cross.docker @@ -55,6 +55,7 @@ exec "$@"\n' > /usr/bin/nosync && \ socat \ sparse \ spice-protocol \ + swtpm \ tar \ tesseract \ tesseract-langpack-eng \ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker index cf93a0ca60..f8e4cb70d3 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -55,6 +55,7 @@ exec "$@"\n' > /usr/bin/nosync && \ socat \ sparse \ spice-protocol \ + swtpm \ tar \ tesseract \ tesseract-langpack-eng \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index f00e9e267c..9e9c71fa94 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -118,6 +118,7 @@ exec "$@"\n' > /usr/bin/nosync && \ sparse \ spice-protocol \ spice-server-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker index ed04b4d6da..dc0e36ce48 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -100,6 +100,7 @@ RUN zypper update -y && \ socat \ sparse \ spice-protocol-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/ubuntu2204.docker b/tests/docker/dockerfiles/ubuntu2204.docker index 94c2c16118..2ca9cff79c 100644 --- a/tests/docker/dockerfiles/ubuntu2204.docker +++ b/tests/docker/dockerfiles/ubuntu2204.docker @@ -124,6 +124,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ systemtap-sdt-dev \ tar \ tesseract-ocr \ diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index e3ed1e5da1..36bc517161 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit e3ed1e5da101943e53d8d89424e17b22120743f5 +Subproject commit 36bc517161c45ead20224d47f2dc4fa428af6724 diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml index 6f0885170d..82092c9f17 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -110,6 +110,7 @@ packages: - spice-protocol - spice-server - ssh-client + - swtpm - systemd - tar - tesseract From patchwork Wed Oct 11 10:33:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846521 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tmbs707B; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LK00Jnz1yqN for ; Wed, 11 Oct 2023 21:35:36 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXG-0001YB-Oe; Wed, 11 Oct 2023 06:33:50 -0400 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 1qqWX5-0001Ks-8i for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX1-0005Ag-KB for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:38 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3231dff4343so484182f8f.0 for ; Wed, 11 Oct 2023 03:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020412; x=1697625212; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0IiuNKmaTaknn72sH80/PHMGMfdmM3U9tgv9losOud8=; b=tmbs707BcfDlan8qEGXnxUYye6R3lkpLbrN5Jyrl2PCtuRrpfmWmlqjuxYB7leIC/Q 69hTXLpRLV22VZiVml/MH1DI5q4REBZWIsdbi5pXOMTjCDI5MtLIG9jfpnUxkouUR8v6 dly+jYocZmEL+hPCSaNJcbD5/sD+LubxYyFkz9mfFurXY+vZjdWumfduNMa2fHZ1t4bM gAOCrvN1IobJ+oDJTX1qHWNWMILjj0OsY7b+lIWWSRhm/LIjNJTjUqeSR9HXdt75Swnh F1oJaSlGGLJ6leIiwWrnPsmerkLW614diPoI5ODkb5+hrqX6oqa2NK9gNaOHwx+dykFu zvYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020412; x=1697625212; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0IiuNKmaTaknn72sH80/PHMGMfdmM3U9tgv9losOud8=; b=Irei3R8Qf/p2acvwR6Imxhms+E61uNAtM8DYecR3uUp66RFAWeoh2gdH3TJcGqD91W 1GrEaSWX1RDbaypYM5tHap2eCwElLhE1HCiZg+GaVNgTyWRRgjoPb3xjudiKoVpnMx0s cXYGiFgo9UBuYZjB2u+KrNwG7/n2aWSacClIlkYLjM+xqgF0V7HbbfCdC9/8J9/DLE45 ptl2XhUAqyrrSj7kahCLD18TZCFtlBvUYQiCoZRKH+OFzomVKbH6An6I3P6EnJ6nNhPD +ggrdzURwd7m8bj+WOuxRfmlXAq9HSJ92AzIA4kR+r++y+7p9tYFJOvISl+ggWDk6FMJ 0ZgQ== X-Gm-Message-State: AOJu0YzlMxAFQqEY/vHZzLzaTzAL5G5fAidwjwx/W7kAkJ+PGlWEqEOt AUQLIOX2WFMywNbXVgBI8QgXgg== X-Google-Smtp-Source: AGHT+IFayRxOTwEys00HTv4l4yaANJpBNQCOOBKi+Riw+1wYbaD1+FY03JQcu6LFqld30uOpgfwjbg== X-Received: by 2002:a5d:5c07:0:b0:31f:d50e:a14f with SMTP id cc7-20020a5d5c07000000b0031fd50ea14fmr20100519wrb.10.1697020412747; Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f15-20020a5d50cf000000b00323330edbc7sm15124930wrt.20.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9F5671FFBF; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 04/25] gitlab: shuffle some targets and reduce avocado noise Date: Wed, 11 Oct 2023 11:33:08 +0100 Message-Id: <20231011103329.670525-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We move a couple of targets out of the avocado runs because there are no tests to run. Tricore already has some coverage. The cris target only really has check-tcg tests but its getting harder to find anything that packages the compiler. To reduce the noise of CANCEL messages we also set AVOCADO_TAGS appropriately so we filter down the number of tests we attempt. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-5-alex.bennee@linaro.org> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index aee9101507..25af1bc41e 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -30,6 +30,7 @@ avocado-system-alpine: variables: IMAGE: alpine MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel build-system-ubuntu: extends: @@ -40,8 +41,7 @@ build-system-ubuntu: variables: IMAGE: ubuntu2204 CONFIGURE_ARGS: --enable-docs - TARGETS: alpha-softmmu cris-softmmu hppa-softmmu - microblazeel-softmmu mips64el-softmmu + TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu MAKE_CHECK_ARGS: check-build check-system-ubuntu: @@ -61,6 +61,7 @@ avocado-system-ubuntu: variables: IMAGE: ubuntu2204 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:alpha arch:microblaze arch:mips64el build-system-debian: extends: @@ -72,7 +73,7 @@ build-system-debian: IMAGE: debian-amd64 CONFIGURE_ARGS: --with-coroutine=sigaltstack TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu - sparc-softmmu xtensaeb-softmmu + sparc-softmmu xtensa-softmmu MAKE_CHECK_ARGS: check-build check-system-debian: @@ -92,6 +93,7 @@ avocado-system-debian: variables: IMAGE: debian-amd64 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa crash-test-debian: extends: .native_test_job_template @@ -114,7 +116,7 @@ build-system-fedora: variables: IMAGE: fedora CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs - TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu + TARGETS: microblaze-softmmu mips-softmmu xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu MAKE_CHECK_ARGS: check-build @@ -135,6 +137,8 @@ avocado-system-fedora: variables: IMAGE: fedora MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k + arch:riscv32 arch:ppc arch:sparc64 crash-test-fedora: extends: .native_test_job_template @@ -180,6 +184,8 @@ avocado-system-centos: variables: IMAGE: centos8 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:ppc64 arch:or1k arch:390x arch:x86_64 arch:rx + arch:sh4 arch:nios2 build-system-opensuse: extends: @@ -209,6 +215,7 @@ avocado-system-opensuse: variables: IMAGE: opensuse-leap MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by From patchwork Wed Oct 11 10:33:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Oz5XCvd4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58M55PNbz1yqN for ; Wed, 11 Oct 2023 21:36:17 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXG-0001Wm-0Q; Wed, 11 Oct 2023 06:33:50 -0400 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 1qqWX5-0001KQ-1t for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX0-0005Ak-IX for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:38 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-406618d0992so64284585e9.0 for ; Wed, 11 Oct 2023 03:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020413; x=1697625213; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gONP7pJxs9GGiNZgo4EWoYPfXNPiQDYcL6QIKvi4tFo=; b=Oz5XCvd4GLEFMxSYySdfnY8/RcZ+BerRGkvInGqcraJDGDfWiwaAWG1AyaxsBauAp+ cIVd5liYKwEsRNjRQFwROHG8i0MK62rrRrcA9ObLHVoVta46lsNBqWlz5xSOEOsptKAc 0JTfK8RFv8UYj7l6OQoObtnpj7jBk+Rnb//IdLhoDBVL9JiVh8NxI8/yzi5w3nsuQDhI JmiFLqAXGP9XjP+6uKrOQaEWf3EwS4LQZ/E0D1IXJjIRtM3M4wZzvoMS6HskYDCuxu+m CsNeEgoPcsqQ8EmisEQbyyiwIWej/l45dfBkj1oxrFYKQvcVYv21sxHLLSSATYYo59YA E/HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020413; x=1697625213; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gONP7pJxs9GGiNZgo4EWoYPfXNPiQDYcL6QIKvi4tFo=; b=f/zXJ/vhxGLrkF/c3XhyM6GFcA06IlLcIi2nq313axnk+E+QuH9OsPUqipdTUxddF+ oOsipVmY/JK6RDNb+OJqE2mXlBri2j/Xvl+od37ycNY+p1oNawUDHB4lYD7Qzl72JQ6X aBK5IIPw1OZFM7vXRjOTIR4uIAIDo8gTnFfzLMz/TtynQzog8bVJVkJqDsEU/j1v/v1+ lM8A7b20oz+I62aTtl9DnsBCx+W3EeksGE7maLSHCQIEx71AI8Rjt2au/DvF6je94lTE MwwMfWPltYDg/1j2Hv9e+JCb3ZhU4JWuARp+cyWjSyiVsCHvtFCKQ3etm+acx8EGYKXC 428A== X-Gm-Message-State: AOJu0YyFSMfL8H8siCSBEWPYOHlZPipVInt1bBPvuwJquMApnaP1WBUT hWYVFcg644p2BVY5mjyhKZ9bYA== X-Google-Smtp-Source: AGHT+IF8F1ehKk9bBfUYWVz7BJa2gTXeXfIcpciTHESWvFmAbkO9942urfy5SYkF9OEoihjxaQ8X3g== X-Received: by 2002:a05:6000:114d:b0:323:37a8:d085 with SMTP id d13-20020a056000114d00b0032337a8d085mr17367577wrx.58.1697020412974; Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v11-20020a5d6b0b000000b00324853fc8adsm14993219wrw.104.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B95601FFC0; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Paolo Bonzini , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 05/25] tests/docker: make docker engine choice entirely configure driven Date: Wed, 11 Oct 2023 11:33:09 +0100 Message-Id: <20231011103329.670525-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since 0b1a649047 (tests/docker: use direct RUNC call to build containers) we ended up with the potential for the remaining docker.py script calls to deviate from the direct RUNC calls. Fix this by dropping the use of ENGINE in the makefile and rely entirely on what we detect at configure time. We also tweak the RUNC detection so podman users can still run things from the source tree. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20231009164104.369749-6-alex.bennee@linaro.org> diff --git a/configure b/configure index 97a5e8de49..1f26639e4f 100755 --- a/configure +++ b/configure @@ -1694,7 +1694,6 @@ if test -n "$gdb_bin"; then fi if test "$container" != no; then - echo "ENGINE=$container" >> $config_host_mak echo "RUNC=$runc" >> $config_host_mak fi echo "SUBDIRS=$subdirs" >> $config_host_mak diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index dfabafab92..ab68b2dbad 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -16,9 +16,8 @@ DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu endif DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY)) -RUNC ?= docker -ENGINE ?= auto -DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) +RUNC ?= $(if $(shell command -v docker), docker, podman) +DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(RUNC) CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) @@ -158,7 +157,7 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES)), \ ) docker: - @echo 'Build QEMU and run tests inside Docker or Podman containers' + @echo 'Build QEMU and run tests inside $(RUNC) containers' @echo @echo 'Available targets:' @echo @@ -198,8 +197,6 @@ docker: @echo ' EXECUTABLE= Include executable in image.' @echo ' EXTRA_FILES=" [... ]"' @echo ' Include extra files in image.' - @echo ' ENGINE=auto/docker/podman' - @echo ' Specify which container engine to run.' @echo ' REGISTRY=url Cache builds from registry (default:$(DOCKER_REGISTRY))' docker-help: docker From patchwork Wed Oct 11 10:33:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=j7NCSXda; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LT5dh2z23jg for ; Wed, 11 Oct 2023 21:35:45 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXJ-0001ZQ-E5; Wed, 11 Oct 2023 06:33:53 -0400 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 1qqWX6-0001Kx-IE for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX4-0005DA-BS for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:40 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40651a72807so64230715e9.1 for ; Wed, 11 Oct 2023 03:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020415; x=1697625215; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=knFp3LFINV+DnPYFBJemRPHvlmKP+IRj/bDUqX8B+FM=; b=j7NCSXdaSX33SewiQGSxXHf3gH1iK9b5xmsmluSswS2zUz5dSd/jAXZkxqThG0KLZ4 2UK3pbisK8h19F/0QVJlJkCaLlbRR0u3ADBJkg/e7AV1a1oyIntXp/0aIeiqLW1TFJyt y9hYul4rTMk7XSAtIqwX+sCBGa6ZOPBrC2yeOJvGDNgNwLPAEgsuKNQ0Fm0APeKOIP/e mjbX5iZe48SevJqTz70YoOLp3zmTnSmVTrAH1IEM0wR8ca8PIKMidk4bSqeVoYX6ZpFe aLrjZXtV2fb2Z5Vv4mWItbdy1wWPvmFehzfaENRMIyZqw/iHSzMCxYXUzUChOAkaivum FOjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020415; x=1697625215; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=knFp3LFINV+DnPYFBJemRPHvlmKP+IRj/bDUqX8B+FM=; b=AecgAML/ox5H8dVpzdR8hJR5jrIN+CYYGjgLIRfazmL1oNDgF6LgkHQ3D2ka9ujyQC +svARSaO9yrN7JpWav4/cnji1gBcjZpQTDJAhDa0CuDA2r9amdLtz+5NVDLTPp6TUkE7 VYh3Q9xMJ9XmWUQGCZyaqu7oIufLHlNLu+3h4bSjLRjKRFzCLgsA8c2EkRQvhQI1H3ko KBeAOcYRT8HVE9afTDUWiAqucftfnzf1hsmpNBhzGkoTOrDVW97vRrOD1z3hYb5wJsHl T2A6os9R9kk1lZwnK2pN+RyPbSJbfRwXZsWDht3wehF07bxz8JPumewRm3FG/zSznCrT fj5g== X-Gm-Message-State: AOJu0Yz7Uoq9WbfkiqrxYVEF0G6MXdLXFyFO2W0D5PQ9Fl4Nry/ityo0 XwBvLR08rMZAGT5yvDnTucEX6A== X-Google-Smtp-Source: AGHT+IE05LgAF7qJTdU+U17qtCngRR2ascteGNgpVItdD2nMthXkW2hc6429wEmREi7PUCv3nmCTWQ== X-Received: by 2002:a05:600c:214f:b0:405:4002:825a with SMTP id v15-20020a05600c214f00b004054002825amr17839437wml.13.1697020415526; Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x2-20020a1c7c02000000b003fe23b10fdfsm18592230wmc.36.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D05511FFC1; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Paolo Bonzini , Thomas Huth Subject: [PULL 06/25] configure: allow user to override docker engine Date: Wed, 11 Oct 2023 11:33:10 +0100 Message-Id: <20231011103329.670525-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If you have both engines installed but one is broken you are stuck with the automagic. Allow the user to override the engine for this case. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20231009164104.369749-7-alex.bennee@linaro.org> diff --git a/configure b/configure index 1f26639e4f..5c04e63bab 100755 --- a/configure +++ b/configure @@ -180,6 +180,7 @@ fi # some defaults, based on the host environment # default parameters +container_engine="auto" cpu="" cross_compile="no" cross_prefix="" @@ -787,6 +788,8 @@ for opt do ;; --disable-containers) use_containers="no" ;; + --container-engine=*) container_engine="$optarg" + ;; --gdb=*) gdb_bin="$optarg" ;; # everything else has the same name in configure and meson @@ -921,6 +924,7 @@ Advanced options (experts only): --enable-plugins enable plugins via shared library loading --disable-containers don't use containers for cross-building + --container-engine=TYPE which container engine to use [$container_engine] --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] EOF meson_options_help @@ -1195,14 +1199,14 @@ fi container="no" runc="" if test $use_containers = "yes" && (has "docker" || has "podman"); then - case $($python "$source_path"/tests/docker/docker.py probe) in + case $($python "$source_path"/tests/docker/docker.py --engine "$container_engine" probe) in *docker) container=docker ;; podman) container=podman ;; no) container=no ;; esac if test "$container" != "no"; then docker_py="$python $source_path/tests/docker/docker.py --engine $container" - runc=$($python "$source_path"/tests/docker/docker.py probe) + runc=$container fi fi From patchwork Wed Oct 11 10:33:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=x4df//Z+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LF21BZz23jg for ; Wed, 11 Oct 2023 21:35:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXM-0001e4-OY; Wed, 11 Oct 2023 06:33:56 -0400 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 1qqWX6-0001Kw-9m for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX2-0005BC-F9 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:40 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-504a7f9204eso8164887e87.3 for ; Wed, 11 Oct 2023 03:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020414; x=1697625214; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f1zLuzNXUek9chAtmqkdvsAg9LAFRcVol3Mr0VZBUJ0=; b=x4df//Z+dtzd7uRjkYsHs+6L4pv7gefJIo6KyuvWbYKD9HbnPYPWciddmNHVV+5ucM dIg9URoVtNLH3c6J2QgOOQyiZM9dLgnEL4g+pOH0PFQkiZRysHqaqJkOfX0tV8UXJ4sh A9Yrg8fi6nRrwr6Bg+j7CNzwxXZij+GT/oLIszr2AglHSFY1pyd2LCzinvb/hzSz79pq vJ3wVvkgEToaSFHPcFCnH3Po0PEnUp8jhgGP+a65n39xnrW62zI0NmTfkE+Hlv0xwKz/ ndeJcm9W4k2/PnsTWPREoEs+IEWVHDgL6W2fQY6bll3ztFz8MJxAobrNMeeoiQoTmYLe xT3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020414; x=1697625214; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f1zLuzNXUek9chAtmqkdvsAg9LAFRcVol3Mr0VZBUJ0=; b=aHTt1pSe9snH6507sjZ0t6MLALVgT514Ash5BgSPf9Lbb/Ey632kxNItAm3P2Zg20y ByQY4b3SoPiL7Ut2PmR6DyVhg7spcq2BsAlHt159HIdM/GiByDC7n9Iii4i0Pz1+WmPJ a3D7JZBP4L6MIZfdMM3FbO9KYI9sABpVnWjCN34q5begnXJHFNXXU0DVFe1UTbCVwuYx ge5fEkclI5yasDsUoWzrRACQRO1vu4BKv/N7tgKePBmfNRm+wQyfU8kCV9At4TtzaA8d CGUlejVszqX9OBBcodQsSrWsziF3l2KCqmimswzo/LCqyg5Mq0fO1p86d9KVdqpCwBAc MT3A== X-Gm-Message-State: AOJu0YzLdHA91ec8zDMkjmXwji/k8fB98IdGqkTc4A4qvibhwA+2yQpq rp4raXoVCtdERLj/Xx60M9PlCNy9hbnNmEUqGnU= X-Google-Smtp-Source: AGHT+IH4huI2ob/OlPUnfCwlf9vUO9mcus72Okd08biZDvc0+ETEMmijWcuqUjpiFml1t1TGH2z1yA== X-Received: by 2002:a05:6512:718:b0:503:5e1:9b6e with SMTP id b24-20020a056512071800b0050305e19b6emr15315676lfs.10.1697020413893; Wed, 11 Oct 2023 03:33:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y19-20020a05600c20d300b004075b3ce03asm2945219wmm.6.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E687D1FFC2; Wed, 11 Oct 2023 11:33:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Thomas Huth Subject: [PULL 07/25] configure: remove gcc version suffixes Date: Wed, 11 Oct 2023 11:33:11 +0100 Message-Id: <20231011103329.670525-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The modern packaging of cross GCC's doesn't need the explicit version number at the end. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-8-alex.bennee@linaro.org> diff --git a/configure b/configure index 5c04e63bab..8fada85a71 100755 --- a/configure +++ b/configure @@ -1334,7 +1334,7 @@ probe_target_compiler() { # We don't have any bigendian build tools so we only use this for AArch64 container_image=debian-arm64-cross container_cross_prefix=aarch64-linux-gnu- - container_cross_cc=${container_cross_prefix}gcc-10 + container_cross_cc=${container_cross_prefix}gcc ;; alpha) container_image=debian-alpha-cross @@ -1397,7 +1397,7 @@ probe_target_compiler() { ppc) container_image=debian-powerpc-test-cross container_cross_prefix=powerpc-linux-gnu- - container_cross_cc=${container_cross_prefix}gcc-10 + container_cross_cc=${container_cross_prefix}gcc ;; ppc64|ppc64le) container_image=debian-powerpc-test-cross From patchwork Wed Oct 11 10:33:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846516 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=IPl3LF5i; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58KV5J2Mz23jd for ; Wed, 11 Oct 2023 21:34:54 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXF-0001WC-JF; Wed, 11 Oct 2023 06:33:49 -0400 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 1qqWX7-0001L9-CD for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX4-0005CX-Bt for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50435a9f800so8699173e87.2 for ; Wed, 11 Oct 2023 03:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020415; x=1697625215; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=djhZEY3GVFJ70rgdAPOhClTGynl2JirWDslytlqGvz0=; b=IPl3LF5imUJsZNRn2Ma50Jg4pGQ7CeDHIeBpik8ZOapCJsz/dVtpnRx4h26s0tdQ/n aUr8xI1981WTFEL41uYGWxABpRw4E8qyMzmpvuoNtAVI0i3Opk+aue451OEynA33kLnJ reFPQ9VGgqKHJysszapfcPEhjqS1tywDzRvN6G9NHp6R4KfCm+W0Oo9OMXSuLvzSLPV2 X6yPqPpp88FxzpQmUiC3k/JkiIuKz0yOnWY9udGSwKOfs6R+lvFEe+ecEz/sRtFp9YBB ZB/J+2y8E/sA2eUGXGEnoqsxL50Nml4Hbk3UUk6O9/Sz7FKeIcmTOepMW/mm7ekF26L/ /bfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020415; x=1697625215; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=djhZEY3GVFJ70rgdAPOhClTGynl2JirWDslytlqGvz0=; b=oy/fA39E5IltSRTC8xqqoMUMztRMBq209V85hNQ0NqExQBIrc1ORUYMfT6gcsWUuCr oB5e3Ddz86xAal3FKubPKJKglzJQkosGc5SDr7m+yzwYMdGnodtKI/Tqr3+97oa+1LVk 0EgB3swbO7c++sysTqb2VHEDYQG9TBhPjE6B8LdVBv9HxK2GtKywts2fmpALFuAgjyxO +8p5TWpdclRvFJGoFqk1ZMyBk4bUq29U87tVgTmiJuy1qn4bO9lFdjFZKSGeAnE/XdsT aHiBBVuF89QUUgIe/UES19R8ZWnXH7IuMOEUpIJuiEo/W2mxVHiEpZi6eQfVy7GLsxBC 1B3A== X-Gm-Message-State: AOJu0YxdXq35o6IxNUtkU1IQxmNKjfD8eMYSvUb+HTU5Uda0B9X6A4z8 l3tXwG6mWkVo8DXEULlGVlHNjA== X-Google-Smtp-Source: AGHT+IFNINSliDfuL1aE/pKafoZObvwTu7gqLcow+jp2mzWdMlvnB263JC63SR7R11jl9yOrVfYLuA== X-Received: by 2002:a05:6512:2811:b0:503:257a:7f5d with SMTP id cf17-20020a056512281100b00503257a7f5dmr23356290lfb.31.1697020415348; Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l9-20020a1c7909000000b00401b242e2e6sm18678477wme.47.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 09FA31FFBC; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 08/25] gdbstub: Fix target_xml initialization Date: Wed, 11 Oct 2023 11:33:12 +0100 Message-Id: <20231011103329.670525-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki target_xml is no longer a fixed-length array but a pointer to a variable-length memory. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20230912224107.29669-2-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-9-alex.bennee@linaro.org> diff --git a/gdbstub/system.c b/gdbstub/system.c index 189975b1d6..48976873d2 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -292,7 +292,7 @@ static int find_cpu_clusters(Object *child, void *opaque) assert(cluster->cluster_id != UINT32_MAX); process->pid = cluster->cluster_id + 1; process->attached = false; - process->target_xml[0] = '\0'; + process->target_xml = NULL; return 0; } From patchwork Wed Oct 11 10:33:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AqqODY49; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LZ6M3tz1yqN for ; Wed, 11 Oct 2023 21:35:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXG-0001Wo-19; Wed, 11 Oct 2023 06:33:50 -0400 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 1qqWX6-0001Kv-3W for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX2-0005BB-En for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:39 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40675f06f1fso4533005e9.1 for ; Wed, 11 Oct 2023 03:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020414; x=1697625214; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CEso1qQHTLbjmT+JXyeDiL7UkgO6kpzpKkYLgvNLU18=; b=AqqODY49Eh6wrPt5NNSd/6eHGcVqqw0hitGUwge3jvSpBRE3tXMFI2gx2D0mVag1EX m89A9CyZtucNCTACfN0Ubh3mIhFy9mre2NlbyrhwZYdlTY4wwDBpEPQ2UMf57VewDFDZ T5erT1Hq4lBAH2e1DsgYrAJp9t+CzJfXFqrLU++hoje/TvqKExCJDD0mR5tLWQa6TqiC 0llv4qdtjsfIV5RMUu8Hj6l1rGLVLhiaUMsJfci+DpjQJ/OzViFaOfwaX0arARSQsB8S N0BE5Zkucfcx1/mAzpOJJGUrGzQ6LWmU6zALfrD6vqIQChbegW8Z5l4Ub9EORwtQjCoX oAQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020414; x=1697625214; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CEso1qQHTLbjmT+JXyeDiL7UkgO6kpzpKkYLgvNLU18=; b=tlfUxj6V1yYTkI3Us+o3bxzVnJaCuIisn0D4O5FlWxfgP4Z0SD1M8S1kJ5AIXFAmw6 MNMTHFlEtVE54D70hWktKl1JD6O7Bh0WFyf/YNCLuiWk8g3uskoqJR9hsVLxnki0w/TT LnAWKDnvD19IZgGn4QraaWq5qUoj3Sp5GEeIY7VzsCJITwWV7qAQjUCmU/iBh4mw7GHF HUPOcGx8jhNnrggwwJsN1OjJlY4w1n6i0lkgz7AUZkFa8m/PR0XsSdZQ1HOwJlc4jk+/ o1cWQ+abfSZTOJEwgptOTcsPwFOVGXXkx+sLgBVtMBvzh20W2HfDiR/mboG5o6GnTcwN Sycw== X-Gm-Message-State: AOJu0YyL9wgiG8eGEqQf9VhPUeGyQOsulsdGfUAgZ3JYg2r9OepBZBBn tlPQGdHWztFUunp9BdwE45T0RQ== X-Google-Smtp-Source: AGHT+IGmdrsxQPWINcdVLuv5EnQa+5M7B/Ou9sDkJ9OJDp9PUGVNnj8Xua4mRrbSKDu6+mksPzrCvw== X-Received: by 2002:a05:6000:3c3:b0:32c:d29c:2f77 with SMTP id b3-20020a05600003c300b0032cd29c2f77mr4520292wrg.1.1697020414092; Wed, 11 Oct 2023 03:33:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s11-20020a5d424b000000b003248a490e3asm15135027wrr.39.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2062D1FFC3; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 09/25] gdbstub: Fix target.xml response Date: Wed, 11 Oct 2023 11:33:13 +0100 Message-Id: <20231011103329.670525-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki It was failing to return target.xml after the first request. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-10-alex.bennee@linaro.org> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 8eea21450c..4f3762fccf 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -396,8 +396,8 @@ static const char *get_feature_xml(const char *p, const char **newp, g_string_append(xml, ""); process->target_xml = g_string_free(xml, false); - return process->target_xml; } + return process->target_xml; } /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { From patchwork Wed Oct 11 10:33:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OwSNGSro; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Lc1F7hz1yqN for ; Wed, 11 Oct 2023 21:35:52 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXG-0001Xm-El; Wed, 11 Oct 2023 06:33:50 -0400 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 1qqWX5-0001Ku-MQ for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX2-0005BM-8w for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:39 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4066692ad35so62488245e9.1 for ; Wed, 11 Oct 2023 03:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020414; x=1697625214; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tXtc55X9ZMWnLYaJ7rtH4hZORRpdhmNZnt+nFsO0Mb4=; b=OwSNGSroQ/SYg4FQJi0KsND0GwFE3rVu00zA3JPaM4h28oKvsO578klV8VMyEAgF6y bmosV9vyXMSoJZ5cn68DkJq3OYf194UlzdESClr3c1N338/jECa2eexDcU+tQXFFF2s7 JcQk781bbIjqQgQmcRZ24iUTRXCn2ZmsHP0v5DBJdIr4kGqg9U++vsrpb0aeL6IIate7 v08dBOzt/wamyFON4vSpgVKzUsjFLlzAAZwwU8Szi9zXu6JwFtTx2tf9DjRpL0qSqnYV W3Ai7DZyFrR6YdNF+oMMCSPGk/6lz5ltyedctFkBq7Jm87G8eCPA9V/vzfZNXTmWDDx/ mdMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020414; x=1697625214; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tXtc55X9ZMWnLYaJ7rtH4hZORRpdhmNZnt+nFsO0Mb4=; b=e2eLKPqtK05a0UubmwNOWk3w6l3CiKUdWoFehXkXbyeXjzIBIc/xOJwE2JDu/0Jits 90jzpPX2r1I/uSAb5q/Nd9uykJ472jF8T1Wxl5+bFZgVcR/uGR1w2Iloq2bCTnhfdd7G kJsfrB91aLZeiwFeG6GXhDbPomeuH/AXDcyGxL/aRWYkpfEOp8H7e8vqRKUxermz18Vf zt4O3kRM9VdyU7G+fB9jk5RCibRtDUH5oYwYajxnt43bZ4tUMvLrFTRvZmfnSc9a/Bpj iVVSlR/ckqys7YoB7I0ldxF+os0tgV3bWng2+OIGglQ5ulBcr/ALpj2JPuJwFfcq8Lb8 +JeA== X-Gm-Message-State: AOJu0YzeyOZhmRcH9B/u7EwU97f2MxxH8l0rnXpwib5RQYTqTVOSthAt i1cgEAv0QOkxsA3qiv6OxR626g== X-Google-Smtp-Source: AGHT+IHvh45bFG36ODYSOlybfFcbv+UXlU8u3Kba5s/Lmmk+et8vANSxZNiU1SDpRBG/Re/SaiYu7Q== X-Received: by 2002:a05:6000:24d:b0:32d:84a3:f3fe with SMTP id m13-20020a056000024d00b0032d84a3f3femr1147488wrz.41.1697020414270; Wed, 11 Oct 2023 03:33:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s13-20020adfeccd000000b003198a9d758dsm15094918wro.78.2023.10.11.03.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 367431FFBB; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 10/25] plugins: Check if vCPU is realized Date: Wed, 11 Oct 2023 11:33:14 +0100 Message-Id: <20231011103329.670525-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki The created member of CPUState tells if the vCPU thread is started, and will be always false for the user space emulation that manages threads independently. Use the realized member of DeviceState, which is valid for both of the system and user space emulation. Fixes: 54cb65d858 ("plugin: add core code") Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-4-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-11-alex.bennee@linaro.org> diff --git a/plugins/core.c b/plugins/core.c index 3c4e26c7ed..fcd33a2bff 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -64,7 +64,7 @@ static void plugin_cpu_update__locked(gpointer k, gpointer v, gpointer udata) CPUState *cpu = container_of(k, CPUState, cpu_index); run_on_cpu_data mask = RUN_ON_CPU_HOST_ULONG(*plugin.mask); - if (cpu->created) { + if (DEVICE(cpu)->realized) { async_run_on_cpu(cpu, plugin_cpu_update__async, mask); } else { plugin_cpu_update__async(cpu, mask); From patchwork Wed Oct 11 10:33:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zTffMfkY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58MN5K89z1yqN for ; Wed, 11 Oct 2023 21:36:32 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXN-0001eG-IA; Wed, 11 Oct 2023 06:33:57 -0400 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 1qqWX6-0001Ky-Mi for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX4-0005FM-Bz for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:40 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-405524e6769so4808975e9.1 for ; Wed, 11 Oct 2023 03:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020416; x=1697625216; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IOZHj2WDZdrEovxhRhKdAFEERTpyPMh/xQMpzlYqBTI=; b=zTffMfkYEWsiryCv23xGmYen7FK462DMrXCtUUv886xYqsQhFi2j2EiUP8txYU6i47 1y1nLEpRAdjSmDayJtkikQe4W7ELcQLBWty90xiHa27h6oFjcwBrsjRlkln/8ru+eadC ccUZPEVvstGme921XVVuvLynoYz2axWEDMcb+uYNNexnPGzeFkiKtTjNE/WIWdjTztYJ b1MERWCxk8OXVt72gyXLaFuUgF/+EBCSjfxrRNpuftEedZP5WkqKU+rZM+WEalQPN0Bd pmvjKUwpLBnGN7bf0X0slAMEhm68Jk94xSN7WeF624nkrMSdUPaYdaLOWv125KxBtBlh l2hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020416; x=1697625216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IOZHj2WDZdrEovxhRhKdAFEERTpyPMh/xQMpzlYqBTI=; b=mhvxjesjWmHaAT0JacG+z9CosoeZwtNmgjhT5RoNa3iB6mrexuqWoqDUVAr6KmWjNU Com/5d5XmKYqoI+Tjy3hUtvwOReVs8K02ZzxVg5jH94hjei2x5Opr5b8TNyP+IMynicm crfkzpX4mK5FVxvS6+/6VVQgpW2HHz5rEIjdAjXCUXPuDZsls6CRniF4PP1uRHFraYe4 QQUK7oquOkt2zlBy5nB8ZQ5JnqvDle9UwDoaWusfZP0RJWSeTrKIw/kN4W1JOKyfv6Mn 7tyBg47Q0or5qfXLziaMIBGchm3awbghkks36dY39Cin1fUikyGbiher+qBtpTSZZr/9 orDg== X-Gm-Message-State: AOJu0YxwBBWcleDMXnuEjT5VpzmhGuspXyx2e6jQYTsIW4z63Vm97Cqw mCVK0SPt/9lWrZQEy5vdrNAL1A== X-Google-Smtp-Source: AGHT+IEaSA2nVY6MikEuO9DzrSFymQ2DRYkAUClH1XBRl6SEGQs/IlFn0aX3Y18Rk+UJKXHzCPogyg== X-Received: by 2002:a7b:c044:0:b0:3fb:c075:b308 with SMTP id u4-20020a7bc044000000b003fbc075b308mr16426874wmc.12.1697020416294; Wed, 11 Oct 2023 03:33:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ay20-20020a05600c1e1400b0040640073d25sm16646526wmb.16.2023.10.11.03.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4D7821FFC4; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 11/25] contrib/plugins: Use GRWLock in execlog Date: Wed, 11 Oct 2023 11:33:15 +0100 Message-Id: <20231011103329.670525-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki execlog had the following comment: > As we could have multiple threads trying to do this we need to > serialise the expansion under a lock. Threads accessing already > created entries can continue without issue even if the ptr array > gets reallocated during resize. However, when the ptr array gets reallocated, the other threads may have a stale reference to the old buffer. This results in use-after-free. Use GRWLock to properly fix this issue. Fixes: 3d7caf145e ("contrib/plugins: add execlog to log instruction execution and memory access") Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20230912224107.29669-5-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-12-alex.bennee@linaro.org> diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 7129d526f8..82dc2f584e 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -19,7 +19,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; /* Store last executed instruction on each vCPU as a GString */ static GPtrArray *last_exec; -static GMutex expand_array_lock; +static GRWLock expand_array_lock; static GPtrArray *imatches; static GArray *amatches; @@ -28,18 +28,16 @@ static GArray *amatches; * Expand last_exec array. * * As we could have multiple threads trying to do this we need to - * serialise the expansion under a lock. Threads accessing already - * created entries can continue without issue even if the ptr array - * gets reallocated during resize. + * serialise the expansion under a lock. */ static void expand_last_exec(int cpu_index) { - g_mutex_lock(&expand_array_lock); + g_rw_lock_writer_lock(&expand_array_lock); while (cpu_index >= last_exec->len) { GString *s = g_string_new(NULL); g_ptr_array_add(last_exec, s); } - g_mutex_unlock(&expand_array_lock); + g_rw_lock_writer_unlock(&expand_array_lock); } /** @@ -51,8 +49,10 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info, GString *s; /* Find vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); g_assert(cpu_index < last_exec->len); s = g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); /* Indicate type of memory access */ if (qemu_plugin_mem_is_store(info)) { @@ -80,10 +80,14 @@ static void vcpu_insn_exec(unsigned int cpu_index, void *udata) GString *s; /* Find or create vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); if (cpu_index >= last_exec->len) { + g_rw_lock_reader_unlock(&expand_array_lock); expand_last_exec(cpu_index); + g_rw_lock_reader_lock(&expand_array_lock); } s = g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); /* Print previous instruction in cache */ if (s->len) { From patchwork Wed Oct 11 10:33:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Lm24iaex; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Kb0f7Rz23jd for ; Wed, 11 Oct 2023 21:34:59 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXL-0001d9-Dp; Wed, 11 Oct 2023 06:33:55 -0400 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 1qqWX7-0001LA-Ee for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX4-0005FS-Bs for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:41 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4056ce55e7eso62298165e9.2 for ; Wed, 11 Oct 2023 03:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020416; x=1697625216; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gP/AsfqCLVva1mwRREqIfk6mLOF5khzgzINRxX/XF8k=; b=Lm24iaexqTaa1zLyDJzCYnQUSTEfhnUcopvw3VZyQsVNyknp+RnCzxx2ZJpqzBXsSF arY3lj3BktNUNO1mQv1jgv0SDYHvsDTwtzNSrpNHu0c6uRLL85Q5hBQLyhNrCClCbdNi jAaTsJ1GNmnpcLRFyC9xA0HfBDplw/9T3xN3gUrGfwNCn+oggGGWBpo3YoFhbyMZ6ybx 3XyL1ntzXxAR1b4jKT0XzAjk/LxUacgFrRLsY+wt2FxUxk8RJl7izKS/JoHca5Swdo2U ILMSXR6M6iq2+MPgvvusyDciof6teptBjXMJXDbufoePQ48WH2jo5hG18uKUo17pC244 wKUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020416; x=1697625216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gP/AsfqCLVva1mwRREqIfk6mLOF5khzgzINRxX/XF8k=; b=J+nE6FKpmDqey5a471U7VvZeDzQ9nVq0LqSghOySXPHe3FJVqvCc+o3OxhmUlzSKRE q5ngdGYzLLvU0+jEXuQ/9zvEsDbAHJ5KPrEOrgnSi/PG1RSuwE7s1Ira0l7QfvRjiWvM RybHCbkNdpWNm5UIRFd1VY1gdnRrsxy47i/KMB9AgLUxwGQUSUnyr2r8WTlQInQ/sTVK iq12tV6URiy7GVeWZvLsf8KN1Ey+ZYviXM9AxtkV1MZIclMnoJ9qMr1sGBNm1F2hUD9y TINfNlHJ35HR7ZeuZluqsqcphLKEJP6kSH8QsuwnEW12/DcbZ1LpJbs5ZmYJLz8QLF+1 /v3g== X-Gm-Message-State: AOJu0YzsY1MjwghU/iI1i/+7YM7NkbKgQBuN2JpUq+MVjluHyWLx+RgT 9ggHcgVo3UQNyFguLLVXQynTgw== X-Google-Smtp-Source: AGHT+IE42bdal35Kzsri4xjnUK2KYwjS61ANQz/tokBgJGU9aTN/DLpHQEkIcX+4aTuStVk6pdylmw== X-Received: by 2002:a05:600c:d1:b0:405:3a3d:6f42 with SMTP id u17-20020a05600c00d100b004053a3d6f42mr18160916wmm.39.1697020416542; Wed, 11 Oct 2023 03:33:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b004063977eccesm18794448wmq.42.2023.10.11.03.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 746A61FFBD; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , John Snow , Cleber Rosa Subject: [PULL 12/25] gdbstub: Introduce GDBFeature structure Date: Wed, 11 Oct 2023 11:33:16 +0100 Message-Id: <20231011103329.670525-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20230912224107.29669-6-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-13-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index 9e7dec4a58..c3cc12dc29 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2842,7 +2842,7 @@ F: include/exec/gdbstub.h F: include/gdbstub/* F: gdb-xml/ F: tests/tcg/multiarch/gdbstub/ -F: scripts/feature_to_c.sh +F: scripts/feature_to_c.py F: scripts/probe-gdb-support.py Memory API diff --git a/meson.build b/meson.build index 79aef19bdc..bd65a111aa 100644 --- a/meson.build +++ b/meson.build @@ -3693,7 +3693,7 @@ common_all = static_library('common', dependencies: common_all.dependencies(), name_suffix: 'fa') -feature_to_c = find_program('scripts/feature_to_c.sh') +feature_to_c = find_program('scripts/feature_to_c.py') if targetos == 'darwin' entitlement = find_program('scripts/entitlement.sh') diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 16a139043f..705be2c5d7 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -10,6 +10,11 @@ #define GDB_WATCHPOINT_READ 3 #define GDB_WATCHPOINT_ACCESS 4 +typedef struct GDBFeature { + const char *xmlname; + const char *xml; +} GDBFeature; + /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); @@ -48,7 +53,7 @@ void gdb_set_stop_cpu(CPUState *cpu); */ bool gdb_has_xml(void); -/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ -extern const char *const xml_builtin[][2]; +/* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ +extern const GDBFeature gdb_static_features[]; #endif diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 4f3762fccf..bba2640293 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -408,11 +408,11 @@ static const char *get_feature_xml(const char *p, const char **newp, } } /* Is it one of the encoded gdb-xml/ files? */ - for (int i = 0; xml_builtin[i][0]; i++) { - const char *name = xml_builtin[i][0]; + for (int i = 0; gdb_static_features[i].xmlname; i++) { + const char *name = gdb_static_features[i].xmlname; if ((strncmp(name, p, len) == 0) && strlen(name) == len) { - return xml_builtin[i][1]; + return gdb_static_features[i].xml; } } diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c index 2b7aee50d3..580e20702b 100644 --- a/stubs/gdbstub.c +++ b/stubs/gdbstub.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" -#include "exec/gdbstub.h" /* xml_builtin */ +#include "exec/gdbstub.h" /* gdb_static_features */ -const char *const xml_builtin[][2] = { - { NULL, NULL } +const GDBFeature gdb_static_features[] = { + { NULL } }; diff --git a/scripts/feature_to_c.py b/scripts/feature_to_c.py new file mode 100755 index 0000000000..bcbcb83beb --- /dev/null +++ b/scripts/feature_to_c.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later + +import os, sys + +def writeliteral(indent, bytes): + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + for c in bytes: + if not quoted: + sys.stdout.write('\n') + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + if c == b'"'[0]: + sys.stdout.write('\\"') + elif c == b'\\'[0]: + sys.stdout.write('\\\\') + elif c == b'\n'[0]: + sys.stdout.write('\\n"') + quoted = False + elif c >= 32 and c < 127: + sys.stdout.write(c.to_bytes(1, 'big').decode()) + else: + sys.stdout.write(f'\{c:03o}') + + if quoted: + sys.stdout.write('"') + +sys.stdout.write('#include "qemu/osdep.h"\n' \ + '#include "exec/gdbstub.h"\n' \ + '\n' + 'const GDBFeature gdb_static_features[] = {\n') + +for input in sys.argv[1:]: + with open(input, 'rb') as file: + read = file.read() + + sys.stdout.write(' {\n') + writeliteral(8, bytes(os.path.basename(input), 'utf-8')) + sys.stdout.write(',\n') + writeliteral(8, read) + sys.stdout.write('\n },\n') + +sys.stdout.write(' { NULL }\n};\n') diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh deleted file mode 100644 index c1f67c8f6a..0000000000 --- a/scripts/feature_to_c.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# Convert text files to compilable C arrays. -# -# Copyright (C) 2007 Free Software Foundation, Inc. -# -# This file is part of GDB. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . - -if test -z "$1"; then - echo "Usage: $0 INPUTFILE..." - exit 1 -fi - -for input; do - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - - ${AWK:-awk} 'BEGIN { n = 0 - printf "#include \"qemu/osdep.h\"\n" - print "static const char '$arrayname'[] = {" - for (i = 0; i < 255; i++) - _ord_[sprintf("%c", i)] = i - } { - split($0, line, ""); - printf " " - for (i = 1; i <= length($0); i++) { - c = line[i] - if (c == "'\''") { - printf "'\''\\'\'''\'', " - } else if (c == "\\") { - printf "'\''\\\\'\'', " - } else if (_ord_[c] >= 32 && _ord_[c] < 127) { - printf "'\''%s'\'', ", c - } else { - printf "'\''\\%03o'\'', ", _ord_[c] - } - if (i % 10 == 0) - printf "\n " - } - printf "'\''\\n'\'', \n" - } END { - print " 0 };" - }' < $input -done - -echo -echo '#include "exec/gdbstub.h"' -echo "const char *const xml_builtin[][2] = {" - -for input; do - basename=$(echo $input | sed 's,.*/,,') - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," -done - -echo " { (char *)0, (char *)0 }" -echo "};" From patchwork Wed Oct 11 10:33:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zbVG5kHG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58KF5TRDz23jd for ; Wed, 11 Oct 2023 21:34:41 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXL-0001dG-FS; Wed, 11 Oct 2023 06:33:55 -0400 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 1qqWXA-0001MY-0s for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:45 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX5-0005GC-VA for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:43 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4054f790190so65569015e9.2 for ; Wed, 11 Oct 2023 03:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020418; x=1697625218; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tXzt6XTvV2zpelaBYxfVQmisWGRyjvu/qrEXej/hrKQ=; b=zbVG5kHGdfSek5yoWVOYYwRrrWl9fMYexV9XCZrpRSXSZEpmjms14VqwlX8KRUCKMz BLZ7uHA9468GPEUpv2tAfwKk/nDgINEKY750O7uaz5y7KbBq211ZlpiyYKbXV5YENcuP mv5axBxAFg0rLqIbeE5Vrqe1CLdeEf9B5PhAzBaK8BrcSfAS8+RsxbLo4k5xJ/uORhwG TDOPIaxID0tfmhVnwWxkLWehCTeDAZnz49IURSB7vUi+84w4c64gRiunKfkiEaRCpw5U Fm+Zi7GO8dAw8pdhp7aswhmfPh4LFducAGzKR9toKlja6iwl5IuMhvDwHHHiMrAP1zUQ 1Wfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020418; x=1697625218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tXzt6XTvV2zpelaBYxfVQmisWGRyjvu/qrEXej/hrKQ=; b=R4Kl9AxE/8Lr7J0Dms1HRaGvS2AFzH6ozemB/aM+v642/AMO96/3uIR9Ys9aSShVgA m2oCkRac/pO0m+69LVzO3tPFUh1W1niuv4XaKC/nnMYPFQ9o4IE+wewA8oG4HphlWzLY IWkNEzZEemA0OUyiwOK0cReysPY7zTA+H1DXrlTpJOxunUuVHaOx3wsM9aBL/fZ454QO n50h8hB3dcHj4uqSuzpvwwlQIzzNlVW8ns8OQ4HC+CzA19bsoauICfwfs4Gqux2EWxGG URQbQoxVkBcp9ZBXJZafPIL8aNfNNAOromfVhPUtmOEj4LJCnT/2mFY3q0Wcsfkwxtn5 h+Qw== X-Gm-Message-State: AOJu0Yyx1GXpAkYGfYSpN/zgqvyh0BI6Uh8X2hZa1R9WpbTxI+wXNBBm Sd+AvexE6lfksuycILHUPNgWag== X-Google-Smtp-Source: AGHT+IGZXo5PcBJpEYNVekjkJsyYaRe/aQ2hywZk2b6aI2Zjxwo2FCn/eLTyrFVsXEBAogpjd9Ms/w== X-Received: by 2002:a05:600c:2211:b0:402:fec4:fddc with SMTP id z17-20020a05600c221100b00402fec4fddcmr18291721wml.17.1697020418034; Wed, 11 Oct 2023 03:33:38 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i2-20020a05600c290200b004063d8b43e7sm18722043wmd.48.2023.10.11.03.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8B65A1FFC5; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 13/25] target/arm: Move the reference to arm-core.xml Date: Wed, 11 Oct 2023 11:33:17 +0100 Message-Id: <20231011103329.670525-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki Some subclasses overwrite gdb_core_xml_file member but others don't. Always initialize the member in the subclasses for consistency. This especially helps for AArch64; in a following change, the file specified by gdb_core_xml_file is always looked up even if it's going to be overwritten later. Looking up arm-core.xml results in an error as it will not be embedded in the AArch64 build. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson Message-Id: <20230912224107.29669-7-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-14-alex.bennee@linaro.org> diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 831295d7cd..b65e8cfea3 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2392,7 +2392,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->sysemu_ops = &arm_sysemu_ops; #endif cc->gdb_num_core_regs = 26; - cc->gdb_core_xml_file = "arm-core.xml"; cc->gdb_arch_name = arm_gdb_arch_name; cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; @@ -2414,8 +2413,10 @@ static void arm_cpu_instance_init(Object *obj) static void cpu_register_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc = ARM_CPU_CLASS(oc); + CPUClass *cc = CPU_CLASS(acc); acc->info = data; + cc->gdb_core_xml_file = "arm-core.xml"; } void arm_cpu_register(const ARMCPUInfo *info) From patchwork Wed Oct 11 10:33:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JZCFaGk8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58LX4xwmz1yqN for ; Wed, 11 Oct 2023 21:35:48 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXJ-0001ac-Gr; Wed, 11 Oct 2023 06:33:53 -0400 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 1qqWX8-0001LU-Ag for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:42 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX5-0005Fp-DO for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:42 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40651a726acso61653875e9.1 for ; Wed, 11 Oct 2023 03:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020418; x=1697625218; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jt1UXVJ9g1e9zBvoXUT5QK8FO+jhEnDupj0uz8RWS3E=; b=JZCFaGk8yhL81twwBfn0bod0eTaQcY6OFU2NcfFEDQLMYKcTp6Du8x+Q7qWFtjAJNk QJMAwUVaXnw4mjln6FZZF5C5Q5FMYeC9siyJbid0KLM5Rou5AuvJFv3QI1R3bHArx8UF k8AEHhTDiy1nr3iNFbki6CBeyAD4miw6+i+MfbAVJeiLFl4lfiOyzFW/HKkvgUpNv79G EgEwJV6I7Y/aH5jNdMYW6dwJxhI4NZVTpLItbcivkKL70Lv7ePJePFtI/a9OtjarjgzR dkfu/tz7/XzweabqAbSLTg/zLS6rhJcGsrjgLzxQyvnI6rDNV/aUd5vKvkfTL0OZp5ck otsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020418; x=1697625218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jt1UXVJ9g1e9zBvoXUT5QK8FO+jhEnDupj0uz8RWS3E=; b=YZ/gxwQOsMZGUDEJk+7eFAOQbIIeuI3q4zlfBdUCkAuaa23nUMCQR7OAPMm3oykzcX WpsRp9zmr3f8y5bDWBj6d2BmPujwxm1juYqFAEnvATQmXrrpZdHd7UNma5rEYhYotG9l 7ZIebeEkueOTD+WLiP86Mjm9RjH4onxDutgsru7QN8NhuF1Qkrn0WGZb8TsOU6kSW8/j PJ1gR/vDXjtIQQpoYFTWGhaUdjJWCVpzGYHLmqx26YqaJjjI0c8jYSBJ8FBotvL9AKPi 4vDIujj2jdxnibcgfarEOneUwjMqB7a9BcOrktLtnrO8SdpAWKEOCoCPTaweUX5pYjFq v66A== X-Gm-Message-State: AOJu0YzalFwNLaTEq6a+7xsu8hgpNuZRJ9jr5DekiLY3KpnObZI1b/ai 4udWIbQ20wLioDSXYHk1A+1tmg== X-Google-Smtp-Source: AGHT+IHKt9A4VwJUABOF1oNg861R0GoB4HmdWSyRTrwkbEXUBOynprnQ4WdiI+Hnnl6wJ1GqY+c+Yg== X-Received: by 2002:adf:edc3:0:b0:321:56af:5ef9 with SMTP id v3-20020adfedc3000000b0032156af5ef9mr15095927wro.70.1697020417859; Wed, 11 Oct 2023 03:33:37 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t11-20020a5d534b000000b003232380ffd5sm15085477wrv.106.2023.10.11.03.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC4111FFC6; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Peter Maydell , Song Gao , Xiaojuan Yang , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Palmer Dabbelt , Bin Meng , Weiwei Li , Liu Zhiwei , Thomas Huth , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Bastian Koppelmann , qemu-arm@nongnu.org (open list:ARM TCG CPUs), qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs), qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs), qemu-s390x@nongnu.org (open list:S390 general arch...) Subject: [PULL 14/25] hw/core/cpu: Return static value with gdb_arch_name() Date: Wed, 11 Oct 2023 11:33:18 +0100 Message-Id: <20231011103329.670525-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki All implementations of gdb_arch_name() returns dynamic duplicates of static strings. It's also unlikely that there will be an implementation of gdb_arch_name() that returns a truly dynamic value due to the nature of the function returning a well-known identifiers. Qualify the value gdb_arch_name() with const and make all of its implementations return static strings. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20230912224107.29669-8-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-15-alex.bennee@linaro.org> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e02bc5980f..7b8347ed5a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -165,7 +165,7 @@ struct CPUClass { vaddr (*gdb_adjust_breakpoint)(CPUState *cpu, vaddr addr); const char *gdb_core_xml_file; - gchar * (*gdb_arch_name)(CPUState *cpu); + const gchar * (*gdb_arch_name)(CPUState *cpu); const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 15803bc313..c881c67a8b 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -221,7 +221,7 @@ void destroy_ppc_opcodes(PowerPCCPU *cpu); /* gdbstub.c */ void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *ppc); -gchar *ppc_gdb_arch_name(CPUState *cs); +const gchar *ppc_gdb_arch_name(CPUState *cs); /** * prot_for_access_type: diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index bba2640293..a20169c27b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -380,10 +380,9 @@ static const char *get_feature_xml(const char *p, const char **newp, ""); if (cc->gdb_arch_name) { - g_autofree gchar *arch = cc->gdb_arch_name(cpu); g_string_append_printf(xml, "%s", - arch); + cc->gdb_arch_name(cpu)); } g_string_append(xml, "gdb_core_xml_file); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b65e8cfea3..6c6c551573 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2319,15 +2319,15 @@ static Property arm_cpu_properties[] = { DEFINE_PROP_END_OF_LIST() }; -static gchar *arm_gdb_arch_name(CPUState *cs) +static const gchar *arm_gdb_arch_name(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; if (arm_feature(env, ARM_FEATURE_IWMMXT)) { - return g_strdup("iwmmxt"); + return "iwmmxt"; } - return g_strdup("arm"); + return "arm"; } #ifndef CONFIG_USER_ONLY diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 811f3b38c2..1cb9d5b81a 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -781,9 +781,9 @@ static void aarch64_cpu_finalizefn(Object *obj) { } -static gchar *aarch64_gdb_arch_name(CPUState *cs) +static const gchar *aarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("aarch64"); + return "aarch64"; } static void aarch64_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index cec5d2b7b6..3aab05ddad 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5916,12 +5916,12 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) memset(&env->user_features, 0, sizeof(env->user_features)); } -static gchar *x86_gdb_arch_name(CPUState *cs) +static const gchar *x86_gdb_arch_name(CPUState *cs) { #ifdef TARGET_X86_64 - return g_strdup("i386:x86-64"); + return "i386:x86-64"; #else - return g_strdup("i386"); + return "i386"; #endif } diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 2bea7ca5d5..ef1bf89dac 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -766,9 +766,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) #endif } -static gchar *loongarch32_gdb_arch_name(CPUState *cs) +static const gchar *loongarch32_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch32"); + return "loongarch32"; } static void loongarch32_cpu_class_init(ObjectClass *c, void *data) @@ -780,9 +780,9 @@ static void loongarch32_cpu_class_init(ObjectClass *c, void *data) cc->gdb_arch_name = loongarch32_gdb_arch_name; } -static gchar *loongarch64_gdb_arch_name(CPUState *cs) +static const gchar *loongarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch64"); + return "loongarch64"; } static void loongarch64_cpu_class_init(ObjectClass *c, void *data) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 2ad11510bf..778ef73bd7 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -589,12 +589,12 @@ static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -gchar *ppc_gdb_arch_name(CPUState *cs) +const gchar *ppc_gdb_arch_name(CPUState *cs) { #if defined(TARGET_PPC64) - return g_strdup("powerpc:common64"); + return "powerpc:common64"; #else - return g_strdup("powerpc:common"); + return "powerpc:common"; #endif } diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ac2b94b6a6..f5572704de 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2004,17 +2004,17 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static gchar *riscv_gdb_arch_name(CPUState *cs) +static const gchar *riscv_gdb_arch_name(CPUState *cs) { RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; switch (riscv_cpu_mxl(env)) { case MXL_RV32: - return g_strdup("riscv:rv32"); + return "riscv:rv32"; case MXL_RV64: case MXL_RV128: - return g_strdup("riscv:rv64"); + return "riscv:rv64"; default: g_assert_not_reached(); } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 4f7599d72c..6093ab0a12 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -282,9 +282,9 @@ static void s390_cpu_initfn(Object *obj) #endif } -static gchar *s390_gdb_arch_name(CPUState *cs) +static const gchar *s390_gdb_arch_name(CPUState *cs) { - return g_strdup("s390:64-bit"); + return "s390:64-bit"; } static Property s390x_cpu_properties[] = { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index d1477622e6..5ca666ee12 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -29,9 +29,9 @@ static inline void set_feature(CPUTriCoreState *env, int feature) env->features |= 1ULL << feature; } -static gchar *tricore_gdb_arch_name(CPUState *cs) +static const gchar *tricore_gdb_arch_name(CPUState *cs) { - return g_strdup("tricore"); + return "tricore"; } static void tricore_cpu_set_pc(CPUState *cs, vaddr value) From patchwork Wed Oct 11 10:33:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kEDeUdYL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58MP0z23z23jg for ; Wed, 11 Oct 2023 21:36:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXL-0001cD-3T; Wed, 11 Oct 2023 06:33:55 -0400 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 1qqWX9-0001MW-LT for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:45 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX5-0005Fn-R5 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-405361bba99so61509515e9.2 for ; Wed, 11 Oct 2023 03:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020417; x=1697625217; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0GGDMjiObwuIV+sEPGodU7jxWDpthevn5Vhw1E3Gt5g=; b=kEDeUdYLFo13z/NWmn6GI8mwLxYmhMsTn/E8ORFEp4qdii2aDeOz8H7YiuE52XXqIa o+EQ58/l9V5ijsJNKJ4Do+jHZKHwRM05Gbx+z0+GMrFmbQCGG2/N88gC01FJNDfL28Ab 0OdeYpSvZ5QgcUD+TZ7jV/Ofoy8QeSjKjCj3X+CITFQUKMTptX8JdKN0cC15WY87djV6 fRrFKNuQWYuCfSzPTNhLIDv/MxfJVmApN0TgzFIUr2FueS4FzUsbAwe14y7hIGzcFEye Pr+z/UVAjIG5SJgTIBspu7VMUgHWGoSN4vtvHFT2EC3POAAfbtQ7hW3Lcl412cCiX8p0 hE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020417; x=1697625217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0GGDMjiObwuIV+sEPGodU7jxWDpthevn5Vhw1E3Gt5g=; b=MFZvwH54FaoFW28uVz4A9I8k1hqE7lqg0cZuBg8RcloLoRiQ3+T1eNOZ0FN/Kt8ir6 sbt8pCii8Rq1H1bko3ipBnGZd7WxDAsz4c+ah8C54e8DMAtK+bTt4QoKFZWjJiaWLis5 KZeciEo8W3FvNaSB9yEkoT63BldpwZOm+I3wrclwmINbIa5LFDIkQPAYrORbTrVuiLB/ FmOmH6gwHwTqcVVX8FdE6B6hkpyrlbsbvNpLkJLC/bD9hFxf5Q/FovPLeWZ8k+ZuN112 +JME+H9GUYFaNB1CMo3ea9OrBYsAoVr7eFk/NQUH6OufIksvo0IGOGhdfTwMdqucleWI jtEw== X-Gm-Message-State: AOJu0YxK564PJFIeIQLdIDLusvT3F1281tV9isT/jNVzswkxHWhmIWyg Cy2FcIdMwzoDfhvTQBLnhCv6Lw== X-Google-Smtp-Source: AGHT+IFu4xuMgV+ah8GqtSkkt9T7mpKMWpiyy4LEIaTe6FRV2/JvoacyUOF0idKCjBVVG60PjuWV1Q== X-Received: by 2002:a1c:7209:0:b0:405:a30:151e with SMTP id n9-20020a1c7209000000b004050a30151emr18905129wmc.12.1697020417661; Wed, 11 Oct 2023 03:33:37 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f19-20020a1c6a13000000b00402d34ea099sm18671708wmc.29.2023.10.11.03.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D37081FFC7; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 15/25] gdbstub: Use g_markup_printf_escaped() Date: Wed, 11 Oct 2023 11:33:19 +0100 Message-Id: <20231011103329.670525-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-9-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-16-alex.bennee@linaro.org> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index a20169c27b..3dc847f835 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -373,28 +373,34 @@ static const char *get_feature_xml(const char *p, const char **newp, if (strncmp(p, "target.xml", len) == 0) { if (!process->target_xml) { GDBRegisterState *r; - GString *xml = g_string_new(""); + g_autoptr(GPtrArray) xml = g_ptr_array_new_with_free_func(g_free); - g_string_append(xml, - "" - ""); + g_ptr_array_add( + xml, + g_strdup("" + "" + "")); if (cc->gdb_arch_name) { - g_string_append_printf(xml, - "%s", - cc->gdb_arch_name(cpu)); + g_ptr_array_add( + xml, + g_markup_printf_escaped("%s", + cc->gdb_arch_name(cpu))); } - g_string_append(xml, "gdb_core_xml_file); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + cc->gdb_core_xml_file)); for (r = cpu->gdb_regs; r; r = r->next) { - g_string_append(xml, "xml); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + r->xml)); } - g_string_append(xml, ""); + g_ptr_array_add(xml, g_strdup("")); + g_ptr_array_add(xml, NULL); - process->target_xml = g_string_free(xml, false); + process->target_xml = g_strjoinv(NULL, (void *)xml->pdata); } return process->target_xml; } From patchwork Wed Oct 11 10:33:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Ay3YH6wv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Xc6YNDz1ypX for ; Wed, 11 Oct 2023 21:44:32 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgl-0008D2-SG; Wed, 11 Oct 2023 06:43:39 -0400 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 1qqWgj-0008At-PG for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:37 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgh-0007fB-3b for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406650da82bso61643145e9.3 for ; Wed, 11 Oct 2023 03:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021012; x=1697625812; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GPaasftMrVbbA875970yr+KsXKzf7HZNoY4yrQwF8Og=; b=Ay3YH6wvFeInz/4JZVMAYNkuLzH6bzNgOd+eBH9rmyPGqoJGhVjp9jXsEMJUwBUmW8 LKJm0Se4cY96r3YrHeDRZ4uWnf3nzBjNhbN9yBbgutjdqoozCoi/JsFoUwrbDU0dHr6A iYaPM+WWNutqLdebVQCAUWSMcCKUwZNJksssGfbFlNQo6AaRXUeuryrOvUQ0VwE0cIHq S2Pfde4D0tUDzeGANEpCtE0tStmkT/PwWbilDEE00f5pHbS2wmaJnFITFGsP8HthR9UW NLQPgG8s438ELw6S1foamXnCpR5xj2pNmFk4l7CL3gJvlAYDOwAZkzv7ga3vexmWt2ZT /n5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021012; x=1697625812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GPaasftMrVbbA875970yr+KsXKzf7HZNoY4yrQwF8Og=; b=wG5KPtv0z471zAdeCfZVlOnExIxvKQLcdLg2U0k/Tjl1mlFxZ5Cr5caZa17tHsZ/dD y+FheStELMBJIr1ojIzK4/aYlFwGdPmG/it5lUTgp9oZocoDIv2mYTfBV6+BkwttbnhV asHme11OtCAC2KngahlFCoRAqQb0NSMirobXMeYE08jcaCkgdWXvbpJLNV/NwLkg/wi+ JJeXv7qkV4oWmjqPnk2SNie1juMQ22MYTUCEC+8KurPwlWuQrzfjcjiODDzpIFz52wYl 6fD2z/6jHDDcnI5GaZtLSTn4Z+ruNjnNZQO5TLR5E7SC0RUP3wqbfmxXfdSYS1bC+nX/ W8rw== X-Gm-Message-State: AOJu0Yxvy6KbDuHXwwgSTqKNe0k6nReQohs/FnBLsAPX4t9a3p5C5c6z kYlv3csMkie3radBHWOlBybf1Q== X-Google-Smtp-Source: AGHT+IFzEy64ewUPAUmpiwMh+dXI7S8AwXRB27XR7BJ3qE1cN9uymFBLg2mD/Cvo/6DAnLak0uhZpQ== X-Received: by 2002:a1c:ed02:0:b0:401:38dc:891c with SMTP id l2-20020a1ced02000000b0040138dc891cmr17641553wmh.5.1697021012597; Wed, 11 Oct 2023 03:43:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p5-20020a1c7405000000b004064e3b94afsm18852827wmc.4.2023.10.11.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EAFFC1FFC8; Wed, 11 Oct 2023 11:33:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 16/25] target/arm: Remove references to gdb_has_xml Date: Wed, 11 Oct 2023 11:33:20 +0100 Message-Id: <20231011103329.670525-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20230912224107.29669-10-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-17-alex.bennee@linaro.org> diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index 8fc8351df7..b7ace24bfc 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -46,21 +46,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) /* Core integer register. */ return gdb_get_reg32(mem_buf, env->regs[n]); } - if (n < 24) { - /* FPA registers. */ - if (gdb_has_xml()) { - return 0; - } - return gdb_get_zeroes(mem_buf, 12); - } - switch (n) { - case 24: - /* FPA status register. */ - if (gdb_has_xml()) { - return 0; - } - return gdb_get_reg32(mem_buf, 0); - case 25: + if (n == 25) { /* CPSR, or XPSR for M-profile */ if (arm_feature(env, ARM_FEATURE_M)) { return gdb_get_reg32(mem_buf, xpsr_read(env)); @@ -100,21 +86,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->regs[n] = tmp; return 4; } - if (n < 24) { /* 16-23 */ - /* FPA registers (ignored). */ - if (gdb_has_xml()) { - return 0; - } - return 12; - } - switch (n) { - case 24: - /* FPA status register (ignored). */ - if (gdb_has_xml()) { - return 0; - } - return 4; - case 25: + if (n == 25) { /* CPSR, or XPSR for M-profile */ if (arm_feature(env, ARM_FEATURE_M)) { /* From patchwork Wed Oct 11 10:33:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=duwdJd5I; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58XX65bQz1ypX for ; Wed, 11 Oct 2023 21:44:28 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgk-0008Bx-F3; Wed, 11 Oct 2023 06:43:38 -0400 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 1qqWgi-0008AU-Jv for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:36 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgh-0007el-0k for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:36 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-405497850dbso61738135e9.0 for ; Wed, 11 Oct 2023 03:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021011; x=1697625811; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NU8OZESOHGJQIdZ7oiM9dX/SvYUcS2a/CZ+IZrzLAg4=; b=duwdJd5IGk+YyczDbO8g4yxC01x/9ppHE7Jks5AdH7zA/M8/q7ElswUOeoj6zD1y/4 KvYLdccZ2Uovum+WV/6OhmKliC94pVSdCBm3UvS6dv46yMNKlRejbyHNq2mPppRIzI17 7F4K2gYO8DMlLzTrhPFZmGq51t9DE1Hk4qOpLn1aHFl8kGA7IlMM9/2WRMpjf0SEmdCA ryisZcoYTzygqZTTi3/IUCXHRhAg7D0Od3oFnLVk8d7l6kUvVVbqwgZcryL8diWOAoYd Qbsf5a21keD3d6ek1gMWtxpxwSqYYpC/RaTEo6KMXaxzLrsT4DrSuKREVac1xL8tpXkl asFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021011; x=1697625811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NU8OZESOHGJQIdZ7oiM9dX/SvYUcS2a/CZ+IZrzLAg4=; b=MagrerC4mcr21SS2NeL4G6AxVHyf8QewYWglwbzzFoFKAhbPw1Rk2VKmFh9simLyoM PDtZTmqpU76pAfnNN/2O+mYPgKAZ9rBwbLpVG9dMzJkue0kXTEnxnEppXFHSBFPWCYUR GG8LUw0IJxkmG4FsfVPE9JnpGwNNodCKzurHYkknHz0Qyjraz1Hmx3FzQn8adob9IIoS xK43B7GaVUbuZpcbHt8zNw0uOJU34zofrsiC2IodZdPJ1FwOriRLAjV/IXGZbGjeJOI7 Va/YfHUla7oQm1ks+frnwgnwIXOSsMPe0Z3dviY3i7IFPETU9708TKjqd63tusD3WrHb BAaw== X-Gm-Message-State: AOJu0Yw8qLrzrNsUKm45/lchr8xqVLx8pBtnUQJwFWLRNJ2akfyx3NlJ H64vVbWW9lvAFjnQ+Z7kp9ngZQnr0jWy4JXmpqk= X-Google-Smtp-Source: AGHT+IHd8d9eWCHtysl3i5nBfGjDAAmBjNUfzCQPGDksJ6m64mK7J4CB3TX97Yg2EjPhQSxXI54Xwg== X-Received: by 2002:a7b:c40a:0:b0:401:23fc:1f92 with SMTP id k10-20020a7bc40a000000b0040123fc1f92mr18871691wmi.25.1697021011267; Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s17-20020a1cf211000000b00405623e0186sm18844813wmc.26.2023.10.11.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0D1121FFC9; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs) Subject: [PULL 17/25] target/ppc: Remove references to gdb_has_xml Date: Wed, 11 Oct 2023 11:33:21 +0100 Message-Id: <20231011103329.670525-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-11-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-18-alex.bennee@linaro.org> diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 778ef73bd7..ec5731e5d6 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -54,12 +54,6 @@ static int ppc_gdb_register_len(int n) case 0 ... 31: /* gprs */ return sizeof(target_ulong); - case 32 ... 63: - /* fprs */ - if (gdb_has_xml()) { - return 0; - } - return 8; case 66: /* cr */ case 69: @@ -74,12 +68,6 @@ static int ppc_gdb_register_len(int n) case 68: /* ctr */ return sizeof(target_ulong); - case 70: - /* fpscr */ - if (gdb_has_xml()) { - return 0; - } - return sizeof(target_ulong); default: return 0; } @@ -132,9 +120,6 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n) if (n < 32) { /* gprs */ gdb_get_regl(buf, env->gpr[n]); - } else if (n < 64) { - /* fprs */ - gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32)); } else { switch (n) { case 64: @@ -158,9 +143,6 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n) case 69: gdb_get_reg32(buf, cpu_read_xer(env)); break; - case 70: - gdb_get_reg32(buf, env->fpscr); - break; } } mem_buf = buf->data + buf->len - r; From patchwork Wed Oct 11 10:33:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=p26hoboc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Yj6XfPz23jg for ; Wed, 11 Oct 2023 21:45:29 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgm-0008D9-F4; Wed, 11 Oct 2023 06:43:40 -0400 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 1qqWgk-0008BH-00 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:38 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgh-0007fR-Je for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:37 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bffc55af02so79468011fa.2 for ; Wed, 11 Oct 2023 03:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021014; x=1697625814; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zawTcP6zVPEQ87O8NTB4Qxv3jWF5guFODyudtyjxLaU=; b=p26hobocXcbl8QWHT/iWXdM4CUAcEz6+5+/gVE06ENLzymsnURHCplHVk8Mi7QtLCz pgvY0M0unJ6jLVDwjsD4/nwfI0f8BRXiuAsUkDqoRRerwvoqfrFOSacrXr3CvfNo56PC MTMwbLjTjT2ECkuQupw/+XOoJ1fW/7QOaOIzc6lzURY4NtglOHSzBuPFk4s7gcCJ9ysW REo4+NYJd5mNbgk24KqiX1Tbbxy2j4/ofwWdbErZTkBS2T/j52XYf9h+kyZmFoUmf3CT HeAe+47I8fy5KyrM+IT1iHeQPP7pv7grpYAYHot4BDnvxc9ef1EEgu9kXl8ocstpRZgP OiIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021014; x=1697625814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zawTcP6zVPEQ87O8NTB4Qxv3jWF5guFODyudtyjxLaU=; b=DB/WJr1HBc7+YQUPjVJ0J8aSm6gB+JkRkwuHiiN4LT3kt1FxrEZWofmUNdv6/wJi0C QTx3mdN447hXg+6tnfs+lWkHUBdIUpdgX6i74h1jZv7ow7MzvZzNMd8j/Z9xD1D1uKSh 3Zs2AZP2rHpTbs4FMizeFh6plqUTWhWT/DdNkwSyAtGgQ0jk4SQrOU+jFyjEoCKchoBB tTd7yC69BDAZSutN2k1B/KqIx9l4AnSy/O6jWTOuaCv0jZX6EuzJ0/jVuta7ea1ICPVe PbKEPu27VdYJQ2ZHelmqRRAhElsGEovvU3IQf3vp9K1wuM+AGyQN7YVEIphVJ458D3aS 24sg== X-Gm-Message-State: AOJu0YwTZDfOaC22tQVjBuSqE5eC12VIb/3NlUos0yRmG0LX8MO8Dwqe Bj1GTTVKX4jRacpI3ciTqwVA2BWypezbhzuU154= X-Google-Smtp-Source: AGHT+IGG7zzirkyqSq5QKfcAL1iG58XT77mr23AtpwVXn6/W/nN96MODC7RkeYhqFyty+vo1GpYGPw== X-Received: by 2002:a2e:2e05:0:b0:2bd:180d:67b1 with SMTP id u5-20020a2e2e05000000b002bd180d67b1mr17655466lju.51.1697021013967; Wed, 11 Oct 2023 03:43:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4-20020a05600c248400b004060f0a0fd5sm16443181wms.13.2023.10.11.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 288981FFCA; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 18/25] gdbstub: Remove gdb_has_xml variable Date: Wed, 11 Oct 2023 11:33:22 +0100 Message-Id: <20231011103329.670525-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Reviewed-by: Alistair Francis Message-Id: <20230912224107.29669-12-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-19-alex.bennee@linaro.org> diff --git a/gdbstub/internals.h b/gdbstub/internals.h index f7fd1bede5..465c24b36e 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -32,8 +32,6 @@ enum { typedef struct GDBProcess { uint32_t pid; bool attached; - - /* If gdb sends qXfer:features:read:target.xml this will be populated */ char *target_xml; } GDBProcess; diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 705be2c5d7..1a01c35f8e 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -45,14 +45,6 @@ int gdbserver_start(const char *port_or_device); void gdb_set_stop_cpu(CPUState *cpu); -/** - * gdb_has_xml() - report of gdb supports modern target descriptions - * - * This will report true if the gdb negotiated qXfer:features:read - * target descriptions. - */ -bool gdb_has_xml(void); - /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ extern const GDBFeature gdb_static_features[]; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 3dc847f835..62608a5389 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -349,11 +349,6 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) } } -bool gdb_has_xml(void) -{ - return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml; -} - static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { @@ -1086,11 +1081,6 @@ static void handle_set_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (params->len != 2) { gdb_put_packet("E22"); return; @@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (!params->len) { gdb_put_packet("E14"); return; From patchwork Wed Oct 11 10:33:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=YZE3CG1J; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Kz6Rwbz1yqN for ; Wed, 11 Oct 2023 21:35:19 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXG-0001YI-Qw; Wed, 11 Oct 2023 06:33:50 -0400 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 1qqWXB-0001OP-3w for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:47 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX7-0005H0-3g for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:44 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-503397ee920so8441233e87.1 for ; Wed, 11 Oct 2023 03:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020419; x=1697625219; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z+7nP3IGdaoip82hIlnEMfS+fdM67SWVcyUnWsux9qo=; b=YZE3CG1JnDa3kGpb+AytELYa5LUtwS9AqcFgHVg5CDW8YyRpbjsVeOffb1TgCQ0jw/ 8Mb8HeNpDllPYn6hwRA96Fk5swYzNeA8hDhVmp8VVgqwNhR4KXHnFGKkRfvFBBTj1XuJ FBNlthE704UQ4Wb5sJdyOth+99ljg8aPruVZz3s8SgNIomIBudIDE138NQN19LVEwTtW OkMLVd/DlFQ1mxGT0IiOw/SDIWeBlsVpDLK5XsJJczNv3KPTeiBc1YHNAxPJJMuoBWq9 Hm03JsASGUH7c+mlAspCJcV7JCrtV01+0avntRvfMetMXcok0aXQMsvm4RBqnW86D38L wa2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020419; x=1697625219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z+7nP3IGdaoip82hIlnEMfS+fdM67SWVcyUnWsux9qo=; b=fMmXUemp5Sa+0Wr6ob7HOh/ClD09GVmq+I9Oa2cLNQRsn8Y6vddzA1h6Cj/lyJ7iZP u04WNsCRx4AwEa4yJWy/zmOlk024Z2FxfNIAtRx0aw+8WnyBfOh1T2/dQlINtvNwWEbQ VLJpwpYMfEik7iMArtRZhn4xJKoFtoLSvULnq2+f3xGQA4V/zG57QaAy7aKxRddRK/YP RQCtwXpQkvrKlH6M2c4W9T3GNCDBfjMy9r17Klgv9Wj3Jq/ACqRJuPFkDbn9h0ToE8di C+fwVSUTuObCQBtHcy2bc3HMlEq1/OwD47GXvFQVS3ZDXCx/G48O0+HjimNSugvSBKVc t59w== X-Gm-Message-State: AOJu0YxG18/ya8teRn2Gb950XRoxNg3vfVzoG9mFVR+7FIP/DVL0Vniy tcv7vkjjYN7HYQk0lv49LoKRXw== X-Google-Smtp-Source: AGHT+IFL/F1Q0hc7PElnnAkTEqmYjhLOk86tMppyVjLjX2mPhUOLgaysp2tC4TJ0GccoO6f9nz9mpQ== X-Received: by 2002:a05:6512:ea5:b0:4f8:77db:1d9e with SMTP id bi37-20020a0565120ea500b004f877db1d9emr25721739lfb.12.1697020418927; Wed, 11 Oct 2023 03:33:38 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c024c00b0040531f5c51asm16622591wmj.5.2023.10.11.03.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 426131FFCB; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 19/25] gdbstub: Replace gdb_regs with an array Date: Wed, 11 Oct 2023 11:33:23 +0100 Message-Id: <20231011103329.670525-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki An array is a more appropriate data structure than a list for gdb_regs since it is initialized only with append operation and read-only after initialization. Signed-off-by: Akihiko Odaki Reviewed-by: Alistair Francis Message-Id: <20230912224107.29669-13-akihiko.odaki@daynix.com> [AJB: fixed a checkpatch violation] Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-20-alex.bennee@linaro.org> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 7b8347ed5a..3968369554 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -502,7 +502,7 @@ struct CPUState { CPUJumpCache *tb_jmp_cache; - struct GDBRegisterState *gdb_regs; + GArray *gdb_regs; int gdb_num_regs; int gdb_num_g_regs; QTAILQ_ENTRY(CPUState) node; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 62608a5389..b1532118d1 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -51,7 +51,6 @@ typedef struct GDBRegisterState { gdb_get_reg_cb get_reg; gdb_set_reg_cb set_reg; const char *xml; - struct GDBRegisterState *next; } GDBRegisterState; GDBState gdbserver_state; @@ -386,7 +385,8 @@ static const char *get_feature_xml(const char *p, const char **newp, xml, g_markup_printf_escaped("", cc->gdb_core_xml_file)); - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); g_ptr_array_add( xml, g_markup_printf_escaped("", @@ -430,7 +430,8 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) return cc->gdb_read_register(cpu, buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->get_reg(env, buf, reg - r->base_reg); } @@ -448,7 +449,8 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return cc->gdb_write_register(cpu, mem_buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->set_reg(env, mem_buf, reg - r->base_reg); } @@ -461,17 +463,23 @@ void gdb_register_coprocessor(CPUState *cpu, int num_regs, const char *xml, int g_pos) { GDBRegisterState *s; - GDBRegisterState **p; - - p = &cpu->gdb_regs; - while (*p) { - /* Check for duplicates. */ - if (strcmp((*p)->xml, xml) == 0) - return; - p = &(*p)->next; + guint i; + + if (cpu->gdb_regs) { + for (i = 0; i < cpu->gdb_regs->len; i++) { + /* Check for duplicates. */ + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (strcmp(s->xml, xml) == 0) { + return; + } + } + } else { + cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState)); + i = 0; } - s = g_new0(GDBRegisterState, 1); + g_array_set_size(cpu->gdb_regs, i + 1); + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg = cpu->gdb_num_regs; s->num_regs = num_regs; s->get_reg = get_reg; @@ -480,7 +488,6 @@ void gdb_register_coprocessor(CPUState *cpu, /* Add to end of list. */ cpu->gdb_num_regs += num_regs; - *p = s; if (g_pos) { if (g_pos != s->base_reg) { error_report("Error: Bad gdb register numbering for '%s', " From patchwork Wed Oct 11 10:33:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=mryxe3Lx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58MQ0Vy1z23jj for ; Wed, 11 Oct 2023 21:36:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWXL-0001dd-Nk; Wed, 11 Oct 2023 06:33:55 -0400 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 1qqWXA-0001MZ-BQ for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:45 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWX6-0005HZ-GJ for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:33:44 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-406609df1a6so63997545e9.3 for ; Wed, 11 Oct 2023 03:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697020419; x=1697625219; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pu5EXKGxbl4h50PEu15NUratwzwygqcDFyq/bZZGLKA=; b=mryxe3LxispMPCRD6tywTZJpUNbKmE/6NdvM9e31wJa8AlYA3Wbviqk7K4sI16cB++ h0RrBzHMvS7V/S7cDxrBVDDSRRGfQLi7RG3JJAc2/cN4YNp5GRbG4yLYQpuWclOMWy6q ezEVj4Uea4QknrhIaahzzEt1/bEVOhjHiiHcTu39WUiK8y5HJDO89euBd+98Jsfb3Kiy Ra54dJJT0TKxIm84UHVe2kw6Qqf4vOfH4k+fdQP00NeuoFrW0t1IsazeV2jFIFB0cZLN oGP5XJhskaXOqPYhDz4XrFUNe+ngZzQrcRc3XLDursuEH2peFCyyyQErSNY5j5DijeMK /oYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697020419; x=1697625219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pu5EXKGxbl4h50PEu15NUratwzwygqcDFyq/bZZGLKA=; b=na7YiY8RsLDBC4Ru1uyuiHMlsGQsobtVtzKdwOv5Bds3K/YcY1lpFLScKi43tyWkZt r0wukarOFc7SRkxenO/n6ik+NOwkbLkd84YvlQUYz7W1zXoezJqtPkchD1b9rDv5gZk0 GxwUyl6uux7YYJQLagHM1+08Zo4ftS6EsYROM9w1v99l3GYz84m9iH/8Y2KfHHims2Vm MiycEgHjjwV/+J21zi1CNyLjZRtl5RbBu81xt3wzD10w1nTD7WfneBu1S5r0ErkUlIPS j8XxeHRB+LxzTnvBfWzsHkpit8xQL3zAQfeP9ZX4xZIDaaKq6EmiIX+4b+wxm7HXpFFQ etHA== X-Gm-Message-State: AOJu0YySymGMyBq1SsuIocef1RtH7ndtvTBAvBNfcAWSXYuAV87lLsTk /QuJ7mkBPgvkIA1kMe5/DPJOgLDFoA6ryX5FZAM= X-Google-Smtp-Source: AGHT+IEDedtLFWcviJjiuCeEvY459bTYPgm4N15vXPPaoT14d8cUBT/WzJGsfV4jpJ7QLj1ObGVj6w== X-Received: by 2002:a05:6000:10c2:b0:321:68af:947 with SMTP id b2-20020a05600010c200b0032168af0947mr16601830wrx.8.1697020419204; Wed, 11 Oct 2023 03:33:39 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bp22-20020a5d5a96000000b0032ce54bacb1sm4599276wrb.0.2023.10.11.03.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:33:36 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5B2D21FFCC; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Paolo Bonzini Subject: [PULL 20/25] accel/tcg: Add plugin_enabled to DisasContextBase Date: Wed, 11 Oct 2023 11:33:24 +0100 Message-Id: <20231011103329.670525-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-2-richard.henderson@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-21-alex.bennee@linaro.org> diff --git a/include/exec/translator.h b/include/exec/translator.h index 9d9e980819..6d3f59d095 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -73,6 +73,7 @@ typedef enum DisasJumpType { * @max_insns: Maximum number of instructions to be translated in this TB. * @singlestep_enabled: "Hardware" single stepping enabled. * @saved_can_do_io: Known value of cpu->neg.can_do_io, or -1 for unknown. + * @plugin_enabled: TCG plugin enabled in this TB. * * Architecture-agnostic disassembly context. */ @@ -85,6 +86,7 @@ typedef struct DisasContextBase { int max_insns; bool singlestep_enabled; int8_t saved_can_do_io; + bool plugin_enabled; void *host_addr[2]; } DisasContextBase; diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index e7abcd86c1..c5da7b32a5 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -158,6 +158,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, } else { plugin_enabled = plugin_gen_tb_start(cpu, db, false); } + db->plugin_enabled = plugin_enabled; while (true) { *max_insns = ++db->num_insns; From patchwork Wed Oct 11 10:33:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LlwfYchK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Y74bk8z1ypX for ; Wed, 11 Oct 2023 21:44:59 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgl-0008CY-5R; Wed, 11 Oct 2023 06:43:39 -0400 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 1qqWgj-0008Ax-RS for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:37 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgh-0007fV-Hw for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:37 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32caaa1c493so1477364f8f.3 for ; Wed, 11 Oct 2023 03:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021014; x=1697625814; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n810Flg3eUKPCpIa9Gc8YMsIUEaYzj3LB0YfR/j6wKY=; b=LlwfYchKOb0fmhShTiRQMjnhLINsXIc1+vaZ60a+vk8W9Rb0lUXyUftQe7SGHw6i98 uE3dBsR6tDYXccDm1mSw2cUDHt3ko3G4M5xS73dZ6s4Z2ZPFG467NEG9bh1qUafSBFrN RrbZcu5v8k6xPuTmPVEY1lu+MUE8TMXrNONkt0kUqaL7ZyhMjAKLXwTx4bMsCh7sTSB3 4OccV0Fto6pikg3Njj2zZaEH1hfRcQ97V63fRraM1wBAMnHZuK8blwJJgMTC2/co5moX 2f169s6jyijN/NuMHLjFCubAkp2oWDfuI1MA1jAiB7k/+LIMfgPcw+FDDQCIRsHAT8HE 9rCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021014; x=1697625814; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n810Flg3eUKPCpIa9Gc8YMsIUEaYzj3LB0YfR/j6wKY=; b=soqx4EdpcRPCaFC1wc9smpByGgjXYWJriVFYkg/hhDEBt4JmYqqou99MmboR0UcvmP aJHktofL6tQRS77F6ZZH8GQqzNSss5YbDrvLuN7Gcq2xTTANRnAzbwUDvgqCx0YYwmog gZkY7vl+B/KttUwJ5fDzbRbW46b33fexHZOxDWOPfkTnLw6Lixc/dAysSIiJrA8SV77D +pnkfAJVDmQxnx/SWG2EmboA3RaMDQGcPNuNtKXQ0ctU1FKLfyf0p7X8FiIRkQChgwrO 88G1GL64oSMV2/kUJYtaq38LONHALvl7Ow76o4Zx7cKmHqk2vbBlsc+6tyacwxTlj55Z H3SA== X-Gm-Message-State: AOJu0YzBjXs6lBmsGUN9VSlSeXkFO/gpLuoC+b46QIKBHmNlSDEEPPZR B0sACbmLp/FubKvDMikrJVEQPw== X-Google-Smtp-Source: AGHT+IHAbeD9UcJCzh6DkJgMUWqT0U1j3jo6jzh492roj7uEI4jQkiFKdVaPqE2rgpAtUAjKyzc6QA== X-Received: by 2002:a05:6000:1c02:b0:32d:4545:3832 with SMTP id ba2-20020a0560001c0200b0032d45453832mr3881270wrb.14.1697021014165; Wed, 11 Oct 2023 03:43:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v3-20020adfa1c3000000b0032d8354fb43sm1869446wrv.76.2023.10.11.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 721FC1FFCD; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Yoshinori Sato Subject: [PULL 21/25] target/sh4: Disable decode_gusa when plugins enabled Date: Wed, 11 Oct 2023 11:33:25 +0100 Message-Id: <20231011103329.670525-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-3-richard.henderson@linaro.org> [AJB: fixed s/cpu_env/tcg_env/ during re-base] Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-22-alex.bennee@linaro.org> diff --git a/target/sh4/translate.c b/target/sh4/translate.c index cbd8dfc02f..220a06bdce 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1816,6 +1816,18 @@ static void decode_opc(DisasContext * ctx) } #ifdef CONFIG_USER_ONLY +/* + * Restart with the EXCLUSIVE bit set, within a TB run via + * cpu_exec_step_atomic holding the exclusive lock. + */ +static void gen_restart_exclusive(DisasContext *ctx) +{ + ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; + gen_save_cpu_state(ctx, false); + gen_helper_exclusive(tcg_env); + ctx->base.is_jmp = DISAS_NORETURN; +} + /* For uniprocessors, SH4 uses optimistic restartable atomic sequences. Upon an interrupt, a real kernel would simply notice magic values in the registers and reset the PC to the start of the sequence. @@ -2149,12 +2161,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) qemu_log_mask(LOG_UNIMP, "Unrecognized gUSA sequence %08x-%08x\n", pc, pc_end); - /* Restart with the EXCLUSIVE bit set, within a TB run via - cpu_exec_step_atomic holding the exclusive lock. */ - ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; - gen_save_cpu_state(ctx, false); - gen_helper_exclusive(tcg_env); - ctx->base.is_jmp = DISAS_NORETURN; + gen_restart_exclusive(ctx); /* We're not executing an instruction, but we must report one for the purposes of accounting within the TB. We might as well report the @@ -2242,12 +2249,22 @@ static void sh4_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) #ifdef CONFIG_USER_ONLY if (unlikely(ctx->envflags & TB_FLAG_GUSA_MASK) && !(ctx->envflags & TB_FLAG_GUSA_EXCLUSIVE)) { - /* We're in an gUSA region, and we have not already fallen - back on using an exclusive region. Attempt to parse the - region into a single supported atomic operation. Failure - is handled within the parser by raising an exception to - retry using an exclusive region. */ - decode_gusa(ctx, env); + /* + * We're in an gUSA region, and we have not already fallen + * back on using an exclusive region. Attempt to parse the + * region into a single supported atomic operation. Failure + * is handled within the parser by raising an exception to + * retry using an exclusive region. + * + * Parsing the region in one block conflicts with plugins, + * so always use exclusive mode if plugins enabled. + */ + if (ctx->base.plugin_enabled) { + gen_restart_exclusive(ctx); + ctx->base.pc_next += 2; + } else { + decode_gusa(ctx, env); + } return; } #endif From patchwork Wed Oct 11 10:33:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=sgbPZFBF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Y755zLz23jg for ; Wed, 11 Oct 2023 21:44:59 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgo-0008F5-59; Wed, 11 Oct 2023 06:43:42 -0400 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 1qqWgm-0008Di-Tz for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:40 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgg-0007fI-Ob for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:40 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32d834ec222so675294f8f.0 for ; Wed, 11 Oct 2023 03:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021013; x=1697625813; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yd35sPPYW+65MfBRsBZG66w/oIpnWjGdXLFZzvofEuI=; b=sgbPZFBFlybtMB/12dzG4MaqVDuLrNNwStEEwEmseUU0+eFT7JeS6HEYx9ytPPmoB8 Jqc6vkrrWplGfxFqrLB7XjwAM/Ab0UtJxqS9xpfeV7ggTh/xNJyI0VY5YDUQK5BA7vbB mKbnCuJUfnoOoQW8js8GWBWZ+gklTrqrNsWBJVy7whvMsZrRHwnTrOF4nRTgfKf4lwVA 2iWDLm9kujqr5Mp+RHinkr5RcAfuGN9y/czrLANAxNZdF2ESdUrUTUfCxDgRqLqX/9Ws a/F/ADDjUYVqMiPR4qpggsvo7Gk/FTujpjhHArRCkyG+k+k57ZKkFfxiyV8+SWRDl8QS Pzgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021013; x=1697625813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yd35sPPYW+65MfBRsBZG66w/oIpnWjGdXLFZzvofEuI=; b=wdMVeXtaDa72naXXmke7/hxmQJplMV2lyHZTHbp6Xc7QFRmXZID+Et8BD+St4tD3ld 8NWIUdG7X54Nh3H/Ew8EoOrmM7N6338pOLe6xL/Ac2jylyf4Q915VafR6o51Xjp+gEv0 FN1aF2FpchZzIc++cpmiBWQ+qF2Oly8oEri2jGbqcucC3SqA63SIyjHXEgw/Zu4K/y7Y VSIHWAoSNtHXfNvQs8nOxwCnyNW0G93jkz+WpBnU7kjecD16sUIJz4WshJKqQe2XH1kl v/XEiqFYzAZ1+dOJ+0SJREmzluF2pyJPT1fsPgXCJz8gMuak9FlkykTd9FfITkvQM7mc +2gQ== X-Gm-Message-State: AOJu0YwbR2TZ1IW0dSU9Tw8lQyT7ElGsDV5PEU5dNK8nw2CPoAY7W6Sq TYj4PFXRZpK2Uzr+ZbyxNQiPKbBEXbjoxSGqsds= X-Google-Smtp-Source: AGHT+IHCNi1U2lGv99D+WmqD2xJYMxkLWk1JhG1hB/bEjavSMBvXSjlYEBw8+eoVJT0L5uToCyI09w== X-Received: by 2002:a05:6000:180d:b0:32d:88dd:419b with SMTP id m13-20020a056000180d00b0032d88dd419bmr740659wrh.35.1697021013115; Wed, 11 Oct 2023 03:43:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t25-20020adfa2d9000000b0032d8373fbe4sm1804097wra.51.2023.10.11.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8C9B91FFCE; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Matt Borgerson , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini Subject: [PULL 22/25] plugins: Set final instruction count in plugin_gen_tb_end Date: Wed, 11 Oct 2023 11:33:26 +0100 Message-Id: <20231011103329.670525-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Matt Borgerson Translation logic may partially decode an instruction, then abort and remove the instruction from the TB. This can happen for example when an instruction spans two pages. In this case, plugins may get an incorrect result when calling qemu_plugin_tb_n_insns to query for the number of instructions in the TB. This patch updates plugin_gen_tb_end to set the final instruction count. Signed-off-by: Matt Borgerson [AJB: added g_assert to defed API] Message-Id: Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-23-alex.bennee@linaro.org> diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h index 52828781bc..c4552b5061 100644 --- a/include/exec/plugin-gen.h +++ b/include/exec/plugin-gen.h @@ -20,7 +20,7 @@ struct DisasContextBase; bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db, bool supress); -void plugin_gen_tb_end(CPUState *cpu); +void plugin_gen_tb_end(CPUState *cpu, size_t num_insns); void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db); void plugin_gen_insn_end(void); @@ -42,7 +42,7 @@ void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db) static inline void plugin_gen_insn_end(void) { } -static inline void plugin_gen_tb_end(CPUState *cpu) +static inline void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) { } static inline void plugin_gen_disable_mem_helpers(void) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index d31c9993ea..39b3c9351f 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -866,10 +866,14 @@ void plugin_gen_insn_end(void) * do any clean-up here and make sure things are reset in * plugin_gen_tb_start. */ -void plugin_gen_tb_end(CPUState *cpu) +void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) { struct qemu_plugin_tb *ptb = tcg_ctx->plugin_tb; + /* translator may have removed instructions, update final count */ + g_assert(num_insns <= ptb->n); + ptb->n = num_insns; + /* collect instrumentation requests */ qemu_plugin_tb_trans_cb(cpu, ptb); diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index c5da7b32a5..575b9812ad 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -210,7 +210,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, gen_tb_end(tb, cflags, icount_start_insn, db->num_insns); if (plugin_enabled) { - plugin_gen_tb_end(cpu); + plugin_gen_tb_end(cpu, db->num_insns); } /* The disas_log hook may use these values rather than recompute. */ From patchwork Wed Oct 11 10:33:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=YeVqIpef; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58XX6T4Cz23jg for ; Wed, 11 Oct 2023 21:44:28 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgk-0008BR-4k; Wed, 11 Oct 2023 06:43:38 -0400 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 1qqWgi-00089f-61 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:36 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgf-0007ep-JM for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:35 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406619b53caso62326275e9.1 for ; Wed, 11 Oct 2023 03:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021011; x=1697625811; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yf1R+Vby24DYe8++3MpeTUjuX+WlwLu5umzTar0tTFw=; b=YeVqIpef26BKWs8iXB1Jcni/siKmHcFUidjZE0hzSJtuYE8dwfVW+ZJeaSnO75aSi+ Y96PeHDi0ZhrcZXs0vfVeQvhyA+rIlpRv5g6n2wdY/uqHPYV+BbpJyuJtAcpZndB5b4c /YGCCxA066Zsl4QG8fhQetxUwuzWRm5V54a4nQoIDBphEsi5wKKTKpjZv1qevuEEF2BN FxOYBM3s8yJTsB30kTlHCHBT3kO4PBG4s2qm8YRFZsqQW8FMgeKuO0ApmsFKRDFkMt/s ik+vMARNMB5wgkyVL8V+cnyOLZncYTOPscjt7IUf5qZxNczoTyx46T8QusEGh0zYTBkv IuNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021011; x=1697625811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yf1R+Vby24DYe8++3MpeTUjuX+WlwLu5umzTar0tTFw=; b=jmZGiA2mkXjxciOfGWbA/EjPTOLSzlSo6NljNN5XHw0CffxUhR4sk4siNaw1Q7ZJBL P6VU2W+G2rl+t9aKWTs8gf2Jtp9/B5VuOVFBTilKUpMKDzIpKAcdBAyejh728sn83Pgj vwtmxNyJx8zP2XuRER3k5jaPg50rHETCFwCgc6PmmErcciAiO60+x2LJX5WYMO++4exw 64sZqvrZojkWuUzdNs9dNv8SSa97IRrUj9Y7HiLfJKpqAb01cX4TnOjlnR6gZOIKVTGi iI+pzgfspcSfLLeKJKjE1x/KlOsniLwyt7g/mexzbmmOXJgwMvfFtk5k2EGdadoJOJRh LSiw== X-Gm-Message-State: AOJu0Yyn6dfO9rqhJoHtx1RMoN6Unjf2H6XqGl+RXH6MjN5y1SA8vniY TA2nHJdnN9vVhrUwzlGjlbw/OLzvHv7Y8P/J16Y= X-Google-Smtp-Source: AGHT+IHB6xb2zZOxenA1oewmdAetLT1kMibYNqSlWv479VH+SIRzNsjzZPY1UcG+xGA4wNAIUuLpCw== X-Received: by 2002:a05:600c:3546:b0:406:8496:bd8b with SMTP id i6-20020a05600c354600b004068496bd8bmr16283352wmq.9.1697021011485; Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s4-20020a5d6a84000000b00327bf4f2f14sm15126848wru.88.2023.10.11.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A2A8A1FFBE; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 23/25] contrib/plugins: fix coverity warning in cache Date: Wed, 11 Oct 2023 11:33:27 +0100 Message-Id: <20231011103329.670525-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Coverity complains that appends_stats_line can be fed a 0 leading to the undefined behaviour of a divide by 0. Fixes: CID 1519044 Fixes: CID 1519047 Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-24-alex.bennee@linaro.org> diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 4fca3edd07..9e7ade3b37 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -535,15 +535,13 @@ static void caches_free(Cache **caches) } } -static void append_stats_line(GString *line, uint64_t l1_daccess, - uint64_t l1_dmisses, uint64_t l1_iaccess, - uint64_t l1_imisses, uint64_t l2_access, - uint64_t l2_misses) +static void append_stats_line(GString *line, + uint64_t l1_daccess, uint64_t l1_dmisses, + uint64_t l1_iaccess, uint64_t l1_imisses, + uint64_t l2_access, uint64_t l2_misses) { - double l1_dmiss_rate, l1_imiss_rate, l2_miss_rate; - - l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; - l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; + double l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; + double l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; g_string_append_printf(line, "%-14" PRIu64 " %-12" PRIu64 " %9.4lf%%" " %-14" PRIu64 " %-12" PRIu64 " %9.4lf%%", @@ -554,8 +552,8 @@ static void append_stats_line(GString *line, uint64_t l1_daccess, l1_imisses, l1_iaccess ? l1_imiss_rate : 0.0); - if (use_l2) { - l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; + if (l2_access && l2_misses) { + double l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; g_string_append_printf(line, " %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%", l2_access, From patchwork Wed Oct 11 10:33:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=YMm7N0b0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Yq2q3xz23jd for ; Wed, 11 Oct 2023 21:45:35 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgn-0008Ez-JM; Wed, 11 Oct 2023 06:43:41 -0400 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 1qqWgk-0008CS-WD for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:39 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgi-0007fE-8m for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-32483535e51so6424182f8f.0 for ; Wed, 11 Oct 2023 03:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021013; x=1697625813; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UzxurWFBanGJDGa17SzO9nkXVLYIxRz6NOFY5btFFbY=; b=YMm7N0b0Y/Wip/32VNVUBE58AJWrlJ8nRx9elgJIqICF/tYRqs4pjWN5aa9O6gDWOn yeGdUdMqt3K51vWvjf88ZAjwTKrXoEqOqHWSsE54BwHBnMiuKd1G/7+bLVLZaSwBVZi5 nrV1EZzdbNkyRfIuEoO5h+1RI8770wivX3vuLcX7AD9IoQ9GGk8MOhd9xiEfcBLErr0R n567WyjCuHf+TpACqQw0tYrHAYc4sRBF0z6IlPizyvNeIkQprgMps+Id3VZOQuJuxTER 6o+Y8d++8MDsLDCdMuS1LJN9XWqAMkdcfSCLGjbjZOl+vyKES9NXapRRCV7e8M6UghQK jk/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021013; x=1697625813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UzxurWFBanGJDGa17SzO9nkXVLYIxRz6NOFY5btFFbY=; b=qUNVyFxbslaUdbjRCJE2ZAZ83nMFiJrOT86hI1rMaGjfeMt7BddCkzEXtYbFJsT67V g94ExVN4Yd18LJ1UU0Qfj2Tzi6p4DWeculSjfQtZgQRs7EWMeG7SfzyYgY1kGPsfRGxa YqKBdmt15ullUM948IPiKE0810TDbIzOVfotYzeRzz6B41yABAgpxnLY6UeUnrRZs5fy cttdiGFRKBPLIY0lwh2/XlxQLPElsdIlJ0w3Od+n6DDMK0VXeWnXt0pVHcy4zGraiPvG Qpy3i6clEHptzDkPkQZ2B0DqxqhSfGCqfd1sVeiPx4EXSnGz9yUudzlGk2A6QVvF/eqX Eq+A== X-Gm-Message-State: AOJu0Yz4RIZKRH14eIhamKy6v94w3XKUeNfiX4gJukBq5IelJrD0aa2k 9F/DMmcQFCtgBY3LIOWB8py46g== X-Google-Smtp-Source: AGHT+IEbtP9Arab0E8K3iBUteRok0NShKk49HN3ETQ6pDmgsEBV8G33oAkrly8k5VCJAmfiIx9OdtA== X-Received: by 2002:adf:e607:0:b0:31f:b9ea:76c with SMTP id p7-20020adfe607000000b0031fb9ea076cmr17169987wrm.48.1697021012784; Wed, 11 Oct 2023 03:43:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p4-20020a5d68c4000000b003232f167df5sm15134109wrw.108.2023.10.11.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B950A1FFCF; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 24/25] contrib/plugins: fix coverity warning in lockstep Date: Wed, 11 Oct 2023 11:33:28 +0100 Message-Id: <20231011103329.670525-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Coverity complains that e don't check for a truncation when copying in the path. Bail if we can't copy the whole path into sockaddr. Fixes: CID 1519045 Fixes: CID 1519046 Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-25-alex.bennee@linaro.org> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 682b11feb2..f0cb8792c6 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -245,6 +245,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) static bool setup_socket(const char *path) { struct sockaddr_un sockaddr; + const gsize pathlen = sizeof(sockaddr.sun_path) - 1; int fd; fd = socket(AF_UNIX, SOCK_STREAM, 0); @@ -254,7 +255,11 @@ static bool setup_socket(const char *path) } sockaddr.sun_family = AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >= pathlen) { + perror("bad path"); + return false; + } + if (bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("bind socket"); close(fd); @@ -287,6 +292,7 @@ static bool connect_socket(const char *path) { int fd; struct sockaddr_un sockaddr; + const gsize pathlen = sizeof(sockaddr.sun_path) - 1; fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { @@ -295,7 +301,10 @@ static bool connect_socket(const char *path) } sockaddr.sun_family = AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >= pathlen) { + perror("bad path"); + return false; + } if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("failed to connect"); From patchwork Wed Oct 11 10:33:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1846538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=KXDO/TWv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S58Xx0GFKz1ypX for ; Wed, 11 Oct 2023 21:44:49 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqWgj-0008Aq-9o; Wed, 11 Oct 2023 06:43:37 -0400 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 1qqWgi-00089h-7U for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:36 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqWgf-0007ek-EB for qemu-devel@nongnu.org; Wed, 11 Oct 2023 06:43:35 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40572aeb73cso62265705e9.3 for ; Wed, 11 Oct 2023 03:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697021011; x=1697625811; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3iJ/Q4kLUmKoxSHeooZspyIFZM2wlJ6x5Q8adgv7bVI=; b=KXDO/TWvUMIEJSSVShYe4JA54qR6qOapaJJOHUCaqUzLWXerUNVUPnX6kbC7Q6D9vx RTt1rgEY+vfOhYnjG7quRbs786dccVibEODdbvcB33fFCXuSDu3HKUB16bj3BUv7w7p+ 3/lIsJMcaNxZ/v1PTotyyMnRLEcAbzRM5G0L+iaAebpUOb+gDF8uHm5vdHOxQzIuZIQp H56F0J/9ASQ5gGUDHPLAANbkHpJZOIzhSplVG5M2Rf8Fpc4sxW4jcWXGVilnT3V9+xC9 zff5XAUOvuWgmXGhwEvgMTNNS2amFFdXXrUBVn/w2oWcbZYSkCwTpFjqqDadi/IB5EFt zu7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697021011; x=1697625811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3iJ/Q4kLUmKoxSHeooZspyIFZM2wlJ6x5Q8adgv7bVI=; b=qKUlrKQWxjMo5972E3D0+TlSb7NW+q1pRCJeJ0lX0tkK/IQwfORgKZOYIgx2xXTSnT C+yKpJ1pYU0CoYcnlHAbE6N0a3YUI8zhzZVbiB7KJhrZfB/DdaubVr6fmwaFVX4ocXQB fnK0cQmZqrBK7znexyq7a70eAsuWDrkOwsNY1CAI7a5abJ8o3DHPnCZczH3PEGLHLBo8 LXMmmqlgFjRC9uAFoOsBmmrQV46iZBqyFCeYv2Rm2qOds83sAcScLhzTXJwdGAhkZ7pg HyL2NtjNseV4mxf69FvPUJl9VbysqW+vIjIoMWeYljWC1Z5x2cLFBk0pgn+qnLkjPh+2 SpkA== X-Gm-Message-State: AOJu0YxCPOtoMVWe281Z0tg5Y/PLLr+FDEm1LfW0XV+LDxAab3grybwR NJ9P+GwkgMAKHInOaUf6uFFfdw== X-Google-Smtp-Source: AGHT+IFhwbue8IGkQOGAdpTOyEDyLuEbeCs937AdMwNMYNXI1fMZdKpiJBBm84iV3vkYUluHeTP7Pw== X-Received: by 2002:a05:600c:231a:b0:3fe:f667:4e4c with SMTP id 26-20020a05600c231a00b003fef6674e4cmr18428821wmo.12.1697021011102; Wed, 11 Oct 2023 03:43:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q5-20020a7bce85000000b0040596352951sm18871220wmj.5.2023.10.11.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:43:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D06BF1FFBF; Wed, 11 Oct 2023 11:33:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 25/25] contrib/plugins: fix coverity warning in hotblocks Date: Wed, 11 Oct 2023 11:33:29 +0100 Message-Id: <20231011103329.670525-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011103329.670525-1-alex.bennee@linaro.org> References: <20231011103329.670525-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Coverity complains that we have an unbalance use of mutex leading to potential deadlocks. Fixes: CID 1519048 Fixes: a208ba09bd ("tests/plugin: add a hotblocks plugin") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231009164104.369749-26-alex.bennee@linaro.org> diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 6b74d25fea..4de1b13494 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -69,8 +69,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) } g_list_free(it); - g_mutex_unlock(&lock); } + g_mutex_unlock(&lock); qemu_plugin_outs(report->str); }