From patchwork Mon Sep 25 14:48:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726016 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2431380wrm; Mon, 25 Sep 2023 07:50:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEr9VsqZ6WOtSZoqpKHtLMzVOvTK2LE4tPVTBJYJ1oVnQz0CxHJknRGZ5T5vWF5uxRR7uk4 X-Received: by 2002:a05:622a:355:b0:412:1c5f:478b with SMTP id r21-20020a05622a035500b004121c5f478bmr9760899qtw.15.1695653443180; Mon, 25 Sep 2023 07:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653443; cv=none; d=google.com; s=arc-20160816; b=CNKyIcz1J3GBRE3ETrth0hNV88FsyAN4Ym4vk/6jOqmUZr68Hetcnn2jXF0NOsCS4K guTKmyB/exu/Sx4vkP/D2Sh005Bk2pGO0O4zRZXemIIRIZ7yJ4RTLcLXPrrgJLh9+aqy 2xHqycA5nAMfWqdKTdstM7JEZroXwE5FqPThbcPJw8SSC5oiW1EUXooAZtRjRtVxGNAU Q8G3TKVO+eOuUCXCgBTqXDHEMGmWVLyQ/hwduWQCEkRSOpABMVGF7hEttU7+81ZqSN9s 0XCcIqMglRt5klBY2pSW7pqwMCgqj8EYa4mzkIbGrO7id7l7y85kCg1BSOOuMgcZC2MN jFBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i/NxOuLXpZoY7AKhUkjRhpOIcVG1WqxnVG0wjWhT+R4=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=rPra9k8C1dP+Vpq1PBulSHwUxorIGYllOPANRu43SJH/yxuuzwjWzpg6c5Dk5IV0LQ YgnA3a8XPtjuAEXZCcYK89JDUwST3k2U15Pa4QxEggN0sc1WofgS47OiCyu3jJRgvh4Q UjsqYGQOu+HoB9wU2BmWKc9kTW07nrpMyt9roCGsdyL2Tp54v8K+ZNV1pkQaqJCendsI mhdLNXIdMmXbhjQTyt1FXf5BOTtAM6ANaz3+h9tA7Hu9XFtMqjeMC4m7fWFEDCPav6Qb J/2PNthqOVAPJB1SKftlM70UlhHOvzNz3QbFW8tvigwd+eGzEnKIkMYGvV+EpRc1xR9g ro4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lrK3xPKS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x11-20020ac86b4b000000b0041220e682d3si4495567qts.596.2023.09.25.07.50.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lrK3xPKS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Marcin Juszkiewicz Update prebuilt firmware images to have TF-A with Neoverse V1 support enabled. 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é Reviewed-by: Richard Henderson Message-Id: <20230915113519.269290-1-marcin.juszkiewicz@linaro.org> Signed-off-by: Alex Bennée --- 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/machine_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: - - Fedora GNU Toolchain version 13.1.1 20230511 (Red Hat 13.1.1-2) + - Fedora GNU Toolchain version 13.2.1 20230728 (Red Hat 13.2.1-1) - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee38 + https://github.com/ARM-software/arm-trusted-firmware/tree/cc933e1d - 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 """ # Secure BootRom (TF-A code) fs0_xz_url = ( - "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" + "https://fileserver.linaro.org/s/g4C3WzJzNBES2p2/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash = "447eff64a90b84ce47703c6ec41fbfc25befaaea" + fs0_xz_hash = "374738599f7ba38c22924b2075ec5355c2b24a47" tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash) archive.extract(tar_xz_path, self.workdir) fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd") # Non-secure rom (UEFI and EFI variables) fs1_xz_url = ( - "https://fileserver.linaro.org/s/t8foNnMPz74DZZy/" + "https://fileserver.linaro.org/s/scJRninsAFTwEct/" "download/SBSA_FLASH1.fd.xz" ) - fs1_xz_hash = "13a9a262953787c7fc5a9155dfaa26e703631e02" + fs1_xz_hash = "5d3f156ebd6c6374da2121e15c7c8f4ed0351dcc" tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash) archive.extract(tar_xz_path, self.workdir) fs1_path = os.path.join(self.workdir, "SBSA_FLASH1.fd") @@ -144,10 +143,16 @@ def test_sbsaref_alpine_linux_cortex_a57(self): def test_sbsaref_alpine_linux_neoverse_n1(self): """ - :avocado: tags=cpu:max + :avocado: tags=cpu:neoverse-n1 """ self.boot_alpine_linux("neoverse-n1") + def test_sbsaref_alpine_linux_neoverse_v1(self): + """ + :avocado: tags=cpu:neoverse-v1 + """ + self.boot_alpine_linux("neoverse-v1,pauth-impdef=on") + def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=cpu:max From patchwork Mon Sep 25 14:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726015 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2431063wrm; Mon, 25 Sep 2023 07:50:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE69vYodMVbHxOKKvvNpLhbd7ZDiKRcG64EMqiwgyoJzDLxJ2XwSjCfqHvI95qPpgCQR/Fz X-Received: by 2002:a1f:29cb:0:b0:49a:466c:199e with SMTP id p194-20020a1f29cb000000b0049a466c199emr1460439vkp.2.1695653402734; Mon, 25 Sep 2023 07:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653402; cv=none; d=google.com; s=arc-20160816; b=J1u33ZtqLl7eWaGMzwmoFzUuEVh+WkgtxicdQk95aM8c5BgTml5F/Ftlw647PDcX5J 5FTgotOrwscLfcsuad7GWftTdyOHsbdhuiH/v5yIXGl6Q9viB9me0lqTP8LB5jiQfoV3 zZk+nAW7BxJB16l2BUZqX/cEoL7UfOsq8qfJHk5C8yNwWpTI/EbQEgAV4ZcCvD4EGI90 vI8oiwkx4babQO1TaPxipJy/BBWNbXJq/wZVIDuVIYPGx4ZBBTcZt/iyqgQKjujtgrsc uEI2kGAnMPbxEbeMIs0RhKPPpTHh5ZE8SB4o5ri9aQa6KBKWvSGjVocgVTO2eikYdMGe XtWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DX65lOE/uUVkmtjhIZOisxQvTzydcI84YNB1WXt/J5w=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=Q6+UHIlQz2Ynm/Px6cR5EudhwkS+danCEW/T5NRwuLv0K1B6AaxVMxthLQDWXBUhD9 06rTrhR0k6sghpTGywWfJhmWxZO5DzpYa1IGp2sHX/hj370I6stMBmwLePlta2engABY 1NBrabeA/Z0AFk7AEzZrDb8JbW39W2IS42TRI7VMP9GaB42BX/69/PdMk67Bmk+n37Is smx2/37XetT0SADbFIwn+jScV81LXPEKrQOxNFI26u9DUmY+Ldn8izH8kFpmjzUGAyt+ mWx4odcQ0CvY2lgCPKd0KiJqCmiI0YQ0Uu7Su2sb6FdsIk2p8hujCb16EiKhAiKkeMHf Hv5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLSJJDlM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d12-20020ac85acc000000b0040fd9f98527si6221537qtd.754.2023.09.25.07.50.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLSJJDlM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We need this to test some TPM stuff. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé --- .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='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol tesseract usbredir vde vte3 xorriso zlib zstd' +PKGS='bash bc bison bzip2 capstone ccache cmocka ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo json-c libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson mtools ncurses nettle ninja pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy socat sparse spice-protocol swtpm tesseract usbredir vde vte3 xorriso zlib zstd' PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme tomli' PYTHON='/opt/homebrew/bin/python3' diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker index d25649cb4f..42f6928627 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -100,6 +100,7 @@ RUN apk update && \ sparse \ spice-dev \ spice-protocol \ + swtpm \ tar \ tesseract-ocr \ usbredir-dev \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker index 68bfe606f5..d97c30e96a 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -107,6 +107,7 @@ RUN dnf distro-sync -y && \ socat \ spice-protocol \ spice-server-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker index 0991938595..00bdc06021 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker index 61dbc3ff24..9b50fb2f63 100644 --- a/tests/docker/dockerfiles/debian-amd64.docker +++ b/tests/docker/dockerfiles/debian-amd64.docker @@ -124,6 +124,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ systemtap-sdt-dev \ tar \ tesseract-ocr \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker index 74eabb274e..2dae3777f7 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker index 1ebd6ebd00..180ed836e6 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker index 59091fed02..d6be2f0cc5 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker index 48b2f28310..ec0041d6aa 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -55,6 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ tar \ tesseract-ocr \ tesseract-ocr-eng \ diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker index afa988574f..08799219f9 100644 --- a/tests/docker/dockerfiles/fedora-win32-cross.docker +++ b/tests/docker/dockerfiles/fedora-win32-cross.docker @@ -55,6 +55,7 @@ exec "$@"\n' > /usr/bin/nosync && \ socat \ sparse \ spice-protocol \ + swtpm \ tar \ tesseract \ tesseract-langpack-eng \ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker index cf93a0ca60..f8e4cb70d3 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -55,6 +55,7 @@ exec "$@"\n' > /usr/bin/nosync && \ socat \ sparse \ spice-protocol \ + swtpm \ tar \ tesseract \ tesseract-langpack-eng \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index f00e9e267c..9e9c71fa94 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -118,6 +118,7 @@ exec "$@"\n' > /usr/bin/nosync && \ sparse \ spice-protocol \ spice-server-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker index ed04b4d6da..dc0e36ce48 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -100,6 +100,7 @@ RUN zypper update -y && \ socat \ sparse \ spice-protocol-devel \ + swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ diff --git a/tests/docker/dockerfiles/ubuntu2204.docker b/tests/docker/dockerfiles/ubuntu2204.docker index 94c2c16118..2ca9cff79c 100644 --- a/tests/docker/dockerfiles/ubuntu2204.docker +++ b/tests/docker/dockerfiles/ubuntu2204.docker @@ -124,6 +124,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ sed \ socat \ sparse \ + swtpm \ systemtap-sdt-dev \ tar \ tesseract-ocr \ diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index e3ed1e5da1..36bc517161 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit e3ed1e5da101943e53d8d89424e17b22120743f5 +Subproject commit 36bc517161c45ead20224d47f2dc4fa428af6724 diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml index 6f0885170d..82092c9f17 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -110,6 +110,7 @@ packages: - spice-protocol - spice-server - ssh-client + - swtpm - systemd - tar - tesseract From patchwork Mon Sep 25 14:48:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726028 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433525wrm; Mon, 25 Sep 2023 07:54:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsq5utSOqGslDFpsHv/5Qk7A7m9jXEm5GlGiTyZe65tJAy/C0Lq2rJ2lOFknoy0exu0G5Q X-Received: by 2002:a0c:e112:0:b0:65a:f7d2:d118 with SMTP id w18-20020a0ce112000000b0065af7d2d118mr6396038qvk.0.1695653699230; Mon, 25 Sep 2023 07:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653699; cv=none; d=google.com; s=arc-20160816; b=WyqK8Hr1G7w6h/OtDj1i6Saa1URBr7dmjDgeIKc6J78rkOJALRZ4SKYZLT3Df9I2j4 IeHnVGl8rO1Xu7R5ZdUAjV8+VoUM+mSbacEHZg9sPs9jztmsjpcIv8Q8UAfvlfcM4yyp 0F9K9eFzMxYQQEHliJyqvSFnGcjVk5Tdnmy/YonfEdXbdsUzypofXD1BaIfX0Pnjg28j 3npOreDa9FvV/Br0unfWQb//ynVshaAKVI4vO9XC4KK6OF4l63EbaH1XopoYFgH56/2w ip1TkZw7VdWmLcy+PVvx9WZneHm5Jc9b1NsEOErBa3MzhsM4Gzlq1Bc5ITXXoGJlnOtk U3wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a52wocQYp8F3YgwPFsZoycBHm5iiCFaISrIdWEZjgl0=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=tq8y2doF4qBVJjqC1CGxl0H+JlwBac/q/AmJiA/SXVECl2zxvbzM46uC54hXXlA10v krvDbZUSbaXS7LL9pWlPqjNDz/vnRH+p6EOYuYfF+QWlYbMzfkFIhCOQy77vSi3MqliM h5d9TrYUuRZ23NXn/oyL0Eqymv7/yqc1CSDjnk5t5fHgMDoIJtrLYaMvgMykt8ZzQKo1 3H8Fx6c4678nFkhl6kBaDs3I6dbo0T2dWDN5TOZZs9/UXARd3MDnl1pelBCFCQykiLfd FOUwt1s/m7VQ2AIE/oGusKyvfEN/+GZ6ypKs4xJEXAH7Zu7c4aa9XI34mG38/zZZQ/6/ hwWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eyc5Nful; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r1-20020a0ccc01000000b0065b081ea06bsi1800592qvk.22.2023.09.25.07.54.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eyc5Nful; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We move a couple of targets out of the avocado runs because there are no tests to run. Tricore already has some coverage. The cris target only really has check-tcg tests but its getting harder to find anything that packages the compiler. To reduce the noise of CANCEL messages we also set AVOCADO_TAGS appropriately so we filter down the number of tests we attempt. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- 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 build-system-ubuntu: extends: @@ -40,8 +41,7 @@ build-system-ubuntu: variables: IMAGE: ubuntu2204 CONFIGURE_ARGS: --enable-docs - TARGETS: alpha-softmmu cris-softmmu hppa-softmmu - microblazeel-softmmu mips64el-softmmu + TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu MAKE_CHECK_ARGS: check-build check-system-ubuntu: @@ -61,6 +61,7 @@ avocado-system-ubuntu: variables: IMAGE: ubuntu2204 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:alpha arch:microblaze arch:mips64el build-system-debian: extends: @@ -72,7 +73,7 @@ build-system-debian: IMAGE: debian-amd64 CONFIGURE_ARGS: --with-coroutine=sigaltstack TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu - sparc-softmmu xtensaeb-softmmu + sparc-softmmu xtensa-softmmu MAKE_CHECK_ARGS: check-build check-system-debian: @@ -92,6 +93,7 @@ avocado-system-debian: variables: IMAGE: debian-amd64 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa crash-test-debian: extends: .native_test_job_template @@ -114,7 +116,7 @@ build-system-fedora: variables: IMAGE: fedora CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs - TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu + TARGETS: microblaze-softmmu mips-softmmu xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu MAKE_CHECK_ARGS: check-build @@ -135,6 +137,8 @@ avocado-system-fedora: variables: IMAGE: fedora MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k + arch:riscv32 arch:ppc arch:sparc64 crash-test-fedora: extends: .native_test_job_template @@ -180,6 +184,8 @@ avocado-system-centos: variables: IMAGE: centos8 MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:ppc64 arch:or1k arch:390x arch:x86_64 arch:rx + arch:sh4 arch:nios2 build-system-opensuse: extends: @@ -209,6 +215,7 @@ avocado-system-opensuse: variables: IMAGE: opensuse-leap MAKE_CHECK_ARGS: check-avocado + AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by From patchwork Mon Sep 25 14:48:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726019 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2432734wrm; Mon, 25 Sep 2023 07:53:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg549yUHQO7EiGEIS+wWAjNeKIwbe4odzAmUwDkJ9/Rw2nhB8Y4SpzeAlwju9NktYktkbl X-Received: by 2002:a05:6870:3119:b0:1dc:ddd0:6ee1 with SMTP id v25-20020a056870311900b001dcddd06ee1mr8368806oaa.38.1695653606005; Mon, 25 Sep 2023 07:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653605; cv=none; d=google.com; s=arc-20160816; b=NqM1riEsZetOMVM75QQPsUYMBOThqftI8gAFqE/TgIa8X3dlHtar4NicmxCrydr1CZ 2Cc0kO64OC4Bl71Mu7oCI7WgfFwL2ZQIVdLu1HR775rPmY9OCWDMEY58bSq4Ob4SLZ9U rvtVv6FHMEA9yQYUqc9Pgnj0c5uNbfdRz1qxlls874F0tbHaWH8j9Jq9XAADSqz/EMVp Roi6LkBA4E9P4iGHyHS0m7Vpsvg7tUqy20KXydlghdlQQhXPonB10hO2Dbz0gYooU3/7 u6oZ30ZmTeJQuBIhOoVZUZJcfXl1HaheBCVrF/4O1AiE+O+aPFsB0ov6Fzg4oVRbAZHf 8d1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Cd4HdnbICWyITK5Y/4XhPzcPYvpQm5TBhsynKcdayLw=; fh=r1ITr4fS0Sbkb/PYV+FRyKA0z7jc6khGkWs4G/EVyfQ=; b=xso2J+IP3mA7/+BRJZFjLcbAimad543FWO0/ThSfTj9RE0pOUP4XDt1F15j5nmb6Ua vy8HVgJylszMKLudMh9E9mZ+06R8OaB0rXY37Goya7T5RpZHaCvLpWHyIpPAPAUGnf0n 45KtmBAHON1ogH3xd82Kq+GvFvqNxjhHbsfbkkXqWA0/v29XF2OgL98W6zIWsnSlofOR FcSJR4b8A01GSSbEzFt/7BHRxLIA+UiXpKe8CqMK5ShcvX3wsndeBNRf88cnFzx0vrMW VYpo24CIAO3eJSYvrZY4ccaQaVBDIegVYGbanoTCqXmirap13vagh/ffIf1GYcARVE5N dv3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eok3J2nN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id uw23-20020a05620a4d9700b0076ef8a28e86si5975377qkn.202.2023.09.25.07.53.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eok3J2nN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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 command line using the used instead, to refer to a ``--object secret...`` instance that provides a password via a file, or encrypted. +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 ----------------------- From patchwork Mon Sep 25 14:48:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726017 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2431386wrm; Mon, 25 Sep 2023 07:50:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzU0tOmJ+MgqFC931WaEhy1NjvnYZzkgmxTlX1rwYlhSmbymzyvqZaNvqHuFLbny9LW0oV X-Received: by 2002:ae9:e602:0:b0:773:c792:bdda with SMTP id z2-20020ae9e602000000b00773c792bddamr6779538qkf.53.1695653443857; Mon, 25 Sep 2023 07:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653443; cv=none; d=google.com; s=arc-20160816; b=LAg5EMxy8H62hbB4eLmG9z31Ht9zCWl2PG/G8ua058uJhsvrBtX28DQmz2rO457XD6 kyOztkQeR5OEANyVG7uSKzeDtXwUrWfPXs2H0RihCsVkESIOdY3gMp32O6aVNK/PFk/A OvyWAGdCwZZnrM5vZs7oDds8uRtnW6KDkg4xGRr9HcJmawxtKEqJPCto6+mTPpi5OyUi tMS+loAOGR2gvv87fsM/W7ObB+4rc3gmnszohdZMeXJ0EcT9d3aY5//TmGHHp27LP5z8 VWtzuXSTHP5tmzOZLbIAJl7P1s11L+Zk/PE0QAFiTsO40nKX8ZTDr7wL8Dm9VTWpFwTW 33SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r13on7w2SbSnXhlFRAWqdY9M0P6WFpp9T5fLln0Y27E=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=IgCBl3ZVO8v+VfBlkIgdvC7N3QeuvJbpV0PURsgIWXRvTAnQ/JbfYfxt4L4XERcjuH VZYTSYeKGmNGAGteU/u5qNwqyywO9ba0w7nvR9BqWgZiqSiSgFW+A2EvOr8yoe4XJxPe CnJluD/Biei6xxdVZe4LIPdRDjDX669dhK226VfDPUV43JBAfUOpSd+bZ6Slvz1ncmh4 OTXVCoLDjuN/nWzl69ueoYFhLxrPhfYqNC0pBGo6fmeRUNB9D1PWMDPCru0uweHrpYeB dngtl7fX/bRyssv7/O67R6B+d7gtX3Ah1/zGqTmYftIlcWHdBP0/Sao8+khI6IUG2/+v wqrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4f2h3MQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r9-20020a05620a298900b00774351019f7si965078qkp.411.2023.09.25.07.50.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4f2h3MQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since 0b1a649047 (tests/docker: use direct RUNC call to build containers) we ended up with the potential for the remaining docker.py script calls to deviate from the direct RUNC calls. Fix this by dropping the use of ENGINE in the makefile and rely entirely on what we detect at configure time. Signed-off-by: Alex Bennée --- 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 if test "$container" != no; then - echo "ENGINE=$container" >> $config_host_mak echo "RUNC=$runc" >> $config_host_mak fi echo "SUBDIRS=$subdirs" >> $config_host_mak diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index dfabafab92..035d272be9 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -17,8 +17,7 @@ endif DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY)) RUNC ?= docker -ENGINE ?= auto -DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) +DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(RUNC) CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) @@ -158,7 +157,7 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES)), \ ) docker: - @echo 'Build QEMU and run tests inside Docker or Podman containers' + @echo 'Build QEMU and run tests inside $(RUNC) containers' @echo @echo 'Available targets:' @echo @@ -198,8 +197,6 @@ docker: @echo ' EXECUTABLE= Include executable in image.' @echo ' EXTRA_FILES=" [... ]"' @echo ' Include extra files in image.' - @echo ' ENGINE=auto/docker/podman' - @echo ' Specify which container engine to run.' @echo ' REGISTRY=url Cache builds from registry (default:$(DOCKER_REGISTRY))' docker-help: docker From patchwork Mon Sep 25 14:48:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726030 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2434164wrm; Mon, 25 Sep 2023 07:56:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHozbJW8r+1IFjiNOsKWuj0GjFAwwg8Hq/ezOpLldh/lC3GsQAqo+cZCGMlYBDs4RBQHRyF X-Received: by 2002:a25:c7d3:0:b0:d0e:330a:160d with SMTP id w202-20020a25c7d3000000b00d0e330a160dmr7336258ybe.33.1695653778802; Mon, 25 Sep 2023 07:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653778; cv=none; d=google.com; s=arc-20160816; b=xWRkeRzyRb6GrwAWkMpLUGUqZkZL6WP0B3pFVdcjiZJSEPAvhZabQNbR+oLJK/b4Ks VA4CJaS4I6jjuxZonOO0cl74/NcsxPwKmEy1FYCF9QGHXkgmsTV1s2AnESsVrBoldtlK OrUJJwRYNQZsRrxxSawimFCLEoVaLq1oOqV3HoLdZFZXYSMxKNeKYPl7SMm8jcqlV4Mq WYMorulSmeXDj33vUpp6dFyW9VMjxdRcMc6Du0kprOYCbL7HUEtI7JB51zJLIKyIl3WE izCJp8ID89KuSwGU/hCBN93HO2A3aE6uS7/i1nRGSicszyfR+P4CecHwGfCfnzrBnVq6 bszw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZDyM/F5z2PX4t5z6swT9o+aFYE3lKyvYgeKJZjudJGU=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=iyoFiB50XvXP6VGWBnDW64QRYSbeGKAmRxQz+VGabtIxoO3uO5F253w4g+V9JtUfbD kF9BmwN2dDwEeGbM/Veau+75laAQ4/4Aq5ZopGRdDgPhAiXI+9EH25bIHz9bQPgjt2NZ vJa2e7jtOo3DUJ1uMDrkbqceMJ8YWtxhRoMmM3a1qCUlyKdXa47FaPPHRU6zQHPd7Fnt 1vSe5TleFNJGcrUlMR+awkFivaLphsrbHGfGVbEwrv8DznP0CXeBNU1mo2VEhvdqE2Cs wy+AeIr4I/PRxgtlkHeq/i8o39hcJccuzQDKMozRUk21tFJtDpBuab9fhr8+U1/Zh+Tl BAdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cCNg6Q0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b4-20020a05620a088400b0076db2ecaa01si6233333qka.779.2023.09.25.07.56.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cCNg6Q0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org If you have both engines installed but one is broken you are stuck with the automagic. Allow the user to override the engine for this case. Signed-off-by: Alex Bennée --- 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 # default parameters +container_engine="auto" cpu="" cross_compile="no" cross_prefix="" @@ -787,6 +788,8 @@ for opt do ;; --disable-containers) use_containers="no" ;; + --container-engine=*) container_engine="$optarg" + ;; --gdb=*) gdb_bin="$optarg" ;; # everything else has the same name in configure and meson @@ -921,6 +924,7 @@ Advanced options (experts only): --enable-plugins enable plugins via shared library loading --disable-containers don't use containers for cross-building + --container-engine=TYPE which container engine to use [$container_engine] --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] EOF meson_options_help @@ -1195,14 +1199,14 @@ fi container="no" runc="" if test $use_containers = "yes" && (has "docker" || has "podman"); then - case $($python "$source_path"/tests/docker/docker.py probe) in + case $($python "$source_path"/tests/docker/docker.py --engine "$container_engine" probe) in *docker) container=docker ;; podman) container=podman ;; no) container=no ;; esac if test "$container" != "no"; then docker_py="$python $source_path/tests/docker/docker.py --engine $container" - runc=$($python "$source_path"/tests/docker/docker.py probe) + runc=$container fi fi From patchwork Mon Sep 25 14:48:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726027 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433448wrm; Mon, 25 Sep 2023 07:54:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEE42YMUMSa9qQVACgE/Dak0IEyZsU//c0gIr/6nDvmipWqkOPiHQKLz4RXcx46+UOlLouh X-Received: by 2002:a1f:c6c1:0:b0:48d:eaa:45c4 with SMTP id w184-20020a1fc6c1000000b0048d0eaa45c4mr3584922vkf.7.1695653688827; Mon, 25 Sep 2023 07:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653688; cv=none; d=google.com; s=arc-20160816; b=tpn89mWN98p0Xlqzc1JCAsLSmarLwroSz+RjB0qz4LCa0DBxmplxzQeYzMNCkNyjcN UghSKXXCJ9dypDMhzG2Fm+z2D+8YpWmCLhi3gB5nLNKygiQK0FqAS3cxcpQzo/kTpCDh 9d/Tb3CJm3vZCFrXusz7H4df6J7OYH/sXvHnL6/0BYBwmn/Ek3HBNgY9xv9opzTDTq2w ljIrxF8rvvOCXyL49MFwxX4TQGbIY0BgFI44A0LmlNYWfdVHQ1iGpiorIHmeJJrGS4mD dlIPJtohmSLp6BJI4/RZPKr9v+3UygvwN3ESulBp3AMw82KcaRjwbh5+3cpft3vq2FGb fVmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Tmt0on2gqtEUKqiKbv0NO0bzg7ahn0zMA7M5ykdCtXI=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=iWbzKoyXW3w0QDtrpLJWSdSaQDBTW0x3xM6VmgksUYHENtBJ3VYJV0a/9xwyKvJux3 V2j+2b7sD2ys81N5MGllE5tIu0pVm9UpjUlo06eh50jNqyrqLlEKXG3A+lq1Da3x+Oj+ uBMjTJr7fyTfZ9fWF3rI6DaOlsbn7ZjgE1R2B/HQgN5zn7IH5gomcL2IrNecynhl48ya hUsW6Lkr3QLTJ19AhQlI5DZR/7nvbK7aH9xvSlddbjYWa25SeoaKl72f62wH1MtbMMNF +Uwow28/CutKh/hEpntvAQW405Zya36rJbRKAXAjzNQtvNZj5UoBw/fO354XcoW/tWVH XqPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vY1SmGV5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u42-20020a05622a19aa00b0041893ae942asi142928qtc.730.2023.09.25.07.54.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vY1SmGV5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The modern packaging of cross GCC's doesn't need the explicit version number at the end. Signed-off-by: Alex Bennée --- 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=debian-arm64-cross container_cross_prefix=aarch64-linux-gnu- - container_cross_cc=${container_cross_prefix}gcc-10 + container_cross_cc=${container_cross_prefix}gcc ;; alpha) container_image=debian-alpha-cross @@ -1397,7 +1397,7 @@ probe_target_compiler() { ppc) container_image=debian-powerpc-test-cross container_cross_prefix=powerpc-linux-gnu- - container_cross_cc=${container_cross_prefix}gcc-10 + container_cross_cc=${container_cross_prefix}gcc ;; ppc64|ppc64le) container_image=debian-powerpc-test-cross From patchwork Mon Sep 25 14:48:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726021 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2432811wrm; Mon, 25 Sep 2023 07:53:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWXuTqZ/oSkduARf4MkXbf4gE2JWW11iW4zYE+fvKLIel6fJlN1VorNrSt+8pLcoczSRFt X-Received: by 2002:a05:622a:34c:b0:403:a9aa:571f with SMTP id r12-20020a05622a034c00b00403a9aa571fmr9855648qtw.16.1695653613307; Mon, 25 Sep 2023 07:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653613; cv=none; d=google.com; s=arc-20160816; b=aiL7OXT8vItXL9g2pBjhNNvZQVMj2gq5wS9kpqIK1W9Su+e45LNUvN0IfykLx7lHP+ dlZsZKpNHho2xtn19v3tDFu3zcseWmECQlRB7HM6AHj58FpI6aLc76LDJ9JZOjZj5nbj mKhd08Q2yCXqnPInHjgLwJdAOFroG4mUj42zDNfGzsg/iN0HKoznvo0FmGlgajzd8QkS 3c8U0QpyK0Q3edAHcyPmVg91N43UqxgQ1jiurNGTrPDdKLiLtPW5anKexcEGybGHY9YI lfAvDBN2v3kFVYQYhuK7hiIRKWHrlGIMDLd/qRQTX/9xAYydDzQo9dgpSHeLKNvBiUPb WdiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iR1iGRTKQhM4i1nnnC3x69E8sH/nb//WSFW8YZTcQR4=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=iBdIK7vEcHXmrtkhburEa9NzT6qnDk3DPvOCoB2ogUY4+KNhrpPVnafB7tWlJiXEbP 14nzVu9ZtGiezWGb80ZSbGp02D0DepaJUvLoazSmYqs37rEeajfvxATNb6hgP4+26upe xuqrOhIJM2G+nqzVr46jDx8+GLuq1YCnHXQ7iOOMcVJeQZMU7IcW7YMF2JLZk3btCr/I 8Ifbh5RNxQ7HAFRLJ0SQGPxr/J9zOTIIwQhA1cLGUQ1GtyukFnk9W0j+kjZtzYzemstd IggJJOc0pLDas71zbQ/6BZWx9OgwRvrPob0Q+QAgV5P2uoMc9RxsVUjwX17CQ130SjWy mj4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gTfmiDci; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u6-20020a05622a010600b00417d6001155si6033988qtw.69.2023.09.25.07.53.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gTfmiDci; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée --- 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=y" >> "$config_target_mak" fi + echo "$config_target_mak: configure" >> Makefile.prereqs + echo "build-tcg-tests-$target: $config_target_mak" >> Makefile.prereqs echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs tcg_tests_targets="$tcg_tests_targets $target" fi From patchwork Mon Sep 25 14:48:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726031 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2434165wrm; Mon, 25 Sep 2023 07:56:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqGcZ95rYvHuo/Sc2PgeRcHCx7vua1JmKjMIWx6EUYxg3eH7QRnlDpfBFLkFqs8GKVMsrj X-Received: by 2002:a05:622a:248:b0:40b:2370:3d32 with SMTP id c8-20020a05622a024800b0040b23703d32mr7705814qtx.0.1695653778848; Mon, 25 Sep 2023 07:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653778; cv=none; d=google.com; s=arc-20160816; b=0WL3vNVa19PLxhl9d3J2UznFU421E/FQ6MR2SJGl1b6zhJuNTTXdXbiXYtDMB+Gap7 IS7E11VJsO7rIdlSAiyFvXI5si126Xq7deVy/yse/gwRbD7Xp+bJXCtCu4ZoZkEVNWFI uidCORHdPPCE3ChRkII3uZwqWavbpASR1C8Iyk1+v2Kxhiq2QfEgHXDIyBNo4MK4gZbn ZB0ignx9bFE+vLgibfdlZH3YlrP78WB2YuXKMQ2U2W6ALYs7oZJVMx+ypt5Xa7IaWe8P 4DprlGfuKXfd2e8EdhjhqP+iyV7WBV2Oys/+UKpxHvRhtc7BF21YOTtpPrGWcMVWXGzC 0azQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kNHX4JyhoYexAQqB9a7CrjUa8yJRKrNW0ix3Ut30RxE=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=TIKqzGIaK4L0ymsZ49fnnBJn/Ly67MiSlBM1IGUQ1lCyQd0cNcfdnjYV/pMthFPJ8C 24R96qbT6z0XVYbXzTudg+be9LZgOppNQYF03s3s7sxQw7OXGe3dNQnuQGzvyPU67Zm9 nGiGa0PJCOOo26h96hbiYg3hR9oCL38TmcmlRFXKXz9POLm/I4rVXa6wwQ8hbL7kTbhw omdxrzm1WFNAs6Y9WtfrbqX/BbKHV/f3PGz7yqElXb2m8QztHkZoKWlPghole2RP97bW fXEGQEuz/PIiodZrATOGICrr+GyBCGNF269JRHqVEEV8x/+eLDYDFMFMCSu0A+eMG93Y dqbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o7okgtlz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z13-20020a05622a060d00b00403be2ad0besi6209673qta.11.2023.09.25.07.56.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o7okgtlz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki target_xml is no longer a fixed-length array but a pointer to a variable-length memory. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230912224107.29669-2-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 *opaque) assert(cluster->cluster_id != UINT32_MAX); process->pid = cluster->cluster_id + 1; process->attached = false; - process->target_xml[0] = '\0'; + process->target_xml = NULL; return 0; } From patchwork Mon Sep 25 14:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726018 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2432702wrm; Mon, 25 Sep 2023 07:53:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXIGpYTc8JCYw4JN35iHg5zezuC/WzTOzA2oJff0LHRc7xo0BxPa8JalqQeKlsA2yCyMwS X-Received: by 2002:a05:6122:45aa:b0:49a:4de3:e290 with SMTP id de42-20020a05612245aa00b0049a4de3e290mr1435217vkb.8.1695653601213; Mon, 25 Sep 2023 07:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653601; cv=none; d=google.com; s=arc-20160816; b=wRiSSukk46hhE3ufifmp9abR/W3rwf5YJcpa+x/OUBVOseqJLhr0J7+DOrrIYv6wMf yyHBd8XqYHyyBuIIZ5MtJ9+Yi9Dkd2QoSrgMOiVdFjESioMSsgUkxE5RJnwUe2bke8QZ ZQqCoyFQx7zTIiMkoAODiupkRm86q5n6xksk2aD0n4akxxBQVuPqCUiMtcugkoeq9kS2 qihZoZrWbPB26A64Q+MWRUqlTBSMj30HH17KY8dfY5vGEGUSOsCJLYbFdGeN95FFOqnn stWKclfBasXD4i+iSbU0my44YdVYM6yiZ/qHPLw2wJC4Wcn6boGfqITAlF7PFDtw+GJX veqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DlEhphEtX0KtQL/e4ae/jun4tEwNOtAavPJ6o58muzg=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=X3b6raPWE5OP1jHkXuKOtTq0xdGorEUxwZ2WO4Nd0x/HBYyoz/AMPTnAI8wFaza7MX CZqIAhBG43kO8gCg03V34/8aU/r2H72aIiNlXp+ZMlccj03y8CwSua4ix9ersUk9oPU2 l7rCrdGuQm1pl439gnqAjy2u0Hit17/GgNCKM+q9WdHpg8ri/SV8n9AZ0zrDHbrlFDg9 iiP0Q4vOf/+Ib7auCCBkZ5acd2RDC719f2oJtsEXGttwJUwBIwlU8m7C0sB2YU1ZtjvW ipIAe5XAHtku4Ic+Z+BQvKVcb7UpqzXZ902gLnguFIuEFCcxpSSC21OqHERYyMHdavyM g7dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o/nUgvjA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w3-20020a05622a134300b00417aff48cf5si6356808qtk.693.2023.09.25.07.53.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o/nUgvjA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki It was failing to return target.xml after the first request. Fixes: 56e534bd11 ("gdbstub: refactor get_feature_xml") Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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, ""); process->target_xml = g_string_free(xml, false); - return process->target_xml; } + return process->target_xml; } /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { From patchwork Mon Sep 25 14:48:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726023 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433070wrm; Mon, 25 Sep 2023 07:54:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiB8kMITLF6Xg1tS7gyg3VLGmGP7UnIIyIHFwTrM7AH8QbMoTJPSDSKS2jLdVjwc4DNZAi X-Received: by 2002:a05:620a:a92:b0:76c:ba25:a8f1 with SMTP id v18-20020a05620a0a9200b0076cba25a8f1mr7021527qkg.42.1695653646243; Mon, 25 Sep 2023 07:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653646; cv=none; d=google.com; s=arc-20160816; b=MG+ZIFseL1pOJQKJXR2qAv9P1zMnxM4R4M4BJfqFOXiGfZ7WyKqCySCAPuKlWYAMZ8 yvAHJP6j99L1ldp1B0LVVCoNTJXaG2njpG6fgUs0rsb2Bq0zvsG9F+/bVIJ9AzG0WlXW 4cX2SPbc1VCtP81Py5+0M5AqbrUaQZ55/Dju+C0Dm+HR/vv4fAcwSsTVMK7tRVLpbAhG lqe7MIscLamkolxKIpU+r5pXlOFG3lYdKJeK6LJ+3NwHTp8Yy1i5+YYA2d2m8D7kX3eJ xyIsqcS+z4IzAS7fCW+ORVe2h3wrrlTNZXQU9a+kx/ItUcO5dwnsE87aRHlGxkNPvHSh CPMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=afBvhFP6609M8IIBIfYpGDboWuF4PMsRTHYI59b4V3Q=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=kH9tAj/S6no8ySq8fhLY5dFinNWFLUMxgJhYqOhg0pgiU1m2mCWdOcfqpFGVPLiWyf tBwrkgx+LvtwfrlcIOnCN3BWeoFfEvOYYO3gz2b1utiLtVbBnYtCsBDuRKpqehgahIXs orUoZCOTT021jOQFwb7MDGeoz4xotcdEHeUtU7IpTZvjAOmAJvGxTHYIAeJWLiWYMW6S CDwcOKbb4TdEaNC51KHBKksKBjM1hSQN6SuB5J+5YIboXIGkikVIFj1RHi105DoWDbCC PtjE5iQ7lKJ6MjaXK0300IwZqxlIAF9TyQWfO9Qo5Ioh2oeIAoQ+91UCMQ9Zjx6aIHes ZoIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ARsFEKFK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f6-20020a05620a280600b0076db80c4929si6181959qkp.749.2023.09.25.07.54.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ARsFEKFK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki The created member of CPUState tells if the vCPU thread is started, and will be always false for the user space emulation that manages threads independently. Use the realized member of DeviceState, which is valid for both of the system and user space emulation. Fixes: 54cb65d858 ("plugin: add core code") Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-4-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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, gpointer v, gpointer udata) CPUState *cpu = container_of(k, CPUState, cpu_index); run_on_cpu_data mask = RUN_ON_CPU_HOST_ULONG(*plugin.mask); - if (cpu->created) { + if (DEVICE(cpu)->realized) { async_run_on_cpu(cpu, plugin_cpu_update__async, mask); } else { plugin_cpu_update__async(cpu, mask); From patchwork Mon Sep 25 14:48:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726029 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2434088wrm; Mon, 25 Sep 2023 07:56:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeGmKhjJMdK6BN2d4QNHOdX52sTFtuIDpc9I4TqCHd3HbV9S1SgCKVy1CLXFXryIl06E+d X-Received: by 2002:a05:622a:1a83:b0:417:9e48:44d7 with SMTP id s3-20020a05622a1a8300b004179e4844d7mr8456566qtc.1.1695653769689; Mon, 25 Sep 2023 07:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653769; cv=none; d=google.com; s=arc-20160816; b=bNtyLFTw5zDWG2uXosjLO6GsrH8R1MeA5NH3ypVT3KlQey9A/FKWQuFouyhPN/ie8g rAhv0K0XIVd2r1U1EcldJZETLJxOCJgKFHhDNI15yEhI22xHEugFui7Zv9rrGzwNjf54 LNNxLA66Q9hKU6e1s+kbzB4QWjZXvLR8S3Y0Nxslv566URp0dSnUg9TuhDpGygYfAnOz 5J6p9D0IXGSqtvYnHkzm8JhTN/GGCkJ9gicjGK0LPILjPcZ9w+AStYYHZ3UFv7XLZ8sl fxV7caTXuP3wDR2kGBM1iE0xrxiqSA2N/9raMFPGSGCPTGrvhd9mJAugy0/EUU1T6Ilo tPVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bHq5bIYTwX4KI919eN/k0HIJh2GL06+mtrfpk9KLLYo=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=wjickjO7l+E6RLGFKd34UNVbnGIdzeFNKE4/AVpgE5AR1AtTe1gLQ7iCobmnaaMgT5 NtF0CqhzH7jpDfiuIALg7H0bz3HSS0ee/S3VBcSC4OAbcdmh1UBsyCamlbHbTHoqczT7 WzDthhrptjt1LpfgxuU3hLxDdBSAtYzvDXxZJ+bGjzGtUkSo1DlI6TgYKbBjy7KDZuEI iDJ0d3a9NBHddvEda24C+54vOpsZCu7qF7aGsKNE1HmZMsK7pwxj8qWr/b2JfY6Lc0z3 z6iafNWfp9pF5Tcy21tt3InnNyXdlc2hePI4KbawNSz8NiZivH92VRwalWn4izLBQdIo jSJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Iu/jASGA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b7-20020a05622a020700b0040fe1ce310dsi1137823qtx.736.2023.09.25.07.56.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:56:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Iu/jASGA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki execlog had the following comment: > As we could have multiple threads trying to do this we need to > serialise the expansion under a lock. Threads accessing already > created entries can continue without issue even if the ptr array > gets reallocated during resize. However, when the ptr array gets reallocated, the other threads may have a stale reference to the old buffer. This results in use-after-free. Use GRWLock to properly fix this issue. Fixes: 3d7caf145e ("contrib/plugins: add execlog to log instruction execution and memory access") Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20230912224107.29669-5-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 = QEMU_PLUGIN_VERSION; /* Store last executed instruction on each vCPU as a GString */ static GPtrArray *last_exec; -static GMutex expand_array_lock; +static GRWLock expand_array_lock; static GPtrArray *imatches; static GArray *amatches; @@ -28,18 +28,16 @@ static GArray *amatches; * Expand last_exec array. * * As we could have multiple threads trying to do this we need to - * serialise the expansion under a lock. Threads accessing already - * created entries can continue without issue even if the ptr array - * gets reallocated during resize. + * serialise the expansion under a lock. */ static void expand_last_exec(int cpu_index) { - g_mutex_lock(&expand_array_lock); + g_rw_lock_writer_lock(&expand_array_lock); while (cpu_index >= last_exec->len) { GString *s = g_string_new(NULL); g_ptr_array_add(last_exec, s); } - g_mutex_unlock(&expand_array_lock); + g_rw_lock_writer_unlock(&expand_array_lock); } /** @@ -51,8 +49,10 @@ static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t info, GString *s; /* Find vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); g_assert(cpu_index < last_exec->len); s = g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); /* Indicate type of memory access */ if (qemu_plugin_mem_is_store(info)) { @@ -80,10 +80,14 @@ static void vcpu_insn_exec(unsigned int cpu_index, void *udata) GString *s; /* Find or create vCPU in array */ + g_rw_lock_reader_lock(&expand_array_lock); if (cpu_index >= last_exec->len) { + g_rw_lock_reader_unlock(&expand_array_lock); expand_last_exec(cpu_index); + g_rw_lock_reader_lock(&expand_array_lock); } s = g_ptr_array_index(last_exec, cpu_index); + g_rw_lock_reader_unlock(&expand_array_lock); /* Print previous instruction in cache */ if (s->len) { From patchwork Mon Sep 25 14:48:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726025 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433134wrm; Mon, 25 Sep 2023 07:54:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpdKAyROiy66m29hyQFmvXKgFVNaf6hMUmpnwh2VyDHCl88epLj+PWsHo1bu65c25mhMDN X-Received: by 2002:a25:496:0:b0:d80:9ed:5038 with SMTP id 144-20020a250496000000b00d8009ed5038mr6215568ybe.21.1695653655833; Mon, 25 Sep 2023 07:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653655; cv=none; d=google.com; s=arc-20160816; b=nISO5ox8rzRDvN/y7/nkYzuaxvB2vzSu3MUYyaUgFp7oV6j12vyDt/e2lVWHU0xPO7 TIj/eeQ0zJHWhBsw3WyZi6Y0QD2Ww7nr250dvZajrsfeM4f7hpUzVU9kX1qFb1aJE3I1 UO5M/7czWrFlVt9yn9XKnUGZ/pjfoSHeEFSy9xMl5bzqKkxiYSScQNGU0dQVOwXsAoJx eWA428oAI861PO6uT1XIPp2kbPk64kaNXdEgyZYNta9u3BsLideD/maLX0sw7ssIMBrg mcimvWt0WgVZv17H+2dcNx/+pu3/Ez0rsOocRnJYgaksKDC+ZrI8fBihsHqE/6hL+o7e XOoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kp6PIbFH6f3v48hXClqQy7qaOEKB35oEkVOcO5gVtwM=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=ZyrP/ovwLjkSehF4M4PotlytyqlQ5yLOOM9ZZPb4LsI3/lHm9I3PrTcpUyeyjmtjBN d4X1wPijp8R+aSOgAXsV8OE2sthf0jBtaSrhnczXdK7RYdUbnAoPvUpGRFPXKE6MyS47 FctOxRHBk//aqpyro/N0BXzLzv031oW90jI6kbp8B9+oIz7FDgQL2i0D06Um2lgfmWB8 onS8XOXCoGxgHvZbfz0JkLtwOkJqAoIw5kn+uIJsGkm4Y0UudaTO68EBK5vv110x0PNx xRqwTKmeS5NwpCTPgqT6tH/lvlK57+IQsqoDRA0y95X4yBv0UbwaIAhsJHPe6ziUwE2r Og5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3fc9aNW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g16-20020a0ce4d0000000b00658a46f7995si1562238qvm.253.2023.09.25.07.54.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3fc9aNW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki Before this change, the information from a XML file was stored in an array that is not descriptive. Introduce a dedicated structure type to make it easier to understand and to extend with more fields. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20230912224107.29669-6-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 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 = static_library('common', dependencies: common_all.dependencies(), name_suffix: 'fa') -feature_to_c = find_program('scripts/feature_to_c.sh') +feature_to_c = find_program('scripts/feature_to_c.py') if targetos == 'darwin' entitlement = find_program('scripts/entitlement.sh') diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 16a139043f..705be2c5d7 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -10,6 +10,11 @@ #define GDB_WATCHPOINT_READ 3 #define GDB_WATCHPOINT_ACCESS 4 +typedef struct GDBFeature { + const char *xmlname; + const char *xml; +} GDBFeature; + /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); @@ -48,7 +53,7 @@ void gdb_set_stop_cpu(CPUState *cpu); */ bool gdb_has_xml(void); -/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ -extern const char *const xml_builtin[][2]; +/* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ +extern const GDBFeature gdb_static_features[]; #endif diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 384191bcb0..12f4d07046 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -408,11 +408,11 @@ static const char *get_feature_xml(const char *p, const char **newp, } } /* Is it one of the encoded gdb-xml/ files? */ - for (int i = 0; xml_builtin[i][0]; i++) { - const char *name = xml_builtin[i][0]; + for (int i = 0; gdb_static_features[i].xmlname; i++) { + const char *name = gdb_static_features[i].xmlname; if ((strncmp(name, p, len) == 0) && strlen(name) == len) { - return xml_builtin[i][1]; + return gdb_static_features[i].xml; } } diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c index 2b7aee50d3..580e20702b 100644 --- a/stubs/gdbstub.c +++ b/stubs/gdbstub.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" -#include "exec/gdbstub.h" /* xml_builtin */ +#include "exec/gdbstub.h" /* gdb_static_features */ -const char *const xml_builtin[][2] = { - { NULL, NULL } +const GDBFeature gdb_static_features[] = { + { NULL } }; diff --git a/scripts/feature_to_c.py b/scripts/feature_to_c.py new file mode 100755 index 0000000000..bcbcb83beb --- /dev/null +++ b/scripts/feature_to_c.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later + +import os, sys + +def writeliteral(indent, bytes): + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + for c in bytes: + if not quoted: + sys.stdout.write('\n') + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + if c == b'"'[0]: + sys.stdout.write('\\"') + elif c == b'\\'[0]: + sys.stdout.write('\\\\') + elif c == b'\n'[0]: + sys.stdout.write('\\n"') + quoted = False + elif c >= 32 and c < 127: + sys.stdout.write(c.to_bytes(1, 'big').decode()) + else: + sys.stdout.write(f'\{c:03o}') + + if quoted: + sys.stdout.write('"') + +sys.stdout.write('#include "qemu/osdep.h"\n' \ + '#include "exec/gdbstub.h"\n' \ + '\n' + 'const GDBFeature gdb_static_features[] = {\n') + +for input in sys.argv[1:]: + with open(input, 'rb') as file: + read = file.read() + + sys.stdout.write(' {\n') + writeliteral(8, bytes(os.path.basename(input), 'utf-8')) + sys.stdout.write(',\n') + writeliteral(8, read) + sys.stdout.write('\n },\n') + +sys.stdout.write(' { NULL }\n};\n') diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh deleted file mode 100644 index c1f67c8f6a..0000000000 --- a/scripts/feature_to_c.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# Convert text files to compilable C arrays. -# -# Copyright (C) 2007 Free Software Foundation, Inc. -# -# This file is part of GDB. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . - -if test -z "$1"; then - echo "Usage: $0 INPUTFILE..." - exit 1 -fi - -for input; do - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - - ${AWK:-awk} 'BEGIN { n = 0 - printf "#include \"qemu/osdep.h\"\n" - print "static const char '$arrayname'[] = {" - for (i = 0; i < 255; i++) - _ord_[sprintf("%c", i)] = i - } { - split($0, line, ""); - printf " " - for (i = 1; i <= length($0); i++) { - c = line[i] - if (c == "'\''") { - printf "'\''\\'\'''\'', " - } else if (c == "\\") { - printf "'\''\\\\'\'', " - } else if (_ord_[c] >= 32 && _ord_[c] < 127) { - printf "'\''%s'\'', ", c - } else { - printf "'\''\\%03o'\'', ", _ord_[c] - } - if (i % 10 == 0) - printf "\n " - } - printf "'\''\\n'\'', \n" - } END { - print " 0 };" - }' < $input -done - -echo -echo '#include "exec/gdbstub.h"' -echo "const char *const xml_builtin[][2] = {" - -for input; do - basename=$(echo $input | sed 's,.*/,,') - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," -done - -echo " { (char *)0, (char *)0 }" -echo "};" From patchwork Mon Sep 25 14:48:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726022 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433062wrm; Mon, 25 Sep 2023 07:54:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXf0+A+E4vKWl4xIr4pfclT2pBZ5jEc8vKkglbcJ/m1Mt6ySjJjDqcANj3+wMxCyK+GJca X-Received: by 2002:a0c:d68d:0:b0:655:ea8d:666d with SMTP id k13-20020a0cd68d000000b00655ea8d666dmr6113502qvi.44.1695653644376; Mon, 25 Sep 2023 07:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653644; cv=none; d=google.com; s=arc-20160816; b=VjaUVZ9I6do847/KXgTdtyoj/HPAP6SCamMUJaQoU/A0C7wJkvznVQvUgpkjYaj0n5 0dQ1XVEEX3ozimI8iRR0KodBF1LnIfU3JRdQeXEYWIqlFBVV3aAbbC8ABlGlMA7o5VUR Cb8RYosxeZPGB2wkVCPncj/mwk/2ndRsKOWXFYTuCM1j0YsH1W8adClaxZvDLlWPM5pC w4rQ+F7HVGoKf3hIz0sokfHEKrcm47jgEIkfpaok/1gjH92nRYL4CYbItXaEb0Wp2t+v SKKihPMtKgUG3fQ0BEl3bi+xrXEMD/Lu9Wtif69LpPIxkFU8dFD2fzGk3rwm98HGZon4 j8Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AwYBjX11kVwleBQYnG52lCtDdSTJ4dxnB89SY/KP3O8=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=XkjMWAQt1QgzoaD+ROnTSpzGJy5yDsH+qc5rr0HiQSEyAYQe3D5IFFfFQnznTW31el 9muNAVlClsxM9n6iLWnz8B2t2jCDnSOWIvaX5CGgMmeqGN/ozmmCsSAbYR8+BV2L5O9p KYWUpYF7/xyhHide523xgiaz4R4wgtBkFdJvMWur6mNE5fujFJgjdf8UqwW3ALD4Yjc/ tlUpO2UrGxUtZCmc+jiT65lq7i8eIU9DAq0aanEuCuS4twLubyXW+suwTC8l9Cth9b59 BpSrH3aGQj8j+lhNu9xdBCjebblWjsMD+Jyj26cPfkrYUJ8e5dv64G6tlzfSObZvYOJw WERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UjRPGS3U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s25-20020a0cb319000000b0064f38825120si5971450qve.329.2023.09.25.07.54.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UjRPGS3U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki Some subclasses overwrite gdb_core_xml_file member but others don't. Always initialize the member in the subclasses for consistency. This especially helps for AArch64; in a following change, the file specified by gdb_core_xml_file is always looked up even if it's going to be overwritten later. Looking up arm-core.xml results in an error as it will not be embedded in the AArch64 build. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson Message-Id: <20230912224107.29669-7-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 = &arm_sysemu_ops; #endif cc->gdb_num_core_regs = 26; - cc->gdb_core_xml_file = "arm-core.xml"; cc->gdb_arch_name = arm_gdb_arch_name; cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; @@ -2415,8 +2414,10 @@ static void arm_cpu_instance_init(Object *obj) static void cpu_register_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc = ARM_CPU_CLASS(oc); + CPUClass *cc = CPU_CLASS(acc); acc->info = data; + cc->gdb_core_xml_file = "arm-core.xml"; } void arm_cpu_register(const ARMCPUInfo *info) From patchwork Mon Sep 25 14:48:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726026 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2433264wrm; Mon, 25 Sep 2023 07:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmE3FiTOTBzqBSCvfARIH08WoKxN19MQ64fMRmMjoAviO+uw5hToCt4pOKZn+UnzAmXjiL X-Received: by 2002:a05:620a:bcc:b0:76c:eb1d:c2d0 with SMTP id s12-20020a05620a0bcc00b0076ceb1dc2d0mr12136932qki.28.1695653668185; Mon, 25 Sep 2023 07:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653668; cv=none; d=google.com; s=arc-20160816; b=ecOGY8aPAGas/mcr3aQ8DytKMzpqs2lx3HH8DIh7+xJHSGpMw4jGJxNcWnRB/SpAGB BNdMc+aaZDZco/HAOEZyiTvv1zmUR4yhtakB3F0UJITHVWYEpVsG7XZXWhrC7/9S73dk HELMijoU/q1GhoG8cvKIs6g32FOGaOJ4dougENlt9xNEloxo300LqunPzNXSmXz/oNtl Z3aYORea0o2MFrAh2wT2v422IgXGPdHo2q3MIoEuNthAzzQtbthG/Fd28AdeTjPu4HCU TkkY3+ZBEvnApdjlnXRFB1HCuee2dwYE0ef16tWkCpwdxJjiPmw7aOQLVVCPlrAc9SjF eMmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wLqocinDU8rF88Hv8wZBmX599z01GNwfmOcliOqqhzI=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=xagc2dWODNiewiYblUhkUWsiXZBHXuq3Mroftk9+Tp+0H4Ier/VfdbL5CRQDMGM/o0 o7bs9eXeWB4fqbGJB4QVmmRROPvGsnHA89whYiy/QqcHF65S1S2YZyiDTb0vteFWpbzs AXyEl2YKPiKYeFhFpyLp0GJC8Sk84qMl2AyEACS0+uyYTQ+ZzkAx77FTnf4szt+Fwi+/ UhVKcZ+cZD7UuRzrBfTNtqdg8oR/TKbDDWoFq8XgyuSQnHsyfTKKKfTyLD+FAHCrucr3 /zjoknaifSW5gNI3Qhu7/S0fBlVPDvT+61cS77mKxPqz/570hyBWCnJmtAoyEQvw3L3F b8Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e98+oy+O; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pb13-20020a05620a838d00b0076daad4ad3csi6198559qkn.32.2023.09.25.07.54.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e98+oy+O; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki All implementations of gdb_arch_name() returns dynamic duplicates of static strings. It's also unlikely that there will be an implementation of gdb_arch_name() that returns a truly dynamic value due to the nature of the function returning a well-known identifiers. Qualify the value gdb_arch_name() with const and make all of its implementations return static strings. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20230912224107.29669-8-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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); const char *gdb_core_xml_file; - gchar * (*gdb_arch_name)(CPUState *cpu); + const gchar * (*gdb_arch_name)(CPUState *cpu); const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 15803bc313..c881c67a8b 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -221,7 +221,7 @@ void destroy_ppc_opcodes(PowerPCCPU *cpu); /* gdbstub.c */ void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *ppc); -gchar *ppc_gdb_arch_name(CPUState *cs); +const gchar *ppc_gdb_arch_name(CPUState *cs); /** * prot_for_access_type: diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 12f4d07046..9db4af41c1 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -380,10 +380,9 @@ static const char *get_feature_xml(const char *p, const char **newp, ""); if (cc->gdb_arch_name) { - g_autofree gchar *arch = cc->gdb_arch_name(cpu); g_string_append_printf(xml, "%s", - arch); + cc->gdb_arch_name(cpu)); } g_string_append(xml, "gdb_core_xml_file); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 10fcc61701..408af17bf2 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2320,15 +2320,15 @@ static Property arm_cpu_properties[] = { DEFINE_PROP_END_OF_LIST() }; -static gchar *arm_gdb_arch_name(CPUState *cs) +static const gchar *arm_gdb_arch_name(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; if (arm_feature(env, ARM_FEATURE_IWMMXT)) { - return g_strdup("iwmmxt"); + return "iwmmxt"; } - return g_strdup("arm"); + return "arm"; } #ifndef CONFIG_USER_ONLY diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index f3d87e001f..8a8cde7c05 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -781,9 +781,9 @@ static void aarch64_cpu_finalizefn(Object *obj) { } -static gchar *aarch64_gdb_arch_name(CPUState *cs) +static const gchar *aarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("aarch64"); + return "aarch64"; } static void aarch64_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 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, X86CPUModel *model) memset(&env->user_features, 0, sizeof(env->user_features)); } -static gchar *x86_gdb_arch_name(CPUState *cs) +static const gchar *x86_gdb_arch_name(CPUState *cs) { #ifdef TARGET_X86_64 - return g_strdup("i386:x86-64"); + return "i386:x86-64"; #else - return g_strdup("i386"); + return "i386"; #endif } diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 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, void *data) #endif } -static gchar *loongarch32_gdb_arch_name(CPUState *cs) +static const gchar *loongarch32_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch32"); + return "loongarch32"; } static void loongarch32_cpu_class_init(ObjectClass *c, void *data) @@ -782,9 +782,9 @@ static void loongarch32_cpu_class_init(ObjectClass *c, void *data) cc->gdb_arch_name = loongarch32_gdb_arch_name; } -static gchar *loongarch64_gdb_arch_name(CPUState *cs) +static const gchar *loongarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch64"); + return "loongarch64"; } static void loongarch64_cpu_class_init(ObjectClass *c, void *data) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 2ad11510bf..778ef73bd7 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -589,12 +589,12 @@ static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -gchar *ppc_gdb_arch_name(CPUState *cs) +const gchar *ppc_gdb_arch_name(CPUState *cs) { #if defined(TARGET_PPC64) - return g_strdup("powerpc:common64"); + return "powerpc:common64"; #else - return g_strdup("powerpc:common"); + return "powerpc:common"; #endif } diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f227c7664e..ce35e95f14 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2008,17 +2008,17 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static gchar *riscv_gdb_arch_name(CPUState *cs) +static const gchar *riscv_gdb_arch_name(CPUState *cs) { RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; switch (riscv_cpu_mxl(env)) { case MXL_RV32: - return g_strdup("riscv:rv32"); + return "riscv:rv32"; case MXL_RV64: case MXL_RV128: - return g_strdup("riscv:rv64"); + return "riscv:rv64"; default: g_assert_not_reached(); } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 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 } -static gchar *s390_gdb_arch_name(CPUState *cs) +static const gchar *s390_gdb_arch_name(CPUState *cs) { - return g_strdup("s390:64-bit"); + return "s390:64-bit"; } static Property s390x_cpu_properties[] = { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 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 |= 1ULL << feature; } -static gchar *tricore_gdb_arch_name(CPUState *cs) +static const gchar *tricore_gdb_arch_name(CPUState *cs) { - return g_strdup("tricore"); + return "tricore"; } static void tricore_cpu_set_pc(CPUState *cs, vaddr value) From patchwork Mon Sep 25 14:48:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726044 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2439014wrm; Mon, 25 Sep 2023 08:02:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1i8s3xXcnfy7yR0vppFCiugnUAIUmslwAavf5aramO7hBSOhIHUCJ7DgdrGtEKEvqjwcp X-Received: by 2002:a05:620a:51d0:b0:770:f3ed:bbc8 with SMTP id cx16-20020a05620a51d000b00770f3edbbc8mr5547224qkb.65.1695654171890; Mon, 25 Sep 2023 08:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654171; cv=none; d=google.com; s=arc-20160816; b=bHvrqNHbjiidSY/cZ4Jq4eaWLmN8Qyy030+jc1a//WhNg6Kai0P0yElpY6uh50ScUT mpxMEca1VTMWGxtbJngZRNjLVbNXenBBNPHbwlgQbq0YdKDe3/EyQikIZ/QhoM0OaqRz CewxC8rpTokUoncGNmshWzyk7byILFCHB/pkcASfqAR1GcWi0KPGgFDnF4dQC57DezPB eRhBnFjQNrxUYxkyCxs51IBHiiHT6AFjzm2YAwCM3Ax5DsMNNQGH0F3YPejITuaE5wQN HnysrcOCpTWUippsk8F7gvmyPYpANSQaJEh3RVIehohRfAZAA2AcVzgBdfix27ZXArMO mtsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Muj6oq//HewwqFNb1Dn6YA/ZLR4P4d92sjjuFTR9b6Q=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=glnWf52HjgCjFP6wSBUZTlR9ZeiKQ5zScLV3ho3gMj8P0YncQrxNPg98GEzGYNnufl VeQxXKcsmGLDWf30Y1gy0btfbiDPVxeA+Lu1GfpSk8QtRm8evqiXO+Ymx0NerYdOY7od 47AnTP519Cg3wsR1gZPdIDUT1ffaDLDqZvjaO/r1KBSjmn9Tpdj70Dd24jseTkBBUEvq zgDzloLJ7pg/dsYPMdQR/lABZDVPRxMB+TkT3vjgzJBuhk1wAnUSYDNjSzTBQGrUDQj5 yXfd9I/F2fdkdkNOSlVpo7iWvfjsNvGkmmKiajlD3Q8OyLkPdyETwAauAqYYuD7f8AUC rGZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DaaegImv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qs16-20020a05620a395000b00765e579f0fesi6146414qkn.69.2023.09.25.08.02.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DaaegImv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki g_markup_printf_escaped() is a safer alternative to simple printf() as it automatically escapes values. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-9-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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, const char **newp, if (strncmp(p, "target.xml", len) == 0) { if (!process->target_xml) { GDBRegisterState *r; - GString *xml = g_string_new(""); + g_autoptr(GPtrArray) xml = g_ptr_array_new_with_free_func(g_free); - g_string_append(xml, - "" - ""); + g_ptr_array_add( + xml, + g_strdup("" + "" + "")); if (cc->gdb_arch_name) { - g_string_append_printf(xml, - "%s", - cc->gdb_arch_name(cpu)); + g_ptr_array_add( + xml, + g_markup_printf_escaped("%s", + cc->gdb_arch_name(cpu))); } - g_string_append(xml, "gdb_core_xml_file); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + cc->gdb_core_xml_file)); for (r = cpu->gdb_regs; r; r = r->next) { - g_string_append(xml, "xml); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + r->xml)); } - g_string_append(xml, ""); + g_ptr_array_add(xml, g_strdup("")); + g_ptr_array_add(xml, NULL); - process->target_xml = g_string_free(xml, false); + process->target_xml = g_strjoinv(NULL, (void *)xml->pdata); } return process->target_xml; } From patchwork Mon Sep 25 14:48:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726041 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2438227wrm; Mon, 25 Sep 2023 08:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2eltil2HRDhd/3ErZpXSTd3fDILCp4PVNZ5/TRNMWLl0muazLqmEkrwAWCmo/KvPACzUx X-Received: by 2002:a05:620a:bcc:b0:76c:eb1d:c2d0 with SMTP id s12-20020a05620a0bcc00b0076ceb1dc2d0mr12170559qki.28.1695654130828; Mon, 25 Sep 2023 08:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654130; cv=none; d=google.com; s=arc-20160816; b=ZSumCm3qEpp7BVJK5whaXEp/y4LHs6bmW4FTncHJxcl524up38FGCqYMaaj196nE+m mjY1XSdceCpCx5z+A0DNXYwPGB90r8bQwoW38vuhY9kygMTM8gn4TL9LMUwvla5l8tvr VKvYKh0XhBf0kKuawsSHaG/wYkSGcy2xn1qpBnYmrs5TkWuJG12U1cpi7wyiIx3k1jGb /XNsk7jJ2eL0C6P67c2iMo3riRDfHROpEt1PwBOsD8mGCJmHLVgfq1Nw//wsQBIUefXE O3lQMmmUjSGGCgR3Bk1GFaB22B1u3s+BhMTD3qTm7InKLgQHpWzzC571LQNzIGao7Sbo a+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VWYhOQMznQlDFerIuEfFly6GjEqfzxxsRGSOgMHMHjQ=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=LZ71Rpe8//hdJ0L7rwnxJZPlZDnod3VOKpNlvrWfL18aFYLNH5Oo1QcpQOWSGWjTE/ O1DsljeU9r0Xa70s5uoWgVAnRTfvFGeVm3/9ma9WA86+rpKvUeB9LEfscQhYBDrMvKna pPM41jbUWHXJknHohZlRkZKBhg2+0MuC2sVOrZqI8uLUFo1OPzrXqi/0KPivDS0FOIdZ VbkucVb1lncrlYJMW3/REIkzIjy7exfZQpdbgBR0wI7G3cVIzj/2KG4sH28ZaEOk9yA1 VfQZqgpCHt8AdEXhLnuw7Vn0YYu+hBMyStR+qHYjiQ9GpiutSQFS9h9HMvM1PLSK1Oh2 m3Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EITU6Bmk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h18-20020a05620a245200b007707bcdf3cesi6341288qkn.176.2023.09.25.08.02.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:02:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EITU6Bmk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée Message-Id: <20230912224107.29669-10-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 == 25) { /* CPSR, or XPSR for M-profile */ if (arm_feature(env, ARM_FEATURE_M)) { return gdb_get_reg32(mem_buf, xpsr_read(env)); @@ -100,21 +86,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) env->regs[n] = tmp; return 4; } - if (n < 24) { /* 16-23 */ - /* FPA registers (ignored). */ - if (gdb_has_xml()) { - return 0; - } - return 12; - } - switch (n) { - case 24: - /* FPA status register (ignored). */ - if (gdb_has_xml()) { - return 0; - } - return 4; - case 25: + if (n == 25) { /* CPSR, or XPSR for M-profile */ if (arm_feature(env, ARM_FEATURE_M)) { /* From patchwork Mon Sep 25 14:48:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726037 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2437375wrm; Mon, 25 Sep 2023 08:01:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFp+YM3BXIDu74lZ8ETB4cTJDiWOxYC92vYZffUNY07SvbkFx73yVF8esZGzbEFQvKbdVwi X-Received: by 2002:a0c:f193:0:b0:657:a0cc:635c with SMTP id m19-20020a0cf193000000b00657a0cc635cmr7347951qvl.22.1695654079380; Mon, 25 Sep 2023 08:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654079; cv=none; d=google.com; s=arc-20160816; b=YPxObEEvTv5hxrAug+ZDImRUl1JIr4wZbylZgVDuK3r/XJmOb6XM+6Fg1MOEDVzn08 1ygeehxEqpvsgqK4uVHNyz8jn24a3xT86pZNDkjwY/HfyK6vF89EdCcscoA0zN9GDzPU uL19Dl2GitDbgtSxAP3B5DKl/L1fuza0UG/V6jiah3LHhu9sL0B4+yfV1TACs6f2YR9L Au9PhFI9hINqcPEXoHSTJOWVa8LXnodrESnFX8w/TRUAHH2ExbXQZJumBmdnZlc+sQB1 cLudg8o5zo4AxkJ8AG6t3LAk657Ox5lIAZmrPyD6uHUN88d12lEHzgceIBmSDtsuAF7x C3PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=54vdWxoInkKQLiHeicKKqmeJW+RARqhkyr/iqwsF+dM=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=OU+TAEzYPGCsD5X0/9wiGIOfN3zP6ruBQJoNr1Po9WbpPL1N9L6rdUuZ2E343FuygW /3NwTeAmD44nqBLEfmuIOKyPE/B2KcbPH/3ikyqQyCsdn2sQbnyaebpoX+3/KxkNzlOo WhGSVlnBkDH2w6WVo1w2WeFhO9KqEPEGsVwlVh8SxpYKAQc7Q2Brq7zldBoxHhZEkEzj hsX7WY1Qg9lfNtopzhAFk1M5KIm8p46kFvN7mNn+AON+LccrlIhPNSSAo4bdxReW8wg8 74I5P+GnzmBsXcsYXHzpN8LlfwlzZTxuZvmfi6rEZxvoGC+qiOf5S9/5SFX3SAKcbVkQ Ujnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N0JGQ1AC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h26-20020a0cb4da000000b0065afe44a6d5si2357831qvf.313.2023.09.25.08.01.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N0JGQ1AC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-11-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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 = buf->data + buf->len - r; From patchwork Mon Sep 25 14:48:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726032 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2434172wrm; Mon, 25 Sep 2023 07:56:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlk4t0YSP6sqjKltM4Bzq+MED6s/WE7ibf4Qe92vrQKmAENRdWNGx4wfVp9cCIMI7ViUx3 X-Received: by 2002:ac8:7e90:0:b0:418:af4c:1850 with SMTP id w16-20020ac87e90000000b00418af4c1850mr249814qtj.56.1695653781184; Mon, 25 Sep 2023 07:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653781; cv=none; d=google.com; s=arc-20160816; b=OERT4tMVBo4DOE4q2c1XveetD0py7IgsmaAY4Hnv/u5oVYwVBLHwbOWtWJPrCrY/Q2 NqzRoTQf1eRTukuP7dsWjYb8WmIFSCq/k8Qpg3kL6tw0yshb6Tx8E2f7vtOmRZ+3o65s RkaKqXZhCQwuqeEM2HlhiAEwODaV7Ce1W3c6JQQP7ALOtI3MS51ZxP3k8LjwSvYdGlsp dssj2aaxCzA43PIb028tmy2LUm1JLwcjHdOWqKBpleo2P7LQZYssVnBTkNTyvw4OY8ol clMmnZlJ/+DQlKsRsJ9fjc1Cy6P/hWHk2N3dKYXWGX8dWg3EMTdCUdudFW0Doam0pdkE Kh/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zo11DLU+8rquYH4lZEKdtepCDhuEE9DTjCn4uAyQoPU=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=JYJl9Xb8PQiMBJrZ16tLMWD1NKGbX3FoU7UfYDTfX8Efk08o+MbWAvntQAWwwAGTOr hjHCgZzMEfFPXkbFAJghdfWVpEFU7WRy69VUyWw2F7aQ3+LZyxvCP8bdo3gSh7sQqDgH ieCyInlzOSuLTBWtpp45ZHRMRh305n3e5V7Z4d+l6oAANJX6QO+niMLREtZ25GKQ3t+6 HC0qBTdu6LHm/jFGknqGAHPrLSN57PBQVZo+6/TxIfiuVRvvqIrm50iS/goGGI8sX61g bdtzc+wY3Jr0TPilsz7dKcdXYwoOFVYXqcm/MCQ7zC17qXIkl1YdGJ930zfonkLXXC31 IlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e+CwW3gt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t18-20020a05622a181200b00417b79c2bd5si6336679qtc.43.2023.09.25.07.56.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e+CwW3gt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki GDB has XML support since 6.7 which was released in 2007. It's time to remove support for old GDB versions without XML support. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-12-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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; diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 705be2c5d7..1a01c35f8e 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -45,14 +45,6 @@ int gdbserver_start(const char *port_or_device); void gdb_set_stop_cpu(CPUState *cpu); -/** - * gdb_has_xml() - report of gdb supports modern target descriptions - * - * This will report true if the gdb negotiated qXfer:features:read - * target descriptions. - */ -bool gdb_has_xml(void); - /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ extern const GDBFeature gdb_static_features[]; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 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 tid) } } -bool gdb_has_xml(void) -{ - return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml; -} - static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { @@ -1086,11 +1081,6 @@ static void handle_set_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (params->len != 2) { gdb_put_packet("E22"); return; @@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (!params->len) { gdb_put_packet("E14"); return; From patchwork Mon Sep 25 14:48:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726035 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2436763wrm; Mon, 25 Sep 2023 08:00:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHN8HDR/XtFjCLCHuArBmO+mExgEreOmf0DJhJQjNy0wLlm0cfVktcbyEkI2kEG98MI/D+ X-Received: by 2002:a25:d491:0:b0:d1a:955f:304d with SMTP id m139-20020a25d491000000b00d1a955f304dmr6257191ybf.64.1695654043314; Mon, 25 Sep 2023 08:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654043; cv=none; d=google.com; s=arc-20160816; b=nbsHf2617Nq0iw2hW+RpwCX0XeMc1hMDpXJ+QHylab9qlHtB/82jiFUMY06WsS5cZu +vK/dxH1nCZjINLKMR+sKLljLKGSwx2idGj3E6LRSD90gasK5Clzi5+cqcHDQ6APmf0F vKK0RNoNrhpjYIOgwcCgfx4KDwNkmw4s2sKTPSB0r0WTsPuVmxFZyb7KQ7MbM2OZx+A7 Q6m5cclkGqYWYKk6LRi4tWOKbajHM5S+ETBNYZOqlj7eYulnGLTwRei2xFMSKVR6CDuf PhGGep0NeHA/qbsbOXySbO3ZaIhvgdHmQyuqJUzLGD8bw1lcUf02RqGF50//+Ga+4Vtw IAJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=51IOq6TYaNyuJXGEkqG0oju+dqewQYpgGsGyKSLbnRk=; fh=mlkRjkvEMCBvV2NmkuZ9E+MTYOKspqfxSPvD1d2xG14=; b=iduYWiRVY5h1Bm/N8FiLfYivTbvnGgvBiUCxcyJZcSO8cL1LWlWOho0Hz3otob9G8D 6A15i5URuaJ0kxaf3wgUln6lK12OojTFt8/tkoEQFIdI254fswioRFybyFBD/OWvmxJa PNqimednp8tRjweLHCk8l93bWGKJi26Pjd46ksulaRWOARJoVxe6OSfBU1vfrg9XBEJ9 TaM8CoWHNVnIG6sDc5oTMBjwiulUh9INWwISHONobiTRiWadf8vcpPzIYwbneXL9xSrw /jqp1zkJXGFJp76GXm861lgealIVJH9hWcYMiZ7iYJ/hLg9Odx8M4DCMSYWkcW+mtMVZ gOdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lUIDmU+G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b2-20020a0cb3c2000000b0065af2065e52si3575733qvf.345.2023.09.25.08.00.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lUIDmU+G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki An array is a more appropriate data structure than a list for gdb_regs since it is initialized only with append operation and read-only after initialization. Signed-off-by: Akihiko Odaki Message-Id: <20230912224107.29669-13-akihiko.odaki@daynix.com> [AJB: fixed a checkpatch violation] Signed-off-by: Alex Bennée --- 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 { CPUJumpCache *tb_jmp_cache; - struct GDBRegisterState *gdb_regs; + GArray *gdb_regs; int gdb_num_regs; int gdb_num_g_regs; QTAILQ_ENTRY(CPUState) node; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 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; GDBState gdbserver_state; @@ -386,7 +385,8 @@ static const char *get_feature_xml(const char *p, const char **newp, xml, g_markup_printf_escaped("", cc->gdb_core_xml_file)); - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); g_ptr_array_add( xml, g_markup_printf_escaped("", @@ -430,7 +430,8 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) return cc->gdb_read_register(cpu, buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->get_reg(env, buf, reg - r->base_reg); } @@ -448,7 +449,8 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return cc->gdb_write_register(cpu, mem_buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->set_reg(env, mem_buf, reg - r->base_reg); } @@ -461,17 +463,23 @@ void gdb_register_coprocessor(CPUState *cpu, int num_regs, const char *xml, int g_pos) { GDBRegisterState *s; - GDBRegisterState **p; - - p = &cpu->gdb_regs; - while (*p) { - /* Check for duplicates. */ - if (strcmp((*p)->xml, xml) == 0) - return; - p = &(*p)->next; + guint i; + + if (cpu->gdb_regs) { + for (i = 0; i < cpu->gdb_regs->len; i++) { + /* Check for duplicates. */ + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (strcmp(s->xml, xml) == 0) { + return; + } + } + } else { + cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState)); + i = 0; } - s = g_new0(GDBRegisterState, 1); + g_array_set_size(cpu->gdb_regs, i + 1); + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg = cpu->gdb_num_regs; s->num_regs = num_regs; s->get_reg = get_reg; @@ -480,7 +488,6 @@ void gdb_register_coprocessor(CPUState *cpu, /* Add to end of list. */ cpu->gdb_num_regs += num_regs; - *p = s; if (g_pos) { if (g_pos != s->base_reg) { error_report("Error: Bad gdb register numbering for '%s', " From patchwork Mon Sep 25 14:48:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726034 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2435762wrm; Mon, 25 Sep 2023 07:59:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEz4kPUudqfUzAi1jwdYMZu65q3+cSEJ1pr/3Hphs5mBCPsFQsH7laU7H5r21Z1OGucN7HM X-Received: by 2002:a0c:9a99:0:b0:65a:c525:5de6 with SMTP id y25-20020a0c9a99000000b0065ac5255de6mr10901891qvd.28.1695653963851; Mon, 25 Sep 2023 07:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653963; cv=none; d=google.com; s=arc-20160816; b=eo1rejtHosxxV40JBKLo+FN3CZjIPkthe3KQ21G8S8IdkLDFiltd/KhdHEeFXmfJIH W8glmDlZNAvGJEIG4hStxT6Ve0HDBOf9GHbuVGYGE1mGPgBM2Utro6xKw7dRbP8J+5Fc d1Wn+q9PKLsKUzu3BiLO7avBi1EkDEGPAa2CvigF4mE/iYQlkr7cOZcrtOFnjOYp/4MX c9hQkG50SBSbccrLL2j/BJ7fJRfjWtliTOtKF3xDA8yv61ZVqvFRI1Zyolhyasm8ztON +MkRq2lPg5jaNsjgytwZUU6xdTyDf6x0zUSGxWQLXYfreHy8B1Z/njRy71qCoGfj/EJY gjsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aeCFFwXCm+A4QdL8cQip0cKdXWBZunNX9KWO8pZi6hE=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=Q8oaTB7gNI9S4FD8i8SU9BhaYcW6hwuqbG1kv2V+huNvPtaSsGiJW946rSjSP7H29w aARBKSX+Y2goF1eVEYtOsQMmK7QGZgUOjGF4oCjmsIgCaenaKvIELZvodQBbV39xGcWy /1JcsOsaGiKajVcRVHq03JQ4fYYPtr8Tohnj6YbgSG0+bPzN/S3ufKI4QtPLj+sC6Ujg qeI8XmqRivcNbH2DmGC5S3gACN02pQ0kkEfI9D+TtWiYtRhNCUY20JgQkEfybQ44cbf/ iCZG8YerOvalHBh7STtXlDkrthdVRhoNoA5NjnpvqIk8ibYEhjyvkEAq4CDuasBm7Kho SPxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wmBBpzmv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n9-20020a0ce489000000b00628418847adsi5896540qvl.492.2023.09.25.07.59.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:59:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wmBBpzmv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-2-richard.henderson@linaro.org> Signed-off-by: Alex Bennée --- 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; 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 *tb, int *max_insns, tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */ plugin_enabled = plugin_gen_tb_start(cpu, db, cflags & CF_MEMI_ONLY); + db->plugin_enabled = plugin_enabled; while (true) { *max_insns = ++db->num_insns; From patchwork Mon Sep 25 14:48:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726040 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2437752wrm; Mon, 25 Sep 2023 08:01:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyktdXmEpmsp0CqKLE44uv8mLW8ndHl+T5Dcu/xN6GR8S1c5fcGsaF8+HW3I70GUmG2TBv X-Received: by 2002:a05:622a:1056:b0:417:974f:5619 with SMTP id f22-20020a05622a105600b00417974f5619mr7442838qte.68.1695654102265; Mon, 25 Sep 2023 08:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654102; cv=none; d=google.com; s=arc-20160816; b=BjGRr8WeNkwTy758pvAM65/CNhmzwZtpaCZMUBfmJToJnoiu5R5hwmua6tB22dV4Wb gKeYU/kMJzE/JFlYQVX/I2vLtmD2HPleFPuW6AqkWur1349PeTk4TTX8+WS+FwuH6kU0 Xuq91zCn4e4iY3J0V/c/j94CpfvKMMcxzDBVyRswGZSvQgtxLUH+pJZye05u4tH42EXm EIy98LWM11Jpn9NrqTUPgamNvvSC6ghpes3CkUGl0+7UrlTMS70lGh4UWkdTLg6Wtrvz 9wO/EF0lT3bykJqGujKYejE83nskUmJrcaZ5ifJPvFhLaUh9HRCz99vvT/sqVdMSVZ19 32zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iA5XRXF9P4Vc7lxXG3kZOc85Dy3uKGzfeERYzP/OVsE=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=iuhcc8MyQ3DbsmlNeqLz34NpbSl9tUw2Mm5rpSy2w1mF50o1m9V7BcYPSCZI4HKf29 BziICCzRzBPv1bIqGmnCCtBTCSTWBLcT3Z2gLGED1iuiDm3V7XY2ZNSTGASGCL+YpUyf NGiKXTFWrctuWlTrllOkGdd8oQBdwZTOls1lfOvCtRoSUn5pQvNMKS1ppWacPxFRlpQt Ww5BVAA2O09P8XkfxSn//KOIeO5ARLz7epPulGlnZFKmL3/iNDCczEsvRqGQiEzcCi+D OMge/Eprncv8ZAzNpkG53AlufA73DhVrnbuEtW6pH29jtKCh6X+LPoQjsMB8NAuNXY9s 4Y3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I+G70Jjc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p11-20020a05622a048b00b004165a06f9aasi6150174qtx.800.2023.09.25.08.01.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:01:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I+G70Jjc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20230824181233.1568795-3-richard.henderson@linaro.org> Signed-off-by: Alex Bennée --- 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) } #ifdef CONFIG_USER_ONLY +/* + * Restart with the EXCLUSIVE bit set, within a TB run via + * cpu_exec_step_atomic holding the exclusive lock. + */ +static void gen_restart_exclusive(DisasContext *ctx) +{ + ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; + gen_save_cpu_state(ctx, false); + gen_helper_exclusive(cpu_env); + ctx->base.is_jmp = DISAS_NORETURN; +} + /* For uniprocessors, SH4 uses optimistic restartable atomic sequences. Upon an interrupt, a real kernel would simply notice magic values in the registers and reset the PC to the start of the sequence. @@ -2149,12 +2161,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) qemu_log_mask(LOG_UNIMP, "Unrecognized gUSA sequence %08x-%08x\n", pc, pc_end); - /* Restart with the EXCLUSIVE bit set, within a TB run via - cpu_exec_step_atomic holding the exclusive lock. */ - ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; - gen_save_cpu_state(ctx, false); - gen_helper_exclusive(cpu_env); - ctx->base.is_jmp = DISAS_NORETURN; + gen_restart_exclusive(ctx); /* We're not executing an instruction, but we must report one for the purposes of accounting within the TB. We might as well report the @@ -2242,12 +2249,22 @@ static void sh4_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) #ifdef CONFIG_USER_ONLY if (unlikely(ctx->envflags & TB_FLAG_GUSA_MASK) && !(ctx->envflags & TB_FLAG_GUSA_EXCLUSIVE)) { - /* We're in an gUSA region, and we have not already fallen - back on using an exclusive region. Attempt to parse the - region into a single supported atomic operation. Failure - is handled within the parser by raising an exception to - retry using an exclusive region. */ - decode_gusa(ctx, env); + /* + * We're in an gUSA region, and we have not already fallen + * back on using an exclusive region. Attempt to parse the + * region into a single supported atomic operation. Failure + * is handled within the parser by raising an exception to + * retry using an exclusive region. + * + * Parsing the region in one block conflicts with plugins, + * so always use exclusive mode if plugins enabled. + */ + if (ctx->base.plugin_enabled) { + gen_restart_exclusive(ctx); + ctx->base.pc_next += 2; + } else { + decode_gusa(ctx, env); + } return; } #endif From patchwork Mon Sep 25 14:48:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726020 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2432784wrm; Mon, 25 Sep 2023 07:53:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENAPGGa23dGYBwqhzJFPXSSe/7lt5lbCBs4nSiDI9V+YfW696/wn//qWuPQNxE7g3Uifnn X-Received: by 2002:a05:620a:4149:b0:76e:e68d:14b2 with SMTP id k9-20020a05620a414900b0076ee68d14b2mr10173598qko.7.1695653610547; Mon, 25 Sep 2023 07:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653610; cv=none; d=google.com; s=arc-20160816; b=qRUHTRTN74bIXcTda48pTCnnQTfiG8WO6quBiBGTHEUv3qBSMpOpRMO8MMvfXcv6Ks ZmyZgnlvTT7r4vpLIj7RkO23bbRuAEVJQ0CL1NKW+L6bEesZu65o8o7c+3Eou2nUiyJR OuzctdnWaalUjJhmrq8yJXQukW681GwmivkAqklZxBy1mfUSX6caUjaU8Df0Be2JKxrK ueY9Bvn89jYyPEOSgyxXziDsGjSmUfqxQAQLKXxTBI8KvhbS+q6qIMbdifxRhx2eGO4w kWkC7ljw9u/1nfQVgGxXOXC19XtXsxZkRn7W8jwHEqT86jp/Grvq2J8iO8oI/LHVRnJl q2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vW14u2/R+fXBkgsAVXJeC+s7wkbS5Xjof2Eeqsenrno=; fh=iyt1v93Cd5lIl8P3DJ02gxmqPN1gw9ifdVngbtZMNRI=; b=hvAXsFwfYsEU/G43xV5w96SQmAkxWn1M+DQkCWOMgAnsACjMPdIab5nhJrA44Ii+JU gRuyq8WuETjP4/OOW7EPH+dEApbwXj3L/Qmvyiy8m2/3K4wjs+Pi/siG0YSz12uSbAdU t5+bGD07EiNwN+9kRd8RFsTgpxZ3wqEUnmj5Eq2gaZay9ltYHDujfXuYW3TXf9wricMv 8ke/IFo+Zcxb7MrAGWKgJKUCOMQxaD+LY44OusZy0J2cu3tv2O2LJrGpja1n3pWkdgQ2 OfchGzqQ+vxV02b122vfk4VtA0frobMUmf5kwgGXyKqvBIsKW5Ol3zHHL0E1FzB7jUfJ 8kKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P07QOw7h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ra3-20020a05620a8c8300b0076db6a9ddd3si3094895qkn.454.2023.09.25.07.53.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P07QOw7h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Matt Borgerson Translation logic may partially decode an instruction, then abort and remove the instruction from the TB. This can happen for example when an instruction spans two pages. In this case, plugins may get an incorrect result when calling qemu_plugin_tb_n_insns to query for the number of instructions in the TB. This patch updates plugin_gen_tb_end to set the final instruction count. Signed-off-by: Matt Borgerson [AJB: added g_assert to defed API] Signed-off-by: Alex Bennée 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; bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db, bool supress); -void plugin_gen_tb_end(CPUState *cpu); +void plugin_gen_tb_end(CPUState *cpu, size_t num_insns); void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db); void plugin_gen_insn_end(void); @@ -42,7 +42,7 @@ void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db) static inline void plugin_gen_insn_end(void) { } -static inline void plugin_gen_tb_end(CPUState *cpu) +static inline void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) { } static inline void plugin_gen_disable_mem_helpers(void) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 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 = tcg_ctx->plugin_tb; + /* translator may have removed instructions, update final count */ + g_assert(num_insns <= ptb->n); + ptb->n = num_insns; + /* collect instrumentation requests */ qemu_plugin_tb_trans_cb(cpu, ptb); diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 37f8dadbbd..ff84282fe5 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -212,7 +212,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, gen_tb_end(tb, cflags, icount_start_insn, db->num_insns); if (plugin_enabled) { - plugin_gen_tb_end(cpu); + plugin_gen_tb_end(cpu, db->num_insns); } /* The disas_log hook may use these values rather than recompute. */ From patchwork Mon Sep 25 14:48:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726039 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2437517wrm; Mon, 25 Sep 2023 08:01:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzIk+KRxVeoHwE9lWqPfRduVRTBzOy7ZjG4B253z7YzKmy6fTTPHF6QDecngNMbcNC35ph X-Received: by 2002:a05:620a:29c2:b0:774:2a7f:fa24 with SMTP id s2-20020a05620a29c200b007742a7ffa24mr6377271qkp.25.1695654090273; Mon, 25 Sep 2023 08:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654090; cv=none; d=google.com; s=arc-20160816; b=oCAfU70wDFbj6sX8dbLu5jkR3L3uMpP7BBRq4bdcOvSwaWTVs23hfhDF6TzdITSPdo wa+A004GGsSY7i1iqb4UuUYgR2jHpPe4ZA7k5VSbgFgVQOWr/UJGSG++IhcS15bYKMtl VDJYiyhc10yPcvGKR4/UsUQzfQeCuPbocNWwNPnfDYOlR16mmPRLDUiJeL9a1f72xcBF EbfOsp4sL/6wQ/yz7jLu/VGxlx3iN2X6COI2ldiWCOa1VRcIu96InafntMRU7NVCpEQn g6gFtiBy4fxSxfQsZQ3vmVoHuoLVEpGfIXyOUHKrEJltOnV0b20+OslYUQOoAdgXEDnH gl8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SQaKCCtPdCExPYstQ0NllKjLPtp/IcVgNdDW/2dG2tw=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=HBWEwaF3uSZsGe7/555fVetLQ37iosMWY1Y+5T6pQkuZulHAEvKO/AbQjg55CM1c8F /e9z2VaQDvVDEN9w9HVYNXfxfZfPmmufobO7hVd+7ATpDnngEwzc5BjaRtNcOWw+WPhd X5uQ759EL/mDdG9A/waaeWlewWoLBWoKQ0qbUDr6ky3S/xwxEoiH8OK3gYn1j2ZLQB2L a88EXiwH64vcxUZgw28PFLvG4hU+yFHhgD5/SFefiV9HwcfN84a81JWFw6FYnbIVBcov 1JVjVjieXQf5nbF4xE8R5Zl1w8N8YvEwQ2UY7HPu8hMrC5HuD1/SITsq+DCypZqWS6Me h6Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhq3eZbI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vu17-20020a05620a561100b0076f1797fa7csi6145245qkn.534.2023.09.25.08.01.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:01:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhq3eZbI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Coverity complains that appends_stats_line can be fed a 0 leading to the undefined behaviour of a divide by 0. Fixes: CID 1519044 Fixes: CID 1519047 Signed-off-by: Alex Bennée --- 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) } } -static void append_stats_line(GString *line, uint64_t l1_daccess, - uint64_t l1_dmisses, uint64_t l1_iaccess, - uint64_t l1_imisses, uint64_t l2_access, - uint64_t l2_misses) +static void append_stats_line(GString *line, + uint64_t l1_daccess, uint64_t l1_dmisses, + uint64_t l1_iaccess, uint64_t l1_imisses, + uint64_t l2_access, uint64_t l2_misses) { - double l1_dmiss_rate, l1_imiss_rate, l2_miss_rate; - - l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; - l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; + double l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; + double l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; g_string_append_printf(line, "%-14" PRIu64 " %-12" PRIu64 " %9.4lf%%" " %-14" PRIu64 " %-12" PRIu64 " %9.4lf%%", @@ -554,8 +552,8 @@ static void append_stats_line(GString *line, uint64_t l1_daccess, l1_imisses, l1_iaccess ? l1_imiss_rate : 0.0); - if (use_l2) { - l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; + if (l2_access && l2_misses) { + double l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; g_string_append_printf(line, " %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%", l2_access, From patchwork Mon Sep 25 14:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726036 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2437009wrm; Mon, 25 Sep 2023 08:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzdterwLiF2nkcDYqJ5vRR63yPMstBH1o1Z8bIcgDCqTkuIX5VlIXIliKbv02BhBYGtjcc X-Received: by 2002:a05:622a:11d6:b0:417:b545:9eb5 with SMTP id n22-20020a05622a11d600b00417b5459eb5mr9247632qtk.10.1695654056448; Mon, 25 Sep 2023 08:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654056; cv=none; d=google.com; s=arc-20160816; b=Vumrzo3y0ssn9dJESZKWWWQXZ/Dehz0QqkG3I1klgTDBYMXSi1OnFsoN1IpyrCDo8Y s1HznQKdo9eLnFWnB2Gwc0D8HuHS6USSknkG1+tR4U+vPtnBqwW886LlWn+ssY8uR+Sn Q3blGyj8hHzEjuAeyo8w24os5zJY/R3SMhqXY342IWsKpWpO7qbR5h7Jq5zq65Vu85Hz WYsQ3l2Gpmdd+XbqIJIPYjEr0FSImtYioixFCdgdlpqyDLgmrkiYaPlQRC/s3X2ci2Fm 3g7viodRVCSO6c9ySOtu5PQP8Fnmr0bcv5tz4E5BjOnvVEz4617YcAJLWtxw3l8VTkUx mhWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mAyYQkrKbWdgjPeSFpAKf8LHOxPMb7ttiO+d+H3EETQ=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=xw4/XLyjDsz5ecpEd1P/S7hrJLbwNOQyfo/5hG6CDCtUFQUZfmGwLZmnHa06b32SfV pFKgV+LFSPI1GN3YyECukn835qvNdUcdsj0B8K90yNKO0b6XBe/gM4Nl+NEP1ZzIFRWS 6Aug/WylrrsWxZ9pDkJbXRmeo+esSfLVYjyQT4Q28qkS7fJUPBRCtZULUmTTM0DITkLP 6CWUhwkjtQ0qodIdtS9V5hxgp1YzA5YWe74gVxWBVXVr5N0J4mOXYjSYM4NN2Lahv4cU parKnvJ5x6gQfLDCqLN0QYS20MrU6DxEOK4viZ5eE39PKC+eOsBTVV1r/ngumFLEX53y looQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eRiMNCpr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e21-20020ac85995000000b00417f199f9e5si4167634qte.738.2023.09.25.08.00.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eRiMNCpr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Coverity complains that e don't check for a truncation when copying in the path. Bail if we can't copy the whole path into sockaddr. Fixes: CID 1519045 Fixes: CID 1519046 Signed-off-by: Alex Bennée --- 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 qemu_plugin_tb *tb) static bool setup_socket(const char *path) { struct sockaddr_un sockaddr; + const gsize pathlen = sizeof(sockaddr.sun_path) - 1; int fd; fd = socket(AF_UNIX, SOCK_STREAM, 0); @@ -254,7 +255,11 @@ static bool setup_socket(const char *path) } sockaddr.sun_family = AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >= pathlen) { + perror("bad path"); + return false; + } + if (bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("bind socket"); close(fd); @@ -287,6 +292,7 @@ static bool connect_socket(const char *path) { int fd; struct sockaddr_un sockaddr; + const gsize pathlen = sizeof(sockaddr.sun_path) - 1; fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { @@ -295,7 +301,10 @@ static bool connect_socket(const char *path) } sockaddr.sun_family = AF_UNIX; - g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (g_strlcpy(sockaddr.sun_path, path, pathlen) >= pathlen) { + perror("bad path"); + return false; + } if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { perror("failed to connect"); From patchwork Mon Sep 25 14:48:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726038 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2437404wrm; Mon, 25 Sep 2023 08:01:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4b0JCWUgicehcayKYLPUi9zJwzBsphtwgerXdSQakILrjQMtLiyIeM7je1PY4+y6vpwjq X-Received: by 2002:a0d:d54b:0:b0:58c:b5d2:bbd8 with SMTP id x72-20020a0dd54b000000b0058cb5d2bbd8mr6641113ywd.28.1695654082258; Mon, 25 Sep 2023 08:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654082; cv=none; d=google.com; s=arc-20160816; b=MSZLibfVePwFrgy6UkFOhFCCZiNPVet+xbR/U6i8dVfjKkOlSEwAPKUvIneUnGRgWN UHj+yOcESl9XPfunhYXWLJdMkAqCg9HvmEjO0Gst3PR0ae2+B68Y6ArYcY+d7JVln8i8 6j70hNR01SCn39RwVnzp2DQYyqQXGIms+gGlxlFTHdSejixdvaBRL5KVvjs8QhR+Kzmc TpuMxetnJftJCux5jT6g/BPl7KlzAhcf/YePBC6k2J53oqHdLJmCFGH6ZdZ1OlKZt70W wuLSIDRSA1BEosPsZGtgPM6g3yhQIZsbYvNyzVloulJi5x7pma62m91gVO0PxKaZ1fjU cAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6tkbJLFSKCFqBt7eF2KdGUHAT+NPxj+IrJR+AQ70tYE=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=laV56b/SZgChAx6BBTtXkgid18rT0OPrpCWbuwfZxBXfHY0bfnSeHf6wUuhPcKteTL o7k86A3zKRkijLecQlwvQMMg5duNer0CEPpskO/chFiy+qF6dUF4F3ik2jXkCTdtKlTw Wrb1b8NO+a3/ilpxTazLEJLZE07FQLrgkjjVFV8FgZu2KqM3z8FDg3XPsbfc4Od1FqXd DuY1T3QDnUrb8g6EHLo/D9NV6gihk2RKloBYjDL7vLeSgxbbXLFbAJOsV7GwQTAjB6us ezF3sE0AtraGoH1vIJvE8jnArvLqfpUXEXRFDVbXcqUsrxSB9Ea9dCSh9sx3exbTAkEf KJSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S1oTraTy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w20-20020a05622a135400b00417c080666dsi2715170qtk.37.2023.09.25.08.01.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S1oTraTy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Coverity complains that we have an unbalance use of mutex leading to potential deadlocks. Fixes: CID 1519048 Signed-off-by: Alex Bennée --- 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) } g_list_free(it); - g_mutex_unlock(&lock); } + g_mutex_unlock(&lock); qemu_plugin_outs(report->str); } From patchwork Mon Sep 25 14:48:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726046 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2440968wrm; Mon, 25 Sep 2023 08:04:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8YYuJ/zbdvndzAJrwUndCLzHJEEI6ZmaoUR5LNoWYUzXZ2x2RSMSwCxDJdBG00Bz/T/28 X-Received: by 2002:a0c:e391:0:b0:65b:1074:fa5a with SMTP id a17-20020a0ce391000000b0065b1074fa5amr2791269qvl.65.1695654290117; Mon, 25 Sep 2023 08:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654290; cv=none; d=google.com; s=arc-20160816; b=i60kW+CaIe3Ke9N7FEghcAObspvzkLpsbGj4srMjSzxmPQZDFUlwDtjoUC7Ro43x6p R/X2jeu6fgkGRBfs11F3mldpL0agy0H8fbqWNoOsEBF+Pej3l2NuYvzfBQ6GVg+NtzKL IcVRN45QFWRHNyTlyR7NSDWmhJ6B3b8uHOjvBdqbMINsgFx3wZM4MHm3YI/gJtkd47U8 kApx3uNMJJTnUGDn4bpHB16uzinn5emICMmRBuKxiBnLVjlH2t2R9NrlIJC6jaMRls+4 p9+60Xl4frtlCj02zDHs3+jRPwQOoMOlPiu/N8mlsEVfh9xqLJwnvTUOCI3G7G8f/1hX /1zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jM0GTpB8x8Pq4p+VnmvbtC3PXJVxvgAV0ON8qJJlT10=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=h7RDeHRy4cJp37CVWPSOEtmGtSqlSYsJR/sXcO0utTCrOFgOK/EGLfcefcqFkesDKL lBJ+dzSq0w/aMjc9e6RujMe3QrVFuNbb97FhdzvHeBx5D1fqojbWpDvDDOvkQ7zgtmFV FxHyQxZI7S8zyEBsqNTkXC6tariFNSlnrlyf7qeVRwRMWWp7Yi4PfC74YFv9Mtwp+CfF V9NbByjkwdAJWfrCYXj/Qy71AmFcrE+f1h5KUnXVvCwceu/JDtZVLyCwUcBmjzjQ4Agd +FCt1nxzMsZyhe9lTx24TD5Ai4gmiQ2g9/OT4vMa4e9/iwrON18dM6G+ekr6FICs601b pYKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlCqC3xY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g1-20020a0ce4c1000000b0064c678f1d24si1791558qvm.116.2023.09.25.08.04.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlCqC3xY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée Reviewed-by: Philippe Mathieu-Daudé 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 => cpus-virtual-clock.c} | 5 ++++ stubs/meson.build | 2 +- 5 files changed, 60 insertions(+), 3 deletions(-) rename stubs/{cpus-get-virtual-clock.c => 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) -/* 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 { void (*handle_interrupt)(CPUState *cpu, int mask); + /** + * @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); /* 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); void qemu_timer_notify_cb(void *opaque, QEMUClockType type); -/* 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); #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(); } +/* + * 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 cycle 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')) From patchwork Mon Sep 25 14:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726045 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2440955wrm; Mon, 25 Sep 2023 08:04:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+xjjZGmkCEvYPJ6Ux4G6odEAL8Rp22tNXfcfEerj6XbG6yEIiL/bIrRgYE7CbyH3BHd4k X-Received: by 2002:ac8:7fc9:0:b0:412:22f5:fe00 with SMTP id b9-20020ac87fc9000000b0041222f5fe00mr9385280qtk.2.1695654289686; Mon, 25 Sep 2023 08:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654289; cv=none; d=google.com; s=arc-20160816; b=RrspDqV/5woynWAAGE8rr16O/s4DfgLipQ1bTQ+KHIyMZPPR0fIIOXFhiB6yl88Y39 ZR3dPLn+1KuIZTOyGJQJcXliSmuB+JRpNRrxpuSO2qsDCEcvBn2AWWp6tzSyMqL5Uu9u IbPyiCvojXcuJ924D2WRLC+Tg16AQtZni6y3Yq67W1Tv3VbNiyNT2GIllVFRvWcvzRud +dLPE3cbvG0cVD+QHx5X69YSxQyql0bZUp8uyHxLwewXwSry/OqO2nlDbDnZPV1YxsCz oIBupbjgYdRxoeYDVNIuGfUchFcf3HfA33wKqM9Qe2VmBWw2/6dJQ8DI/W6Cjej1QKl1 LLEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pzgHDvkSEQDHi8J0pZ97uLL1mOaFrktKKPN/mU4z0S8=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=I8G+umCmtPHw+YUq6u4frt7IfKBgvIdKWQALegAlj0iAWa1IybKKO9Jaxaim4rsI78 7H5AcQn8FAIG3RVyftC7E244IdDq4Mo3QlzZlqN7Iw6nktHSD7ieVlCzkiqkHj5qJWx9 tGywoJq2SiMakGCqSWB5Ql4dNRV1qaR8DPFC2bqsCz3N8ee6Dk2FTTZQuSVVzvKIjNV8 B5b/dk5SquAPyHmVK8kkpOV/M9aLCYXehOCtaWOYkKj82r/G5rDuabR5G4JuRKK49bNF rwIZFSO6kv2dqlM9ECF6vQ9LMfXrb8hw7Cc7cBuwxEpKJUjOjt88NGTQEuA3o81wGG6G owtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mzQuBc8A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d16-20020ac85ad0000000b00417ccca0054si2271800qtd.174.2023.09.25.08.04.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mzQuBc8A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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 *, const char *), void qtest_server_inproc_recv(void *opaque, const char *buf); int64_t qtest_get_virtual_clock(void); +void qtest_set_virtual_clock(int64_t count); #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, void *data) ops->create_vcpu_thread = dummy_start_vcpu_thread; ops->get_virtual_clock = qtest_get_virtual_clock; + ops->set_virtual_clock = qtest_set_virtual_clock; }; static const TypeInfo qtest_accel_ops_type = { 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); } -static void qtest_set_virtual_clock(int64_t count) +void qtest_set_virtual_clock(int64_t count) { qatomic_set_i64(&qtest_clock_counter, count); } static void qtest_clock_warp(int64_t dest) { - int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + int64_t clock = cpus_get_virtual_clock(); AioContext *aio_context; assert(qtest_enabled()); aio_context = qemu_get_aio_context(); @@ -347,7 +347,7 @@ static void qtest_clock_warp(int64_t dest) QEMU_TIMER_ATTR_ALL); int64_t warp = qemu_soonest_timeout(dest - clock, deadline); - qtest_set_virtual_clock(qtest_get_virtual_clock() + warp); + 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]); From patchwork Mon Sep 25 14:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726033 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2435755wrm; Mon, 25 Sep 2023 07:59:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYUbnl2axNrNugKq+I9PaULbJK9ikWmY308s9hWkjt+zKZxXiCLCAyzP4scLOnhphB5hI9 X-Received: by 2002:a05:622a:256:b0:412:184d:cfe2 with SMTP id c22-20020a05622a025600b00412184dcfe2mr7008574qtx.19.1695653963333; Mon, 25 Sep 2023 07:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695653963; cv=none; d=google.com; s=arc-20160816; b=j89ok9rhMosDe99TGUgTUY8CCU9LmySwaXZ6foW4ZPekhPTKg3lVNwKBjXpCwwxEPl C4DjUMninyfWHgoaR6iIquQL9sT2Fxw9OkUbdUThX01t9UiPRogB1godjaYTRZDnP/Vs aVYrlwOXqNbF4IcHAMi7NmgkZzcr0dkkahvONgbYw86EgFdWejSoroGWFFnoMKBgV+FP Hg2Z4VepZ+Kx0WG0b8EyHcN6AnRNh0ACuY6PTW4orWMXBtzdfkUGEd5CE0Ey3pMTa1gF IzH5m0bs2P0k7HL5X1iampIzCMtIKooZLRSvPYturuw8wL0OGWhm8ugh0sEKAOboRjRj kMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DGpqbinWgFdcTh8orlOkSkjWWt1Ye8Jo/m++la5kzCk=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=oLq1c/Q4xe8GnQdOaQAKXJWSHTw704CJYc6SoNy6eaCPBQ/lMf1cSGo/4U/O3nplC4 B3WvmtMnmjtyG5xGjSYbzZn45JlBSpBtOzZ1mmeBDM5a3o1M2elHXjX/78oClnhwsKoV UJ79Lmq09fRj1ECYV4PfgQfJDZiT56BJV4JX4j/MKpXu3FfD95bNeX17Eb+Vm0Xl9qEB Yc+TISkr1SHNLkS0Rty9VaOoLw3x3EvrmN80I+x33JL0MfJsCy/sCwqhtizSEGZ0xxHb anUBlbl362iDo8/voRyLzMJJ6tlpESHIQBiIHgjrnVzRmQQOdAjxl7ljLrsIDfOKoT6L sqxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xO0RVHuo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o15-20020ac85a4f000000b00403be3a4086si4383264qta.338.2023.09.25.07.59.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 07:59:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xO0RVHuo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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); +/** + * 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); /* * 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); } -static void qtest_clock_warp(int64_t dest) -{ - int64_t clock = cpus_get_virtual_clock(); - AioContext *aio_context; - assert(qtest_enabled()); - aio_context = qemu_get_aio_context(); - while (clock < dest) { - int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, - QEMU_TIMER_ATTR_ALL); - int64_t warp = 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 = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - } - qemu_clock_notify(QEMU_CLOCK_VIRTUAL); -} - static bool (*process_command_cb)(CharBackend *chr, gchar **words); void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words)) @@ -754,7 +734,7 @@ static void qtest_process_command(CharBackend *chr, gchar **words) ns = 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_VIRTUAL) + 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, gchar **words) g_assert(words[1]); ret = qemu_strtoi64(words[1], NULL, 0, &ns); g_assert(ret == 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) } } +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) return progress; } + +int64_t qemu_clock_advance_virtual_time(int64_t dest) +{ + int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + AioContext *aio_context; + aio_context = qemu_get_aio_context(); + while (clock < dest) { + int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, + QEMU_TIMER_ATTR_ALL); + int64_t warp = 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 = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + } + qemu_clock_notify(QEMU_CLOCK_VIRTUAL); + + return clock; +} From patchwork Mon Sep 25 14:48:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726042 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2438437wrm; Mon, 25 Sep 2023 08:02:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHmwY1WeJIBS8IO6lHA30deKo1wNkZ+qtcQdTL4N7UhYCDCBlcQ6qWQZlGHcZz4sxj6N3B X-Received: by 2002:a0c:f051:0:b0:64f:4be7:b6c7 with SMTP id b17-20020a0cf051000000b0064f4be7b6c7mr5879442qvl.4.1695654142017; Mon, 25 Sep 2023 08:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654141; cv=none; d=google.com; s=arc-20160816; b=ZzaOQOcXQWz0jDIvFa5L8iDDfREzZ8I2K0caXWB3duBGGofVT04NPpS3OZHE0eKXle O3+uWTfrFL4D5jn5X03XW4MORUFmYH9yq2afKa+WmFUHILgP5zkCc6YfOU81c5oodscG 4CAyi349t0efd1Bu2BO0Z/iUZKq+CB1OTh8IxZk6eZcPmwJLcv+zUVCUYVDyIc+6LPyl fVS/UvcGOQOgoVDTL0J/e+jI2Vdoqupbg+hfjJTIHBeZ4V2zD/qzTmtjzFX0Q0HkIt+c Yx25jfNITxs0Yb/WY3iit3rSMLvlefRHNs9ZTEfmddzN8QJVEeF3LlOLg+9H2oW0TaMj PztA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y3Mf9pXINv9MNziLLoU9Gq8z0X78btsM4rjGFmiQ41I=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=vhkOI7NMLZCp2NXfg0gMEqeTV8KZ1rcJtDHu0M7p+YwiyxI73w9wNLsWUw8Jyx8nro oQCb0CMAVGz/3wlL+Qu55bI6ecageKsLmhBniHljukdJMyoALo+vx7iDmWdvHayZ+2JA TeKUQocTz4Yr034snm3e4K7MvSnfK+yLY71iLoFhl095M+EUAyikq6hxshQrXtzld93A sS4mKli+gNiHGRLVHw9BI8kLJiSQjv3JA7gcNQtAo0tNnMxrNKUfIrASbrGzSffY2+Zm SpE7f15/ZwFtlAkbXbtVwISxJ7V4L1SP/48TTmq6tD6jeN5h0oW1uSSxiuhzFekz/Usc QiTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u+F/DJ7q"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x15-20020a0ce0cf000000b006588d9d70a4si5597640qvk.483.2023.09.25.08.02.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u+F/DJ7q"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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 *ptr, uint64_t imm); +/** + * 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); +/** + * 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); typedef void (*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_index, 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 = true; + return &has_control; + } +#endif + return NULL; +} + +void qemu_plugin_update_ns(const void *handle, int64_t new_time) +{ +#ifdef CONFIG_SOFTMMU + if (handle == &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; }; From patchwork Mon Sep 25 14:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 726043 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2438711wrm; Mon, 25 Sep 2023 08:02:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGQVoqH6a5pUDgbSajqfjTw7enU+C20vEHrBislZBDPpd75FKGuqkzohttonVD0UlNAXrP X-Received: by 2002:a05:620a:3185:b0:767:9d40:a3b7 with SMTP id bi5-20020a05620a318500b007679d40a3b7mr6911649qkb.21.1695654156395; Mon, 25 Sep 2023 08:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695654156; cv=none; d=google.com; s=arc-20160816; b=QkyoweVNjKb4VDUXBy2O3h/1JpgwW3PvdbrNImCUXSubKeDaiXiB4AIQ0O04l5N55y yOW3M2HthqZw5n3+hR7xsYENljUQ+wJhZTyN1RMseReYIwcYmp9TX1M38Kep3ze9LHDo UKwAFMd89Js2rOeUhC0mfUL4yt3B2lp/wWsDRDIgNhHJ7i1dsEtMkhrnBt2wWBb3ucv0 mXkVCxr7vgd9pRbRsY0RxIwccuaHrY7+ewFuJfp6J0LHztgTXznYSVbB3T71OsC3MH9C oLQyoPbq25hg/XtxVJcDpOtC6fe6bav6plwAGQ+fcLkITEQQRNJDTlWfJ7PoipYnYy39 AnqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eKXyxkZjkgMHzhbh3Oq/XROWT/WyaO+gDU9Mjp58TiI=; fh=f1HG4YWa+ndoxgBhrv2wvoi5B5rsQCa0P0+M/9TAKns=; b=xT1bJhX3QrCquU1OhoxGNrv7dj2Ce54sRjppKqfUhvq3cePJrpaLyvdqwS0VKV6CoT 6Yr8ef0yrwIsdFZ2C+I/qCo7jEeAsyBSD/VFHa8EFsxML3/0tXZD9za2yP587l0C2aQX UDuUhbk7c5kJAtoFpZP7Re5tEJwtTbi3wo/lnDX+hJmelC73hgmerA1avv9rys5ZZhAi AYPllWBGRKo6XmXTltFE/kwa0uFxYpwHlLXmIWtmtIYrs8j7L3rp24jaV1pTv/ABRLnQ ANQKeA1wHtgCSDQ0d6uD0lNOtURFoDdMV2Dw74X6SmRlMCvAqD09ouP7kvg1k5248BIf 5T0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v4+LzZ0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s1-20020a05620a0bc100b0076d81c85ecesi6176780qki.723.2023.09.25.08.02.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2023 08:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v4+LzZ0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Marcin Juszkiewicz , John Snow , libvir-list@redhat.com, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , 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_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Cleber Rosa , Paolo Bonzini , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-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_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée 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 = QEMU_PLUGIN_VERSION; + +#define SLICES 10 /* the number of slices per second we compute delay */ + +static GMutex global_state_lock; + +static uint64_t iops = 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 = 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 = 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 = g_get_real_time(); + int64_t real_runtime_ns = 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 = (vcpu_ticks / iops) * nsec_per_sec; + if (tick_runtime_ns > real_runtime_ns) { + int64_t sleep_us = (tick_runtime_ns - real_runtime_ns) / 1000; + g_usleep(sleep_us); + } + + /* Having slept we can now move the clocks forward */ + qemu_plugin_update_ns(time_handle, vcpu_ticks); + current_ticks = vcpu_ticks; + next_check = 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 = get_vcpu(cpu_index); + vcpu->state = CREATED; + vcpu->state_time = *vcpu->counter; + + g_mutex_lock(&global_state_lock); + if (!systime_at_start) { + systime_at_start = 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 = get_vcpu(cpu_index); + vcpu->state = IDLE; + vcpu->state_time = *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 = 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 = current_ticks; + } else { + int64_t window = next_check - vcpu->state_time; + *vcpu->counter = next_check - (window / 2); + } + + vcpu->state = EXECUTING; + vcpu->state_time = *vcpu->counter; +} + +static void vcpu_exit(qemu_plugin_id_t id, unsigned int cpu_index) +{ + vCPUTime *vcpu = get_vcpu(cpu_index); + vcpu->state = FINISHED; + vcpu->state_time = *vcpu->counter; +} + +/* + * tb exec + */ +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + vCPUTime *vcpu = get_vcpu(cpu_index); + uint64_t count = *vcpu->counter; + + count += GPOINTER_TO_UINT(udata); + + if (count >= 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 = 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 argc, + 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 = 0; i < argc; i++) { + char *opt = argv[i]; + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); + if (g_strcmp0(tokens[0], "iops") == 0) { + iops = 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") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], + &precise_execution)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + /* + * Setup the tracking information we need to run. + */ + vcpus = g_array_new(true, true, sizeof(vCPUTime)); + g_array_set_size(vcpus, info->system.max_vcpus); + vcpu_counters = g_malloc0_n(info->system.max_vcpus, sizeof(uint64_t)); + for (int i = 0; i < info->system.max_vcpus; i++) { + vCPUTime *vcpu = get_vcpu(i); + vcpu->counter = &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 = 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 = qemu_plugin_request_time_control(); + if (!time_handle) { + fprintf(stderr, "%s: not given permission to control time\n", __func__); + 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 += lockstep NAMES += hwprofile NAMES += cache NAMES += drcov +NAMES += iops SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))