From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653443; cv=none; d=zohomail.com; s=zohoarc; b=N+t6O0mjysKz/R9cSlbQc8l97RjfejpU/BK/UqLMQ3GkX1f07Yr19MzrRVHo4u7aidks/qQRY6Nu/DcEvHuD435qZ5XSeIrruWnwdTVVk8cdsQ/In6j+IRoucWtEar/9OogmYxKmIXBw3zl9Uy2GrTFKUOIyLhJ4k71I1VKX3jU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653443; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i/NxOuLXpZoY7AKhUkjRhpOIcVG1WqxnVG0wjWhT+R4=; b=ibllS5ltBpQJhkZlkMgjeYg2wAbPyZdKXf5eLb3raXnRJ5lWfG1SKL4CnkLK9gQqp+34uApqAUUOrHvxOeP46Jv1WpphF0YBE6ruwHFnvydFa//W+mqog32Iby6aOeV51ehVqDhi8F2bP5Ri/cVA3UciOy8F8PB3jgUsfQRn7Nc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653443436402.27354379107067; Mon, 25 Sep 2023 07:50:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtV-0000yh-Or; Mon, 25 Sep 2023 10:49:05 -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 1qkmtT-0000x9-P4 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:03 -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 1qkmtO-0008EU-TL for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:03 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4053c6f1087so56289565e9.0 for ; Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b12-20020a5d634c000000b0031773a8e5c4sm12032016wrw.37.2023.09.25.07.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:55 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0B0B31FFBC; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653336; x=1696258136; 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=i/NxOuLXpZoY7AKhUkjRhpOIcVG1WqxnVG0wjWhT+R4=; b=lrK3xPKSkWbMQTJIMaEdcHOecIZ98V4bvJ9ZO1dcAeafvlwSeanOoJ8rPoWkyVnCru Jl2w/DKpsQjX6P8ZTfDK3un5htEDN3nO/xK0TJxSaczjtcURpuDxNfEP5SHYJzISXYoP rdIYPDfU3k/TEBoo9NmYoT6REdMqGx6vEdaGyHKSiV7VvvxT/YM9jwGEaWM8rR6BKeSc 9yYqfw8wIvzLpk/lNc3IPLAdSEKo3w45IpFtRTj+Ol7a+dTeuV+63DYHexTum3Jm20uq UwlJss2KyroxYOov/g7Fvd1vCq0MEUs3l4K+5GKvRpbIanjkzFPpU1iX4mfxnpalMBlz 8nlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653336; x=1696258136; 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=i/NxOuLXpZoY7AKhUkjRhpOIcVG1WqxnVG0wjWhT+R4=; b=qpttuxGKW9cMmemiIykOFiDXGEyO2hwIhl8oLQxV78q/+bibHkRypA6S21rkmz1zTZ ZL9pofpMFsxzVaSOLBpjgXQx/tX8XNGISRA0o0CS3Zfh5qsKc0ijINh0RPGb5grTxwiu u5vCNbO4ZHYUnpdZn9Wl+UT17mGRsgbD4YSNbTVcv+mLPBC6w7SaLP0njMkERtv23cIV 6E118vPPfBdzdi60t2kGzdmqng/MoNoEoiYcGGUAJD4ENq33OXakvQgPSPfe8GFNwuhW 7b2u/tPvdjNMha/96whbHN7PWbXqatJfpYd5kpHnSnaR8BbTEkSOOhl6a0XSGMjA06uE l81A== X-Gm-Message-State: AOJu0Yx9DEUwTuGmHebtCRpSuKOLNxVMrmZeY/ucTWVoT9HGTb13670Q n5DYU/5CnpZWK3zs206ZLqyqMA== X-Google-Smtp-Source: AGHT+IHlCGeK/tvgna3gzkxwfVFAY6TBWSp276ajeWZiDVI1lQWGadbKDsxgUtYGPZunOy0YBBalYg== X-Received: by 2002:a05:600c:2215:b0:405:1baf:cedd with SMTP id z21-20020a05600c221500b004051bafceddmr5505385wml.1.1695653335748; Mon, 25 Sep 2023 07:48:55 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 01/31] tests/avocado: update firmware to enable sbsa-ref/neoverse-v1 Date: Mon, 25 Sep 2023 15:48:24 +0100 Message-Id: <20230925144854.1872513-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653444976100003 From: Marcin Juszkiewicz Update prebuilt firmware images to have TF-A with Neoverse V1 support enabl= ed. This allowed us to enable test for this cpu in sbsa-ref machine. Signed-off-by: Marcin Juszkiewicz Acked-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230915113519.269290-1-marcin.juszkiewicz@linaro.org> Signed-off-by: Alex Benn=C3=A9e --- tests/avocado/machine_aarch64_sbsaref.py | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machi= ne_aarch64_sbsaref.py index a794245e7e..b39f5566d7 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -28,33 +28,32 @@ def fetch_firmware(self): """ Flash volumes generated using: =20 - - 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) =20 - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee= 38 + https://github.com/ARM-software/arm-trusted-firmware/tree/cc933e= 1d =20 - 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/29cce3356aec + https://github.com/tianocore/edk2-platforms/tree/fc22c0e69709 """ =20 # Secure BootRom (TF-A code) fs0_xz_url =3D ( - "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" + "https://fileserver.linaro.org/s/g4C3WzJzNBES2p2/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash =3D "447eff64a90b84ce47703c6ec41fbfc25befaaea" + fs0_xz_hash =3D "374738599f7ba38c22924b2075ec5355c2b24a47" tar_xz_path =3D self.fetch_asset(fs0_xz_url, asset_hash=3Dfs0_xz_h= ash) archive.extract(tar_xz_path, self.workdir) fs0_path =3D os.path.join(self.workdir, "SBSA_FLASH0.fd") =20 # Non-secure rom (UEFI and EFI variables) fs1_xz_url =3D ( - "https://fileserver.linaro.org/s/t8foNnMPz74DZZy/" + "https://fileserver.linaro.org/s/scJRninsAFTwEct/" "download/SBSA_FLASH1.fd.xz" ) - fs1_xz_hash =3D "13a9a262953787c7fc5a9155dfaa26e703631e02" + fs1_xz_hash =3D "5d3f156ebd6c6374da2121e15c7c8f4ed0351dcc" tar_xz_path =3D self.fetch_asset(fs1_xz_url, asset_hash=3Dfs1_xz_h= ash) archive.extract(tar_xz_path, self.workdir) fs1_path =3D os.path.join(self.workdir, "SBSA_FLASH1.fd") @@ -144,10 +143,16 @@ def test_sbsaref_alpine_linux_cortex_a57(self): =20 def test_sbsaref_alpine_linux_neoverse_n1(self): """ - :avocado: tags=3Dcpu:max + :avocado: tags=3Dcpu:neoverse-n1 """ self.boot_alpine_linux("neoverse-n1") =20 + def test_sbsaref_alpine_linux_neoverse_v1(self): + """ + :avocado: tags=3Dcpu:neoverse-v1 + """ + self.boot_alpine_linux("neoverse-v1,pauth-impdef=3Don") + def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=3Dcpu:max --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653403; cv=none; d=zohomail.com; s=zohoarc; b=lWES2sjf6Xpaebam6CEZLVJ9SOlJCLUbccEL8X7tw5OI8XF0DNjlkdYxZAHgX+M7igERKQM1GxA8824zmZ7qup2OJkQYB11F/HdSZPi9XXXUeckA5vcJ3pF96ZGg54T6Myv+o1Ke+UtKCD0bW3oX8TUgPkCHYQELOPC7qoH5O4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653403; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DX65lOE/uUVkmtjhIZOisxQvTzydcI84YNB1WXt/J5w=; b=IaRce1izUgNKNMju0hns0c09loiiyOS6VwD9q+FYT4UV1kG2VQw1JRSpeZ84Y//pkleFkUuNTrdxwJzMRgXBwsLXLO3CUpLsdgDC+c2aATojgpywaiZYUDLchdm9RGYqYhKKf6cGRJQYV0yVOdv3w4tIWvojh82C721majSWw3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653403175898.4609737454183; Mon, 25 Sep 2023 07:50:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtZ-00012Q-NX; Mon, 25 Sep 2023 10:49:09 -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 1qkmtX-0000zw-M8 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:07 -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 1qkmtP-0008Ei-BR for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:07 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso35429685e9.3 for ; Mon, 25 Sep 2023 07:48:58 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ay18-20020a5d6f12000000b003143cb109d5sm2929399wrb.14.2023.09.25.07.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:55 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4EBD91FFBD; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653336; x=1696258136; 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=DX65lOE/uUVkmtjhIZOisxQvTzydcI84YNB1WXt/J5w=; b=DLSJJDlMAheC5yrdgJkt3cUwWZn5TfYvBAC8EPB8sNkKx3xWllzYEUJ53OIpT4yxHv 9Tfp6ocNl3DrNQRyDuxp+JoeZSURn6o3L6XoUwTgF8CMIeAvZVRd9/MbbUNiPgeUQe0J 1l9UxlTsDD/ku9rtZyg8R0b/LQjkPhC4Dpb9OULsbZDVtv9Vo+EMj6SAFR3eBnutvunc JjA5/wqDQazxlsa39AerE3CtolNze4IusVz9HQFpgNtIlifKvHxqIFAf2j+bfAuOhvtT QGkZmmErG12Hhro2fjXkdeV2Ais7+eZJkSHZMK5hv2q2f+6iWHA6DGBolY6rYEoK7Pjz YnDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653336; x=1696258136; 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=DX65lOE/uUVkmtjhIZOisxQvTzydcI84YNB1WXt/J5w=; b=At3yw5by5PytRDA1x/olDgU8I/ov1BixAx4anXlzO7rOVk0Ni+SKtDncbURN2g/1dK /slLVzzMlAtqcsFN5Vt3iqdtlyZrajP/7YmQgTGiKx4aJGbpLOlt57LZfqxfi5nullbk FxzeKk8MZp52IM020Jol9K/UBIQaqkLqT1SQLR4uut63W7AizKcF4Nwgc7J4joM3lC6Q t/dzADskf22B0d71s6bdA9zI27V0A1c4LjF6dexHgm1Sflf5TY+MuZyjJ6W60Tqzy+Fe OrxX0qtyxbOET2H/r+WPXQjTMQ+DwAG0ieQaIkDZIJVIkYgoSY/KKDXhP8oyyrhs6MsC ybQQ== X-Gm-Message-State: AOJu0YywdoufSGvmpEds8LfyaibbT5wIwFcVeUyCTkmeiEz3eMD0PUml ngEdPGH8jV/ciesV3ixuQ26aqA== X-Google-Smtp-Source: AGHT+IFzvqpyIuikxt70glWxYNdRhVVnfZu3ojWJqodYYDE8eSxdmKDc6xUQxGVHVfRmayVk112wTg== X-Received: by 2002:a05:6000:819:b0:323:1689:6607 with SMTP id bt25-20020a056000081900b0032316896607mr8161726wrb.5.1695653336162; Mon, 25 Sep 2023 07:48:56 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 02/31] tests/lcitool: add swtpm to the package list Date: Mon, 25 Sep 2023 15:48:25 +0100 Message-Id: <20230925144854.1872513-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653404503100001 We need this to test some TPM stuff. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Daniel P. Berrang=C3=A9 --- .gitlab-ci.d/cirrus/macos-12.vars | 2 +- tests/docker/dockerfiles/alpine.docker | 1 + tests/docker/dockerfiles/centos8.docker | 1 + tests/docker/dockerfiles/debian-amd64-cross.docker | 1 + tests/docker/dockerfiles/debian-amd64.docker | 1 + tests/docker/dockerfiles/debian-arm64-cross.docker | 1 + tests/docker/dockerfiles/debian-armhf-cross.docker | 1 + tests/docker/dockerfiles/debian-ppc64el-cross.docker | 1 + tests/docker/dockerfiles/debian-s390x-cross.docker | 1 + tests/docker/dockerfiles/fedora-win32-cross.docker | 1 + tests/docker/dockerfiles/fedora-win64-cross.docker | 1 + tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/dockerfiles/opensuse-leap.docker | 1 + tests/docker/dockerfiles/ubuntu2204.docker | 1 + tests/lcitool/libvirt-ci | 2 +- tests/lcitool/projects/qemu.yml | 1 + 16 files changed, 16 insertions(+), 2 deletions(-) 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=3D'/opt/homebrew/bin/gmake' NINJA=3D'/opt/homebrew/bin/ninja' PACKAGING_COMMAND=3D'brew' PIP3=3D'/opt/homebrew/bin/pip3' -PKGS=3D'bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffuti= ls dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo= json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh li= btasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-co= nfig python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol te= sseract usbredir vde vte3 xorriso zlib zstd' +PKGS=3D'bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffuti= ls dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo= json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh li= btasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-co= nfig python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol sw= tpm tesseract usbredir vde vte3 xorriso zlib zstd' PYPI_PKGS=3D'PyYAML numpy pillow sphinx sphinx-rtd-theme tomli' PYTHON=3D'/opt/homebrew/bin/python3' diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfi= les/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/dockerf= iles/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/doc= ker/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/do= ckerfiles/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ systemtap-sdt-dev \ tar \ tesseract-ocr \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/d= ocker/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/doc= ker/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/doc= ker/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/dockerfi= les/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/d= ockerfiles/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/dock= erfiles/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=3Dnoninteractive && \ 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 --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653699; cv=none; d=zohomail.com; s=zohoarc; b=bqnlzTxPWkanjRFS3PULlCWPJuzlMn8t8MNV89uXRkg1+3UbRQUzbwhKsLv6cXL0FKCx8gme5WD9FFxjEJG8kFb+6vgIosRZnBP2FWLPTwuzuOOPuySOIzQ85WWjWL/ofH9qtTovOEuRki1qx8ML7hyigjP5GbsTmgS6uVPrCo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653699; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a52wocQYp8F3YgwPFsZoycBHm5iiCFaISrIdWEZjgl0=; b=WfaL/dUWXiLsDpdMz4zRSu1A2OJcMX8W7ChUgdqLFUukCxuEcov/ZqXGdZnLWxo8kDDKOvoy8jdavld1mNf8+pi2lEsGqmteGqFAvgQW2kxNX5P82pibojL2oJPcL3W/cnxS29iOFcDHIV97xhKqQ+QPraFrt9bUROML8HG0wTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653699498107.11285602701548; Mon, 25 Sep 2023 07:54:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtf-00019E-31; Mon, 25 Sep 2023 10:49:15 -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 1qkmtZ-00012k-SZ for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:10 -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 1qkmtQ-0008F9-B4 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:09 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4053c6f1087so56290295e9.0 for ; Mon, 25 Sep 2023 07:48:58 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h12-20020a5d688c000000b0031779a6b451sm11975569wru.83.2023.09.25.07.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:55 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6E5AF1FFBE; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653337; x=1696258137; 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=a52wocQYp8F3YgwPFsZoycBHm5iiCFaISrIdWEZjgl0=; b=eyc5NfulXANc91s9Tt1G7RgSjVsf1tStUjZEcUrdCUVAVu7ftmvg3KSEgKuqF/Ow5i zSvBYd/CKV/+k8olDIjaVS7e4sGkG3R26tMwwfrQIsYuZkOv1uNupC8ILKEyUs6a4oe/ 2Hfo5ECZcIeNDMl7r0T48p1eTBn75RjzaK4gw0o5ZsbmmnOS5RmEczJZIR1+WrtMrYNF kawwIP5+uRaraf/Xxxr8zosfQnEHDKzAgDJw5adxIKUe7jBskzd2NEpeY4OWY9ijKGQC vXlB07nsB089shcyzDQ/JU95H1J7ctqJu3MaBv62yI4SHugjJ+0R77w7k37gAEGTqe0s aPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653337; x=1696258137; 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=a52wocQYp8F3YgwPFsZoycBHm5iiCFaISrIdWEZjgl0=; b=fKz7gJgJTFt2thmlkqLpAFuD3/dxZWwhZRbXugth8HxFI1hoKmTMbmVrMmXsNGSdr9 jYZXyEd+5Qa+TYyHNeAxwVjw8JLzW7aRysLzAdrdCkIXkk2KPouTU0VRE1mvrvfEF1Bq 9d/uVpciA+gOLNwB+mIny9l3x/ELHSKwZ+Yn76YRv7AJDKyW7IcgWJ5OqJJYR5zmUl0e Ig/2GJBgxHrE8pEtx2WOXR5wcKXo+igIcnsL5/JBEh54wCvR5/kkIxfOzNkrTlKk1APl HX2ErBcyHcmLURAPVd+Y71+6tByL561OfvIRgefaNBJnI3T+/P56ftdb/Ue2zIg9EkwX wNXA== X-Gm-Message-State: AOJu0YzvHBsSxlkIRMM59SVk/azWUOqq3RGm13BgqDGcSvi9kqWlOkh3 6GWjJV3ijwIipZV9+wWEcrSg7w== X-Google-Smtp-Source: AGHT+IGOF6KtpG+nISEDvad+Phr3PN8xaLPF7HRn2zImY++RVLmcASBXl6qic08aE8hDUsfJ7OR9dw== X-Received: by 2002:a5d:4d46:0:b0:321:62b0:7ad8 with SMTP id a6-20020a5d4d46000000b0032162b07ad8mr6031753wru.16.1695653337268; Mon, 25 Sep 2023 07:48:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 03/31] gitlab: shuffle some targets and reduce avocado noise Date: Mon, 25 Sep 2023 15:48:26 +0100 Message-Id: <20230925144854.1872513-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653700247100001 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. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2 - minor commit reword, no longer attempt to keep cris going --- .gitlab-ci.d/buildtest.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 =20 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 =20 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 =20 build-system-debian: extends: @@ -72,7 +73,7 @@ build-system-debian: IMAGE: debian-amd64 CONFIGURE_ARGS: --with-coroutine=3Dsigaltstack TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu - sparc-softmmu xtensaeb-softmmu + sparc-softmmu xtensa-softmmu MAKE_CHECK_ARGS: check-build =20 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 =20 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-soft= mmu MAKE_CHECK_ARGS: check-build =20 @@ -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 =20 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 =20 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 =20 =20 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653606; cv=none; d=zohomail.com; s=zohoarc; b=nStckZ/gmUoV2Lqcb3AsfyJVCsbL/lAMSt4+cRHrIORvx3uPof88HSWuKW3yq0i2WNOSIOsbfJwZ9HxdKVOapZ/3V2nySlVdeJIMh4eLj34qisHP4c5Ge+9G64qq+79ZULIEogf5eUzmCF3taE2ppCL85WW7f2/6n9mYi4sqVr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Cd4HdnbICWyITK5Y/4XhPzcPYvpQm5TBhsynKcdayLw=; b=I8OHDRQpWBM/v5ChKH9upMMoaqB6c9fuUwBKvXjHO7RTTpHCP3vAhffcaXGgO9dX1tzCKf8FClolT2Y3WqXeP5Hzl6WpxzZzrPXTc/YRAyr0ugyS4UsMtd7ZO82n791AG7+4xwWP/5aeNDxfLHeTpFBdKjGgEEyUVKV85yDBkjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653606388217.64919670730262; Mon, 25 Sep 2023 07:53:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtk-0001Nb-R6; Mon, 25 Sep 2023 10:49:20 -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 1qkmth-0001DG-1D for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:17 -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 1qkmtS-0008Ho-Qi for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:16 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4054f790190so49800785e9.2 for ; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v19-20020adf8b53000000b0032318649b21sm6818394wra.31.2023.09.25.07.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8A5F61FFBF; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653340; x=1696258140; 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=Cd4HdnbICWyITK5Y/4XhPzcPYvpQm5TBhsynKcdayLw=; b=eok3J2nNQVGkHlbMvu8/rmmNvL03GNnzO0/wLfpxZhzhVh/eHjV/0KgjNKWIQ4ysDl 2LUHbrPAtl1zOK5YJ/pdl0n1oC2Jp/eye8mL++JVn5vCE2lciqMoeSxym1cR5rHnTpqo uzkqyLzEpXljHDavZ21Lrn/oW6Tr38aqzd5+epiOK0TSaYVWpLmoyTnaPbgGq+REc+eg zHan06QQYcdj5LZiA9hdtW09BWylX1FbT+gD4scTA1uQtEP7jW09iusDsMzr0jLGGA1g PjwEWSflTc4MYEAIPc0RSG5iSTnxilxgvv9VJETqLLJLPqiilmbNpbV7ehryoC0UctMS CNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653340; x=1696258140; 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=Cd4HdnbICWyITK5Y/4XhPzcPYvpQm5TBhsynKcdayLw=; b=IjO4k0rJBFbkigc5G7Uto12AXOXI0IJIG4abQYfolO5EMsh/SxbjoVtaAeCvwlSwlv rDxMiBUytauKd0IhCyGRreW5cbWQqHEJtDkr6a2dytKF97nq54qxvFWZ71akew8Hiksl 5+J0MLu8904KOkO7MnJ0gKE++Zh+hhpDTRCDj35PkwwvV/ZWyEpLee/L/Ylbb90hb85S 96cPfQWhA+/rvPIhsbbmTwdtPReTnFqASZefR6BSsmIgz7fz3iDGWEGyXU+2wC1EVsRz yZBmY6IwJ2npjnbehVodt56FX8/uVLKPxdnP7d74nlnvb+RBGBaBjU/z9u+/2CSqI3vd 3H2w== X-Gm-Message-State: AOJu0YxmHPu2PtbP81eITvrjZcUqZOvIkEeC+JOoMMYrKmhcIEhy2WQ5 2GjETyt6Mx+aLDG0zbpy92Iwkw== X-Google-Smtp-Source: AGHT+IGIMYocIaDoZ9eRM/8O33TiaHsL2YWIHMFN7tmlUnw5/PDkfYQxbIiSwyzvw88ck/ZVkroehQ== X-Received: by 2002:a05:600c:230d:b0:404:6ed9:98d1 with SMTP id 13-20020a05600c230d00b004046ed998d1mr6165003wmo.41.1695653340427; Mon, 25 Sep 2023 07:49:00 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Rabin Vincent , "Edgar E . Iglesias" Subject: [PATCH 04/31] docs: mark CRIS support as deprecated Date: Mon, 25 Sep 2023 15:48:27 +0100 Message-Id: <20230925144854.1872513-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653608351100003 This might be premature but while streamling the avocado tests I realised the only tests we have are "check-tcg" ones. The aging fedora-criss-cross image works well enough for developers but can't be used in CI as we need supported build platforms to build QEMU. Does this mean the writing is on the wall for this architecture? Signed-off-by: Alex Benn=C3=A9e Cc: Rabin Vincent Cc: Edgar E. Iglesias Acked-by: Edgar E. Iglesias --- docs/about/deprecated.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index dc4da95329..7cfe313aa6 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -399,6 +399,17 @@ Specifying the iSCSI password in plain text on the com= mand line using the used instead, to refer to a ``--object secret...`` instance that provides a password via a file, or encrypted. =20 +TCG CPUs +-------- + +CRIS CPU architecture (since 8.1) +''''''''''''''''''''''''''''''''' + +The CRIS architecture was pulled from Linux in 4.17 and the compiler +is no longer packaged in any distro making it harder to run the +``check-tcg`` tests. Unless we can improve the testing situation there +is a chance the code will bitrot without anyone noticing. + Backwards compatibility ----------------------- =20 --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653444; cv=none; d=zohomail.com; s=zohoarc; b=ZOlMCf1blysVtgypRGxwUgc91Nx+3C3qNzhoTq+CvoS6iBO402e1E8PkB3LMHXHanEAQ2+Jq8FEKKcxO5Ejr3DRE9zxmluxELZe3nY41lOEITCbpSQcbGKkIlVWCSxBRbWN4c/WJwDe0JzsDBqjpaD4cDxy5c7S4e2f2naT69Vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653444; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r13on7w2SbSnXhlFRAWqdY9M0P6WFpp9T5fLln0Y27E=; b=N1pn/ys9UZdOM7+kTrkmdOf1QPhCifSrJyHwWcILpkMWb5oo9EeZrcHJ56PZuYOk0pozYRhDdmuHJEhSkiAUA/gvYbSTVhCJNz9Zq+IVQQZYzs9Hhfb6R2NSb4aJohsraCJq8mok/5V5TSAZcA1FNkMV6uACWsd+Kbh8crLQ5PA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653444127486.942243570751; Mon, 25 Sep 2023 07:50:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmuC-0002Dv-V4; Mon, 25 Sep 2023 10:49: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 1qkmtf-0001A7-6O for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:15 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtQ-0008Gj-Hq for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:14 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32172a50356so6204530f8f.0 for ; Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f18-20020a5d58f2000000b00317b0155502sm12047215wrd.8.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A6FCC1FFC0; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653339; x=1696258139; 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=r13on7w2SbSnXhlFRAWqdY9M0P6WFpp9T5fLln0Y27E=; b=F4f2h3MQJTmQe8AoqU2a+I/zOiPXPbyL3Cty1t62Bmv5uUkwjjzVVTqUD6AoGIQx3V cefY9wbmB8uN/1aAB2AuLgHSdIOtBsv4JVbwN4YlE32eGeZQA0gXDRkOz2a5bvzIm+kG hS4tULvDkO09gdDkpjGVwEU7WIzQWLBZrsyyxXBodFULmBvNxLIG9CgIOEFYJtbsaxp6 VbmXvHNWntaUZmHIoJiLk9N4fxwwvhH3qj+locgYE4Naw8/hkVmWpY4JZcxR/dImC2tG qfE6TVzP+bZuis/SIo5WoNehknm7jlI7TcKrMb/l+bfkvy1+H8jsoA9JElwxPSAIB8cW 7wRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653339; x=1696258139; 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=r13on7w2SbSnXhlFRAWqdY9M0P6WFpp9T5fLln0Y27E=; b=RUdAKmNzKVTtIazGvt7WwNsPC0u2aYQ+b1lem1nujlqdzk5oFDMf5fAwoRrSapm5En Nd5AqJJKcC1B3jYU3DSIAaadD3RWxWxFe3GothP2wawAccPMMkkA6Hyr4EPj3XtTnRgO oEWg7Co0+wTJ2UolirjLtmIw90VQSxeRfciMzC26e1iIpyhDgwn4bZM4dzKKG6RGCV0T G1/ezIuSzSchjrNTtyj32HuqgubtDWAu8sQj3xZV6Reiwj7c4hhd+E2+l4046gxblJNY 6Z28WRTUzGzpt/wXLzkvMNjK25C1tvYoHPqg0J9rclNXY05CUXteOo/UaJ106S5loi47 f/LA== X-Gm-Message-State: AOJu0Yzc3/JjB21+t1EQQynwWwnsrj/ySGR/LbmBQHYRYo2vVcM3kTzA vioxF2D3zaA/bgDuQ3mOK3lHNw== X-Google-Smtp-Source: AGHT+IE3kyYs4YdsaciWtbu3ns+G9H7zM0tAc4x8OuL+AXjRejIOFYblrX6yxmTWrGqVvOb2xZxPUg== X-Received: by 2002:a05:6000:185:b0:321:8d08:855e with SMTP id p5-20020a056000018500b003218d08855emr5684333wrx.24.1695653338893; Mon, 25 Sep 2023 07:48:58 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 05/31] tests/docker: make docker engine choice entirely configure driven Date: Mon, 25 Sep 2023 15:48:28 +0100 Message-Id: <20230925144854.1872513-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653445986100005 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. Signed-off-by: Alex Benn=C3=A9e --- configure | 1 - tests/docker/Makefile.include | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/configure b/configure index e08127045d..707132a3ae 100755 --- a/configure +++ b/configure @@ -1694,7 +1694,6 @@ if test -n "$gdb_bin"; then fi =20 if test "$container" !=3D no; then - echo "ENGINE=3D$container" >> $config_host_mak echo "RUNC=3D$runc" >> $config_host_mak fi echo "SUBDIRS=3D$subdirs" >> $config_host_mak diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index dfabafab92..035d272be9 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -17,8 +17,7 @@ endif DOCKER_REGISTRY :=3D $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTR= Y)) =20 RUNC ?=3D docker -ENGINE ?=3D auto -DOCKER_SCRIPT=3D$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) +DOCKER_SCRIPT=3D$(SRC_PATH)/tests/docker/docker.py --engine $(RUNC) =20 CUR_TIME :=3D $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) DOCKER_SRC_COPY :=3D $(BUILD_DIR)/docker-src.$(CUR_TIME) @@ -158,7 +157,7 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOC= KER_IMAGES)), \ ) =20 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=3D Include executable in image.' @echo ' EXTRA_FILES=3D" [... ]"' @echo ' Include extra files in image.' - @echo ' ENGINE=3Dauto/docker/podman' - @echo ' Specify which container engine to run.' @echo ' REGISTRY=3Durl Cache builds from registry (default:$(D= OCKER_REGISTRY))' =20 docker-help: docker --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653778; cv=none; d=zohomail.com; s=zohoarc; b=bhCr3SlOxxTEkRykLizCsyrGHuG64LLFDQfc4XDk9VrUGqcYgZ4S/haB/JmvY4b9oJxZQ0Z5oyYgzfCET8p0Bw4aoYAZOdKmBwlgzvwT5Ps8Bh2ZwWOjMKFYyBgJnCgzNx/xuz3w7Epr+owKF6FC5VL+hZYxKFc9evQHrqe7dQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653778; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZDyM/F5z2PX4t5z6swT9o+aFYE3lKyvYgeKJZjudJGU=; b=bIMVrs6m72Vicq58WFQbppIrhEeEb8LKjeO9LtmokzoI52xCo81S9u2KabDxUZrzh0ldh+GDNEhXO2ikfzZb+UAZIdTGxNHMR+IM2V6k8QwMOZ3g4S0Q4gPnuNDf2E41WUlIX1KRI1J4w3+Vu+UucZQ5Jr5K1FPSiUiZ4dCEmSM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16956537785611001.3442924715577; Mon, 25 Sep 2023 07:56:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtn-0001Xs-4G; Mon, 25 Sep 2023 10:49:23 -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 1qkmtg-0001Cw-VY for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:17 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtQ-0008FV-OM for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:15 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-405417465aaso54028345e9.1 for ; Mon, 25 Sep 2023 07:48:59 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w12-20020a5d608c000000b003179d5aee67sm12080936wrt.94.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C02DE1FFC1; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653337; x=1696258137; 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=ZDyM/F5z2PX4t5z6swT9o+aFYE3lKyvYgeKJZjudJGU=; b=cCNg6Q0qhqTAXvA+V86/0R0uu7KraCgNMGFtz2jlCgoxV+Vjl/G/ThAChc4Qi2KUOD 9grxTxk5RwsVzNl6abwc+bBWtOTP6aTry4fpQPuYaafUo97fbO1xB6G4+7DYoCznnGcR M7BR2PTSEJlq3tqOS2mDTq48/zvQsVJbAc2dy4uqDRlfe+QQb/D2nucHrX46s+XzQQxT pswFbA44bp7GnY3Ab9BUw9Y+lRE7yOaf2rZSPvNNecRuBsa70lPMITpOL2DwHQKtx17i oa38ETV4HFFdVqnoUlchIFRo5GUCBphSgV/XKNrCx7Lva+Q5NqRPvnHT3/Qiq257ihfj PdQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653337; x=1696258137; 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=ZDyM/F5z2PX4t5z6swT9o+aFYE3lKyvYgeKJZjudJGU=; b=h1XF4XN6AKOBxChTxQuAJNpsmt87j3ykQavnwTVMMRd1kTazRGlWZGeNh7kDsIOkSi B20Gz2923QHbigjcwxirraYIbf0cprC/os/272OcVBQzaQFMpUdr3JaAiFmxOA9DxBV5 5MkIOEfhVyCxIXf+WB/Rr3YI9QNkU+WjccOhDtumekgWx3BeHHb5QC4lP3/OVstZ2PtT HbRw+ijq2Yhgh5HLqT1hUdk6pGKngDxPsJ/b0n/z2Sy7Cr1aYYyG7A2r5yqDUQBa3Kol HU65hdgkWMBv2dTwFQq8MO7jbkpLg6cxNUmCuZZ2a5xCMf1sBSOV1edCKMG1sbGhegBO znkQ== X-Gm-Message-State: AOJu0YwmtkNrFi3ZY6yndKYeTmV77oXr0yrHQ5C80lRTEF64/0xQNERw txd54vBWqcECOZzpley4rfw+mQ== X-Google-Smtp-Source: AGHT+IFoUDF3xaSfQcn6ibrc1NNHdt07R94Aer1qgTYlNbBFBvCxtP/nwf9vmP/Kia7l8NcB4i+a8Q== X-Received: by 2002:adf:fcd0:0:b0:31f:f8c1:f43c with SMTP id f16-20020adffcd0000000b0031ff8c1f43cmr6112503wrs.41.1695653337674; Mon, 25 Sep 2023 07:48:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 06/31] configure: allow user to override docker engine Date: Mon, 25 Sep 2023 15:48:29 +0100 Message-Id: <20230925144854.1872513-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653780551100003 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=C3=A9e --- configure | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 707132a3ae..ebad155d9e 100755 --- a/configure +++ b/configure @@ -180,6 +180,7 @@ fi # some defaults, based on the host environment =20 # default parameters +container_engine=3D"auto" cpu=3D"" cross_compile=3D"no" cross_prefix=3D"" @@ -787,6 +788,8 @@ for opt do ;; --disable-containers) use_containers=3D"no" ;; + --container-engine=3D*) container_engine=3D"$optarg" + ;; --gdb=3D*) gdb_bin=3D"$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=3DTYPE which container engine to use [$container_eng= ine] --gdb=3DGDB-path gdb to use for gdbstub tests [$gdb_bin] EOF meson_options_help @@ -1195,14 +1199,14 @@ fi container=3D"no" runc=3D"" if test $use_containers =3D "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 "$contai= ner_engine" probe) in *docker) container=3Ddocker ;; podman) container=3Dpodman ;; no) container=3Dno ;; esac if test "$container" !=3D "no"; then docker_py=3D"$python $source_path/tests/docker/docker.py --engine = $container" - runc=3D$($python "$source_path"/tests/docker/docker.py probe) + runc=3D$container fi fi =20 --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653689; cv=none; d=zohomail.com; s=zohoarc; b=IlKmsS0lJ4vpLLd2V+Z5RW5wyE5sljYgUgnqQVw9lD9kxBbE0X5dfzDMeprLlp8GaAQnLHqB34Z6OWaxmbl+Nhn2nF7OpueZk6k2h9Y59U+WA6T35aLdXG0gPMSa7UFtpPalmO68kToqMVQHM+Al9ohZxi13/ZnRmCbSSQ1Q5XQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653689; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Tmt0on2gqtEUKqiKbv0NO0bzg7ahn0zMA7M5ykdCtXI=; b=nDHIQFBTAAwABPTbHFJUSKHBVO91ZVXH+NOpVPjGsa2GgytTLVkYVVC788LS1YrtABP7iF3upZc8rUQuHLDjgbsC5v20yqg3H7JiTXglNBLaVfrnQf//NCbSjnqRX0bHipORhxUR2q45mw3QyNMhCvnuzNdzhK0ErYtO3WSFpIY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653689202621.2012871836574; Mon, 25 Sep 2023 07:54:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmu0-0001tI-Ch; Mon, 25 Sep 2023 10:49:36 -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 1qkmtl-0001Pr-6d for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:21 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtT-0008HA-3n for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:20 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4053d53a1bfso53743265e9.1 for ; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c171600b00405442edc69sm8244128wmn.14.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DA6341FFBC; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653339; x=1696258139; 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=Tmt0on2gqtEUKqiKbv0NO0bzg7ahn0zMA7M5ykdCtXI=; b=vY1SmGV5G79fgZkVlnyyaHJV6nVLQ4vV1Wx3B0Ud1rV87XGurr3OzpP+bEccFbNA0c RCKSYDU4sxKDCTenAnxuRbZvQGj8AbuRwQ1RegzOOSZ066NA7KoF1PXjFxBV/fN9sMhU LNIogWKuWEbEl+4jUNI6L7JznNLLQsPdnD9HLK49hATH9YRpdbz5qYKx3bTZAn9M7UM1 3Jq/m3U1M1lz0US5DNTvGXb2KfGPmyPqL5mDn9/qZPt0ucAtRYoK4nMbJb+60N9X1q2+ yCRJiDlr9PrUQlcnsoDvAtLRh7PVtiKqgoksT9vBGBkIA27+BCTCFzS+uF3HFR3cF2LN ZWDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653339; x=1696258139; 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=Tmt0on2gqtEUKqiKbv0NO0bzg7ahn0zMA7M5ykdCtXI=; b=ltZ5uMA6uGr/AkK6MfJhvOUlXle+AC6YiEjT1vjIZmRi57yLxYTkBWx/6+e8tviffL A5ED0hRkDRpFcn/dILzzxzR6upSbETuh+HZy/FddS3KgXF3fOCZx9Wa4B4QnvJOdDd0x UIabeCYBCbwRHW6uyVao9f+naKTYM0XQS3XWzFTuEvwRo0m9VAopXu7SQPPER7YOAjvJ UYYdwW4xvQErZnWdxmZBz2Qb2eNMFWITug+UVLsL8yt7i6MXj/yPmLN0VlF56nsoEEL9 id6eYKNiFsB5w1Rdm12yBEAwewHNjd9YZgWh0uG/fxkDG/YQKcshRTSSveZtrZp+iKEN 5Jxw== X-Gm-Message-State: AOJu0YyENwUmiYsEYh+9ZvvhHwiQIDty+0m6pr78EdiKD6YcZhtPdrrI ObZSJyIrPaLy9AWZUPQASQN8Sw== X-Google-Smtp-Source: AGHT+IHCrryrBzsPj/q9XxzJDXcaN/RZ559iKlhX9u2qSpA9P1GQgog7di0ZG4gtChK2Ua0luo0V0w== X-Received: by 2002:a05:600c:3b89:b0:405:9666:5242 with SMTP id n9-20020a05600c3b8900b0040596665242mr767794wms.31.1695653339270; Mon, 25 Sep 2023 07:48:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 07/31] configure: remove gcc version suffixes Date: Mon, 25 Sep 2023 15:48:30 +0100 Message-Id: <20230925144854.1872513-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653690820100003 The modern packaging of cross GCC's doesn't need the explicit version number at the end. Signed-off-by: Alex Benn=C3=A9e --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ebad155d9e..e83872571d 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=3Ddebian-arm64-cross container_cross_prefix=3Daarch64-linux-gnu- - container_cross_cc=3D${container_cross_prefix}gcc-10 + container_cross_cc=3D${container_cross_prefix}gcc ;; alpha) container_image=3Ddebian-alpha-cross @@ -1397,7 +1397,7 @@ probe_target_compiler() { ppc) container_image=3Ddebian-powerpc-test-cross container_cross_prefix=3Dpowerpc-linux-gnu- - container_cross_cc=3D${container_cross_prefix}gcc-10 + container_cross_cc=3D${container_cross_prefix}gcc ;; ppc64|ppc64le) container_image=3Ddebian-powerpc-test-cross --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653613; cv=none; d=zohomail.com; s=zohoarc; b=VadKT+pof+lhumYdnDt0L50i3m9OQx9u9qmiQ35Upbezxx8pJbamTrIQd6qesfzxWx1X6z5B/p7p8b5FtGzP/fsyL9nN47JGOm8gSI5hPM21RTd1DP8VKiAsJltHZC1CLrAPHlDbMcF20A5mzttk66fYndPkIXlZLBOysyLju0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653613; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iR1iGRTKQhM4i1nnnC3x69E8sH/nb//WSFW8YZTcQR4=; b=k4c8x0MnHojKfaK3c831E6TTHIfwvJnEqbhZzM1LDYBhCtUSQynvfoJBsBHj0dka3qp1eJMlLyWS7pRwlMMBjrXy6w9A1UKYB9xgOy9SdXYlQg2hHOqOg+a+/iwRxsUtogPwaTQ40j8YI7ulbLoCMagUlGDOvdJt4BxnKUsNgPA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653613802273.82365608493205; Mon, 25 Sep 2023 07:53:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtk-0001O7-W3; Mon, 25 Sep 2023 10:49:21 -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 1qkmtc-00014j-TB for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:13 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtQ-0008Fj-Po for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:12 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3226b8de467so5266765f8f.3 for ; Mon, 25 Sep 2023 07:48:58 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bw10-20020a0560001f8a00b0032326908972sm3557423wrb.17.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F3B991FFC2; Mon, 25 Sep 2023 15:48:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653338; x=1696258138; 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=iR1iGRTKQhM4i1nnnC3x69E8sH/nb//WSFW8YZTcQR4=; b=gTfmiDciHGcnHOh675FpFqs/r5NIxBNOqK82gDzZ5UuhEENXMMqJniNZwLO8fCI3yh 8597T5mxVWpeQRWw7uLleJNXCBPh2/gDC14B/BOexxxMnzbbj+7eOTiU072hFpRDw8F+ RVhPdE5wfZT/zamQZW+FIqukOgny3i5B5MN3Fae3q4YG4rVngkqsdleH0dKzVyli83/W YEAwU8latFZa+R/FuMirndy+xK8EDN8qM/20n0qS2DrE+go/ocdVpcQbaquL9CI1MQzn a3BTux1Y7afAPq+dw/P3F2Rh/kYHzwFhdHA9pgHcgwDYE0jlz7y9x3XB7r2EOCykf7q+ suYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653338; x=1696258138; 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=iR1iGRTKQhM4i1nnnC3x69E8sH/nb//WSFW8YZTcQR4=; b=Vq3n1xTXlk0qx9wglJI1XODI2zKHX0SvQAuaYXYG5WYC44QYIEAoe0fAqxywWbH/Di EgFW+mnso7j9O+4UsPfn/dfJsDShEcL0ZsieduKNGN5On0qx4+2jInTI2L//vI4XppFy 1Tt/hkyfYnxwFHMHSX4ShhkQfDpOVzQXYUCSByroquXRMm16oSCpF1oP2Q94oroJZwLl cfYEs/3Q4lnhfXBQaT+Rfo4rzkbNrR1wr8RsUWfB6NEJIA+Kilh3YkEI6u7czeJG4jgZ Fjfoa6PrFM30Ua5EVWeJtHtma5S1f4HgDHbb/0fdJdRsUDJVxDWb5W5f1/zzEFpjoT1u aKrQ== X-Gm-Message-State: AOJu0Yx72HLg2SUOMmb2ejClM8XlXYsHTMyZypMVyuw3bYfS7AHx3BwQ 9CN9k7spSvZi4lBk16u76Go3cQ== X-Google-Smtp-Source: AGHT+IHugUQ5tOq6CRzPkYCzsBd9E4Yy/hi2wf4KRfr4/Tz70/a43yWShtUDMYE1btwRst1FJhQGdw== X-Received: by 2002:adf:eb84:0:b0:31f:bab8:a31a with SMTP id t4-20020adfeb84000000b0031fbab8a31amr5254791wrn.39.1695653337710; Mon, 25 Sep 2023 07:48:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 08/31] configure: ensure dependency for cross-compile setup Date: Mon, 25 Sep 2023 15:48:31 +0100 Message-Id: <20230925144854.1872513-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653616025100007 If we update configure we should make sure we regenerate all the compiler details. We should also ensure those details are upto date before building the TCG tests. Signed-off-by: Alex Benn=C3=A9e --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index e83872571d..a95e0f5767 100755 --- a/configure +++ b/configure @@ -1788,6 +1788,8 @@ for target in $target_list; do echo "HOST_GDB_SUPPORTS_ARCH=3Dy" >> "$config_target_mak" fi =20 + echo "$config_target_mak: configure" >> Makefile.prereqs + echo "build-tcg-tests-$target: $config_target_mak" >> Makefile.prere= qs echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs tcg_tests_targets=3D"$tcg_tests_targets $target" fi --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653779; cv=none; d=zohomail.com; s=zohoarc; b=g36Q4cb+R+rt2VUOQ2vXB8CSf8yv36weZ8KmNo2W5U8lXVJqam4Ydq1r8P/lMV6pblFUPEacDRtIlh0i8tVEVYCI2KjAEAEkCkV2s0FyVj0zQ/DvQorN4zPpLViDwJa7MtXQTEPpn8sfqj8F0TiYoEu/QhDmjBywlAsJZPguxw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653779; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kNHX4JyhoYexAQqB9a7CrjUa8yJRKrNW0ix3Ut30RxE=; b=K+wSVmkux3g4X52zrjgcRrHiw6bFhkE4G9VFWB9fJngku1oJ193umf1KIC8I4U4CP8HcMCW3PwykWPlx/KBInFPFa9AGsofM2gNgNBuPkjKyYIaNFZeaJSswA/CQbCaTa36SXuOpPzezS8e3yWzybKCHejn0BG6J86YGEPGwnBs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653779167257.00257422597645; Mon, 25 Sep 2023 07:56:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtl-0001T0-VP; Mon, 25 Sep 2023 10:49:22 -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 1qkmtc-00014e-Rq for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:13 -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 1qkmtQ-0008Gx-Jv for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:12 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40572aeb73cso31127225e9.3 for ; Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c230800b003fe61c33df5sm15386125wmo.3.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A8A31FFBB; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653339; x=1696258139; 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=kNHX4JyhoYexAQqB9a7CrjUa8yJRKrNW0ix3Ut30RxE=; b=o7okgtlzKM5CdQPEsjYaWC/JCovzE4x9nZPmryzKjLnYr+KwgIO92EBcllUVMpLwTP yKnPWH0bXZxePEqYhd9oIhyDONqAjFYEgSnEJNIJhHMylwUhDWNuq3wz1a2gA94Iosqf zK0NGvhXonwTmUQK0iqkt/yuQEJTiZIoQ9p9ztLGBJ1OVvJUafe7O3L7URsoNUgdVG+C MMOU4aLBkD+pAeVmDmTBsSyJBgcU4yec65/QoVZocVYpOuE5mqAyrd1u7z0Jv6SZ6p8V +P+0H5hUHuzDfNJsvFofxv7sqxvAnfW6lj5K4zpte5ZzbFr1SY7KpIkZZqIma2JZM23t Ch8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653339; x=1696258139; 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=kNHX4JyhoYexAQqB9a7CrjUa8yJRKrNW0ix3Ut30RxE=; b=i3Iq+lp9GJ8oE0MSbqlUSRqTDTp08n6A8mc59XesgBa1cLHziCElRYD6lL4toDPRHj kVlbPgamlLLR9nZOrb8mHf3cHcFbptn3zNR7UnVo0F61p2+w4oDX1ks9oLXezkMCVdkR MHTSWlJCM6gYTv+wSWBF1BA0ol1DLuGtJdopuSnLHZ/aoW1E1CA2vXgQLMTfflvDD7RV 6tDh2z7EXn1WI29ZdXDJtAVV7JUM2rWhcdqc4vcZ/4MyuZV9Qu9pEbTfsb5wqnmGGGjP 4ZN7yQIyGw+2WItDJQd1RsrIdToDIIGUxa2GYV60yfQoJR5PFhN75ZbkGTmFAFejlByM AzhA== X-Gm-Message-State: AOJu0YzpDjv7y9aq65nYI/JhVLHQ/DkryDT59B7fD4d4ZEs75IfYuHSa q5V/Rm4pBMozd9lOyH8TDr+oSw== X-Google-Smtp-Source: AGHT+IGMr7N7urKQ8V3Sq28hXqy9yAVrCdYa0uBVNGkQ33p+6KFVM9aPbd7eskGG9fS//8pY41zZPg== X-Received: by 2002:a05:600c:5192:b0:405:75f0:fd31 with SMTP id fa18-20020a05600c519200b0040575f0fd31mr3794870wmb.31.1695653339092; Mon, 25 Sep 2023 07:48:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 09/31] gdbstub: Fix target_xml initialization Date: Mon, 25 Sep 2023 15:48:32 +0100 Message-Id: <20230925144854.1872513-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653779916100001 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=C3=A9 Message-Id: <20230912224107.29669-2-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- gdbstub/softmmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index 9f0b8b5497..42645d2220 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -292,7 +292,7 @@ static int find_cpu_clusters(Object *child, void *opaqu= e) assert(cluster->cluster_id !=3D UINT32_MAX); process->pid =3D cluster->cluster_id + 1; process->attached =3D false; - process->target_xml[0] =3D '\0'; + process->target_xml =3D NULL; =20 return 0; } --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653601; cv=none; d=zohomail.com; s=zohoarc; b=cc6o5jTP0gb+q35a3dHYrq+JqHoQ+vx56f+waVEjOEa0+SQZwrm8fAyZamU1FKWWtcZLpaV7sBRAG8KBPvMNEJ6yFOOLrLU02Cz0U1KAKafvR/sV6xlcM87v7y/KrftLVvD0elgk0QBQsLQAlGhr/K5UMs2uH/YYwLCFZ0+W108= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653601; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DlEhphEtX0KtQL/e4ae/jun4tEwNOtAavPJ6o58muzg=; b=oHArc7nmM7NFPe9CD0jJ8qr4QH3nz2Osq7iawI9GAWIemCb50XGqiO/m4MTJ1+jtWylMlyaptybjo3abFmXkqJqQpPy5b0dJGvW+/KKzA9ficog1U2JoDcqV4KwT0q0YpO6RMd81gcYEaH9SrEH3JbwEyefZIFL4YCcerEpyRrU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653601632561.2121866771095; Mon, 25 Sep 2023 07:53:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtl-0001PT-7R; Mon, 25 Sep 2023 10:49:21 -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 1qkmtf-0001Br-H6 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:16 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtR-0008HY-OA for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:15 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40528376459so66392365e9.3 for ; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y23-20020a05600c365700b003fefe70ec9csm15207988wmq.10.2023.09.25.07.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:48:57 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 347651FFC3; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653340; x=1696258140; 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=DlEhphEtX0KtQL/e4ae/jun4tEwNOtAavPJ6o58muzg=; b=o/nUgvjAXOP8v2n0hbHEcBWRjMZI4980/xMJyrB9IzV3Mpu9/kPkYsNFQf4Z2f392l CN6cFmmPNhIinKQk3Yr4YOHoht0Ps6NhtxjZzXIXRsmP08/hTWudXOsYZ+VE33/Pd1aO rRWPI/GxAbNBTkZ03tV0cKH2Pio6ybNz8y2HIq11I0cpNRAlp4FtPgdfdjq8WqVp/fuj bXO5VO/0ZOZ9/eJ/ObccQK4YPHB6S9qWEna7ID+TQMubJ5eu8geo8I/Ub8tzStHuzb6p rdO/va++RBpbZxq5MDA4Cpwee1U/mDcgbYYQVF7ulB5NMvVa50aBp4Mwus4M1Bg4UQYg mV3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653340; x=1696258140; 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=DlEhphEtX0KtQL/e4ae/jun4tEwNOtAavPJ6o58muzg=; b=sXw/FCcam5T7do1LbPSN/mDyRZIzvD1+i+Y49EH9IcOWkKh1F6uw9C63t+yNgazD59 IeSCKI1Ut2Tk10qZTbaO9slU8DT7Y8F4SPOLvy77m0OgfGy16e648VQ6qTDEaDoqTGr7 RhN7r5K+FxiyJU6N24+WDOcUM6ZXyFbGZtx+/jWSATmgTSZaKGMPnvgTI6qRMwi3nD2j IhH0ij6pyY7YHcU5L2GnGUbShvC0ZIu9vRhfU9Unio3mmz21/iuZOCPKUmELJKpfUOcL ztUwzBeGXIe2BskOraMQJg66BQ5+QyBvieaQgjO96uA/C/pZE5QkKE8/dMMWkoQHcozS qgKw== X-Gm-Message-State: AOJu0Yx52DJ+rkCry0tSPLyywdQlWmsquKAFjcFpfOq4H2UGx01AwBpV CeZREWaEkeMuy9YefAioSNCOfg== X-Google-Smtp-Source: AGHT+IGhe1u04XO93m5rgLTFr+jl5409HMKnsiFsSpSw9wJkJLs5eAVSrkgDsaznTTLlTJAxliqaUw== X-Received: by 2002:a05:600c:22cd:b0:401:b493:f7c1 with SMTP id 13-20020a05600c22cd00b00401b493f7c1mr5917888wmg.35.1695653340198; Mon, 25 Sep 2023 07:49:00 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 10/31] gdbstub: Fix target.xml response Date: Mon, 25 Sep 2023 15:48:33 +0100 Message-Id: <20230925144854.1872513-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653602274100001 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=C3=A9e --- gdbstub/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 349d348c7b..384191bcb0 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, ""); =20 process->target_xml =3D 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) { --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653646; cv=none; d=zohomail.com; s=zohoarc; b=kF+jhlI5q5pS/2X4yz/EH5gf0qr7evFuj0e88a7bWnyLqxDBvI04yHOf704ujfCKtAYHLOXNw6usx75OuUAfWg2A2br35b0n3t75hceCGvss6ctH1FNu8qmvyvzUJnYQcD7/WtUF3N33wrIs08En3wTYPaVJfzHpFtiLiV0Tj0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653646; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=afBvhFP6609M8IIBIfYpGDboWuF4PMsRTHYI59b4V3Q=; b=BqRYjg/M9croMuNdWN3x6jQP5/KTw0cGJwopU/eJk3O7IXPNpA1OlLPB8BwWZ79Kad6AOEnBg1J2FT4z28JHUDd9vsygxz5Fpv4ev+PFEDI2ihFto2CQujzP0DZb0Pjs9GDCjYTIwRv5J9FMn7lXlKb6D24vfgNdQylyKuc8tUI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653646593874.2461697821653; Mon, 25 Sep 2023 07:54:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmvp-0004nc-Pp; Mon, 25 Sep 2023 10:51:31 -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 1qkmty-0001rC-Ie for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:35 -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 1qkmtV-0008Ju-NV for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:31 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4053db20d03so53044215e9.2 for ; Mon, 25 Sep 2023 07:49:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f2-20020a7bc8c2000000b003fefaf299b6sm875831wml.38.2023.09.25.07.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4E4351FFBD; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653343; x=1696258143; 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=afBvhFP6609M8IIBIfYpGDboWuF4PMsRTHYI59b4V3Q=; b=ARsFEKFKB+0+gsHCoDorzenIy0R2PpUMhPOGlZ57PvASeOM+jN/p5bCXD7txWtPZf/ hLWEA0JqsEZMN9+elVzpg8Cefe2uax6QT/EAn0xeoy2+KdlMwHuYOlTpmHQ4/nfn4iDM zVy4dZfXaLRxwUPnzMt5jZsxlZZxmSoCRoG+M5s+FbNKJwmIBza4cM9kcIRDFlIHTk0Q BxAcVmMfaOZCOTln6Q5BMGP34LIRhS1iLbuN7XRQoDk62MLV7pzMEYIG6Gz7PVQ56P7y m7DqvMg9Wqg5KEluOlH5ah1ecAk6Z+4D0GlBG58UIKiGavdkCMgG1K0exjTHXpyIR1eN iC6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653343; x=1696258143; 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=afBvhFP6609M8IIBIfYpGDboWuF4PMsRTHYI59b4V3Q=; b=tnPv9DZt2Vj12eWtQt50JBry89t6MXr3MuqROnrgdllciXrk7+aJjCtyMTg/Gilpey z6Y4/m4MvhNvIRulijS89CtCL7logW6gtqko+Bk7agpNGmM75i9MtreaMiV1dZzFg1qK Mi09aq2PTjAu7ntuGTx7Qln9XKS2Rjl9tHYvyns/jhLN+723C/jXgdFuk7qFjDPH7/+o DHxaWGJ8rD7mEJJMCGLxfznA04c1Uc+qqGPHVO7fa9kCtoJHA6UgyR58u8KBUnOE+bBm vilO16wznNmI9LRELcuEBT5MQbSTgqhEHrGzizZ5wHBCpzydvx682w7y/yiiouJscQMx 7LlA== X-Gm-Message-State: AOJu0YxOVf5dSYkWlVPmRzH0dOdnakcXCNJlyvsACylV8ETLi3X2bI0P EvYnP6PRUn3EPBlIJgwxDPJQUA== X-Google-Smtp-Source: AGHT+IE81+2T4xmz33lUTgO9MMdDyXYA17Iq1qAXs2BdCLV4x8cBgbMmfstz2B6rR+o/BoOtK15D/w== X-Received: by 2002:a7b:ca45:0:b0:405:40c6:2b96 with SMTP id m5-20020a7bca45000000b0040540c62b96mr5826835wml.3.1695653343173; Mon, 25 Sep 2023 07:49:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 11/31] plugins: Check if vCPU is realized Date: Mon, 25 Sep 2023 15:48:34 +0100 Message-Id: <20230925144854.1872513-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653648521100007 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=C3=A9e --- plugins/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, gpointe= r v, gpointer udata) CPUState *cpu =3D container_of(k, CPUState, cpu_index); run_on_cpu_data mask =3D RUN_ON_CPU_HOST_ULONG(*plugin.mask); =20 - if (cpu->created) { + if (DEVICE(cpu)->realized) { async_run_on_cpu(cpu, plugin_cpu_update__async, mask); } else { plugin_cpu_update__async(cpu, mask); --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653769; cv=none; d=zohomail.com; s=zohoarc; b=V+nZNg4lBhfX6SdNNY+6oHdAkP0hQEgS/2hpS58bPoxTpuEkCwDB6Ee+euwxYAI66/XQZA/LaswrtXujeWIS3Qw4+JgHPCWEJ5aHDESCE8olinSB5xdDx0Gy4eTAMi//zS7mf/2481FIJuPvHBlZXInmRaRWeaQgwDRtkHnqtbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653769; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bHq5bIYTwX4KI919eN/k0HIJh2GL06+mtrfpk9KLLYo=; b=XSPiow1cndbWL+1ljxHAIucVnUKPejrkO6wdQzZWA7Zd6UaAvKkm6yK1WzuJYLPfUExSVC4Vcmsauvy//028l95f3y4KwquJi99WQPTvc0W2QubpPPrVumQ0n6bErlD3aImzfoF81kP7uy1nUSgTH3cdGwNlDjuXLS3tkgyz15o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653769762170.3162692896425; Mon, 25 Sep 2023 07:56:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmtn-0001Xv-4a; Mon, 25 Sep 2023 10:49:23 -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 1qkmtk-0001Kl-8R for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:20 -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 1qkmtS-0008IX-W3 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:19 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4053c6f0d55so61797745e9.0 for ; Mon, 25 Sep 2023 07:49:02 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s17-20020a5d69d1000000b003141e629cb6sm12021354wrw.101.2023.09.25.07.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6901B1FFC4; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653341; x=1696258141; 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=bHq5bIYTwX4KI919eN/k0HIJh2GL06+mtrfpk9KLLYo=; b=Iu/jASGAr/RdOVqAT5CuAGMIExdRoXunQyWhlRWUJtd6P663oPyDht0LuBXvJRWXjv hdb01Z/xPW/w+5txPuhw0c2g+zGWmRzLJXqr8R1Eysexh/o0MQ94DBWx5hQu0bKxt6Cs VhNF91/Byh7nbjUJWsASAghULz2jZDc9I2HWFjp4GnbCqhouzwj9wp3luGtW/XgXrSOe 5qZUDPGJbWR69iIPon2NNaBYugQ8NddIQ0oLoGisMdKsCssB+AlIIUzu4fpt4R+UNdE6 ZIEfXbZ4oY+85/CeN/nJp4RBCWd/7knuk+1wfQ3XEW7bT179NvD4A+I3teXtf3kjKib0 X5HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653341; x=1696258141; 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=bHq5bIYTwX4KI919eN/k0HIJh2GL06+mtrfpk9KLLYo=; b=DCUqYh1iU96rd3d6tEz+luarJ8D+BlHhmtpXfZHekOEvcZCy21q8nZz6VZJ7qvKf1j iTVGeC9UZRvCTOaYYbbXcU5l9JMW4bqv8YxysUoSu5IGkUMHSX4w1S7Hi2JAdg2MW6N5 ORluNGG3ZnAROYnZYM+keoq2n9AOP9/VcXWxdgG9mHjHZbdX0icDmyi/w5/9Yb43IG6w l+mfwPM4fzeZ3iJCTPEYw8MDuW66YV8pD9RM1K1bLfZY2H7oZE18y1PaA4yrj3B1BiJ2 bYwdLsgJqeB1LThdexo+l1PNF2j1i8idlec/QYH9ozfXdvGnYNiv69zVUgJZyi7rqTAn lE4Q== X-Gm-Message-State: AOJu0YzKUQtTEfjiKo2o70MRI5RS+g4N+9NrTP/6EB4QU/m/sy1jqu0i w3J91ts7ObuthQquq/DlCqD14g== X-Google-Smtp-Source: AGHT+IEhBk8SeRggdbZhAwdbG7re8ud0UcWE4y15dVUXiYufGJ7GlUNKwtenWZAwCrp38HqJ+IdJTA== X-Received: by 2002:adf:fa0f:0:b0:321:7050:6fb6 with SMTP id m15-20020adffa0f000000b0032170506fb6mr6903023wrr.67.1695653341463; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 12/31] contrib/plugins: Use GRWLock in execlog Date: Mon, 25 Sep 2023 15:48:35 +0100 Message-Id: <20230925144854.1872513-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653771461100003 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 executi= on and memory access") Signed-off-by: Akihiko Odaki Reviewed-by: Alex Benn=C3=A9e Message-Id: <20230912224107.29669-5-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- contrib/plugins/execlog.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 =3D QEMU_PLUGI= N_VERSION; =20 /* Store last executed instruction on each vCPU as a GString */ static GPtrArray *last_exec; -static GMutex expand_array_lock; +static GRWLock expand_array_lock; =20 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 >=3D last_exec->len) { GString *s =3D 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); } =20 /** @@ -51,8 +49,10 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin= _meminfo_t info, GString *s; =20 /* Find vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); g_assert(cpu_index < last_exec->len); s =3D g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); =20 /* 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; =20 /* Find or create vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); if (cpu_index >=3D 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 =3D g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); =20 /* Print previous instruction in cache */ if (s->len) { --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653656; cv=none; d=zohomail.com; s=zohoarc; b=hmgttHzdUwGDEcNk7qFEE+LRLIh2p+INaTs7gZV3yik4RCfpls8cuzI0s4gZamqhzkTkrzyif8kbTsNFAUWWcjSwHV4z3wNEzNBxfgpEg3iQo18nJpnxlzOMJn+O0XTq+wrOLdA7cGxx/vvHHXkSn0X0NMHndMYQgEjC6Kg9IDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653656; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kp6PIbFH6f3v48hXClqQy7qaOEKB35oEkVOcO5gVtwM=; b=MGs4svIFE1+TY+6QntOHodC2agp9gp0MRAs1OwlW1sffNOXzdybknpmyM6oStZNDzdSO65G1Tj5dCkw6n6M5lJ9+uMOxeOlGbDkp5sl/J69aG5QGFGvyVWbxB1LZArX+e95EhKkCPbfhURtKL9CN2p3Ab7p0q34/yz2kw+mi/5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653656361397.90791770913586; Mon, 25 Sep 2023 07:54:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmuC-00027f-67; Mon, 25 Sep 2023 10:49: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 1qkmtp-0001c2-SU for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:26 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtU-0008Ip-2e for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:24 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-32179d3c167so5598001f8f.1 for ; Mon, 25 Sep 2023 07:49:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p14-20020adfe60e000000b003197b85bad2sm12109399wrm.79.2023.09.25.07.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 947401FFC5; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653341; x=1696258141; 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=kp6PIbFH6f3v48hXClqQy7qaOEKB35oEkVOcO5gVtwM=; b=D3fc9aNWNf7p4VwxvKOxAROAd8tKZgsWJR38yzfz4n7dxDPktacJtZtDxCU7vWIyBo verl7UJWStUwvQx96iPCwamGfHLCnbzPTbcODoeYBwonla1a3acvxTlAWpaNuSxQIKdq 3OiwSzYQAjnhgIm0hHe81ui5mNAUXIQZbbruDHXdX23FBx2iWwBYUzh/M6IzSpoeZ5kG IOwMeH7KTdJtF2XBx+wx5TqCMgKA2YYGJCjf8Kmso1X3V3lRJhE0Hh6d6CdxKAb3V2Hq H7e6hTbvw7o3Q8b+JlodPFo5mRTY6YMeRMLHhFnhmlj94cIhdjDHbCKKu7m12AIHsqQG XDHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653341; x=1696258141; 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=kp6PIbFH6f3v48hXClqQy7qaOEKB35oEkVOcO5gVtwM=; b=t1gVSnKESsOnk+ivN8LnYUMij62wef1FPyGHsLeQV1GaoaJVT+/J/FJIJkpvtVY63c KgwhumPwxKpe+iHxOlRmnpLLo6qPjvn1nlADhoV4IPhL8VRHySY0vVF0uxLyfl2qIAQI lV4emWbbDJwu9k3qZhWQXdwVbF768FLUIQCK+5SM+nB9Yr7DKMJgQMGzZ4oJPLTKk2dc 2VDfF6Zribuntal50xpb7i30e9t846773lzoOC9YJ+PA82LXoh45aEDBWp9MBFVBaD7A /kghOASH8+1Tl+YgXNJOQgztCgr4ThyOvkJF1Om66HADFII9ZvWJMQP0aXvhQZZBSzXI txVw== X-Gm-Message-State: AOJu0YwA7AH3meA1453/9n3AVG0+ygZlLw8gPgDjCb13Bkpq86amMlha R+fkJznTIvPYhWeYxSIFn/Z5XQ== X-Google-Smtp-Source: AGHT+IGE1vn2IVA9e/asvFrG10vF6+MyT1dD1UrvRjPx+QXTi2BOidvHRYdARRGrFFESwJqVfN0P7g== X-Received: by 2002:adf:eb84:0:b0:313:eb09:c029 with SMTP id t4-20020adfeb84000000b00313eb09c029mr6811479wrn.43.1695653341570; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 13/31] gdbstub: Introduce GDBFeature structure Date: Mon, 25 Sep 2023 15:48:36 +0100 Message-Id: <20230925144854.1872513-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653658338100002 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=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20230912224107.29669-6-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- MAINTAINERS | 2 +- meson.build | 2 +- include/exec/gdbstub.h | 9 ++++-- gdbstub/gdbstub.c | 6 ++-- stubs/gdbstub.c | 6 ++-- scripts/feature_to_c.py | 48 ++++++++++++++++++++++++++++ scripts/feature_to_c.sh | 69 ----------------------------------------- 7 files changed, 63 insertions(+), 79 deletions(-) create mode 100755 scripts/feature_to_c.py delete mode 100644 scripts/feature_to_c.sh diff --git a/MAINTAINERS b/MAINTAINERS index 355b1960ce..8ccd978811 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2829,7 +2829,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 =20 Memory API diff --git a/meson.build b/meson.build index f426861d90..98a65c7df9 100644 --- a/meson.build +++ b/meson.build @@ -3702,7 +3702,7 @@ common_all =3D static_library('common', dependencies: common_all.dependencies(), name_suffix: 'fa') =20 -feature_to_c =3D find_program('scripts/feature_to_c.sh') +feature_to_c =3D find_program('scripts/feature_to_c.py') =20 if targetos =3D=3D 'darwin' entitlement =3D 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 =20 +typedef struct GDBFeature { + const char *xmlname; + const char *xml; +} GDBFeature; + =20 /* 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); =20 -/* 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[]; =20 #endif diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 384191bcb0..12f4d07046 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -408,11 +408,11 @@ static const char *get_feature_xml(const char *p, con= st char **newp, } } /* Is it one of the encoded gdb-xml/ files? */ - for (int i =3D 0; xml_builtin[i][0]; i++) { - const char *name =3D xml_builtin[i][0]; + for (int i =3D 0; gdb_static_features[i].xmlname; i++) { + const char *name =3D gdb_static_features[i].xmlname; if ((strncmp(name, p, len) =3D=3D 0) && strlen(name) =3D=3D len) { - return xml_builtin[i][1]; + return gdb_static_features[i].xml; } } =20 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 */ =20 -const char *const xml_builtin[][2] =3D { - { NULL, NULL } +const GDBFeature gdb_static_features[] =3D { + { 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 =3D True + + for c in bytes: + if not quoted: + sys.stdout.write('\n') + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted =3D True + + if c =3D=3D b'"'[0]: + sys.stdout.write('\\"') + elif c =3D=3D b'\\'[0]: + sys.stdout.write('\\\\') + elif c =3D=3D b'\n'[0]: + sys.stdout.write('\\n"') + quoted =3D False + elif c >=3D 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[] =3D {\n') + +for input in sys.argv[1:]: + with open(input, 'rb') as file: + read =3D 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=3Dxml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - - ${AWK:-awk} 'BEGIN { n =3D 0 - printf "#include \"qemu/osdep.h\"\n" - print "static const char '$arrayname'[] =3D {" - for (i =3D 0; i < 255; i++) - _ord_[sprintf("%c", i)] =3D i - } { - split($0, line, ""); - printf " " - for (i =3D 1; i <=3D length($0); i++) { - c =3D line[i] - if (c =3D=3D "'\''") { - printf "'\''\\'\'''\'', " - } else if (c =3D=3D "\\") { - printf "'\''\\\\'\'', " - } else if (_ord_[c] >=3D 32 && _ord_[c] < 127) { - printf "'\''%s'\'', ", c - } else { - printf "'\''\\%03o'\'', ", _ord_[c] - } - if (i % 10 =3D=3D 0) - printf "\n " - } - printf "'\''\\n'\'', \n" - } END { - print " 0 };" - }' < $input -done - -echo -echo '#include "exec/gdbstub.h"' -echo "const char *const xml_builtin[][2] =3D {" - -for input; do - basename=3D$(echo $input | sed 's,.*/,,') - arrayname=3Dxml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," -done - -echo " { (char *)0, (char *)0 }" -echo "};" --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653644; cv=none; d=zohomail.com; s=zohoarc; b=AIfZzdKcDnw8RO94AFeQylRpw8F9pRW3VRIv0LyR4Aj1p1xs6N4BAeN4yNZZsE0PyJW2AX2G8xu40Djuq5v3HodI7G5K9g+XKJZDMZxmdDnHYvxaqVrfrGOd/I9hkYL3wq2WbCzt1qhAr0R01jqRnm8IbQz4MLwg6BHL6wA9OaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653644; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AwYBjX11kVwleBQYnG52lCtDdSTJ4dxnB89SY/KP3O8=; b=nbIlk/Y9Q2qWtGWTLpYUdaT4DCyCnOymFyM5ZfPzVZlA3UrzDN6Z4KkzMRRvOunXhNptPCOHcRq+FtXFCIy/8sZcM/XLPxbkcMw0cQJMLdayuBu7BCeieMqtiqcEh7jpd3+xN+THiJhw/aTFO5RZtFKmBJUsQ9IBGuka8YbrZFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653644502859.8125688759525; Mon, 25 Sep 2023 07:54:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmuG-0002Vz-Rr; Mon, 25 Sep 2023 10:49:52 -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 1qkmtp-0001c6-Vr for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:26 -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 1qkmtU-0008Iz-AE for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:25 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-405361bb9f7so64767825e9.2 for ; Mon, 25 Sep 2023 07:49:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s13-20020a5d424d000000b0031753073abcsm11995462wrr.36.2023.09.25.07.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ADF201FFC6; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653342; x=1696258142; 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=AwYBjX11kVwleBQYnG52lCtDdSTJ4dxnB89SY/KP3O8=; b=UjRPGS3UCbJHCt6ODKJBpBQCRvaNegUrFGp81vd2nfl1F7V1OIJeQRkLA4JU8bBxjz SKk69b5a8N2VFPKYR377UwEMWNd0YZUa4rTeOK01ToRQ10S+u/i+RUoVHr/ZdUP73Y4F A6dHzR9glkHy3zBVNY2WHi8NEvW/MdVVMVPjyjoEhePU2YhYVrtwAcAzYIEpELLEo/nq 8m7qHYsHm49dUzIe/YiNBBUdK3cWPW12HZdHdN8YZEqCjz5lQo0IixodZqLQYcBtCcZa 6ff5F50wzp666r8hvYVOhgsPGONKZBkmr2DlRAguUqMi1K/6vAoOdmsDVvblb7pInMLi 1eBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653342; x=1696258142; 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=AwYBjX11kVwleBQYnG52lCtDdSTJ4dxnB89SY/KP3O8=; b=D8uxHDCmUOaxEyJB8P1t2h02WK9aKC9amOWX3ZEdS+tq04dS1xlj53WhvUbUSc6lBi fWjmzsGsEMhIDD2ps7clDW1k3Zt5IWX3K6mQGDCDjanzF1sBBcJA+DXb/r8DcNcg1rND AnNBk4vxSQxYmEEV7qH5IKGlOqaULfenjZ+Y6Hj/M5Ui69hI9qTcYn6n+KjWdBIznSKN X5wthTiJMnHI58M4YYQSjg0BEwCZD39IhNfbt68K9rHtOWkt664I/pUAIpzk2UO/XPm8 0MCo8tl+idY95CRQSdDK+F6q+izwxM8a+TnGI38KkXDoqklA1GNkBAywT6PxPm40il4m PZaQ== X-Gm-Message-State: AOJu0Yz15FS4ua11kOPgtfHgTe/Un3a1kNVQv/LkYN+2tlQfAeLSSKAt dxoekU9qIkPqHJZmt1CGTQ+GvA== X-Google-Smtp-Source: AGHT+IFfEWWhRGOWllDwvUBwcJYmT874H+l2IMfxtr7TeYA+0ZRRBGEBpEveD7GnIVCqIJ1pBndzvw== X-Received: by 2002:a05:6000:1048:b0:31f:e980:df87 with SMTP id c8-20020a056000104800b0031fe980df87mr5635374wrx.38.1695653341772; Mon, 25 Sep 2023 07:49:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 14/31] target/arm: Move the reference to arm-core.xml Date: Mon, 25 Sep 2023 15:48:37 +0100 Message-Id: <20230925144854.1872513-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653644841100001 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=C3=A9e --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b9e09a702d..10fcc61701 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2393,7 +2393,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void = *data) cc->sysemu_ops =3D &arm_sysemu_ops; #endif cc->gdb_num_core_regs =3D 26; - cc->gdb_core_xml_file =3D "arm-core.xml"; cc->gdb_arch_name =3D arm_gdb_arch_name; cc->gdb_get_dynamic_xml =3D arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint =3D true; @@ -2415,8 +2414,10 @@ static void arm_cpu_instance_init(Object *obj) static void cpu_register_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc =3D ARM_CPU_CLASS(oc); + CPUClass *cc =3D CPU_CLASS(acc); =20 acc->info =3D data; + cc->gdb_core_xml_file =3D "arm-core.xml"; } =20 void arm_cpu_register(const ARMCPUInfo *info) --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653668; cv=none; d=zohomail.com; s=zohoarc; b=LtgcoHBN/yZfDdZCagYjEFy6pvDfQBGOvcIraZ+iYdRN86+oDv6j6lsKTcMW5fU8mFOWRoqmNkJvF4pvEbdlhjb1Z2d4HkmQySSwM9GGoG1qWe2SQoTaMgqBa5NWBsghTCtMnR+v/IAS+1A6dy0hB92E0wgwNYWnHVGguB3+49Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653668; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wLqocinDU8rF88Hv8wZBmX599z01GNwfmOcliOqqhzI=; b=himm2eN5BxMqXW3MVby/0M8427KgfOtPDEuCfPxcGu3WOrJzWg16NrE7uJq6ofS/A5zhfv3KUm1CIC5WLIE+RdXtwwemguldlzeq63tqqTfl5/vn+ykYjpyDHlaGF6jNISa9YrlHi4Zjqx4yy157vHS+eK6h0q4Y/X0NcqVfrOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653668569553.6739379690954; Mon, 25 Sep 2023 07:54:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmvp-0004tD-Qo; Mon, 25 Sep 2023 10:51:31 -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 1qkmtt-0001ps-E3 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:33 -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 1qkmtV-0008Jb-8J for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:29 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-405621baba7so36075895e9.0 for ; Mon, 25 Sep 2023 07:49:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c234300b004013797efb6sm15499567wmq.9.2023.09.25.07.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:00 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E2ADB1FFC7; Mon, 25 Sep 2023 15:48:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653343; x=1696258143; 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=wLqocinDU8rF88Hv8wZBmX599z01GNwfmOcliOqqhzI=; b=e98+oy+OEG7KTIBA25if9PLGqWAkqpU5zE+vTUpiOGl/s3Up7rsT2R2Q9g4vf2FgNi 42ITVLN6zHkXNPSM/YxGTOa7itRbri4GAF9A2xUw+WW3FuIWl2Y6KR5C5rx6S3JeWo5h 7khncJyLFrWTic6j4hrxuuqIUEHSqXpugqCeGpxSo59PyQ0XGSvnMhtWn7PUsGjfqj+Q /oOmdKyuu7Qu1mHAIow6pwxbzR0aWKqHak2+DeRqhGlGn9QfSGg8S1htnKuBs7r0H8jT IbCWgEEwkRiwh10oYdXOKV2TJHOltfx1Dc+IV9HZ8/wDqetva9qeWFTEBVBtAg2+/eU1 lPog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653343; x=1696258143; 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=wLqocinDU8rF88Hv8wZBmX599z01GNwfmOcliOqqhzI=; b=F1b+WSLhLukfWPOWC/94plenRzLA/fvpF717oEe9vJRQjuESkkTB8tD11xa70cJbag IPcoZcZZuHvL+Ig7WnH/zdm6+1BWBxIsvjyb7lLb6wlsV7wvwqzlGnjznMVibLf8cHNz zCvx0vge+l3kgy1NFVxC9yQyGULFqAktxmBjR0nKOQwVtmOOO2xi5eu8yne0Vn3fopho TtZvhPmhALWpOVXBZZXbOJfSNfpoQq1q5z2yDTkswMumyTfNppaFBAiWIfZahrVLqDv8 eyqrZ32MgWOocaxaQlldq9f3M0adLMBNvgzMcJjMRcJ+bQ3xhvj1t9GXQ1pPsCNLSoI5 YvMQ== X-Gm-Message-State: AOJu0YwYtfVfEHqW9Dzp2VytwwKevm+qFBlcYi2CUNPRgM+KlNKQ81qA ZcL0+WjAeQoTKaDcwazcIlQvrA== X-Google-Smtp-Source: AGHT+IEYETA/eZMaSgtnwPM5HKHP/hZKHHoWnK5FiEePTnVNoute+VJrf7vqcFSgEFsnlKC66sW72g== X-Received: by 2002:a05:600c:2057:b0:405:3a3b:2a9e with SMTP id p23-20020a05600c205700b004053a3b2a9emr6883048wmg.9.1695653342956; Mon, 25 Sep 2023 07:49:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 15/31] hw/core/cpu: Return static value with gdb_arch_name() Date: Mon, 25 Sep 2023 15:48:38 +0100 Message-Id: <20230925144854.1872513-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653669602100001 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=C3=A9e Message-Id: <20230912224107.29669-8-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- include/hw/core/cpu.h | 2 +- target/ppc/internal.h | 2 +- gdbstub/gdbstub.c | 3 +-- target/arm/cpu.c | 6 +++--- target/arm/cpu64.c | 4 ++-- target/i386/cpu.c | 6 +++--- target/loongarch/cpu.c | 8 ++++---- target/ppc/gdbstub.c | 6 +++--- target/riscv/cpu.c | 6 +++--- target/s390x/cpu.c | 4 ++-- target/tricore/cpu.c | 4 ++-- 11 files changed, 25 insertions(+), 26 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 648b5b3586..5ae479a961 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -164,7 +164,7 @@ struct CPUClass { vaddr (*gdb_adjust_breakpoint)(CPUState *cpu, vaddr addr); =20 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= ); =20 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); =20 /* 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); =20 /** * prot_for_access_type: diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 12f4d07046..9db4af41c1 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -380,10 +380,9 @@ static const char *get_feature_xml(const char *p, cons= t char **newp, ""); =20 if (cc->gdb_arch_name) { - g_autofree gchar *arch =3D 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 10fcc61701..408af17bf2 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2320,15 +2320,15 @@ static Property arm_cpu_properties[] =3D { DEFINE_PROP_END_OF_LIST() }; =20 -static gchar *arm_gdb_arch_name(CPUState *cs) +static const gchar *arm_gdb_arch_name(CPUState *cs) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; =20 if (arm_feature(env, ARM_FEATURE_IWMMXT)) { - return g_strdup("iwmmxt"); + return "iwmmxt"; } - return g_strdup("arm"); + return "arm"; } =20 #ifndef CONFIG_USER_ONLY diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index f3d87e001f..8a8cde7c05 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -781,9 +781,9 @@ static void aarch64_cpu_finalizefn(Object *obj) { } =20 -static gchar *aarch64_gdb_arch_name(CPUState *cs) +static const gchar *aarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("aarch64"); + return "aarch64"; } =20 static void aarch64_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 2589c8e929..993ebc21f6 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5914,12 +5914,12 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUM= odel *model) memset(&env->user_features, 0, sizeof(env->user_features)); } =20 -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 } =20 diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index fc7f70fbe5..3cc9b2a89d 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -768,9 +768,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, vo= id *data) #endif } =20 -static gchar *loongarch32_gdb_arch_name(CPUState *cs) +static const gchar *loongarch32_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch32"); + return "loongarch32"; } =20 static void loongarch32_cpu_class_init(ObjectClass *c, void *data) @@ -782,9 +782,9 @@ static void loongarch32_cpu_class_init(ObjectClass *c, = void *data) cc->gdb_arch_name =3D loongarch32_gdb_arch_name; } =20 -static gchar *loongarch64_gdb_arch_name(CPUState *cs) +static const gchar *loongarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch64"); + return "loongarch64"; } =20 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; } =20 -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 } =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f227c7664e..ce35e95f14 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2008,17 +2008,17 @@ static Property riscv_cpu_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 -static gchar *riscv_gdb_arch_name(CPUState *cs) +static const gchar *riscv_gdb_arch_name(CPUState *cs) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; =20 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 df167493c3..cf4b5e43f2 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -284,9 +284,9 @@ static void s390_cpu_initfn(Object *obj) #endif } =20 -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"; } =20 static Property s390x_cpu_properties[] =3D { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 133a9ac70e..44e3ba6f0e 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 |=3D 1ULL << feature; } =20 -static gchar *tricore_gdb_arch_name(CPUState *cs) +static const gchar *tricore_gdb_arch_name(CPUState *cs) { - return g_strdup("tricore"); + return "tricore"; } =20 static void tricore_cpu_set_pc(CPUState *cs, vaddr value) --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654173; cv=none; d=zohomail.com; s=zohoarc; b=NUYT7UINwGFqS0/0BSRpwOrgPBZGvcVM6lq0gMPDrLwU//ZTadaAwcYd4WaeKfW4DMMPwEvrQseNDu1nlq3xuBMjT1FvZinzHbx5P/YSPK7ohRfeRyIk9O1za3LAhU5/rpI8StVY/Ja8zbh7XvLPxn0fmMWJodA1tbVLr+kpg2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654173; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Muj6oq//HewwqFNb1Dn6YA/ZLR4P4d92sjjuFTR9b6Q=; b=ZwEfoXLu1xDc4gmGnHVBJz0AQFnf8x59YYSnN2cVxNmwfhHX0UXpGGReTKiBzVnpGYAwyi/rbCIfKA/ierkj8XCTjUwfjt4oxpVRhUfD6MkRMh+xaPVn8nn7jL3expRxf+5G0k9KZBQs2VZtmLrfZkQRo3jC1lnuOKvF2Ivr0FQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654173200391.82491363849545; Mon, 25 Sep 2023 08:02:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3M-0000E9-5L; Mon, 25 Sep 2023 10:59:16 -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 1qkn35-0008Kz-Bq for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:01 -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 1qkn2q-0002DV-IQ for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:51 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-405361bb94eso66235435e9.0 for ; Mon, 25 Sep 2023 07:58:43 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a3-20020a5d4d43000000b003177074f830sm12214244wru.59.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 078DE1FFC8; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653923; x=1696258723; 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=Muj6oq//HewwqFNb1Dn6YA/ZLR4P4d92sjjuFTR9b6Q=; b=DaaegImvntrWM+0vvPKYNhd6sA7GjTl+o5tlz4R6npR2z2/wRgCJfN9C3xiDIRdouo 2XiZGIV9cOJuF+PXI96z6vtYZxtEo4C2r1ctunPk35Z05/jh7MO96U3RnqTgTd5mzN8z qLSk6yNkPtU3z4vGNM/opijPcnxy5kckD/hn8A689cFfKGurS8G+zAp6xPOl3vX8ZzSP E6J8EkcmzOKLjcgA3REr/TGTzUAlfJBre36tM5Q3EHmFBDOIUZvAdIp2LlXBTS/2bACR 9JoaCUgaJKABViZN4eXGhfPJgoxzFaZdhEv+1BdgSQvYTrrpdUaHsBHQKL15HOUjAqyx KVew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653923; x=1696258723; 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=Muj6oq//HewwqFNb1Dn6YA/ZLR4P4d92sjjuFTR9b6Q=; b=iSkrJWby/p9KOuxKeKCE/d4A3ipgB2yhz5je7082rPLcXF91WKNvQL7tmgZKTS57Jt vN3XtcDEzNuNxN0IwdtRLanw+QjOCbI+/ypC+CH5LeTZJcfgJ1uQrMh5tTrAGGXwtZdP 1HsRbhqCI+/v0riM1EwJYqkI7KvZ1KH9nRJrBcdQyUF19IJVdyROv+RA0JuYGVjXCUHh 2XwzKPbWMyanfSUuJKNR9K2+eT2Xi9iicHmdXPs9IFbFQpOvD33q2FOSRFugz9h1mn07 MtlsuR6t5oMQqJuyrne0z4uFPzVUIePH5MS8hVbg+fXqOWtu+4Ftft5U0zXwbImAcHWF xc4g== X-Gm-Message-State: AOJu0YyNC+WnXL8Q1Br1k1aWlF8uXKALXuf45tW4sgCapAEHu4ycCN1O 7u5MZnClrGm+O8up0L2uqDSeuA== X-Google-Smtp-Source: AGHT+IEYe4BJyScK2QsC4DrLMygYlSI2AWvJqT3BPrk0nW+S+4B6rEJ5OFCNAObJvcjpLdn4Gpbl4A== X-Received: by 2002:a1c:770c:0:b0:405:3d41:5641 with SMTP id t12-20020a1c770c000000b004053d415641mr6365257wmi.15.1695653922843; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 16/31] gdbstub: Use g_markup_printf_escaped() Date: Mon, 25 Sep 2023 15:48:39 +0100 Message-Id: <20230925144854.1872513-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654174107100003 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=C3=A9e --- gdbstub/gdbstub.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 9db4af41c1..a4f2bf3723 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -373,28 +373,34 @@ static const char *get_feature_xml(const char *p, con= st char **newp, if (strncmp(p, "target.xml", len) =3D=3D 0) { if (!process->target_xml) { GDBRegisterState *r; - GString *xml =3D g_string_new(""); + g_autoptr(GPtrArray) xml =3D g_ptr_array_new_with_free_func(g_= free); =20 - g_string_append(xml, - "" - ""); + g_ptr_array_add( + xml, + g_strdup("" + "" + "")); =20 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 =3D cpu->gdb_regs; r; r =3D 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); =20 - process->target_xml =3D g_string_free(xml, false); + process->target_xml =3D g_strjoinv(NULL, (void *)xml->pdata); } return process->target_xml; } --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654131; cv=none; d=zohomail.com; s=zohoarc; b=mFBzybeSFNuEE1yLCh+CTHYTsET48X/5CC6g0YA7RnHW1/LUrPJWGIqjaZ8Sq37jaUag/GaJyvTIsYRGr/2bjK+qABT34sH78iN9jW1u0FhrMCPQflE9r/217Z9Rz13RWRq9vkt8F2R2uid6NEu7mBi37faat17yXP3prGvKkA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654131; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VWYhOQMznQlDFerIuEfFly6GjEqfzxxsRGSOgMHMHjQ=; b=nvC/kdMAUVjkNmCQ7QvLcF7iZBlLSZnQES6n8ZkK3tPkMk2ryhIAB7FsUGutTfRdBagg95K8i1t35dSciSRc84YQyyt+Jhfkic2rzEj0eprHfLPbjQAFQ0RWfcm8Z8TRr0gyxkygQFySAd0y1lDfmCx9LkvLjoYSrc8eubglHKA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654131103706.4011915990145; Mon, 25 Sep 2023 08:02:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3O-0000Jm-PW; Mon, 25 Sep 2023 10:59:18 -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 1qkn3A-0008T5-4f for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:07 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2u-0002HR-AW for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:03 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-405361bb93bso63072685e9.3 for ; Mon, 25 Sep 2023 07:58:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t18-20020a1c7712000000b00405959469afsm1657004wmi.3.2023.09.25.07.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:45 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2129D1FFC9; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653927; x=1696258727; 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=VWYhOQMznQlDFerIuEfFly6GjEqfzxxsRGSOgMHMHjQ=; b=EITU6Bmk/KZ7EoeEAKgC8FW47z8Lk6tBvcmCwDACzlytgXN1f2clNAjxjDPIXlvcsv VFPDmRPzUqiwu7EXLI03AO1O88rNBz55edM0LGrUvS3T2nk6/46ypVOrVf/TQCjQhf7t rLt17akKd64eyun7cd7uoFdu8KsiBhxsov2VcsabNbmPGE/Sjnzx8VSZ1ghZzeCI0UEI DObmxeF8DLYC2A9doV0lH8vcZb7tU8mfvyrBiS4Ca7SrmxaCITGf4315t2TgiYA3p3/x UAELhyPpm7M+ewSutfSxbcDqBC2z7eoTyzqaGt3B7tdjqsQIpxadA8+Xuzo1XBfGRaLC PPiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653927; x=1696258727; 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=VWYhOQMznQlDFerIuEfFly6GjEqfzxxsRGSOgMHMHjQ=; b=uTDR+hqbLyCZOglW6VNWGvB1nimfElqBMwwQrMM+OIHLkKwgHn9oKR/YMZEsmrLtwh U9j6uoiYRHXaIy5Fo2Qmd442o/zaiN8T8teyPhaf+k1lsvKMkxn/P16E0UVHTu3jYZxB ARyNyEC6OEoHFH+GXWMAVi0NOzqyhNpkhGavR5K6EAVZ++sZKrNW+UAVgTxwBK4XIPHc HKNmoQHDpB9Ra19WItYaRwJ/+KzIXRcxir3d5pO56H7P7Vsd8EhG47DsR1epLKy0VoYA /ka0LGGblzsq1mEd7mr0lZbLHPFnoLEDFY1vaFLKoEMbrl9O1XmYCVVxHrnAgP0VNK7S 45wQ== X-Gm-Message-State: AOJu0Yx6TW7E5nvIfoysaTGKFOZmuCmhBMUvMMgn60x1mqfa+9N57yM5 EvH+GhmlwImuJZ0g6Bqi9g0fVA== X-Google-Smtp-Source: AGHT+IGHhcyszvNWqg8cEs9rJ+gdnn6azFdoW2Twyip98CgdpKdtGrCIPGnliDpBidqk815HgNQJgw== X-Received: by 2002:a05:600c:4a9a:b0:405:9657:9ab4 with SMTP id b26-20020a05600c4a9a00b0040596579ab4mr919003wmp.6.1695653926893; Mon, 25 Sep 2023 07:58:46 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 17/31] target/arm: Remove references to gdb_has_xml Date: Mon, 25 Sep 2023 15:48:40 +0100 Message-Id: <20230925144854.1872513-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654132591100001 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=C3=A9e Message-Id: <20230912224107.29669-10-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- target/arm/gdbstub.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) 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 =3D=3D 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 *m= em_buf, int n) env->regs[n] =3D 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 =3D=3D 25) { /* CPSR, or XPSR for M-profile */ if (arm_feature(env, ARM_FEATURE_M)) { /* --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654079; cv=none; d=zohomail.com; s=zohoarc; b=HpMukTEFZlrbN3rRVGViz4G+g91nLzFv8zeiT46kuuMk2SNxuUdnFuzqlegemYWpoW0qYuyRY9r7XbmWmJr+gWlZ46RXjzdLeAP+iOpi1mdnypZt9K7WQwtq7prw//NH2JqfdFd7geg2mGwaEcqsh3hS27lCtC7dplDy5Jb4Iw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654079; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=54vdWxoInkKQLiHeicKKqmeJW+RARqhkyr/iqwsF+dM=; b=jGhOBp1RnfNO2l8ikn/oM/OmpAU9ugJcQ84xu0hd7mGv2hX7D5F64HWBMwyRa+h+Q93w3harq7N9AsDyUwG6FEEv2Jg0N7hAbT2fCswV9oZj+17tdzMsfkdQYq9hcsdbFF58xhpQil+8jfZASw/rI1BtFGd2s7q76k9/ZpV5A+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654079597947.7265248082306; Mon, 25 Sep 2023 08:01:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3N-0000Fe-Bi; Mon, 25 Sep 2023 10:59:17 -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 1qkn35-0008Kr-8E for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2q-0002D1-MD for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:52 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32172a50356so6225551f8f.0 for ; Mon, 25 Sep 2023 07:58:43 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x17-20020a5d6511000000b0031fd849e797sm12075216wru.105.2023.09.25.07.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:41 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3C22E1FFCA; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653922; x=1696258722; 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=54vdWxoInkKQLiHeicKKqmeJW+RARqhkyr/iqwsF+dM=; b=N0JGQ1ACzErPhj5/RVKIZPU3P9/fhZ2N2vT87IdLax6i2mzk8syvv0taLKXvF84ZDu SrcEqRbxC1rwkKCeOsXeQlTWFka7FQTBT1R76QItknkjO35mghSpH9NkwBA3Qcd+bXGe hV5PV/kBtFtAry+toxYcD7SALKDPk9K16G4SxvrQeXwcuZD24vcFWWBgRMCFBCQcur0a a5tcJJQA7E7+hLOk3VglpARWZWP7LkaFRio8q2TSfUVIWk043vukSXxhg0zRU27x6i31 cVrq1MLlI95v8pqp9uuVf3Io2oreMXlIfEim1eimN+zTKpuyPmTF1adKIsLB9JJd6ddo ej0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653922; x=1696258722; 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=54vdWxoInkKQLiHeicKKqmeJW+RARqhkyr/iqwsF+dM=; b=KL2CB8d+V2RmvZrRnfXpaRjQjGPXyN6cHxA0P9EcC9T7xhOamMl5BWsizcog2hTATg eaAxvQtmvJrBhJvFTd0OrQasSPNlr+d9+4VXK9rjwRARdsSS2wQ600Ijqx8UGzsPIQ4C 4VyOk2uTUbeb0gi7HwB2a0Y2ZzNJ3glY7l8qdctykwzzOL6dNdfROEWAIb5XGkp+QRrN QVHPFxGyIF27MMKYTCo/MCLObVCCnjPoNFWPo2WKsQOAjDm7ADFQjdM0NjA4MNAh1nWx 68om7ZCXIwzAax4OM90PNX4fFtE4IIODpCegmk3oi/FrWJowUMa6fVo0h2boOrg4o9KI zL6A== X-Gm-Message-State: AOJu0YwhHoLTOBXv5rkKW4du1H2T0v5Syku2XZ95bOnoH0Jd37XCna8v TcbPExXPVTBu+RqQGAlHs8esiQ== X-Google-Smtp-Source: AGHT+IETYE8gGZUvi5YSKhCE7iA0Eg4AKr99jrnWwLoe6ct7K7zw2dvLkEWkX477WRraNOiMP25uTg== X-Received: by 2002:adf:fe85:0:b0:319:f9d6:a769 with SMTP id l5-20020adffe85000000b00319f9d6a769mr5600388wrr.45.1695653922406; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 18/31] target/ppc: Remove references to gdb_has_xml Date: Mon, 25 Sep 2023 15:48:41 +0100 Message-Id: <20230925144854.1872513-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654082012100003 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=C3=A9e --- target/ppc/gdbstub.c | 18 ------------------ 1 file changed, 18 deletions(-) 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 =3D buf->data + buf->len - r; --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653781; cv=none; d=zohomail.com; s=zohoarc; b=dzfd5EY4pVVPifBIVhwYnWdNzw96AiY4NfsInVRs05ljZut7a6HXovLrM+2ImDYdyZTwxYg8RUK3Y4hN9ygHWuBCO7I1vFywcT96kIwgzZsCmaKg5rZC6eHHoxRDe0Hw8M6MYaCslStedJYR3cpASqfACi6qqptBFnPmNZUDbPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653781; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zo11DLU+8rquYH4lZEKdtepCDhuEE9DTjCn4uAyQoPU=; b=GiF9Q6SOQ20U3epwPpRRus7IlvqJTfucBoBSSXQp+T7md32fV3mS1IJxODqYrJHALr6eztbVnq1DwmyQLNn/evncO7L4qR+dKjvdDnozi02mT54a7RSF4JFY9epiM3ZnWhb30W603FpI+nRvnH4ptNiY/nxopWWZ+XV7x+WEkBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653781458149.50321439575282; Mon, 25 Sep 2023 07:56:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmuu-0003Oa-6O; Mon, 25 Sep 2023 10:50:34 -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 1qkmtu-0001q3-LC for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:34 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkmtV-0008Ks-Dz for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:30 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-313e742a787so4463403f8f.1 for ; Mon, 25 Sep 2023 07:49:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r2-20020adfe682000000b0031ff89af0e4sm12008603wrm.99.2023.09.25.07.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:01 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5ED431FFCB; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653344; x=1696258144; 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=zo11DLU+8rquYH4lZEKdtepCDhuEE9DTjCn4uAyQoPU=; b=e+CwW3gtERnbhQc7HqRIdkR4/xI31YSvR6QYChat/Fs0uEsnr14uaMymruJLDOOKji 3RSutnJ0AhEMM5iZQRSvApT8aYV/NT6tJl/Tm9ST9tmpXN5uj5wRAGwX0FnQK+to8MAt yGDNtosknsF7ARib1HkwsO7xTQj9XVVyHBArAvxri6+o5+jdNxMYLoFsKsii1/SKYULX IBd3szXtpOeFQZRgToZnZzuOLRVlu4Z9+gxMAoTtMDXkLgkMmOzHp65Hep5KJ861LNML gmPzDPkNE6H0FXIXz1rGlfginxMJCQTWyPzeyzDUkp3iFedcJ+lRHJr/r9vL5WPQovUn PdPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653344; x=1696258144; 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=zo11DLU+8rquYH4lZEKdtepCDhuEE9DTjCn4uAyQoPU=; b=jbw1WkQQ75bZ/ZY5+gRYe9UOmseWrmhugvoFwOJE7lMXlneUdUW2kMOupTiKQEsrJ4 gB1aR7MooXaSNeqqwzujsJfcgaAMUD5n4qyW02zOVBplQ5kevpyo5cE+lVH2d21Q9Q22 9+6tucoS+bz2/DPu4Z+KjXp/t9YDD6mmiAo0hm3TgxPHE0yDJVxbXsM4mUsUP9b8cdHe dMK2r8hDZ9/xVOpEznsY9g6OE92HrTDX+xGYQaTHobDNlTUzHm9wGEUJrHZTMSU4zHNM UvGUr5wRLyGeRcdkcJ3VpYkqJbZwFw8wowmNCFEdBaAU/OBJ5Gq1+r9yIuJmXacSsIae 2zYg== X-Gm-Message-State: AOJu0YxX/5pNoX1am3pFTFs45gMLfZimh0m3ahlGewudkaYL1ysv3gzD I/XZt5nIzK0++p7Z3XYxK28Ncw== X-Google-Smtp-Source: AGHT+IH5WEnpPHBw1XnsLzrdfo08FkSzYM+F5tTVEh0k6x1eVqECKHSqKZKha5HuVXzuyhuHYbRnqA== X-Received: by 2002:a5d:5a89:0:b0:323:1738:1c35 with SMTP id bp9-20020a5d5a89000000b0032317381c35mr5459173wrb.26.1695653343990; Mon, 25 Sep 2023 07:49:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 19/31] gdbstub: Remove gdb_has_xml variable Date: Mon, 25 Sep 2023 15:48:42 +0100 Message-Id: <20230925144854.1872513-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653782545100009 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-12-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- gdbstub/internals.h | 2 -- include/exec/gdbstub.h | 8 -------- gdbstub/gdbstub.c | 15 --------------- 3 files changed, 25 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index fee243081f..7128c4aa85 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; =20 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); =20 void gdb_set_stop_cpu(CPUState *cpu); =20 -/** - * 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[]; =20 diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index a4f2bf3723..177dce9ba2 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -349,11 +349,6 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t ti= d) } } =20 -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 *use= r_ctx) { int reg_size; =20 - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (params->len !=3D 2) { gdb_put_packet("E22"); return; @@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *use= r_ctx) { int reg_size; =20 - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (!params->len) { gdb_put_packet("E14"); return; --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654043; cv=none; d=zohomail.com; s=zohoarc; b=Ter2UAB/2y1nhd8YPSIgEFbu2ArM4fke+ld1Owk6mr5bpG7hpRgHVn522DLN1kePLGQxJY/iIZnj6qnVBfSsqnera2NV6n4z2FxZ3X1mip6csuztz4xWJ96rLPPssdqauLnvr/uRsD0N0ijRT0ACMLlHwZKnBi7T8/RhppNrafc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=51IOq6TYaNyuJXGEkqG0oju+dqewQYpgGsGyKSLbnRk=; b=ORQn4bo/SqH3eDj6iBGd4NDWoGynHMt6HQwREKQFtRO43mCxFaxubuvcK+8cPou/EKQv3IFKntsX61oLZP3QGu7+DtmPFn4K3q0eTte7vn4Ag21QTcDM5F98MBtW2jr5kbDZ+z7NExkNoxCN0XeeLjkaSyZcAxPmmxWXFiA/NNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654043823899.9671507494596; Mon, 25 Sep 2023 08:00:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3R-0000Vv-P6; Mon, 25 Sep 2023 10:59:21 -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 1qkn3A-0008TD-Sy for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:08 -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 1qkn2u-0002Hk-RO for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:04 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-405524e6740so43653445e9.1 for ; Mon, 25 Sep 2023 07:58:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s13-20020a5d424d000000b0031753073abcsm12017142wrr.36.2023.09.25.07.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:45 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7CEA01FFBE; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653927; x=1696258727; 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=51IOq6TYaNyuJXGEkqG0oju+dqewQYpgGsGyKSLbnRk=; b=lUIDmU+GOfcrYZYDX+buNryfjYWavL2LwSgtGANiwd4IZNkpII6H7YV4vPoezdsgK8 mgQL/bBYlcW5SHLdUGEj4lHcVKnBHfZC1b7EkftrUkkexzxRaIRPVKn8i8BLcGxYoXG+ LbpJvqflIDvcwmcOxpT5+s3tB79Lb0A92nfPA5+TiXmYteVeGtc260yT3wAw+gIk/h1w WDRO3ZV/bTh5K9DhNoFFfd+8ejdULoGnTeDRNe9Cb+fLb+/TVlfjMrU0KZrP2ziOt5Ux +4xOg2YIaiWMeSAb6MvGCOv4P8lyfFwXQRyFsAO48RHSyqtZAbUz7Kv0z3fYk9qL6EdU JqMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653927; x=1696258727; 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=51IOq6TYaNyuJXGEkqG0oju+dqewQYpgGsGyKSLbnRk=; b=Abm4hxLia8ck5QMuYfZ/DSIcY5TrrIZppGTtuDZ/HZT7px0dZ7zyAg4MzFMJBN+cQp n6e+gHvupXgj4HP6Dsh4RVds5Sic3TIm11sGXl/F4mPclr9c4SsuRnsXmsAHEqPTQWCD AHU7fK6GHXSpSVm2F0HXgHK7hSO7Y1c4cwJswqz+ibpqirXikBRD7ldXsaUxz5dAOPNL xcTjKxtfbmp/6fDuZ7MQVzs/KDIo/3q3mANuYxqiV7DLSeN/buRXB+DVfCaVicYscIr4 zU69NseiX+tMywbPHQbjSGiZG/J1I1B6MONXUWaOoDs1l8ONhsazp5uwIqQ+wQq3I2QV WrCQ== X-Gm-Message-State: AOJu0YwEZg10by1io+jZJAcO6BrtfTpFf6A6mDEC38puP7+f5GUZaacW BdQspcgkxXFuBT3efxIsV3q+xw== X-Google-Smtp-Source: AGHT+IFp2wA6DneLQRdyFfr+1lVFyb49Nq9B9pLZ1yyg3NDwxwyPpU9yunMeIvahn7Nf65Lq1ah57Q== X-Received: by 2002:adf:f404:0:b0:31f:eb88:e3c8 with SMTP id g4-20020adff404000000b0031feb88e3c8mr6204375wro.32.1695653927087; Mon, 25 Sep 2023 07:58:47 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Akihiko Odaki Subject: [PATCH 20/31] gdbstub: Replace gdb_regs with an array Date: Mon, 25 Sep 2023 15:48:43 +0100 Message-Id: <20230925144854.1872513-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654045117100003 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 Message-Id: <20230912224107.29669-13-akihiko.odaki@daynix.com> [AJB: fixed a checkpatch violation] Signed-off-by: Alex Benn=C3=A9e --- include/hw/core/cpu.h | 2 +- gdbstub/gdbstub.c | 35 +++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5ae479a961..0338640e3d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -364,7 +364,7 @@ struct CPUState { =20 CPUJumpCache *tb_jmp_cache; =20 - 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 177dce9ba2..a041b1c0aa 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; =20 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 =3D cpu->gdb_regs; r; r =3D r->next) { + for (guint i =3D 0; i < cpu->gdb_regs->len; i++) { + r =3D &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); } =20 - for (r =3D cpu->gdb_regs; r; r =3D r->next) { + for (guint i =3D 0; i < cpu->gdb_regs->len; i++) { + r =3D &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <=3D 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 *m= em_buf, int reg) return cc->gdb_write_register(cpu, mem_buf, reg); } =20 - for (r =3D cpu->gdb_regs; r; r =3D r->next) { + for (guint i =3D 0; i < cpu->gdb_regs->len; i++) { + r =3D &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <=3D 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 =3D &cpu->gdb_regs; - while (*p) { - /* Check for duplicates. */ - if (strcmp((*p)->xml, xml) =3D=3D 0) - return; - p =3D &(*p)->next; + guint i; + + if (cpu->gdb_regs) { + for (i =3D 0; i < cpu->gdb_regs->len; i++) { + /* Check for duplicates. */ + s =3D &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (strcmp(s->xml, xml) =3D=3D 0) { + return; + } + } + } else { + cpu->gdb_regs =3D g_array_new(false, false, sizeof(GDBRegisterStat= e)); + i =3D 0; } =20 - s =3D g_new0(GDBRegisterState, 1); + g_array_set_size(cpu->gdb_regs, i + 1); + s =3D &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg =3D cpu->gdb_num_regs; s->num_regs =3D num_regs; s->get_reg =3D get_reg; @@ -480,7 +488,6 @@ void gdb_register_coprocessor(CPUState *cpu, =20 /* Add to end of list. */ cpu->gdb_num_regs +=3D num_regs; - *p =3D s; if (g_pos) { if (g_pos !=3D s->base_reg) { error_report("Error: Bad gdb register numbering for '%s', " --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653964; cv=none; d=zohomail.com; s=zohoarc; b=V6h9BkENIuqegFS1HPZuPa2c/GsVLI7yimhKqKw6kfebESXJmd6x0qiUWxruSSvWsTTDaiH7x/O2G8PPE+XqB2oy3gcV7vySxe9vLdh1K/Yxe3iCt4DC6n/Ts+FooGg3bbkjL0W2ImJlNmeZGBABKyoWhkZFsYMQEP7Off0x+pY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653964; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aeCFFwXCm+A4QdL8cQip0cKdXWBZunNX9KWO8pZi6hE=; b=G/O7MOfbwcrgps507zmzjO30j1+Kxe4F0SsNr/LW3GNnZVSGu1BTKbXtjUDTAKMoIhP+piPdkaDMe66oD4HfSWryDz5+cbYq9dOXX+O4umkR75rUJuayLISuewSYxxWY34QVlJXAVDWtxkS2sp91u+jgqzD0iOmP2j98oOBi4zg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695653964290851.0921049360267; Mon, 25 Sep 2023 07:59:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3J-00006a-E3; Mon, 25 Sep 2023 10:59:13 -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 1qkn2u-0008GV-Nx for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:48 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2o-0002Bd-Ux for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:48 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40572aeb673so33363565e9.0 for ; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d29-20020adfa41d000000b003197869bcd7sm6970991wra.13.2023.09.25.07.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:40 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 99E231FFCC; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653921; x=1696258721; 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=aeCFFwXCm+A4QdL8cQip0cKdXWBZunNX9KWO8pZi6hE=; b=wmBBpzmvlxnyPj3VQiJZH7Mb3RFKwuZJZo3hPp97bpXDGqOBR9F+W41j3SKzmPRiWA VH/OL9LL7/g9SVmHd1srLS0LzrgOfGDT0GbW8Eb4kiL1aRtetTkVEFCwmrtlvTgs5739 33Thjx9IttZSIhd4XXZ1QlsaOCfDFsuyEl3TwTuvK8Dudhv1oubGVA2Jzzui2I87JzWV wM6uVxvJ8QkyDBqYfAUXHqNG/ksXx+7Z6ANFWLZE3XPKLNKJz3EkHjLuZc7a/L5xkDiP wo2Wmkb3W44DeP4WS3IO8lOzWwK8OBGgfgC9xlzBCBzgFSioCsyCPeACgjxu2mQ6Xghc gKGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653921; x=1696258721; 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=aeCFFwXCm+A4QdL8cQip0cKdXWBZunNX9KWO8pZi6hE=; b=h9WO4WF5Iucbds9gY9aZBaiVkZCJiQGviH//+aUDuu3j4hFxzocnhm5ZjDsKGAEo21 wreJzNMaMzJGjqGaHro+QqA7U7s5LWFphfa87zBblT+9+AIFJoaBXe6YR+hoKDR4rc2w rXgIja/0KXHZQofAAUqFxD72zziCy1jcn1so1WO/xXKvPSTb+7Ns2nWnTye6TUW2pyQ9 z9HwR4IHqwNbLjI7yyporrS4RDjFdx9pk2t+QDLCSZcKg4usD4Z/J35U6exvbTmbIav7 yfAFE1JXp9A0KNrRcK7QmZRWn9I08v0hy0ellQM4djRjws0oIj2XDH2rwdW9cYJFP0zs GIEw== X-Gm-Message-State: AOJu0YzyzLdCHIfDb7rJTzATL0r04ZXeMqPqTlcWuvkPnkZ/CY1f/MPC XpRcporS0kxQIEyWKMN4I1iO+Q== X-Google-Smtp-Source: AGHT+IHFSwhv1ZDVTaQUicchew2LE/1enh8F7w94hdBqCcq21Z5zTqmrgbzfuabMJjszGdjEODPmGA== X-Received: by 2002:adf:e4ce:0:b0:321:6414:5869 with SMTP id v14-20020adfe4ce000000b0032164145869mr7303953wrm.58.1695653920841; Mon, 25 Sep 2023 07:58:40 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 21/31] accel/tcg: Add plugin_enabled to DisasContextBase Date: Mon, 25 Sep 2023 15:48:44 +0100 Message-Id: <20230925144854.1872513-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653966470100007 From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-2-richard.henderson@linaro.org> Signed-off-by: Alex Benn=C3=A9e --- include/exec/translator.h | 2 ++ accel/tcg/translator.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index 4e17c4f401..bf5bac260a 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -72,6 +72,7 @@ typedef enum DisasJumpType { * @num_insns: Number of translated instructions (including current). * @max_insns: Maximum number of instructions to be translated in this TB. * @singlestep_enabled: "Hardware" single stepping enabled. + * @plugin_enabled: TCG plugin enabled in this TB. * * Architecture-agnostic disassembly context. */ @@ -83,6 +84,7 @@ typedef struct DisasContextBase { int num_insns; int max_insns; bool singlestep_enabled; + bool plugin_enabled; void *host_addr[2]; } DisasContextBase; =20 diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 1a6a5448c8..37f8dadbbd 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -156,6 +156,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *t= b, int *max_insns, tcg_debug_assert(db->is_jmp =3D=3D DISAS_NEXT); /* no early exit */ =20 plugin_enabled =3D plugin_gen_tb_start(cpu, db, cflags & CF_MEMI_ONLY); + db->plugin_enabled =3D plugin_enabled; =20 while (true) { *max_insns =3D ++db->num_insns; --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654102; cv=none; d=zohomail.com; s=zohoarc; b=eXHQ1rE5UMKrZm1x+ukK6RTMQTwgTx03fZudjOGVs8+GHTVGBHaRrTfjdbTeHw2gbbPf6NEFaeD+OYweLwdHNFzEWIz5OPFtVes8ciOaWT0/GgWv8k7jKqESrp7YE3AEbMQPYf8BWNUcgNn3DWYVeXdZoCplUiNDHUkmOSerE+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654102; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iA5XRXF9P4Vc7lxXG3kZOc85Dy3uKGzfeERYzP/OVsE=; b=kjs4aKXAmOtksSKDIbia+25BTdIsY7fm5au1/FnwqxqK0eZp52wp0ver6XFMGW2cUmrvfnaSPJUakdRJdqDYBhT0IwNEU3R753EcSFCCFmKZy1zr2iHrogBpYWWScJzgrHnzrnw8MZWffkO+9s7oNjax9kv6ehT2qykeRmEiDi4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654102693552.637779335413; Mon, 25 Sep 2023 08:01:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3Q-0000Pe-K6; Mon, 25 Sep 2023 10:59:20 -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 1qkn35-0008Ks-8X for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -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 1qkn2r-0002F0-V7 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:56 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4053cb57f02so53748485e9.1 for ; Mon, 25 Sep 2023 07:58:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o13-20020adfeacd000000b00317f3fd21b7sm12170189wrn.80.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B38181FFCD; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653924; x=1696258724; 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=iA5XRXF9P4Vc7lxXG3kZOc85Dy3uKGzfeERYzP/OVsE=; b=I+G70JjcmXENIil5PRNrRGwmqRNcqksI8R06GqOngS5TSDOv5iS6VAr1lFwITYB5a1 uT04bOQYPJjP70uW17+b8IJsT/s1vCAH2dG8SXzvoriWInXShBqVV+7bbRnC/M7CryJV 53kPkchIQ+FfFKJr4VT/hT4jublNi7XxvokFmEwoeO12KKRSg6VkOpnB7RiPy1vUxQEC 2qFyacPBnpVVkBg18gyars1xwtxYhe+i7DLtHppK/HBK87TiiAxqY5nWsVwbEVc9u+1P PrL1QpHhFkECC7vEocAD7t3WrBm+lN6KcbiO/+QVpRhCNWA7IedXRMXQ19gDhuyBoS7I CScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653924; x=1696258724; 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=iA5XRXF9P4Vc7lxXG3kZOc85Dy3uKGzfeERYzP/OVsE=; b=P2izQaal7RcVful//9F58O61mXUm/NIiIUvYcpAFOTE/KDaYYiSDU0RzmA3gobi2jH QSqxusnByaWByV3Win6dX01gHrEoDyhWteenlXZPv0TT9jiQciBFt4OjFnVc9rF48uwi Snx5VDkWx4/WfWZKIw5xrMo5NQuvwqgp22BaAAB2zmvDiyGNK/IVhjKaQwSZmBnnF5Fl HSrdYQLtMCgTl4sfb0MhLv+6ujc0PnnSQPx4gCz0pLg03eET1AqfchtE766r+LZT5x7N nFGdjgZvav3a70FokS+7GS6Qbtqfi/OmQ0i64/n1rW6n6YIueRUZ1GBVLIEBJmiXttu9 En8g== X-Gm-Message-State: AOJu0YziO/bMXRGP1EYx8NSwE2psIjck2fLkk8Brf5Dk+9c0zGbf5TNo Oc5gr7opDSQ6/3/essb8FpBGXg== X-Google-Smtp-Source: AGHT+IH3kX1Oj1brSObUdZXhVcwKkHsBnlT5ud9YZVQ4HToc2ifB5Aq5Z+XMQhAyrNqM10SDBgeeJA== X-Received: by 2002:a05:600c:2057:b0:401:bcd9:4871 with SMTP id p23-20020a05600c205700b00401bcd94871mr5623754wmg.21.1695653924058; Mon, 25 Sep 2023 07:58:44 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 22/31] target/sh4: Disable decode_gusa when plugins enabled Date: Mon, 25 Sep 2023 15:48:45 +0100 Message-Id: <20230925144854.1872513-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654106631100003 From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-3-richard.henderson@linaro.org> Signed-off-by: Alex Benn=C3=A9e --- target/sh4/translate.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index c1e590feb3..b4dee34c9a 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1816,6 +1816,18 @@ static void decode_opc(DisasContext * ctx) } =20 #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 |=3D TB_FLAG_GUSA_EXCLUSIVE; + gen_save_cpu_state(ctx, false); + gen_helper_exclusive(cpu_env); + ctx->base.is_jmp =3D 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, CPUSH4Sta= te *env) qemu_log_mask(LOG_UNIMP, "Unrecognized gUSA sequence %08x-%08x\n", pc, pc_end); =20 - /* Restart with the EXCLUSIVE bit set, within a TB run via - cpu_exec_step_atomic holding the exclusive lock. */ - ctx->envflags |=3D TB_FLAG_GUSA_EXCLUSIVE; - gen_save_cpu_state(ctx, false); - gen_helper_exclusive(cpu_env); - ctx->base.is_jmp =3D DISAS_NORETURN; + gen_restart_exclusive(ctx); =20 /* 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 +=3D 2; + } else { + decode_gusa(ctx, env); + } return; } #endif --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653611; cv=none; d=zohomail.com; s=zohoarc; b=O/BqJC2Gq3+Fo1VswjsHtdNfec3GZzJv48rSIyc8AgO7O0SqnYiPIuks3NziI0im0inzTLjI7ZdEGy1CoYB9zmc+WWO2fr8qmlBIusq31BikSr6Wg0uKjvtbhk6V5hdlnMU89gjSlZxs+6UT4ptO3ns2co/Dt9Nb8RmhkxIVAUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653611; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vW14u2/R+fXBkgsAVXJeC+s7wkbS5Xjof2Eeqsenrno=; b=GPB5U5fsEwelNxBFdUEJNapVp7B+wa4Qotm+eSRbCG0FBg2CXHBbas9z2H37u+QK7c4rByukCMBw/B6zMPWTsnbM1ylDdvbGCQTfzA80a/PDBhR1r7efAMmdQh8V9T1ejeTNAugGMfnmUosAh5JEE+dqCd/evgNAEiYRXaLg0N8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169565361119822.185415511039537; Mon, 25 Sep 2023 07:53:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkmwI-00061c-FD; Mon, 25 Sep 2023 10:52:00 -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 1qkmty-0001rE-IF for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:35 -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 1qkmtW-0008L9-JE for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:49:32 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3232be274a0so1026041f8f.1 for ; Mon, 25 Sep 2023 07:49:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m13-20020a7bcb8d000000b003ff3b964a9asm15334036wmi.39.2023.09.25.07.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:49:03 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D21F41FFC1; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653344; x=1696258144; 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=vW14u2/R+fXBkgsAVXJeC+s7wkbS5Xjof2Eeqsenrno=; b=P07QOw7h7oSiIPedHOIx4ngpU/EA9KM7CHQbbpv6tGCmBqzS5i8MGV2+Rq0OUDAe8W varXa11UsGKo3ckBmFqZkrnS5NttRlCWa3pZB05qBNbHcTUaBM8zughgyAtWNb+ZF3qw 8EX/Ubl1iVQvRuTiUlevCnHccHKOBvn8ejjOh9aelQTxPJCOS/wGbaSd5GMmU/7fPLyA AOm57XbvMtu3HnK4TvNqzCxgUkDIPbQQu65k6m/SFEce3ISw/pHYRRJgPHo/V5FR4BfT JvqqDJnXzJXQIfY07fpfTdzvQlEuEL2uUlnAVHot/5FAZ0yHSBz0+ipTTi3m/IhZv8qn wEjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653344; x=1696258144; 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=vW14u2/R+fXBkgsAVXJeC+s7wkbS5Xjof2Eeqsenrno=; b=OqLjjmOveuCYfbeXK/nI7oBxJ6V3fynG+k5wQz1u6w/NIQ50FVJcxP8+Xth2jIYbv7 joZs8SXU4KTOrRt8O2w1Kw0K2Pvq/XhSy1jZ7re+/Jd1mZp4mWGRLKuNpNDnRVMZWors FPtGIEJdO/yCZ6Wjf4cpadErrVEJTsZNoIhSNZ+pOXb+1LmAlpC8a5OVGKH4GouHyoQ7 o/VnO2jqVAh4k200jfrDcrfOJtG1mWJrZv9KyQHAPfIxq07uyuc81b82SW/JQ8CkGSZd pG1p66uy2LirILG3aKWzUyX6pnM5t94Wevq/6+56ZgfCz5kHnAiJniPvjvFnnVy4lUa5 xz2Q== X-Gm-Message-State: AOJu0Ywe713uLvo5Vy7M3LdEH6JTx38vHH93WTFFTx565kEJLo9/F3KF eoVVl3WNoH7jm33siFz8YPb/5w== X-Google-Smtp-Source: AGHT+IFoDt+/1YdAyaAs2mIqGW3PYJilqzR3pMEU0y3yKYA/nuwBdpG428Qs2pPLYZN2DO43DVDw7A== X-Received: by 2002:a5d:4003:0:b0:321:f74d:ade3 with SMTP id n3-20020a5d4003000000b00321f74dade3mr7250450wrp.32.1695653344259; Mon, 25 Sep 2023 07:49:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal , Matt Borgerson Subject: [PATCH 23/31] plugins: Set final instruction count in plugin_gen_tb_end Date: Mon, 25 Sep 2023 15:48:46 +0100 Message-Id: <20230925144854.1872513-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653613351100002 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] Signed-off-by: Alex Benn=C3=A9e Message-Id: --- include/exec/plugin-gen.h | 4 ++-- accel/tcg/plugin-gen.c | 6 +++++- accel/tcg/translator.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) 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; =20 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 *d= b); void plugin_gen_insn_end(void); =20 @@ -42,7 +42,7 @@ void plugin_gen_insn_start(CPUState *cpu, const struct Di= sasContextBase *db) static inline void plugin_gen_insn_end(void) { } =20 -static inline void plugin_gen_tb_end(CPUState *cpu) +static inline void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) { } =20 static inline void plugin_gen_disable_mem_helpers(void) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 5c13615112..c0adc9f4b7 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 =3D tcg_ctx->plugin_tb; =20 + /* translator may have removed instructions, update final count */ + g_assert(num_insns <=3D ptb->n); + ptb->n =3D num_insns; + /* collect instrumentation requests */ qemu_plugin_tb_trans_cb(cpu, ptb); =20 diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 37f8dadbbd..ff84282fe5 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -212,7 +212,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *t= b, int *max_insns, gen_tb_end(tb, cflags, icount_start_insn, db->num_insns); =20 if (plugin_enabled) { - plugin_gen_tb_end(cpu); + plugin_gen_tb_end(cpu, db->num_insns); } =20 /* The disas_log hook may use these values rather than recompute. */ --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654090; cv=none; d=zohomail.com; s=zohoarc; b=iphYCOrEl97M1OAFmHYcQ5Q6qDfsEdcKjCa+2VcQoPMRaRM3VkhJtQOFzX1P4ogWw656668r1gcBgeO6Y6nMU0aUjiFVqLFMNGANnYZqrtygtzG+kRqFKtfPrt7r8vTUsRiVM6YsnWHhuztdHmRlC3N6Qgfvvm0n2QzzLpO5cNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SQaKCCtPdCExPYstQ0NllKjLPtp/IcVgNdDW/2dG2tw=; b=nB3AXP7VEbsaKP9bLa+y76oE3FmVYjvA0ax+OOJZgWSVN60cdoer7JbL/yBn0Omc5vfRZOik+WCu60ac6WWVecPLYotF1rWqub1kg1SeWoHvHdHHiUznepgJvwga4b3yR/nkFWHq6Csw7Q+7uR4pr7Lt3niPkP5ang25HWEfylQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654090811418.9339758227636; Mon, 25 Sep 2023 08:01:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3Q-0000Ph-MM; Mon, 25 Sep 2023 10:59:20 -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 1qkn38-0008Lu-0n for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:03 -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 1qkn2s-0002GF-To for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40566f8a093so34893415e9.3 for ; Mon, 25 Sep 2023 07:58:46 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t1-20020a1c7701000000b003fe23b10fdfsm15367489wmi.36.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC8801FFC2; Mon, 25 Sep 2023 15:48:57 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653925; x=1696258725; 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=SQaKCCtPdCExPYstQ0NllKjLPtp/IcVgNdDW/2dG2tw=; b=dhq3eZbIsX6rub1xZBO0zWvFWXHCRafGZ2iHkOIZUsolYzqAJOY3tLjb/dsPUqy+ko WRbLe/L31/BgUX5n39CXgxGmbJUNH6gEp9ZLi9l7WEA29ubHzxlsWC2gSSWDwpwjU+Cz OuT0ZYlPALb0akBXlCQ4TgqRcrYgFDcbxFqNUkzXvGOSZXASM2sPNN6DuOwZ8sPJXmW0 ZHPdEa5IBVi6iYnI1tacL1PNzdBRQ5npK9AvOGI2BKpG/GgiCWvd8a019hwXdP0wyjQg 7YfxFtZNfaCCJE6NmBPC38oAqpBoA/yzDnTizyMrRXpCLbAm9o8hiq86vwInnt/2Jx/F hlbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653925; x=1696258725; 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=SQaKCCtPdCExPYstQ0NllKjLPtp/IcVgNdDW/2dG2tw=; b=CEQieMP4Ciq9l3caJCpOqVvhgPb5r6CY0rRdq264kHpC4xt4kdioFhENG2Gqqmce23 cnXxO5MrwUuprocCTWbYwH159QH8Y4jNceWWGOZwBtCiS+Vx5ADeswslQwKdt5ypQXiB jTuNUbezO4S0PICNPS0yQ1NgI27bVnMj67qDiSayJIyXap0zsvcYJZBfJEcOUBTAyDmN MJxDQxAibvDyc2VzdEByRELm7lImmjjQFavLvV/hoEhjwndMmqfQ4SeT2XlWC02ILoPL +Mqk5V8QEkivU/ZqfZH8jC/xcW18yeHqBpNsyf1dVF3VCiyEkigGSPcaU2Kb+9+mrSQx ZhTg== X-Gm-Message-State: AOJu0YxfRgV4Jgf6xuIHZMlMfmyn/bFRsnxVospCC+gAOM7bzssB/w1R Fs+mGmYCdLV8cSQSCkJ5vVYn4Q== X-Google-Smtp-Source: AGHT+IG5H8XpO/i2Pzv7xFgguxMyyEZnV76ynGh3qBvX6EusTMWO25hHy6LCxzc3dFuvZhldDt9ZIw== X-Received: by 2002:a05:600c:210a:b0:3fe:1cac:37d5 with SMTP id u10-20020a05600c210a00b003fe1cac37d5mr5768595wml.4.1695653925443; Mon, 25 Sep 2023 07:58:45 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 24/31] contrib/plugins: fix coverity warning in cache Date: Mon, 25 Sep 2023 15:48:47 +0100 Message-Id: <20230925144854.1872513-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654094571100003 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=C3=A9e --- contrib/plugins/cache.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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) } } =20 -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 =3D ((double) l1_dmisses) / (l1_daccess) * 100.0; - l1_imiss_rate =3D ((double) l1_imisses) / (l1_iaccess) * 100.0; + double l1_dmiss_rate =3D ((double) l1_dmisses) / (l1_daccess) * 100.0; + double l1_imiss_rate =3D ((double) l1_imisses) / (l1_iaccess) * 100.0; =20 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 l= 1_daccess, l1_imisses, l1_iaccess ? l1_imiss_rate : 0.0); =20 - if (use_l2) { - l2_miss_rate =3D ((double) l2_misses) / (l2_access) * 100.0; + if (l2_access && l2_misses) { + double l2_miss_rate =3D ((double) l2_misses) / (l2_access) * 100.= 0; g_string_append_printf(line, " %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%", l2_access, --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654057; cv=none; d=zohomail.com; s=zohoarc; b=JKY0p0g5DBXENcBIe7OEm9QUqqrWCfkhG8AqvhL07Wasbdvj+gpNrfMXJHmntiA+zjGuRMAs6oOnEung+kemhVf+yHtNbc2inoHj6o+3WdiU9P4dA9dlBSpPX9qLVptVnCVgs/79mFmsaY0vkdVf/L54ZUeU4v2ZtoloAuIsdjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654057; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mAyYQkrKbWdgjPeSFpAKf8LHOxPMb7ttiO+d+H3EETQ=; b=n1awP6P80w2UZhMhIA6OfWg+LGKUT+hUbzTn108HoTF53MAwMW6mKLhe4B0F/D6JWMxTF1b/2mUJiY8Vzxvc1sgE89UCSad/iEIeC9DmeL3WfCpqfVWu920dXNN7aommkHvELd3R1FC7VbdBjidal8vWBjSZ2QBRq4vPlM5/TcY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169565405700249.78894130485878; Mon, 25 Sep 2023 08:00:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3M-0000EE-BA; Mon, 25 Sep 2023 10:59:16 -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 1qkn35-0008Kd-7u for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2q-0002DB-Bf for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:50 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-405524e6769so26305985e9.1 for ; Mon, 25 Sep 2023 07:58:43 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t18-20020a1c7712000000b00405959469afsm1656915wmi.3.2023.09.25.07.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:41 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 139401FFCE; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653922; x=1696258722; 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=mAyYQkrKbWdgjPeSFpAKf8LHOxPMb7ttiO+d+H3EETQ=; b=eRiMNCprFqO+yGRM9oCTiA6Y0gwO4jqNb9dDsE33sA3iQFEIFTtvIUJYpYntOgaWXI 1ou0z6vyjLg4xYJj5rhzA0oCbCLvu1xmyJ7jH3L8DnrreZKVPe+9vP4VttZthz9gz3Oz CXsOL31lp/vEdZtQelIC4q2LRmsfP+xC56w/HsvqhM2xLXlbsl/gbkNhMOzW1RpWb7n8 FQdYPfdLoOMHlaiviU04i3ZgJ74Andxm+QmRYvaLNVBcVPrmmnH8sVyqRscRcZu9DokJ UixhJvqs/E4KTi8f3BioxfE3fk2GFp9hEJZv55+VxlxMD5Jo93v2LB2ofKulLk+Ff5rZ KkxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653922; x=1696258722; 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=mAyYQkrKbWdgjPeSFpAKf8LHOxPMb7ttiO+d+H3EETQ=; b=h1DsiSKCJ5aXNCq5fv7SreNzcIQNpPx64a5RBr5FiTSNy35McARJkboDQPDITf9mW4 VnP/neNGSeSQZqlIp70SWWCh2iSlhnx8h+xsU+x8FY7rM1Q7GQ3OBEBSvHqC/PyT3JLy 2uWc0AdM+0BS0Sv/Vz8Nou5xHOlrLovdTsR9IkeBIIA6urMD/lVtEK2DH6/xakAPGnun +BVpYB8DKc7yvHy7VS5FBDxl0ktB3vsp8ZbCN2DzAnvXe+lkbgYNzeQRGSPCoOR2TfSv QugNCa6GIDOTj9tYdWJy/sJg6MPevnqeCK2LoXhSXXMPScb1yc4bJtPEnDVkAcxT8ccP AcBA== X-Gm-Message-State: AOJu0Yz9BdUgqIERhapUcWij0+mpPoMzJJW+FPSZmVElXIKPP3IRCW2+ 0QZlUjZUkX9YE9yHDuKfGW6u6w== X-Google-Smtp-Source: AGHT+IH2XfJb3x0zHxvnBuTaxCCHgYT/tdglQoUrYMFI2CY3Q9o2lM+MyL+r+0MoUc7+RKqmMdKqZA== X-Received: by 2002:a05:600c:1d8c:b0:405:d70d:1790 with SMTP id p12-20020a05600c1d8c00b00405d70d1790mr196064wms.13.1695653922594; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 25/31] contrib/plugins: fix coverity warning in lockstep Date: Mon, 25 Sep 2023 15:48:48 +0100 Message-Id: <20230925144854.1872513-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654057691100001 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=C3=A9e --- contrib/plugins/lockstep.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 q= emu_plugin_tb *tb) static bool setup_socket(const char *path) { struct sockaddr_un sockaddr; + const gsize pathlen =3D sizeof(sockaddr.sun_path) - 1; int fd; =20 fd =3D socket(AF_UNIX, SOCK_STREAM, 0); @@ -254,7 +255,11 @@ static bool setup_socket(const char *path) } =20 sockaddr.sun_family =3D AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >=3D 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 =3D sizeof(sockaddr.sun_path) - 1; =20 fd =3D socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { @@ -295,7 +301,10 @@ static bool connect_socket(const char *path) } =20 sockaddr.sun_family =3D AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >=3D pathlen) { + perror("bad path"); + return false; + } =20 if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("failed to connect"); --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654082; cv=none; d=zohomail.com; s=zohoarc; b=Wb8fYzuI/+bSA4FFVX4OrvpKYz/Yq6xOmn9fk2Mw7PNUxJ25/WDVKaXdzMEF9SC2zqmhOohngR4WrSUy0lu7zuGE1IIym1gm6y2RmGtRYVObsSKza/73K/5qqs//8XoAXAmKelfeatBxTBWSSiL4LneJQoE3B3yXs7/MhprkYbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654082; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6tkbJLFSKCFqBt7eF2KdGUHAT+NPxj+IrJR+AQ70tYE=; b=ZDO6S7b+gC8Kch9wha6Zy0B+n5Uu2J1X7DbMhLegv3wLSzmqGpqJrC8afNJ/hfr6B/4LAPQ54EccQgeYA7npvx5jCcOLwOHX2fixk7+SlUdyP/B7DPdz1dJcLeFDfgUTbEkamGM+ndQBT3uS4d/gSqCE8hLC4Y6xg63jdGrKCs8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654082622139.29392180404568; Mon, 25 Sep 2023 08:01:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3P-0000Kq-Jg; Mon, 25 Sep 2023 10:59:19 -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 1qkn38-0008Nu-5z for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:03 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2t-0002Ga-C4 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:01 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32325534cfaso2184706f8f.3 for ; Mon, 25 Sep 2023 07:58:46 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b15-20020adfde0f000000b0031c6cc74882sm12131874wrm.107.2023.09.25.07.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:45 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2D54A1FFCF; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653926; x=1696258726; 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=6tkbJLFSKCFqBt7eF2KdGUHAT+NPxj+IrJR+AQ70tYE=; b=S1oTraTyXSDNJt8va7JiZ6sOR37srQAbPvV7RH/oBoSrz/mlAau/4hFzrBKv5gjKnF Yftwm+OKM+cfDzcE3u6mHflf66eKJ1e6Rp2qy3pkyLsTmnTo9p8QduVsHPX1ILy4ozbe Gs1L+IswMu3FGLxNGJtiKXo7qwHLCKqWuz6tJQYzX1tgzaCndFVMxinIVv238K+UWbMA gOk+xy4wt4FnHmRPMEcK8KXGhGpeKiRogkmy5ARR5HvcpNq0q51Mh5ZEepCfqsjCQy4f zWEk4zJdxOZn6kSm2/DhBYdRevFTySTlysOleVnnAdPKFl7tzTH9J8aErSN1uBw+Gjgk SxMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653926; x=1696258726; 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=6tkbJLFSKCFqBt7eF2KdGUHAT+NPxj+IrJR+AQ70tYE=; b=ef/QZLXpxKqM7klmxXHMlibmtZRsfiVgYhkKDQhSKo7dgbUieB/dFYNNk6YJBLaxOw gd8zw24b6sC9QqvwD5RRA0/w2gYrzaYTVKfGL3IezEmbCqLMh7hu+NfKT6U1Fj6wWyBo wA7Wl6tIi7zA+V/eeiCtCVD0xubCE4YsJ2JmQhK1Q7LxLmatNagT7ZgHaMIrM8VIWi6g UNxEVvn8YM2l5tLvlR8uBHB/wpIqYaQ2QHavZg+cKvnLDDiX9sBfp9NEYRzc3YbPhENj m/1l3CJEJHnk7b+2+l/Yhce+pyOsfrvzWbKxPGj5uMLZe8YCIS0rBKz2khhNClYp0ckb qgKA== X-Gm-Message-State: AOJu0Yy6+BwM/RdhbohL3Rp3nmFQvyKOf4HqlzF2cJrefWECoGSQB5qR jR/PoPp9iwj1ThDgptZrSSkC4w== X-Google-Smtp-Source: AGHT+IEB+LSxWDhlAJuQfpBjvRRZYzv9cggedEwwiXoMeChPwXIEcnFq/h7DgJb5MibSj4QONhtY1w== X-Received: by 2002:adf:f9cd:0:b0:319:7656:3863 with SMTP id w13-20020adff9cd000000b0031976563863mr6110386wrr.47.1695653925827; Mon, 25 Sep 2023 07:58:45 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [PATCH 26/31] contrib/plugins: fix coverity warning in hotblocks Date: Mon, 25 Sep 2023 15:48:49 +0100 Message-Id: <20230925144854.1872513-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654087061100001 Coverity complains that we have an unbalance use of mutex leading to potential deadlocks. Fixes: CID 1519048 Signed-off-by: Alex Benn=C3=A9e --- contrib/plugins/hotblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } =20 g_list_free(it); - g_mutex_unlock(&lock); } + g_mutex_unlock(&lock); =20 qemu_plugin_outs(report->str); } --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654290; cv=none; d=zohomail.com; s=zohoarc; b=gMEa0vel9PRuVZPU2Nx8KZgva9xNuJTV9LF4Hz+uf+6f/O0u4bfx+/R9Z9/8W1QzIZ7aYrZ4j1qLAsWRZjTpyQiWHuDdk+S/Fazay9C/7ZPYWxqRjlfvKwPDIzisYKestQnLIJQ7AmvRn4iWviUW3Ohas+k+OPi296GKIVhzHo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jM0GTpB8x8Pq4p+VnmvbtC3PXJVxvgAV0ON8qJJlT10=; b=AriWDgMJQLtK0cIxFsnv2VgNT2cNKvlCEqocmoiN10PbEmYAOc6UJNH2cy9eEEPICJECnrXBOKePdtIeu6mHpqfPAzb8PUz1pZtCf+f4RVpOvoCZMVY00S0EdMSITIzTq0pgjJ95GivjFURbKMhIOzQJr7JbgDO65HN1si6CCMk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169565429035586.34884572487283; Mon, 25 Sep 2023 08:04:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3H-0008Uk-FJ; Mon, 25 Sep 2023 10:59:11 -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 1qkn2u-0008GK-A1 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:48 -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 1qkn2o-0002Bp-UO for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:47 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405621baba7so36309705e9.0 for ; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z9-20020a05600c114900b004058e6379d8sm3826355wmz.23.2023.09.25.07.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:40 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 532431FFD1; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653921; x=1696258721; 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=jM0GTpB8x8Pq4p+VnmvbtC3PXJVxvgAV0ON8qJJlT10=; b=qlCqC3xYjyDw/7bRVCE+hiWh5B6TGj1Qq3Ix+iSlBYQTl9vq+bYevMNeK9qQ+9JfIJ zrJCA+Hd8IMbGAIGQpsB85R261ST9XmWeHk6rBHo788lotywzs8W7x/XlsiWpUHqLuMY N1bnQVO8w3WY14BhRAizKVJawiLX1yEk9CW9rhrFt/N6dHmXhvXFd/G55QO7NwBhgVkW ZPy+pMlv73lsx5q5iUxcDQ7p7Gl2UePsefkD4JTT6kK/axZSP8qT4nXV8ulOEIKtJRxm 28oFh+jk/HIISseTisAWiX5CNbC6nvHB3sqfedZlxHLGpoMib4EQ6+0P5MbFrJxrl09k nj6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653921; x=1696258721; 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=jM0GTpB8x8Pq4p+VnmvbtC3PXJVxvgAV0ON8qJJlT10=; b=SGW/rAxePtqjxSNFdXLxL4Q28c7SZgkj9wx1AJXxtQ8lUKxOcwg69p6VdKXbdIYQOS qspmUnnq2WOfeKj8lQMQ5cHsEcpBdpccMsVScrXNdBPriAq7BaaHNjwuAcVrq0zn6+t7 Dh2l26w4S5Nlo17OoxDO2Ki7rZtYIeQYwkarRfNqyLmBU/P3X0OBf8yL2cOinoDKyrNQ DrtLFdFZm22XZ3MsdRy9iFruxW7tJrkeOTGf7ZScH39YTed5q7M2KFiZyS/4XusbUATN PXJPBHp62aoRF6QC38oywP4AVdtUUp9kYBgQBHRAKnExRxzXAOj5PoJ0ijVMZgp9HvBe Yfww== X-Gm-Message-State: AOJu0YzslDiY/yvKOoAdbAXbOkUpzy/OibGTqYlRJ5sykDSKEiHzqDUJ Fz773rAKBhiRnzsuKh4dPix0tA== X-Google-Smtp-Source: AGHT+IF8BA3ifVNy6i7gY71DWPUdbeluWJ79bFNawmMMYbWpuO1wDrk0vftXMDDmYRbTdAoWSBTIsQ== X-Received: by 2002:a05:600c:247:b0:401:b6f6:d90c with SMTP id 7-20020a05600c024700b00401b6f6d90cmr6079242wmj.35.1695653921019; Mon, 25 Sep 2023 07:58:41 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [RFC PATCH 27/31] sysemu: add set_virtual_time to accel ops Date: Mon, 25 Sep 2023 15:48:50 +0100 Message-Id: <20230925144854.1872513-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654292054100009 We are about to remove direct calls to individual accelerators for this information and will need a central point for plugins to hook into time changes. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230519170454.2353945-5-alex.bennee@linaro.org> --- v2 - more kerneldoc annotations --- include/sysemu/accel-ops.h | 18 ++++++++++++- include/sysemu/cpu-timers.h | 27 ++++++++++++++++++- softmmu/cpus.c | 11 ++++++++ ...t-virtual-clock.c =3D> cpus-virtual-clock.c} | 5 ++++ stubs/meson.build | 2 +- 5 files changed, 60 insertions(+), 3 deletions(-) rename stubs/{cpus-get-virtual-clock.c =3D> cpus-virtual-clock.c} (68%) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 3c1fab4b1e..224e85a649 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -20,7 +20,12 @@ typedef struct AccelOpsClass AccelOpsClass; DECLARE_CLASS_CHECKERS(AccelOpsClass, ACCEL_OPS, TYPE_ACCEL_OPS) =20 -/* cpus.c operations interface */ +/** + * struct AccelOpsClass - accelerator interfaces + * + * This structure is used to abstract accelerator differences from the + * core CPU code. Not all have to be implemented. + */ struct AccelOpsClass { /*< private >*/ ObjectClass parent_class; @@ -43,7 +48,18 @@ struct AccelOpsClass { =20 void (*handle_interrupt)(CPUState *cpu, int mask); =20 + /** + * @get_virtual_clock: fetch virtual clock + * @set_virtual_clock: set virtual clock + * + * These allow the timer subsystem to defer to the accelerator to + * fetch time. The set function is needed if the accelerator wants + * to track the changes to time as the timer is warped through + * various timer events. + */ int64_t (*get_virtual_clock)(void); + void (*set_virtual_clock)(int64_t time); + int64_t (*get_elapsed_ticks)(void); =20 /* gdbstub hooks */ diff --git a/include/sysemu/cpu-timers.h b/include/sysemu/cpu-timers.h index 2e786fe7fb..31ab2bbd4e 100644 --- a/include/sysemu/cpu-timers.h +++ b/include/sysemu/cpu-timers.h @@ -84,8 +84,33 @@ int64_t cpu_get_clock(void); =20 void qemu_timer_notify_cb(void *opaque, QEMUClockType type); =20 -/* get the VIRTUAL clock and VM elapsed ticks via the cpus accel interface= */ +/** + * cpus_get_virtual_clock() - return current virtual clock. + * + * This is a wrapper around accelerator specific get_virtual_clock() + * + * Returns: ns of virtual time + */ int64_t cpus_get_virtual_clock(void); + +/** + * cpus_set_virtual_clock() - set the virtual clock + * @new_time: new value in ns + * + * This is a wrapper around accelerator specific set_virtual_clock() + */ +void cpus_set_virtual_clock(int64_t new_time); + +/** + * cpus_get_elapsed_ticks() - get elapsed host time + * + * This is usually the current value of the host tick counter (i.e. + * not taking into account guest pauses). However some accelerators + * which want to keep elapsed time in sync with virtual time will + * return the virtual clock. + * + * Returns: ticks of elapsed host time (usually ns) + */ int64_t cpus_get_elapsed_ticks(void); =20 #endif /* SYSEMU_CPU_TIMERS_H */ diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 0848e0dbdb..b645c462e1 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -221,6 +221,17 @@ int64_t cpus_get_virtual_clock(void) return cpu_get_clock(); } =20 +/* + * Signal the new virtual time to the accelerator. This is only needed + * by accelerators that need to track the changes as we warp time. + */ +void cpus_set_virtual_clock(int64_t new_time) +{ + if (cpus_accel && cpus_accel->set_virtual_clock) { + cpus_accel->set_virtual_clock(new_time); + } +} + /* * return the time elapsed in VM between vm_start and vm_stop. Unless * icount is active, cpus_get_elapsed_ticks() uses units of the host CPU c= ycle diff --git a/stubs/cpus-get-virtual-clock.c b/stubs/cpus-virtual-clock.c similarity index 68% rename from stubs/cpus-get-virtual-clock.c rename to stubs/cpus-virtual-clock.c index fd447d53f3..af7c1a1d40 100644 --- a/stubs/cpus-get-virtual-clock.c +++ b/stubs/cpus-virtual-clock.c @@ -6,3 +6,8 @@ int64_t cpus_get_virtual_clock(void) { return cpu_get_clock(); } + +void cpus_set_virtual_clock(int64_t new_time) +{ + /* do nothing */ +} diff --git a/stubs/meson.build b/stubs/meson.build index ef6e39a64d..2ea43ee076 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -5,7 +5,7 @@ stub_ss.add(files('blockdev-close-all-bdrv-states.c')) stub_ss.add(files('change-state-handler.c')) stub_ss.add(files('cmos.c')) stub_ss.add(files('cpu-get-clock.c')) -stub_ss.add(files('cpus-get-virtual-clock.c')) +stub_ss.add(files('cpus-virtual-clock.c')) stub_ss.add(files('qemu-timer-notify-cb.c')) stub_ss.add(files('icount.c')) stub_ss.add(files('dump.c')) --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654290; cv=none; d=zohomail.com; s=zohoarc; b=gG41dtxNcnZlZef/K7ZxXNnrLnOCEw8+RzGoYB7MPiqXzhjDE0AK+n0pU5pM53BMQmm9k0kaZ6RmjO5+MiSQlNs1NrdvOA7YAhk/Vp0/tt399g2OIKjvJQp3YmpQ7yjnlh5FI3ZBCnAlx1GuAdKUf7XWfbHXTPXu1eiRrSISCgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pzgHDvkSEQDHi8J0pZ97uLL1mOaFrktKKPN/mU4z0S8=; b=JGE9KTR0kVh2kI80Sk9vJRA8mOeselWTwzrA7TOFMdj0MLGnZI4DqDk8z+uRsGqLsrlbldQG7XBK9SULdXp2T5soRosuEwUZ4MnVviBksxqGxUHzTonqYNC2PuS6bCDOul9VOW6yMFPqVV+OesZyYZ4ig5mE/TlOB1UPT6lhP2Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654290004466.7168890477212; Mon, 25 Sep 2023 08:04:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3R-0000WO-Qp; Mon, 25 Sep 2023 10:59:21 -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 1qkn36-0008LG-Au for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:01 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2s-0002FJ-6v for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:59 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-307d58b3efbso5552201f8f.0 for ; Mon, 25 Sep 2023 07:58:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t7-20020a5d49c7000000b003176aa612b1sm12043674wrs.38.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 73C1E1FFD2; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653924; x=1696258724; 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=pzgHDvkSEQDHi8J0pZ97uLL1mOaFrktKKPN/mU4z0S8=; b=mzQuBc8APVtviKLxBms2E4zW8c584CMrVl3ikNySRg92S7TcXpecXd1H36fVj7HiPR pF6yJLqEb25mubZMC09MzpGpiOgAmQGBHtxug++86+7caqY9ueAl0JzsQMorAJbA/PPt wmAEBrnLlRb1Tsq/0BCJUT77Iz+iGCQOvxbxC3KfTJGZpBxSS7AikP30NSh+ovhH+ZVw TkBYxRNEah9je01MPtde7BvHhppw1kTWlB6l0uehbabr4dgY4dELac9p0HXJ+PWKBMic Cw1Hpp8NGEH7FyMEYt19x5ypHm/0zt8HBffdySr8kvM2rXhTz5yCEhEE8yrHXmYIhZh2 NQWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653924; x=1696258724; 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=pzgHDvkSEQDHi8J0pZ97uLL1mOaFrktKKPN/mU4z0S8=; b=G+ZRg++WbBNSXdS+f9Vn5dcnEVz3jZQieNBUbkF6o69yirSvf9hs4rHzLvUNcwTLWK cweSzSsUQ2FD2WHAoZt6KwnW+nokvRlz/CKQclibkef0C0aojyVibjDCdMQGyUwbEnw+ lsb6Vn1ylrzOwuOCGi8QwANsYGoPH1ZnQVpuVE3FVyHESAY6TFQq+sM438SXOavKGk45 hVoPWuU6q9P4qQDOTBqAT2HzYE4FQInLuWZTTrI1CEDF44ZCepZOWwAEpck9J5+K5lY6 qIVdvAGqk1iRNz+chbMnxJnVNN+jRj3PGod6Z+DcX+HNlKSLXIRrO/ZKeZnU7n/Q9+bc MNng== X-Gm-Message-State: AOJu0YwmVipKfrSuxSmV4w3/1kTYJmHERl95CF/qYlJxCXVgi7c6inVt wWmgzOjAIO/lRJayxqKnbYZP/A== X-Google-Smtp-Source: AGHT+IEK0Goz+dxJRznfKltKNgQq9qAmubNsDzadXtMcGR/Rnpytq7dHIOItqTM3umFDNRkCiWgnKA== X-Received: by 2002:adf:fe49:0:b0:321:6fb0:9a84 with SMTP id m9-20020adffe49000000b003216fb09a84mr6392006wrs.37.1695653924221; Mon, 25 Sep 2023 07:58:44 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [RFC PATCH 28/31] qtest: use cpu interface in qtest_clock_warp Date: Mon, 25 Sep 2023 15:48:51 +0100 Message-Id: <20230925144854.1872513-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654290516100001 This generalises the qtest_clock_warp code to use the AccelOps handlers for updating its own sense of time. This will make the next patch which moves the warp code closer to pure code motion. Signed-off-by: Alex Benn=C3=A9e Acked-by: Thomas Huth Message-Id: <20230519170454.2353945-6-alex.bennee@linaro.org> --- include/sysemu/qtest.h | 1 + accel/qtest/qtest.c | 1 + softmmu/qtest.c | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index 85f05b0e46..e1f69783d6 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -35,5 +35,6 @@ void qtest_server_set_send_handler(void (*send)(void *, c= onst char *), void qtest_server_inproc_recv(void *opaque, const char *buf); =20 int64_t qtest_get_virtual_clock(void); +void qtest_set_virtual_clock(int64_t count); =20 #endif diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index f6056ac836..53182e6c2a 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -52,6 +52,7 @@ static void qtest_accel_ops_class_init(ObjectClass *oc, v= oid *data) =20 ops->create_vcpu_thread =3D dummy_start_vcpu_thread; ops->get_virtual_clock =3D qtest_get_virtual_clock; + ops->set_virtual_clock =3D qtest_set_virtual_clock; }; =20 static const TypeInfo qtest_accel_ops_type =3D { diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 35b643a274..bac1962efb 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -331,14 +331,14 @@ int64_t qtest_get_virtual_clock(void) return qatomic_read_i64(&qtest_clock_counter); } =20 -static void qtest_set_virtual_clock(int64_t count) +void qtest_set_virtual_clock(int64_t count) { qatomic_set_i64(&qtest_clock_counter, count); } =20 static void qtest_clock_warp(int64_t dest) { - int64_t clock =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + int64_t clock =3D cpus_get_virtual_clock(); AioContext *aio_context; assert(qtest_enabled()); aio_context =3D qemu_get_aio_context(); @@ -347,7 +347,7 @@ static void qtest_clock_warp(int64_t dest) QEMU_TIMER_ATTR_ALL); int64_t warp =3D qemu_soonest_timeout(dest - clock, deadline); =20 - qtest_set_virtual_clock(qtest_get_virtual_clock() + warp); + cpus_set_virtual_clock(cpus_get_virtual_clock() + warp); =20 qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL); timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]); --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695653963; cv=none; d=zohomail.com; s=zohoarc; b=giMMplVKtP1WbkCyPyCgVV2AaY1YulWNWuMpxaOzi7Dbgi1wDaayqAiRXZfCjiKhOpp02HJfjr7/7TmYQFOGDCuN9HXSzpL8nnJ0IWM/Jo16aXZwWOqktHwRhdeRWXydkTMxMa7rziznGtR2NqCEVBAZgoId4KlJIVe3TahA5Eo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695653963; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DGpqbinWgFdcTh8orlOkSkjWWt1Ye8Jo/m++la5kzCk=; b=krzPh168mbtLtYU1gIfwQXSs+Mah7P9KXYnxygy889+FXliwtdnHvaxG93p8lh9Z30PUmdsy2JiHKgwxzzDl/+CivpLAEBUygUGPgN8oMFXUHS6/xLQRvITQ9hRwbqUNwmr/3nkPbkO2XuQf7oax6N7NRjym8mAtSGoUIVvWkig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169565396363879.06409220541843; Mon, 25 Sep 2023 07:59:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn2x-0008H9-4B; Mon, 25 Sep 2023 10:58:51 -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 1qkn2t-0008FH-84 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:47 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn2o-0002C6-Sg for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:46 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4053c6f0db8so56513765e9.3 for ; Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x6-20020a5d60c6000000b0031f300a4c26sm12038543wrt.93.2023.09.25.07.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:40 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 926931FFD3; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653921; x=1696258721; 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=DGpqbinWgFdcTh8orlOkSkjWWt1Ye8Jo/m++la5kzCk=; b=xO0RVHuo1+8EFKXadIV1xnk7eX9cWjIVRGvb+VBCWxFJkCJcwh+FA7TFVzeFwEhbUr M7xpbo+kgNF4QPeoojHwCRCncfxhnJShhL2M+wFvTSeP2uQ3vo6Tts2EBt/JO3LaVAdr gj9dnLVUYdhV1tBNqyriGS6bnZjCElXaTjd6N7jDI0pZxAT8o5E0XQwZ7yjo6YrVZj/u Vze4A1ecK7XRpP8Tx0fsxpCGuv0fx47iS071lH+ldQMdYr6JeaNrXgEjagehCZFXynoc zSkR+Sz0LVpJoRYRSMRP59dwlo7LJRb7aXGgPZrvcmeGcolYADofOyqEJgfBB16qQPO1 3+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653921; x=1696258721; 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=DGpqbinWgFdcTh8orlOkSkjWWt1Ye8Jo/m++la5kzCk=; b=B98yJM7e+R2wIA2w5jegIkPQ4Lk/SKcDLS9u44GNYWXFB0HVECuEWxHJ00QyYukSJS xn0JFkM0+wyWBz61VoYSHTLLcCRNM7fO1iYujL5Y09spg95Qrl+d1CTi1pr/pdQbRADz gMtThQfm9ux+8X7KEsOeBC1WNeNW5Ac74hS/HX4/k3+H7Xd6aJzJ2mGUSCXFt1MKjKBb KNXL/6RfDvmdKASoJYh5yLxPT/NPURA86jmLvaN/EEgFi+UplF6S8a6cnTskCFYWUkkv Em7sAZ8VPNN/EAuiAodoXuEtIbX/ZA5TgZaRi1/QJNWhoNdhBDr1zhK9gQ5YJTNaa4Ag OQcw== X-Gm-Message-State: AOJu0YymELn//vOVrW2btTSwaFKJVicTUuiZGsYd7ZB9rUnru5iDpkEj z1LkxCqgxFiIGZlBPUj5AtvdPw== X-Google-Smtp-Source: AGHT+IEb+hpsuPjYkc0JIZMBH1wz3xDTFHvAV+RFdtX6oPkfs0s1EF9T4PwglEGeZejoz0zpOAsSzA== X-Received: by 2002:a05:600c:2296:b0:405:3455:de37 with SMTP id 22-20020a05600c229600b004053455de37mr5597736wmf.1.1695653921200; Mon, 25 Sep 2023 07:58:41 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [RFC PATCH 29/31] sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time Date: Mon, 25 Sep 2023 15:48:52 +0100 Message-Id: <20230925144854.1872513-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695653964681100001 Move the key functionality of moving time forward into the clock sub-system itself. This will allow us to plumb in time control into plugins. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230519170454.2353945-7-alex.bennee@linaro.org> --- v2 - rename arg to target_ns --- include/qemu/timer.h | 15 +++++++++++++++ softmmu/qtest.c | 24 ++---------------------- util/qemu-timer.c | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 9a91cb1248..aa30f693b0 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -245,6 +245,21 @@ bool qemu_clock_run_timers(QEMUClockType type); */ bool qemu_clock_run_all_timers(void); =20 +/** + * qemu_clock_advance_virtual_time(): advance the virtual time tick + * @target_ns: target time in nanoseconds + * + * This function is used where the control of the flow of time has + * been delegated to outside the clock subsystem (be it qtest, icount + * or some other external source). You can ask the clock system to + * return @early at the first expired timer. + * + * Time can only move forward, attempts to reverse time would lead to + * an error. + * + * Returns: new virtual time. + */ +int64_t qemu_clock_advance_virtual_time(int64_t target_ns); =20 /* * QEMUTimerList diff --git a/softmmu/qtest.c b/softmmu/qtest.c index bac1962efb..72a2ee7a31 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -336,26 +336,6 @@ void qtest_set_virtual_clock(int64_t count) qatomic_set_i64(&qtest_clock_counter, count); } =20 -static void qtest_clock_warp(int64_t dest) -{ - int64_t clock =3D cpus_get_virtual_clock(); - AioContext *aio_context; - assert(qtest_enabled()); - aio_context =3D qemu_get_aio_context(); - while (clock < dest) { - int64_t deadline =3D qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, - QEMU_TIMER_ATTR_ALL); - int64_t warp =3D qemu_soonest_timeout(dest - clock, deadline); - - cpus_set_virtual_clock(cpus_get_virtual_clock() + warp); - - qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL); - timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]); - clock =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - } - qemu_clock_notify(QEMU_CLOCK_VIRTUAL); -} - static bool (*process_command_cb)(CharBackend *chr, gchar **words); =20 void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words)) @@ -754,7 +734,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) ns =3D qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, QEMU_TIMER_ATTR_ALL); } - qtest_clock_warp(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns); + qemu_clock_advance_virtual_time(qemu_clock_get_ns(QEMU_CLOCK_VIRTU= AL) + ns); qtest_send_prefix(chr); qtest_sendf(chr, "OK %"PRIi64"\n", (int64_t)qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)); @@ -780,7 +760,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) g_assert(words[1]); ret =3D qemu_strtoi64(words[1], NULL, 0, &ns); g_assert(ret =3D=3D 0); - qtest_clock_warp(ns); + qemu_clock_advance_virtual_time(ns); qtest_send_prefix(chr); qtest_sendf(chr, "OK %"PRIi64"\n", (int64_t)qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)); diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 6a0de33dd2..213114be68 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -645,6 +645,11 @@ int64_t qemu_clock_get_ns(QEMUClockType type) } } =20 +static void qemu_virtual_clock_set_ns(int64_t time) +{ + return cpus_set_virtual_clock(time); +} + void init_clocks(QEMUTimerListNotifyCB *notify_cb) { QEMUClockType type; @@ -675,3 +680,24 @@ bool qemu_clock_run_all_timers(void) =20 return progress; } + +int64_t qemu_clock_advance_virtual_time(int64_t dest) +{ + int64_t clock =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + AioContext *aio_context; + aio_context =3D qemu_get_aio_context(); + while (clock < dest) { + int64_t deadline =3D qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, + QEMU_TIMER_ATTR_ALL); + int64_t warp =3D qemu_soonest_timeout(dest - clock, deadline); + + qemu_virtual_clock_set_ns(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + = warp); + + qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL); + timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]); + clock =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + } + qemu_clock_notify(QEMU_CLOCK_VIRTUAL); + + return clock; +} --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654142; cv=none; d=zohomail.com; s=zohoarc; b=eG64jGqjizgeVISWA7HePQga5ABQMy3HMV1eJSxnn+EWsMaMVlM2hz/gnS3nnveZAq/+BsWS9xxyw9I58iP1yg0eP7RrJYHMsWOV1jc/EbEph8ZixuJo7GKUpkwIGxbZEq+lMUdQiWHQhKsgu5HTyisYjzxouO/bH7/ex5AtMB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654142; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y3Mf9pXINv9MNziLLoU9Gq8z0X78btsM4rjGFmiQ41I=; b=kT73hfMuXuenhydFc3SsqXSdZxKm25i0kdeGy/1eemn64i2H+3bahkjG1HFHESSETF1IRTzzbCnfcgO+Jpki4fVwvOzJoOat4qBj4+P0d30kGMZGjD4XD5+dHym8QkVPvcuYmqtwfa8/DhSh7wiphoUHn+X8RJhMamrm/2wV5pU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654142401808.392833139138; Mon, 25 Sep 2023 08:02:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3N-0000FH-6E; Mon, 25 Sep 2023 10:59:17 -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 1qkn35-0008KQ-5U for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -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 1qkn2r-0002Ei-U2 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:55 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-405524e6769so26306285e9.1 for ; Mon, 25 Sep 2023 07:58:44 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b12-20020a5d634c000000b0031773a8e5c4sm12054037wrw.37.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B57851FFD5; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653924; x=1696258724; 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=y3Mf9pXINv9MNziLLoU9Gq8z0X78btsM4rjGFmiQ41I=; b=u+F/DJ7qlRZsnBL0Z1lVSZFqS3G03shccLStBwJcnNPogQ02GjWOXrfo1NqgHwDl4g 5DJWr0YtQMLKUCYLPH6DM1KWoJySXqbhzz0Yv1/kd6ZtjXTmhI3sBW/c1CoXVpl57MON RKgSSqgPxkrq52i61y3fX78wA+O/J6tG2Q+qHliT5jIWfNh+Qm5UApo7JsS6y2+dcIUM ECYy5m5buy9CM1KqXRzZsB41Cw0sU8yGilF6Wh9w0YeJp7k5x+2qkvAk9SBT1IHZFK9M dG36KnOYPWXCxRYbVeLqIBmDMor36/pWeqnk1Of4sHtP6ay59/PGYZjlKV/x00H3JrnM xAYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653924; x=1696258724; 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=y3Mf9pXINv9MNziLLoU9Gq8z0X78btsM4rjGFmiQ41I=; b=LJC6w8gTOs+8w6PVhRkxQ4Hy46dP1usaUfGm+FKsIGMbXxHq7qM04aV8L3kuoS71HO G0DJSXOFGF33h6lsvoevzI0+Ryzvuah215QWFLBK7Jhc3TjR+8iD+kexttv1ilfP/Z/e Vk9CuQkiq8H/ZqsrlHKA7ooG0fsI+hCl22XHwy1zv2+4KgLI1VdwdChr+E4IOZS4M8/8 7AJK1rImwFGlZm6xEYOM/oxX47SNvQqdBeRXGjO5UZOTnNR6T1Pa4rXC/cVYcT6XSxUX gcjXqXDMTBduVndNBu+Owd0ijqdwu7t026s8UXb/kyUuSS4WOrmQQ9uJq7xJFYZg4ypV j33w== X-Gm-Message-State: AOJu0Yz3xKKCn5qhuADuk3kee0PvglEyt7OZyPqp0OiDdccQ+OPJGbRm qv6aWEbQpvgT1yV9Vd6wbJ2nVA== X-Google-Smtp-Source: AGHT+IEiLCyOEts8B03mcZSLRA6zd9J8yZxN0E94W2V1sD6BYxfhnegjBU/8FSmvl7Wb9833D6d/DA== X-Received: by 2002:a1c:4c12:0:b0:402:e68f:8a4f with SMTP id z18-20020a1c4c12000000b00402e68f8a4fmr5500650wmf.0.1695653923892; Mon, 25 Sep 2023 07:58:43 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [RFC PATCH 30/31] plugins: add time control API Date: Mon, 25 Sep 2023 15:48:53 +0100 Message-Id: <20230925144854.1872513-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654143328100001 Expose the ability to control time through the plugin API. Only one plugin can control time so it has to request control when loaded. There are probably more corner cases to catch here. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230519170454.2353945-8-alex.bennee@linaro.org> --- v2 - ifdef for SOFTMMU only - fix checkpatch warnings --- include/qemu/qemu-plugin.h | 19 +++++++++++++++++++ plugins/api.c | 28 ++++++++++++++++++++++++++++ plugins/qemu-plugins.symbols | 2 ++ 3 files changed, 49 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 50a9957279..898385d92d 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -536,7 +536,26 @@ void qemu_plugin_register_vcpu_mem_inline(struct qemu_= plugin_insn *insn, enum qemu_plugin_op op, void *pt= r, uint64_t imm); =20 +/** + * qemu_plugin_request_time_control() - request the ability to control time + * + * This grants the plugin the ability to control system time. Only one + * plugin can control time so if multiple plugins request the ability + * all but the first will fail. + * + * Returns an opaque handle or NULL if fails + */ +const void *qemu_plugin_request_time_control(void); =20 +/** + * qemu_plugin_update_ns() - update system emulation time + * @handle: opaque handle returned by qemu_plugin_request_time_control() + * @new_time_ns: time in nanoseconds + * + * This allows an appropriately authorised plugin (i.e. holding the + * time control handle) to move system time forward to @new_time_ns. + */ +void qemu_plugin_update_ns(const void *handle, int64_t new_time_ns); =20 typedef void (*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, diff --git a/plugins/api.c b/plugins/api.c index 5521b0ad36..a1d413dc2d 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -37,6 +37,7 @@ #include "qemu/osdep.h" #include "qemu/plugin.h" #include "qemu/log.h" +#include "qemu/timer.h" #include "tcg/tcg.h" #include "exec/exec-all.h" #include "exec/ram_addr.h" @@ -427,3 +428,30 @@ uint64_t qemu_plugin_entry_code(void) #endif return entry; } + +/* + * Time control + */ +#ifdef CONFIG_SOFTMMU +static bool has_control; +#endif + +const void *qemu_plugin_request_time_control(void) +{ +#ifdef CONFIG_SOFTMMU + if (!has_control) { + has_control =3D true; + return &has_control; + } +#endif + return NULL; +} + +void qemu_plugin_update_ns(const void *handle, int64_t new_time) +{ +#ifdef CONFIG_SOFTMMU + if (handle =3D=3D &has_control) { + qemu_clock_advance_virtual_time(new_time); + } +#endif +} diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 71f6c90549..91b882fecc 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -35,11 +35,13 @@ qemu_plugin_register_vcpu_tb_exec_cb; qemu_plugin_register_vcpu_tb_exec_inline; qemu_plugin_register_vcpu_tb_trans_cb; + qemu_plugin_request_time_control; qemu_plugin_reset; qemu_plugin_start_code; qemu_plugin_tb_get_insn; qemu_plugin_tb_n_insns; qemu_plugin_tb_vaddr; qemu_plugin_uninstall; + qemu_plugin_update_ns; qemu_plugin_vcpu_for_each; }; --=20 2.39.2 From nobody Fri May 17 09:18:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695654157; cv=none; d=zohomail.com; s=zohoarc; b=Gh06XhRX+HSMXawQpNWY9R6x1t8zsgs3+b45PFj3QPXwf3R5h0J23lTOTVQp7TJ215feXIZmW0NOz3j1c5aBXOlVz11GR+9AxlsZ0L3lJIzKoHWvxCIvPJ4CEClH6b0TJP8dsoHln37lYwfHDqW64oD3d8BOBMr86YxgCW5rm2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695654157; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eKXyxkZjkgMHzhbh3Oq/XROWT/WyaO+gDU9Mjp58TiI=; b=R9vzO7pSjG2DDNqf1TF05tYo/Up89m8OrE4LZgxyhl4HnbfB1G42hXtmemu1fIMTUIe/m3n5L8c45CwfWmBc6SkludgpnWbov48qJiqjKW9/3WWSO91UyBr6sXdj+CCOX9e59JMugtyW9i5JDzsmVuu8kH4QSSCVp3SNVuSv+Yg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695654157327713.2430760778815; Mon, 25 Sep 2023 08:02:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn3M-0000E8-5e; Mon, 25 Sep 2023 10:59:16 -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 1qkn35-0008KP-6T for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:59:00 -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 1qkn2r-0002Ef-W9 for qemu-devel@nongnu.org; Mon, 25 Sep 2023 10:58:57 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40572aeb73cso31366045e9.3 for ; Mon, 25 Sep 2023 07:58:44 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k12-20020a7bc40c000000b00403038d7652sm12457849wmi.39.2023.09.25.07.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:58:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D967B1FFD6; Mon, 25 Sep 2023 15:48:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695653924; x=1696258724; 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=eKXyxkZjkgMHzhbh3Oq/XROWT/WyaO+gDU9Mjp58TiI=; b=v4+LzZ0qKbYpVrBm6g7rdVJQ8kcfUnpsf7UwmNcPdeG0i8DpQt38mJXhXdN/ITGRnG zrFI6EgINpKA3T4dRNzEHwrTS3syn4Ai/GcfIkxAUGtWKYb0VqUTVW1E9Qs/NLokJmk+ kLyRC2wPJ0EOc/LpE7YntaKyfRbDusE+6R/yqB7B88ALXPnPQYgAqt/3c3GlcdvdPDfG wXKMTIzVzy/wURDyvciSnr8JFdjkfWFlWvRFYDt93vPUSzmexosIj0dmYweq706Gfg5w g4t5+fJplIs4N5tBzI0qKgZgPojh16fpONsjvzIpaoJR8sK0xSCqfILVepQRL2ou0mJK rgBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695653924; x=1696258724; 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=eKXyxkZjkgMHzhbh3Oq/XROWT/WyaO+gDU9Mjp58TiI=; b=Js2QWS7GPCjEwes1cDkjZlw7p/9bK6Q9Ed2OhMBKgmGstjGRo8B5293kPevMEkGjFm NB4ikj7ncuFtyIaTkgLO8NZJ4BZN6MAADaAwemjQTT/tHWjfYQdtRNfJJaMRhai5SGKv ZttKnyUeseZHENTiALbsXowURpx9VTm9Xnl19WaTpclyinTxzXKUmKlLLs/aEKZ7zuzR g2E9ilawCfkyeo1q28Ozb++IeUrOY7dX4F2dgLPJbXTTeUaCipTDdTIHrTDYoNI/4fDL qFijpFZIMC+UEEY7M4vQ1Q1Y0BgZn6oE31POv1gvspaMj+F1bhQKuxK9f84PqIIy176Y QAzQ== X-Gm-Message-State: AOJu0Yzo5N7WLWKpMJ4G1+qV39GJ06AS65PJSBda+VsC9HXKjUMa9hbB pzRwrEVryxgrty0qOcch47IcQA== X-Google-Smtp-Source: AGHT+IGWbUjxohdjoGUz1NACjFC7lPrzbzSjOIinfeWPBprq1qiMF15BclJ+KgJx8fxJhUxcDhDCPA== X-Received: by 2002:a05:600c:230b:b0:3fe:d448:511a with SMTP id 11-20020a05600c230b00b003fed448511amr6821322wmo.9.1695653923716; Mon, 25 Sep 2023 07:58:43 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Song Gao , Daniel Henrique Barboza , Marcel Apfelbaum , Bastian Koppelmann , Liu Zhiwei , Weiwei Li , Nicholas Piggin , Radoslaw Biernacki , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Richard Henderson , Bin Meng , Alexandre Iooss , Xiaojuan Yang , qemu-ppc@nongnu.org, David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yanan Wang , Peter Maydell , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Palmer Dabbelt , Ilya Leoshkevich , Laurent Vivier , Yoshinori Sato , Leif Lindholm , Beraldo Leal Subject: [RFC PATCH 31/31] contrib/plugins: add iops plugin example for cost modelling Date: Mon, 25 Sep 2023 15:48:54 +0100 Message-Id: <20230925144854.1872513-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230925144854.1872513-1-alex.bennee@linaro.org> References: <20230925144854.1872513-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1695654157668100003 This plugin uses the new time control interface to make decisions about the state of time during the emulation. The algorithm is currently very simple. The user specifies an iops rate which applies per core. If the core runs ahead of its allocated execution time the plugin sleeps for a bit to let real time catch up. Either way time as updated for the emulation as a function of total executed instructions with some adjustments for cores that idle. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230519170454.2353945-9-alex.bennee@linaro.org> --- v2 - fix various style issues --- contrib/plugins/iops.c | 261 +++++++++++++++++++++++++++++++++++++++ contrib/plugins/Makefile | 1 + 2 files changed, 262 insertions(+) create mode 100644 contrib/plugins/iops.c diff --git a/contrib/plugins/iops.c b/contrib/plugins/iops.c new file mode 100644 index 0000000000..6f8baca6f7 --- /dev/null +++ b/contrib/plugins/iops.c @@ -0,0 +1,261 @@ +/* + * iops rate limiting plugin. + * + * This plugin can be used to restrict the execution of a system to a + * particular number of Instructions Per Second (IOPS). This controls + * time as seen by the guest so while wall-clock time may be longer + * from the guests point of view time will pass at the normal rate. + * + * This uses the new plugin API which allows the plugin to control + * system time. + * + * Copyright (c) 2023 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; + +#define SLICES 10 /* the number of slices per second we compute delay */ + +static GMutex global_state_lock; + +static uint64_t iops =3D 1000000; /* iops rate, per core, per second */ +static uint64_t current_ticks; /* current global ticks */ +static uint64_t next_check; /* the next checkpoint for time */ +static bool precise_execution; /* count every instruction */ + +static int64_t systime_at_start; /* time we started the first vCPU */ + +static const uint64_t nsec_per_sec =3D 1000000000; +static const void *time_handle; + +/* + * We need to track the number of instructions each vCPU has executed + * as well as what its current state is. We need to account for time + * passing while a vCPU is idle. + */ + +typedef enum { + UNKNOWN =3D 0, + CREATED, + EXECUTING, + IDLE, + FINISHED +} vCPUState; + +typedef struct { + /* pointer to vcpu counter entry */ + uint64_t *counter; + vCPUState state; + /* timestamp when vCPU entered state */ + uint64_t state_time; + /* number of ns vCPU was idle */ + uint64_t total_idle; +} vCPUTime; + +GArray *vcpus; +uint64_t *vcpu_counters; + +/* + * Get the vcpu structure for this vCPU. We don't do any locking here + * as only one vCPU will ever access its own structure. + */ +static vCPUTime *get_vcpu(int cpu_index) +{ + return &g_array_index(vcpus, vCPUTime, cpu_index); +} + +/* + * When emulation is running faster than real time this is the point + * we can throttle the execution of a given vCPU. Either way we can + * now tell the system to move time forward. + */ +static void update_system_time(int64_t vcpu_ticks) +{ + int64_t now =3D g_get_real_time(); + int64_t real_runtime_ns =3D now - systime_at_start; + + g_mutex_lock(&global_state_lock); + /* now we have the lock double check we are fastest */ + if (vcpu_ticks > next_check) { + + int64_t tick_runtime_ns =3D (vcpu_ticks / iops) * nsec_per_sec; + if (tick_runtime_ns > real_runtime_ns) { + int64_t sleep_us =3D (tick_runtime_ns - real_runtime_ns) / 100= 0; + g_usleep(sleep_us); + } + + /* Having slept we can now move the clocks forward */ + qemu_plugin_update_ns(time_handle, vcpu_ticks); + current_ticks =3D vcpu_ticks; + next_check =3D iops / SLICES; + } + g_mutex_unlock(&global_state_lock); +} + +/* + * State tracking + */ +static void vcpu_init(qemu_plugin_id_t id, unsigned int cpu_index) +{ + vCPUTime *vcpu =3D get_vcpu(cpu_index); + vcpu->state =3D CREATED; + vcpu->state_time =3D *vcpu->counter; + + g_mutex_lock(&global_state_lock); + if (!systime_at_start) { + systime_at_start =3D g_get_real_time(); + } + g_mutex_unlock(&global_state_lock); +} + +static void vcpu_idle(qemu_plugin_id_t id, unsigned int cpu_index) +{ + vCPUTime *vcpu =3D get_vcpu(cpu_index); + vcpu->state =3D IDLE; + vcpu->state_time =3D *vcpu->counter; + + /* handle when we are the last vcpu to sleep here */ +} + +static void vcpu_resume(qemu_plugin_id_t id, unsigned int cpu_index) +{ + vCPUTime *vcpu =3D get_vcpu(cpu_index); + + /* + * Now we need to reset counter to something approximating the + * current time, however we only update current_ticks when a block + * exceeds next_check. If the vCPU has been asleep for awhile this + * will probably do, otherwise lets pick somewhere between + * current_ticks and the next_check value. + */ + if (vcpu->state_time < current_ticks) { + *vcpu->counter =3D current_ticks; + } else { + int64_t window =3D next_check - vcpu->state_time; + *vcpu->counter =3D next_check - (window / 2); + } + + vcpu->state =3D EXECUTING; + vcpu->state_time =3D *vcpu->counter; +} + +static void vcpu_exit(qemu_plugin_id_t id, unsigned int cpu_index) +{ + vCPUTime *vcpu =3D get_vcpu(cpu_index); + vcpu->state =3D FINISHED; + vcpu->state_time =3D *vcpu->counter; +} + +/* + * tb exec + */ +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + vCPUTime *vcpu =3D get_vcpu(cpu_index); + uint64_t count =3D *vcpu->counter; + + count +=3D GPOINTER_TO_UINT(udata); + + if (count >=3D next_check) { + update_system_time(count); + } +} + +/* + * We have two choices at translation time. In imprecise mode we just + * install a tb execution callback with the total number of + * instructions in the block. This ignores any partial execution + * effects but it reasonably fast. In precise mode we increment a + * per-vCPU counter for every execution. + */ + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n_insns =3D qemu_plugin_tb_n_insns(tb); + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, + GUINT_TO_POINTER(n_insns)); +} + +/** + * Install the plugin + */ +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, int ar= gc, + char **argv) +{ + /* This plugin only makes sense for system emulation */ + if (!info->system_emulation) { + fprintf(stderr, "iops plugin only works with system emulation\n"); + return -1; + } + + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "iops") =3D=3D 0) { + iops =3D g_ascii_strtoull(tokens[1], NULL, 10); + if (!iops && errno) { + fprintf(stderr, "%s: couldn't parse %s (%s)\n", + __func__, tokens[1], g_strerror(errno)); + return -1; + } + + } else if (g_strcmp0(tokens[0], "precise") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], + &precise_execution)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + /* + * Setup the tracking information we need to run. + */ + vcpus =3D g_array_new(true, true, sizeof(vCPUTime)); + g_array_set_size(vcpus, info->system.max_vcpus); + vcpu_counters =3D g_malloc0_n(info->system.max_vcpus, sizeof(uint64_t)= ); + for (int i =3D 0; i < info->system.max_vcpus; i++) { + vCPUTime *vcpu =3D get_vcpu(i); + vcpu->counter =3D &vcpu_counters[i]; + } + + /* + * We are going to check the state of time every slice so set the + * first check at t0 + iops/SLICES + */ + next_check =3D iops / SLICES; + + /* + * Only one plugin can request time control, if we don't get the + * handle there isn't much we can do. + */ + time_handle =3D qemu_plugin_request_time_control(); + if (!time_handle) { + fprintf(stderr, "%s: not given permission to control time\n", __fu= nc__); + return -1; + } + + /* + * To track time we need to measure how many instructions each + * core is executing as well as when each vcpu enters/leaves the + */ + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + + qemu_plugin_register_vcpu_init_cb(id, vcpu_init); + qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle); + qemu_plugin_register_vcpu_resume_cb(id, vcpu_resume); + qemu_plugin_register_vcpu_exit_cb(id, vcpu_exit); + + return 0; +} diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index 8ba78c7a32..3f45a46a03 100644 --- a/contrib/plugins/Makefile +++ b/contrib/plugins/Makefile @@ -21,6 +21,7 @@ NAMES +=3D lockstep NAMES +=3D hwprofile NAMES +=3D cache NAMES +=3D drcov +NAMES +=3D iops =20 SONAMES :=3D $(addsuffix .so,$(addprefix lib,$(NAMES))) =20 --=20 2.39.2