From patchwork Mon Oct 9 16:40: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: 731007 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311422wrw; Mon, 9 Oct 2023 09:44:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgQMg3IUj4brFK3jZ2YgPvMTRz0WX0S+vBgA9oiGW39h7e0qtARpupC/PX3Ji+e+38aots X-Received: by 2002:a05:620a:f14:b0:76e:f62e:45cc with SMTP id v20-20020a05620a0f1400b0076ef62e45ccmr16934533qkl.32.1696869848481; Mon, 09 Oct 2023 09:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869848; cv=none; d=google.com; s=arc-20160816; b=Uq6+SNZrznmvhA3WhWEKenb+9OdaHPuTetc6maGn5Iq4WWgdiO37GXMplz5Mx/eybZ XLJqIBUc0DnTu7tJAZZSJKadmdG7bbMcRNWe/Z5+/5Vk88hy5lZSZv/RYEvFX4ylwvtn F/d/F2EZHMNJvcw3gyj8M7oLoaG52uK7T+Q/H9pmFgNgVtzFz01PtkEU/CtOsfI03EY/ 40/HufsJ/okpCnr9TtWkr4f67ypwxcff/FI3croKqKdAtQ0+j+dJwjTwPXxtpIQcby6b 8mXmVnOgbsiAz3OCjneoBOQjYLtXxlpfGO8Kf9wQAjYRBM8uX9BUfqGboVzvK4ZPy8e1 AZdw== 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=iMC4+hjgqKV/lGIlu49d0i7qAAR9ydClgNpOgYzMG7M=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=L63iTYfYQTQKT9FDV7+EJKzRioxVIwsMX+p0fGd1mUHyDgTFyjFbEQE/PX3uO81YQy 1QzSZc/CCDW0jWVN6zY70gzIQ/kJW/V3DG0ymC9gGesB57mkxcv7TlPKaqCTvjd7P9VD 6htU5eWXz24YbLioqKmwcRg+PYFO7WS59p8mnRibRgEaaYo3qO36KWhftCKipsjpsiPk PU7Z34ekfB6pSrnXH1aG6PRWAZHL6ABAyNM6+/mFP4OQXJqI2mYV8S9UwYFfGag7sJ9h iFdCJE/jwEygabsQw8BcXz1HqCDmnD4eUITu9HFepavWqHHp1uRq9mUycZDD5v7V+g9z pjgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uEW343fY; 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 bs9-20020a05620a470900b00774184acfeesi6562054qkb.297.2023.10.09.09.44.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:08 -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=uEW343fY; 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 1qptKo-000748-96; Mon, 09 Oct 2023 12:42: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 1qptJx-0005Ia-Ec for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:34 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptJc-0001SG-NG for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:26 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3231df68584so4416795f8f.1 for ; Mon, 09 Oct 2023 09:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869666; x=1697474466; 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=iMC4+hjgqKV/lGIlu49d0i7qAAR9ydClgNpOgYzMG7M=; b=uEW343fYgkdW6T3MoD7ssr7O+A96nALvALy4Lsj/lTr8y3RmeiwzI/jKAASz6emuEZ kLzH/UT6hrz+9jdPM0JHKa+tEsbyZj1Q/sddxXHio5GxCaLGpveiewJln4ypWE0RVbUG pldhjC4UZ79R7o6g9c66MiA2De1AgaxmQM2eM4GLVlHNwxVZyKXwnGlptg4lx56nXUn+ w1jgH5l4QWnrlBhZ9DjGP5wk0Q7SsGqFhJI1ak9u0OX4/4lr8sncz52Yeazd6hL59Eci 7eTPCLvo87hQNMTqiPrk3Zty7/I+8suSpdjxUSovaZXe66PgxK5jO2FoqMHcJ0BVO9Ht JZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869666; x=1697474466; 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=iMC4+hjgqKV/lGIlu49d0i7qAAR9ydClgNpOgYzMG7M=; b=hYMO+gpVRNrlDjZg7SJA3lLPGRs9TfsiQdEJ+F/zmn+J0Ck0+RwAGJtTDQd6i+mhfA SBxpwyPf+viDmiyJD2SRYutTCnZKCvzDrR2ZY88GJJrKPKibgDJA5LB+QULng5v0BgxE GGUHGMZylcgnssI32/RDJkkno2aZpK7uj+ei/xClSFL1I+qkg0bJs3by4n5BtwLbhV1c iO88GhNPXbbd/JlWQ5utaA9Rp/AbkkxQXbUwQSZpJs9gnpkUsKaIAUXAyaoyWqQZJXZq wTYpEMyT1QZ4+OVPJ1BjKp+aVfwkVXK82TbkmGMbxnonBiTVO4HTj3A5L1jeQM9xGEL7 KIxw== X-Gm-Message-State: AOJu0YwpfY6erd1FfGv82sqHuesZHJ9V/t5xCw8+RUWJ/hsJawqqx5MT IXM+qe5AMDghSdAIqeuYP8FPRQ== X-Received: by 2002:a5d:4d12:0:b0:316:efb9:101d with SMTP id z18-20020a5d4d12000000b00316efb9101dmr14167048wrt.25.1696869666151; Mon, 09 Oct 2023 09:41:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v16-20020a1cf710000000b003fefaf299b6sm11623199wmh.38.2023.10.09.09.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:05 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2B0161FFBC; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 01/25] tests/avocado: update firmware to enable OpenBSD test on sbsa-ref Date: Mon, 9 Oct 2023 17:40:40 +0100 Message-Id: <20231009164104.369749-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Marcin Juszkiewicz Update prebuilt firmware images: - Neoverse V1/N2 cpu support - non-secure EL2 virtual timer - XHCI controller in DSDT With those changes we can now run OpenBSD as part of sbsa-ref tests. Signed-off-by: Marcin Juszkiewicz Message-Id: <20230927120050.210187-2-marcin.juszkiewicz@linaro.org> [AJB: fix whitespace and longline] Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/avocado/machine_aarch64_sbsaref.py | 70 ++++++++++++++++++++---- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index a794245e7e..b272053eaf 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -28,33 +28,33 @@ def fetch_firmware(self): """ Flash volumes generated using: - - Fedora GNU Toolchain version 13.1.1 20230511 (Red Hat 13.1.1-2) + - Fedora GNU Toolchain version 13.2.1 20230728 (Red Hat 13.2.1-1) - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee38 + https://github.com/ARM-software/arm-trusted-firmware/tree/7c3ff62d - Tianocore EDK II https://github.com/tianocore/edk2/tree/0f9283429dd4 - https://github.com/tianocore/edk2-non-osi/tree/f0bb00937ad6 - https://github.com/tianocore/edk2-platforms/tree/7880b92e2a04 + https://github.com/tianocore/edk2/tree/ad1c0394b177 + https://github.com/tianocore/edk2-platforms/tree/d03a60523a60 """ # Secure BootRom (TF-A code) fs0_xz_url = ( - "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" + "https://fileserver.linaro.org/s/rE43RJyTfxPtBkc/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash = "447eff64a90b84ce47703c6ec41fbfc25befaaea" + fs0_xz_hash = "cdb8e4ffdaaa79292b7b465693f9e5fae6b7062d" tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash) archive.extract(tar_xz_path, self.workdir) fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd") # Non-secure rom (UEFI and EFI variables) fs1_xz_url = ( - "https://fileserver.linaro.org/s/t8foNnMPz74DZZy/" + "https://fileserver.linaro.org/s/AGWPDXbcqJTKS4R/" "download/SBSA_FLASH1.fd.xz" ) - fs1_xz_hash = "13a9a262953787c7fc5a9155dfaa26e703631e02" + fs1_xz_hash = "411155ae6984334714dff08d5d628178e790c875" tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash) archive.extract(tar_xz_path, self.workdir) fs1_path = os.path.join(self.workdir, "SBSA_FLASH1.fd") @@ -144,7 +144,7 @@ def test_sbsaref_alpine_linux_cortex_a57(self): def test_sbsaref_alpine_linux_neoverse_n1(self): """ - :avocado: tags=cpu:max + :avocado: tags=cpu:neoverse-n1 """ self.boot_alpine_linux("neoverse-n1") @@ -152,4 +152,54 @@ def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=cpu:max """ - self.boot_alpine_linux("max,pauth-impdef=on") + self.boot_alpine_linux("max") + + + # This tests the whole boot chain from EFI to Userspace + # We only boot a whole OS for the current top level CPU and GIC + # Other test profiles should use more minimal boots + def boot_openbsd73(self, cpu): + self.fetch_firmware() + + img_url = ( + "https://cdn.openbsd.org/pub/OpenBSD/7.3/arm64/miniroot73.img" + ) + + img_hash = "7fc2c75401d6f01fbfa25f4953f72ad7d7c18650056d30755c44b9c129b707e5" + img_path = self.fetch_asset(img_url, algorithm="sha256", asset_hash=img_hash) + + self.vm.set_console() + self.vm.add_args( + "-cpu", + cpu, + "-drive", + f"file={img_path},format=raw", + "-device", + "virtio-rng-pci,rng=rng0", + "-object", + "rng-random,id=rng0,filename=/dev/urandom", + ) + + self.vm.launch() + wait_for_console_pattern(self, + "Welcome to the OpenBSD/arm64" + " 7.3 installation program.") + + def test_sbsaref_openbsd73_cortex_a57(self): + """ + :avocado: tags=cpu:cortex-a57 + """ + self.boot_openbsd73("cortex-a57") + + def test_sbsaref_openbsd73_neoverse_n1(self): + """ + :avocado: tags=cpu:neoverse-n1 + """ + self.boot_openbsd73("neoverse-n1") + + def test_sbsaref_openbsd73_max(self): + """ + :avocado: tags=cpu:max + """ + self.boot_openbsd73("max") + From patchwork Mon Oct 9 16:40: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: 731003 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311405wrw; Mon, 9 Oct 2023 09:44:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTD07A/CPYMHb0ziT/uQOOK0mdzsl2sS0WqsQ6SJtSVof8iH/4K6h8PUzBfWkOldC/LRtl X-Received: by 2002:ac8:4e8a:0:b0:418:1b8f:4cde with SMTP id 10-20020ac84e8a000000b004181b8f4cdemr20483456qtp.45.1696869847510; Mon, 09 Oct 2023 09:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869847; cv=none; d=google.com; s=arc-20160816; b=FA9tpsCTYZS0tZSJk+FmqZvv/t1s68EbCCmS5NUMtuozxKe1na5F2hYlQjloSWgFWs Ls/ibSowZunksbxO4U35UC/HF6s1zlrp/uZczCTBVBtICWInoGh3xYVtiO9YcQtvWSmT Cf5Ucg3Xd/At4B214E3E1vRmMtVbVG+zcjvN4hUZ1nHIDQfQ2kWwu+iWZ0PPhk7UTcZj 7rMpA7bQqSE75Z2ODxZLTcHG/rOF1AdQMfrK1Lkx2hn6CC6kG92kY6LTgq9pH5PhWUKk luBp/loj7hVIog6H1sAAfYE3tAJvhJjbNb5BdmeYwcXCxMF1ARd4vJQZ4f2okgPerxhD ljaw== 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=xV3BG4Srg5Y6VlVNbacPBEYIMzi3RrER9K0pSz3VkxM=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=sGxwY0iJcmJtO8GcgApMFaWKIQeCnCkpUhgrRtUz3YtvC+c7DK9xe8yyutSv/geVrZ vv0Zm7VqsS9VCKskz471sYc2BTpjSej2eNPN2bRDCFgXksdpcHG358xRXATRMAfzfAMq E3DiYiU1p6kzB1oyfFApdSVn8XeTggvJh+UlA2e5zBvtZEYVvGLZm650N2yGLpgx43/D 7h4XF7IG+QChk5ZNZUX5+u4fSCKsw3u5wM7/qTs68dMELktbo/RQGz9CQVY992fXzPcE Ywxw6BMmNCfYmk2N9XPO1X0SkcUHZuDx4dboz4fxRliBIdiKUtHmMcCiHajIvfUNFo2m Vesw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eF3apVqq; 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 u11-20020a05622a14cb00b00419a2c68218si6144644qtx.799.2023.10.09.09.44.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:07 -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=eF3apVqq; 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 1qptKP-0006Bq-Oy; Mon, 09 Oct 2023 12:41:58 -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 1qptJq-0005Bw-Vx for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:33 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptJd-0001UB-Dx for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:21 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32487efc319so4553105f8f.1 for ; Mon, 09 Oct 2023 09:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869668; x=1697474468; 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=xV3BG4Srg5Y6VlVNbacPBEYIMzi3RrER9K0pSz3VkxM=; b=eF3apVqq8Ng5x3HHsV4PHv31k7V0oFlnnjQFxUAxIQik1J+YJ+QKNCIGpYN9NRKrD5 fQ33QxIeCAp63MS0uRFn3YFrSCbu6vCFmg2oF+8qjhAdXzPKEVrR0DifEJd0eygmdbCT ObHB7xvmeAn9nhDwnTU0Jg3Ujzjv3rnIcZOkJ83oXkIPPpgRhxaR+4MR2fD3b716nflr tkkJHz+OYpMzotjh77ufiEiG+XT9Z2NDExNMzRjZ6Flpo1REwdevtPmA/JgagtU5GuVG tZUpdVxjFcvb0dnXAKoO01ewqdVz/Gxsh/CYf5rtV4xnqt3ieJj1XWqmgQLEF0rXgcY5 Mhjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869668; x=1697474468; 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=xV3BG4Srg5Y6VlVNbacPBEYIMzi3RrER9K0pSz3VkxM=; b=WBedcez1I0TITELLfG5qycW7+CT60xM731YT2O7/FQu1kd6my/Qvw364CgCvVhmbcP EaP4Wp3y3S1YHq/Heib6C3zN604dBi/bRCIAcOeEWcR5Y19Q19PP8n0Ehy7J96uscOHo tT8Dk4/msal2wc4yzV6IQTqyTKmys5gjZlMYV/65L8AW9+KY8MTPTS+ua3f19gbpISXS oYoa6dC8R1XaveBzz0DGmiOdE9Hqa23dmxy7NGDpb4VJ9n90LltRk52uMMRu/WPThadQ 5owrwh8NdTbHE42khrfVNxQ1vUFxlS1nWJTpMl5GkGiBidCq/vyIMWpCJ1LO1UVihTmu 1NDw== X-Gm-Message-State: AOJu0YzhKlmMYvadmJmxV6a1iEf/j5RK97GXW4/Zn0gIts0qIbXJArOY HCuTrnkkh93M5N7T4HsWqq1Qag== X-Received: by 2002:adf:a19d:0:b0:329:6b8e:c16 with SMTP id u29-20020adfa19d000000b003296b8e0c16mr7005776wru.35.1696869667711; Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q14-20020adfcb8e000000b003296b488961sm9530042wrh.31.2023.10.09.09.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4707B1FFBD; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 02/25] tests/avocado: remove flaky test marking for test_sbsaref_edk2_firmware Date: Mon, 9 Oct 2023 17:40:41 +0100 Message-Id: <20231009164104.369749-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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 After testing locally I decided to revert a5754847e0 (tests/avocado: Disable the test_sbsaref_edk2_firmware by default) as the test seems pretty stable: env QEMU_TEST_FLAKY_TESTS=1 retry.py -n 50 -c -- \ ./tests/venv/bin/avocado run \ ./tests/avocado/machine_aarch64_sbsaref.py:Aarch64SbsarefMachine.test_sbsaref_edk2_firmware yields: Results summary: 0: 50 times (100.00%), avg time 2.064 (0.04 varience/0.19 deviation) Ran command 50 times, 50 passes Maybe f0ec14c78c (tests/avocado: Fix console data loss) has made it more reliable? Signed-off-by: Alex Bennée Cc: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- tests/avocado/machine_aarch64_sbsaref.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index b272053eaf..bdd1efc768 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -75,7 +75,6 @@ def fetch_firmware(self): "sbsa-ref", ) - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is not reliable') def test_sbsaref_edk2_firmware(self): """ :avocado: tags=cpu:cortex-a57 From patchwork Mon Oct 9 16:40: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: 731019 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312911wrw; Mon, 9 Oct 2023 09:47:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1Nv49we8UvWNT3sbiQYcvyeeg6bUbjiLi+EdO97XiMdtHaHaSoA9MXJs5iDlxLvdzUux/ X-Received: by 2002:a05:6902:348:b0:d89:5638:8bb7 with SMTP id e8-20020a056902034800b00d8956388bb7mr12715647ybs.20.1696870051948; Mon, 09 Oct 2023 09:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870051; cv=none; d=google.com; s=arc-20160816; b=gQKRq4dvaMU9vktmbYOLxGjcQixuNH4ewEpP+5KGRFL9wateBExp6/aOzZrXDqtrMZ DA2Njfx0E6z8IA8ATgwHkst7iDEhlrXXkxO7bC/0E4/0WA82d/A5mcspicH/rkelChuR 8pZLYnV9DwB3RJy+iVjZ+0uB8fewhecrvNOFToVJOShwGK9ijlfkYdJE+uv/uPqCIrHP AMyQYk+MbFAOqDIE3PKIMqic3Czq17wBAIIOe4xLX9pnUjDxwwl4ny/xKddikwhO7rqa jCpx4mDPnxQY5I+AhdRDzT/2Elip87NJRY1Fn6pcWwT+OpdyK4p7TND/08kNEE1e/WPd gFxQ== 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=L5m5U8IdFTmwnSfYsG3qTGew7BexOyKIusQXPfvvs/U=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=zqzLPidljAoYh+39lImzRv+QuFlza2ooWRdLlMlxOVDGZfL/Gva9p7XieFuSjGnOSN +dDlN81/DjsvumhwJLzfwI9pnU1ysB/4YVpCs88BtQcUpD6dk1ykOZmCZeh3Z/BVBRSH 0AVTM08kcIx6IE4gU+i8x6fsqlowFRM7TLFVN1lUnr+ywLxt2EXdhV1x7SMITEQ/s44w rQCQsWFi2HbddsJCnpJg8ZSAZ1cjD12UNFxKEHtQPJ8c+2Rbzs6PZHPbChG+ulGaD6mX MjRXU+Q2xpQ/dbLK/z6pW9OyKWaJWTgCXluvLX0nWpLH6+4YoKwVtUUoWw1RowL+PCpG bOug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz5PqvH9; 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 c10-20020a0ce14a000000b0065b0fc01a9dsi6295414qvl.385.2023.10.09.09.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47:31 -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=vz5PqvH9; 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 1qptLx-0000JI-Gw; Mon, 09 Oct 2023 12:43:33 -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 1qptJl-00056m-Rt for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:22 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptJc-0001Sb-9D for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:17 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-406619b53caso43604565e9.1 for ; Mon, 09 Oct 2023 09:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869666; x=1697474466; 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=L5m5U8IdFTmwnSfYsG3qTGew7BexOyKIusQXPfvvs/U=; b=vz5PqvH9U5rKALlBvgbzKyROM3vzShax7FDmDTQZQbkPlxXAl+F0MgGi2DcxKuc0CQ ZCpS/86QS76EOoNuH46DhDGod1Jg6jMES3gkoMabXgPB+FL7Da2wLNge+dMToJpuxrjg Uc8Th0VVrh/GVs8f7xDAZwtSzqCEu4yj9t0CioQsuzuJNxj+wY8+45xGIycTLtCQFiTI 0BWtkIW5TdtfLoJTP73ydoizVOJt/D7u1HYKJ6sA43TDkIPblkh2wQbeQsLdZOBVx3lt TTb3p8EuDPWq2kxJOYwlMKXNuYMNV44NqBJi8ChHG3dereCMcGHkjuhbz3siKl6Sojf/ Y7jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869666; x=1697474466; 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=L5m5U8IdFTmwnSfYsG3qTGew7BexOyKIusQXPfvvs/U=; b=v+j1351NgbpRXLbeOOhxFQpZxedDhdqXJi3f74KbzwuYTnpWKtHnS36SyUuJhiImlI vtpdFgJ0lBZwOSk91yPtMMfdD71EsBaIXZ/2JvEVNzFseOTmoXzfjewcnGk2ie7jnGzL AiKur1wKO0rnPyeiiV+whK8uiyjhlnSNfluO3LSlCmOU5HfUJUxlNB8UJ+CteE/Gxw6J PhPvsljeurimR0EpAW5YVxymm/Bl5GpJiD4Do9OMgdQaGlLDyrmMRymc7VWgUuKYhccq ucfYFLH6mJQuPiWHaoIPKILzEUiqX5B7lWsFiXZwKULz9bNv9cOF/3FAEKeTehbrlQJ2 3hIg== X-Gm-Message-State: AOJu0YyOK/7R+5dR9aVYY6379jPYFu3jNtAYSCQStskB1nVpL/GFEl5z gjrhdHC05o08FdlV6aA5XpiPyQ== X-Received: by 2002:a05:600c:378d:b0:401:a0b1:aef6 with SMTP id o13-20020a05600c378d00b00401a0b1aef6mr14480216wmr.2.1696869666447; Mon, 09 Oct 2023 09:41:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id az41-20020a05600c602900b004068495910csm13838934wmb.23.2023.10.09.09.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8775C1FFBE; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 03/25] tests/lcitool: add swtpm to the package list Date: Mon, 9 Oct 2023 17:40:42 +0100 Message-Id: <20231009164104.369749-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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. Message-Id: <20230925144854.1872513-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé --- .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 Oct 9 16:40: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: 731006 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311424wrw; Mon, 9 Oct 2023 09:44:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr49abZRK9714Ml+PP/zPM0nF8awAz5lnLqKDPnAZUFdMQSK5oDnwr1xi07Q/oggp3eB1h X-Received: by 2002:ac8:5813:0:b0:418:1e88:83ca with SMTP id g19-20020ac85813000000b004181e8883camr20107232qtg.40.1696869848646; Mon, 09 Oct 2023 09:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869848; cv=none; d=google.com; s=arc-20160816; b=FemUELSllpEHbiOVLUebTPMDcLlLpdYbbRDrHufuJYsAZD4Yt1zIyJ16NR+P7UQfRE SkcylYouHNmCuDY4QjAdD4/dvn4N4FuUDfmiiErWZydAeN5wSeoTNsgcA+H6jINoVyDQ vVy5SY5HireVtyvWKzweIClRxdJM/9HkMaNiCbwp3Vx9AxhX5P34xhPR9V6LscwbhJCJ 81VRBBRp05wLuBdZY9xX0/BTCBWyHr6aYXTGPgYH3aojjJ9BKPJIkuJ9GPWkjdiD6pog btLdVwfPUKTX9HOJX/vEZz1DjQPeds3sWJK5V53a8VbS4FNzDj9fFGMeJfdK8Z8A2zJy i4mA== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=rUIZ1jQNYBjvSBLjX78DN4gKNnqVWfjaplYaeFeEz1C8QUVm9F16ZrwW6cY7LPtzfG Sn6i+Rd1PsmCmW9URqQOIQj9gFiNdyADHSJK/OJ17d9vEvm4jW721dJTlk2PC+Hs7iCd 2JfvBxkfoaL0kQds5LqY0e+sx9DeW1fTsR0jBsNblQ7tp6awY0R/nNPwY0mVHJYoauT8 EjefaZVdFJnLW89rwjl+7xli8UOhlrMp4XWJaw6CxfH259uHILwzzMlFyr2Z4tzus/fU N2Vt5VzYFgOuXo4AbNayg/tcDxngnN75/vuH5flPy0KYJbxjEETAZnVpx6cZPoHkXeCu EIUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PJFplBfX; 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 u21-20020a05622a011500b00418d6b2d48dsi6487084qtw.187.2023.10.09.09.44.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:08 -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=PJFplBfX; 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 1qptLz-0000aN-4h; Mon, 09 Oct 2023 12:43:35 -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 1qptJs-0005Cd-Mu for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:32 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptJe-0001UN-0P for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:24 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32003aae100so3534515f8f.0 for ; Mon, 09 Oct 2023 09:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869668; x=1697474468; 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=PJFplBfXMh1OFG9xJg1xLUpyf9jR0JWT5dY25dlIUuCCqGrm20V4SBCKJiV+G6zZxS 8llEwM1MMi0HTU6tTeUlqoXDwZ8u6P+pXBHFtFWzlb19LuPJHmVAFz6i+RExnow5EoL3 g5EEF69K2C2fK+QJ/mcM0HeBTH9N6uJApVmA+H3UGPN+J0Kg+CHgh5ci78Vf+trYJYx2 bmGhUPiX4dRYSj4HbAIB+rYrh3c8VKNQFlDrbNf9e7eJkfVPu2+3fBjrD/gQI9Qt0g7N UVAp4y6zLJMMDv9sdrTEpAoCTjJIFsgy43ds8d06ee3oP1FahiFAonM9/GFWrB7Lzy8P EE2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869668; x=1697474468; 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=PWnihTGTIIUH3VcqqUIUP/Pb64tIbfMcouHe5RxIu10kSSlvpWvMMnCUfra+IaXLlA YDoyJW5hd52YxSi17921HiKwTkEwkOlxa0lbZif/EmT0KJiO4vgGTj125zEcxw9AoKUG TR63mGeHl9XKTesrZW6olsVayjP3yt6OVc6I0jm6aTWe8kzTNmsRxoT6lu+gOgmdqV7z tSEFr7skV9XfOVEQM2F+Lv3SdyM8zCj94Nm1vfxnqTQy7KfxmWeOaIOnQDW35tFqGGva uEwFvdg6fdZ6MAtEdXkCaHDdNXhpJ2pKdmbsxMCczBbZzLibVbRvSYkHjUe3P+okgyBq swlA== X-Gm-Message-State: AOJu0YywJ/9iQTwzmwANuRFTd94R4iepuu5N2t5uhjYpE2N+R4U8elMv wRtkIFv1jvyOxd3JZvUcsDgv6w== X-Received: by 2002:a05:6000:1a45:b0:31f:f8a7:a26c with SMTP id t5-20020a0560001a4500b0031ff8a7a26cmr11611057wry.25.1696869668067; Mon, 09 Oct 2023 09:41:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g7-20020a056000118700b003143c9beeaesm10076058wrx.44.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A33B61FFBF; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 04/25] gitlab: shuffle some targets and reduce avocado noise Date: Mon, 9 Oct 2023 17:40:43 +0100 Message-Id: <20231009164104.369749-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -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 Oct 9 16:40: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: 731001 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311396wrw; Mon, 9 Oct 2023 09:44:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWl0JowXa74pCu1LSEh10O1f775p2ivgjJi6Kc4fmZ17x9qHmCj38vf/1SGOORU89SQhSq X-Received: by 2002:a05:620a:2802:b0:776:f8b5:c4c with SMTP id f2-20020a05620a280200b00776f8b50c4cmr12417426qkp.20.1696869846573; Mon, 09 Oct 2023 09:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869846; cv=none; d=google.com; s=arc-20160816; b=on3izNad7gGQRAlLSPIx46qK6i1bAqL5LnwNVsugROp3nfPYEdLRiQFgUrqzTZE4cP MgroEJ4N9iPOZwSk9dR6ZprQ8yk5Pb5cLz3d8B03gYn1Meo9ZBkoBMj9an+yWYVflBd9 Glg8fzLcUE4a5tcBNDiPWfHwPBqP5Kcf/dkM8P4BTlV7PS1gosm9cwmZdpdqtz6RtxBY ymM3vO34slEBsHB8s8EFLTcznD/zWC0e1MD4wlRH53cof0frD1OBPfpUTrCJSHgP3MAo z5hd6nC0fFHSC+O4HIh/39aVLUPOYiuUXh7Yp4+xRFR7wGut8g2AjIPp5kyIyq3naqiI 2lPQ== 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=zh7N0HFTIxBax5KXX0zczKhvUC5xK1l1PfGLSBYFHwc=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=EEfwzWgpR32fCBN5QOmHcXZrnTJ0+SLZDVkqSFMAX/lgeRDb4IhQ6aLy5NH+j4M9Rp aC5YnQ53AG5ZPSNKWMOd/YEuDtPapRzP0E2qNqLwsKGbjz+Sak5vsqM7yNWbxChHEWr9 XP0+xNh8RKvwDWuTuD4TxZ3GF6AJYrmfh/1NX2aZZ+Fg5CRUppthaiZyY2n7tFt8XiB3 rU5BOYDcLvcHivvJnEWJf+Naw2d7RSfpvAQamNUzk2GaMVtjsegCYk6jJM22HS9b4VuU GY3igqNMYRzJ+gZ2Ep2OK/aI2wLX236q4vDwfHOLLmnmpCr7smPmJvC35oZ1cB8tcNwq B5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PwcDzxlt; 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 m6-20020a05620a290600b007742abceac8si6567332qkp.665.2023.10.09.09.44.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44: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=PwcDzxlt; 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 1qptM0-0000pe-MU; Mon, 09 Oct 2023 12:43: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 1qptJx-0005IS-FE for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:35 -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 1qptJe-0001Uc-4W for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:25 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-406618d080eso45689115e9.2 for ; Mon, 09 Oct 2023 09:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869668; x=1697474468; 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=zh7N0HFTIxBax5KXX0zczKhvUC5xK1l1PfGLSBYFHwc=; b=PwcDzxltD5YR3ShAQzhz1eilmfTYm+45rVXlqOy5QEK22HJ6XkKQg6F/fwvpa0lFhQ r4EnyvkmDC0sEQcNLlpbpOFo5Ucb+AnkUbfTfCfpEA7lbpmwTNdzb2uUlCsFiL6H06cf 4g3XWhP9r6dlYIeJimRqK2FuXmfr/QQ3mluXWvgGflcH7f9F/gerNLzzD7BfdqGKwDa0 vxCynn1Hf0BCWK8mvwkjt/wiWdQAQWvh3g3pmXMbYvDL7jpRNGt0t/lee76Ahw78N/SA YPmoQ60Ce5N0OYuPjULpVZmd0fNE2WPqxXEpYvE1OGj2tXHuz47wrl6CbWsNUX3+fJ3N JPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869668; x=1697474468; 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=zh7N0HFTIxBax5KXX0zczKhvUC5xK1l1PfGLSBYFHwc=; b=P65HRzrgfs3PT2EgvLh/KbOGb94FGSrykHiySqf8nk3d+VP+B4QU6JmxsTWaYJcWtW pb9ffyi44qNc+bTAnTDl2GABjEE2SrK5yICpAiv9BKCIh9OZSXuJaskpRP6u8zqlTbyy 9JAXG90q3SMlKauZzwS5mjcKHpHu68U7cl8m0MUyq74DLMw57mEpVpHZlwJXjrD9b9aH 9BKLBmEdLJB8X1T6DUcnEu6v//a2fQKvf9AP2AigWEtQA2Gi7JT1/HCJ0LOSJqyPCRRs ILmx2O/7Uc9aO23s3PdzIDugzrW8PAXk3HbaTvqw8GTnAqrNfpfU6fAUrH+4wQul2zf4 DA/Q== X-Gm-Message-State: AOJu0Yx2THfDpBjCt1nbdCWrXHXXPYnsYm64YZsSSNJu0rWJD7agdG+C MLHHmJ2teSjbjokFtmzZv1/fOQ== X-Received: by 2002:a05:600c:2317:b0:406:6964:7e96 with SMTP id 23-20020a05600c231700b0040669647e96mr13462745wmo.13.1696869668212; Mon, 09 Oct 2023 09:41:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c470a00b00407460234f9sm6145168wmo.21.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BDDBC1FFC0; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 05/25] tests/docker: make docker engine choice entirely configure driven Date: Mon, 9 Oct 2023 17:40:44 +0100 Message-Id: <20231009164104.369749-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 Since 0b1a649047 (tests/docker: use direct RUNC call to build containers) we ended up with the potential for the remaining docker.py script calls to deviate from the direct RUNC calls. Fix this by dropping the use of ENGINE in the makefile and rely entirely on what we detect at configure time. We also tweak the RUNC detection so podman users can still run things from the source tree. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis --- v2 - add RUNC stanza suggested by Paolo --- configure | 1 - tests/docker/Makefile.include | 9 +++------ 2 files changed, 3 insertions(+), 7 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..ab68b2dbad 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -16,9 +16,8 @@ DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu endif DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY)) -RUNC ?= docker -ENGINE ?= auto -DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE) +RUNC ?= $(if $(shell command -v docker), docker, podman) +DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(RUNC) CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) @@ -158,7 +157,7 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES)), \ ) docker: - @echo 'Build QEMU and run tests inside Docker or Podman containers' + @echo 'Build QEMU and run tests inside $(RUNC) containers' @echo @echo 'Available targets:' @echo @@ -198,8 +197,6 @@ docker: @echo ' EXECUTABLE= Include executable in image.' @echo ' EXTRA_FILES=" [... ]"' @echo ' Include extra files in image.' - @echo ' ENGINE=auto/docker/podman' - @echo ' Specify which container engine to run.' @echo ' REGISTRY=url Cache builds from registry (default:$(DOCKER_REGISTRY))' docker-help: docker From patchwork Mon Oct 9 16:40: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: 731008 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311513wrw; Mon, 9 Oct 2023 09:44:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMYDNZgXp8o46HpbOQCULkGBC03jg4PiOHZnx/QU7/xdcN/KaN/6GUblkwwdKPk4hzUyNf X-Received: by 2002:a05:620a:2ac4:b0:774:16fc:65d8 with SMTP id bn4-20020a05620a2ac400b0077416fc65d8mr15880476qkb.32.1696869860364; Mon, 09 Oct 2023 09:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869860; cv=none; d=google.com; s=arc-20160816; b=Ld8Vdni5lwDuDbfVrri0JXh+pEvAacdKgNHDR7xXjQqrQpTciRwc0c1kMBvz7AqJdV c0nxJ0BkqEE/aoNRBRT9XeQWZR4Dr+v4PbdhkhqKDBgG/AEQ61kYIVyGpJWWGHncfXd8 uYECVKCujbsuK4zETEX9kbUyt3Jj3IbjTpx9AW/ok2xk8QahEDDrpLpPsbMYEADSIKw4 4AsABx7YrmRqq5w2ykf3Q0zW0DelbUYxSe5l8kTtesK3kKa4Aona4IIgi66YLqHgBBWJ YMFyfoNpuGWt9HjgLgmEwbofHwC3E8hY6G1jSF4MIPMaAl8iWCQesOgeUh8h5opvcTFS ojdg== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=FQQtLcvOL5Uhh+pkZeUVdpNZi7r3Cx1hBT5YuUpndbldrOegti5iYyWUpAjzNAt4/F Ynj8u+h1/WRZeRfUaJnWtHCkzNjw9jGaoxh+lszisssYiZGGBTwfayRVxBDp7pizUx4k n4Qox7ye2BDGcf4YikYi7wcYgcmI97rXpymfUAyG1WYdRL4rXFVHRMZmzJq3JLocYoBO 4UNBTRRVPqV41WP42XwdTRxzUN78235P3wDnwOL2DPfvHwYwPc9uC7JUu2G4llb3VbGL AsdlOZAFxCpjvOMMSqcGO5YHBqTheF0/zKg5DTd4eVtbM5LGmfeBVUreWqW0Tt53eidS jSrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KVQF/6OJ"; 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 az7-20020a05620a170700b0076dbb17e788si6477668qkb.721.2023.10.09.09.44.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:20 -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="KVQF/6OJ"; 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 1qptM7-0001W2-2p; Mon, 09 Oct 2023 12:43:43 -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 1qptK4-0005OQ-2D for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:37 -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 1qptJf-0001WN-5y for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:30 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32487efc319so4553146f8f.1 for ; Mon, 09 Oct 2023 09:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869670; x=1697474470; 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=KVQF/6OJtZAecL7Rj9FJcNABY7chR/mxJjK+dGdtIo0/03mTQADhHPyjiJGYdhXJgg pX+r2v2Z8GYmszKqIi44bOHSFBSjCFPe8yEk+v+gS3SRujX4TpQEnTIU6mnfJpaHicw9 U5f/ObeP+5fylPdSLGNVoHstdQNuvTdgaqw9qFm4Az7zyUgeD4Cf8Rkvi85Lg3oB/2it OEvBn/AzWmNCflgMe8bGLPxptazUF3oL8J09RZB0laaTFFkJoRajPanRSqBLembdEooJ WOdLm5wSTbxNqmctCr7AA4Y9rbOUn1nXEsJvd+3OmSnG7GPIE2xWG9BGC+VBsstTbwfn a88g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869670; x=1697474470; 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=Z6O+A14KFp07G1CRRABWBOI7SFw7WKEmsuvg6LYsORFc0jrcJPGNA+OFYHUEW8Spo3 yI0bc0aPFSJd+EPxqPgfmOrqNEsvZXF5j1t9Mmhc0MwST09Yi3QagiFIV4y+WL8YSU0a EMNjASzeQd5jd2wlc2+oEINHeHb9iIYPKsinoW+CObSbt9zIKY0iFv+DgOHejsD9p9lj 1x86TO8FttOHK1pMQ4TFyd7f5ftVYJdxkij+ME9UuwLuLmovwebr7ix0H9miE2Cd+wTR Kp2OPk32HewUeFnxXHvdXmcJUtmyaMv3v3ipKuo9lu7ZmAKwNV0LWc59hOD8b41cFt5h oFeA== X-Gm-Message-State: AOJu0YwuzmQDd40v5Kb61niXhqysgA9jS7efKGWP4xzdmPvkGroMtK08 5YyKgQerlDcAfs9MvV3se1TNoQ== X-Received: by 2002:adf:f845:0:b0:31f:e74d:c82a with SMTP id d5-20020adff845000000b0031fe74dc82amr13985515wrq.31.1696869669785; Mon, 09 Oct 2023 09:41:09 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t11-20020a5d534b000000b003232380ffd5sm10071994wrv.106.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D6C7A1FFC1; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 06/25] configure: allow user to override docker engine Date: Mon, 9 Oct 2023 17:40:45 +0100 Message-Id: <20231009164104.369749-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 If you have both engines installed but one is broken you are stuck with the automagic. Allow the user to override the engine for this case. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis --- 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 Oct 9 16:40: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: 731013 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312190wrw; Mon, 9 Oct 2023 09:45:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeZrbyUKLzuG97CJ4n/CKvZVd6EdB2gb9R5qD/SmniuZRt24zL4utaXT/QS/jtwh1teGap X-Received: by 2002:a05:620a:2952:b0:774:32f0:e2b5 with SMTP id n18-20020a05620a295200b0077432f0e2b5mr18972614qkp.9.1696869954635; Mon, 09 Oct 2023 09:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869954; cv=none; d=google.com; s=arc-20160816; b=xWGoUHp1z1AF28wIVLClE19Kmu5Dx2qEIHJBKLj1FIHfH92aO997PlRiymN8Aao+ht mUes7hydtFnaowwQZudXpZjMz4gu4ZRt+txCAM1GvK+kQ5zuwzDM522x0bu13FtuuEn+ tVAeJnCnYkESsZtF9Hc236khPP0Q0TqhPVtTypg6l82SiAdKHJZigABKjn437wnMegNG gWrEf/AFcL1P+kiEde7ICbTtX+tZKBfl/Jt4cn0tWcX9XTYkbghVuvC6QXcI6NMVoBSN 1hUyYmNbrMgojHpfvxfjOuuvc6x+azvjd8jrE1hOlOkBwWSKWRRdCsrNJMUop0IckESM SGqA== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=VyTIU/1nnz9j2qmbGVLDc8ADqCQmzocJNhXXei8wYknkr9/5MqSMyyiC8DACF+zrJQ p0gNV7t5mq01Xjf0eew/cWfJGNa8pzHWlPgXWsZATL9B3cOzHYPOG4mgjkfqASWwfMPa b04on1wMyT6+x02atkyyguxsLrDua55vajnJGKfI9HDtCsy9p0sd/CBjf0ALy1d614lw i2TSEYJK3Fi1AmzH1mmdPzsBgZtp+BfA3Ui2MCI7Qx17rFOfTZ1bnASc43KfAo54iC9t X0nJpMo4DHIMgUZQXQma2uSvEmVbD4sZsnP2ucc/qQDXYrWWW41cyUz5uC5L3V6eXLzH f06A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQ3BtYUr; 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 o4-20020a05620a2a0400b0076d9dc0bc9esi6311150qkp.230.2023.10.09.09.45.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:45:54 -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=nQ3BtYUr; 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 1qptMK-0002Dg-O4; Mon, 09 Oct 2023 12:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qptKJ-000679-Ru for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:53 -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 1qptJj-0001Yw-S1 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:51 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-405524e6768so46184235e9.2 for ; Mon, 09 Oct 2023 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869672; x=1697474472; 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=nQ3BtYUrsDG4eC7icXQBGSgYaktbDSljfKELum9im5SPogudEDbsk9EUI0fUWhBdgN ym2PlVAfk1UfgaEbUsV/efmx1hZSVBt7ujF5XWrkoCVMOt92y5R8lsEF7qJaAVsu9RWT ah8uuu+i/ciAWRwWupvXSynC0bbkJNoFvyAJ5C629FyEwxRVYKtT6cmuOeJnyE+uw6bn He4IWOdXSrMNTajrb/innpLulnZbnWpgHcjTGD33Tzy7hhq3482Geapt25L12uFyx1mw pQaptDZAJHHdPKyecrhjnzBbs+78x5WXbu1Ffbjht9SWwLWDN084rt8RSbkJ70P6pd3m KFZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869672; x=1697474472; 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=vqBLh4xWVOyu1iCIoZ6+Gew7mKCwlnkCpLtLoS6hE0RhpkM2i/8s9sbChe2YKTmKsb KHN+EdwzbE87utwP0KfucLqMXWqS1V8Ao1q+Q2mDQNb+1V+480oghKZwqS5Q6BvJtdJj WmXsMTcTJpw7f/4RplZz76wgkwjzKvVBDAJlK9QnJGFT6otLDwpti8Dlq11w00ByLexs 7y7CL1jxsr/81x5yZVP3my/l8KPBL11EBZOf2auivzwLVrS5E/AHH1pwDi+ZAiL8bFyD dW7VbOrCET3z3ohoOW2c4MR48MuJcN6dkNrzJaA2KGw9MxWcXqje6jpcYOtUXsBeydKM AIaQ== X-Gm-Message-State: AOJu0Yzeq1Us/fUofNBH1djzeh+mGePMqV02BOogE2kdP2+Y0p7hBbWs ttZK+6Q4IctVZA+F/zBRfMbdJg== X-Received: by 2002:adf:e8ca:0:b0:31f:e1b4:583d with SMTP id k10-20020adfe8ca000000b0031fe1b4583dmr15722756wrn.56.1696869671738; Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k21-20020adfb355000000b003296b913bbesm9541932wrd.12.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EF1351FFC2; Mon, 9 Oct 2023 17:41:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 07/25] configure: remove gcc version suffixes Date: Mon, 9 Oct 2023 17:40:46 +0100 Message-Id: <20231009164104.369749-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 The modern packaging of cross GCC's doesn't need the explicit version number at the end. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- 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 Oct 9 16:40: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: 731009 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311550wrw; Mon, 9 Oct 2023 09:44:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3BVvof+pqkiLQAHGGCueBjOfvIPbHKJVZ1G8W1hEbkiBtF+GpVcwimzBuadsSgmS0T6z2 X-Received: by 2002:a5b:8c6:0:b0:d8b:684d:afd9 with SMTP id w6-20020a5b08c6000000b00d8b684dafd9mr14541168ybq.63.1696869864360; Mon, 09 Oct 2023 09:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869864; cv=none; d=google.com; s=arc-20160816; b=qLkptCc/vr5vBcIaHEmDl6/7F+RWtNMJ1XLm5oOmuS/zJj3VsMf5qcm9z363XsuTk4 Ia2Oo0ynGcNpmqv3k9GRGw/BwI6qa7k1IYjkbiKiHz8VlZVQvJHMuD8u3egfBm1QbFTZ O8bAxyWLHdKSR++KXGVnLrfDRZPXzXGoPLWA0x+hUb/k9HtJKHslv57FAq//u356Wx72 9vFcFRGrJ4Z7a2CRztQ3WUZY/8c34TSrX0BERtfKiXDDJCfg/BjwJkFszilMwsEkhzrR qyfYlalWi5zcQ8FUA2bkLfP21QkIE4XBnrXEtKBB0XfzQkGd3P4ZSEMeD43ckX+BprOH PF5g== 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=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=TGnE3824qXH6ILo3YBAo5Sdjnez2ahhWAomy3BBiptApKnOpS1oWqhjEPXvjQvB+y7 ZdjDCwDRb24plyX9aDODhndIddL1oTIh4A1X3OQnRrA5XFaO/LSoXLdBeHMEY+no+gFZ DY1tdP6qh/jUicUwDv0eeCB/4MLDJAXZjC+56djEI/+2qRZduxFVDkiaDMx4KNRoA94E TDQdAoSX1dYXOa/hndjYoig6IbF+pQo8UJUaNsiI9dYCUEhCCHgOLN4ilAE6To7yySPg 074JlTMuxbAGvhqCgucptXmEaM8afd/ca+d6OCfqRe/lipYTlX9VB4KEaYI2+YH423Ua ZQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Td5guE2R; 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 z3-20020a0cda83000000b0065af0cfad9csi6370054qvj.44.2023.10.09.09.44.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:24 -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=Td5guE2R; 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 1qptM4-0001Iz-Og; Mon, 09 Oct 2023 12:43:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qptJy-0005KE-9F for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:35 -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 1qptJg-0001Wr-As for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:28 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-317c3ac7339so4333097f8f.0 for ; Mon, 09 Oct 2023 09:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869670; x=1697474470; 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=Td5guE2RPTMNdyZTQzZUcI77K5oCS1CwjUIA7yICrXN2HJqRdEzSZBLsE4HWTw2xbd Y/NX9X5jUJXURijIVTdrROB9O2e98JbwvSxTS4lTJ5aDOoa+fwV0h+9JjHeVUzZBxGXT v93E8QLzKm9rynwuT2mt+nkmXQouYgq7y5u1t4Hq9JAsvB4vl1WHJJQeF4wpZOi1ywSk xhF7L9uNJ5UPF/CzNG5LOvl8ksGFLg1oWeKF6jwSlRsPhpX+/taurfHM8JzJHoOUjFSE lF4+1X1z17fJRDh6QKQ45PiR5WxeR26WGtvlzYcv/3uDHD69SH0NnARr05DtsB5i0ElR npew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869670; x=1697474470; 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=u51i+UC7e6IXWeCWU6xzVK5AnvcubeR+hw86KHk5YZsWxbK9QPeLUJEhs1emcZidLE YexPeb/tGLRDAdyrjR67UruUu5IrROhR6RHJ547ivI4h8CB3SI+JDSH0PGRylikC3gTH SMEGLETDFV3wrHpHCyV8YMIIe8c6AH98qNHxDbw6ED39z47yEUeG4x5aF8lXOPshvb0U yQVEbZzbl7CmxYYyUiz9K5QlwTTf3dyOH7ghnZ/ICOQzxFAf//Sag3P3VDd/U3FQ3ypZ qJ4gZJo+Ar3e52tNxJrMTm0ICQvYg3dg9+SKxD5KkbeOLnYhiaq13UJExljOGvTrBKI9 39NQ== X-Gm-Message-State: AOJu0YwWkObD/WkFMIT2Vrg3RHaTsxs2uqwyrEwg96mNlkjuCjm1fMVj 84gmFo1Ea3OYDN295HDQD1WlfQ== X-Received: by 2002:a05:6000:12cd:b0:320:976:f942 with SMTP id l13-20020a05600012cd00b003200976f942mr14088178wrx.7.1696869670278; Mon, 09 Oct 2023 09:41:10 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d12-20020a5d538c000000b0032769103ae9sm10094218wrv.69.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 13F561FFBB; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 08/25] gdbstub: Fix target_xml initialization Date: Mon, 9 Oct 2023 17:40:47 +0100 Message-Id: <20231009164104.369749-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Reviewed-by: Alistair Francis --- 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 Oct 9 16:40: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: 731002 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311404wrw; Mon, 9 Oct 2023 09:44:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNbRFJfHM7JjcqVn9iA6flOT5BNnT3Vr4nebTDb6qyOLL1R6q6Z2IHyswvYpA2kMYm63y4 X-Received: by 2002:a0c:d98a:0:b0:66a:f5f3:87ed with SMTP id y10-20020a0cd98a000000b0066af5f387edmr8882668qvj.3.1696869847417; Mon, 09 Oct 2023 09:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869847; cv=none; d=google.com; s=arc-20160816; b=itlPW3+1djyPUfc2MTtoSzAmeJgj5R253jtScOu+w3kzpmFAJWfSidAknJF9Jtrkzo EjddADvnPH87Qyn7SSdpjJu39oXMRxZQWkdtIyd8Usuq88MxyhzL+nnZ99pMNb1WG6as uhAnPHezYxd6hbrOvCt62B1hoiFyTOgSZcETnohDGk67hurNU4olWtQd8wb6u6kHNJS+ 3bAro3tt1FMWBC/J4Z41ebPJkEocJmLQ/T9RV/bBEy3F+KIchd93yRcVdWPFfUQBSwTB HUparqbC6pSPz7MOkAWpSD098LCWGEQx9J9P2Y17+vlPB4zjL8QITZxu5WPYujWdUk5u 29Iw== 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=LG2NkApx4TVidHIbE463d0CCb2MX5UuJ0CO2x3DfXcM=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=col4s9Npr6YY4/XoXJ7EWUfk3Oaj4qiQbtd4IMIBLR6X2h6mJuydYgr5/arjc+7kQk qJkEHrw6z7HmnRHFv+wFcRvMceBC/aCV6Fm77DDAtdgLeAZaZvkyamclC0DPd1pWCUlP VaOLXjyAQb41+XaLPzDsytZU0+T0nmClS0p356X1lKm5Dqo1qdi/vV2gSg8IizcxYKXv Gwigweqs6k/xy2oAet29dVPmypDauYG+hrp/z1BgNumbOmWXB51ao95hxb8CVMvNZZDU +CobknQsbgym3IBV4rPgjWs88xhPsQlvZnLY/PQYA0IVVhO3oxwFtQWTHRtpT+DMZQvv GZvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VHPcBfdx; 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 g19-20020a0cdf13000000b00658b21e541csi6191138qvl.174.2023.10.09.09.44.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:07 -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=VHPcBfdx; 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 1qptLy-0000a0-TT; Mon, 09 Oct 2023 12:43:35 -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 1qptK5-0005Pi-0x for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:38 -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 1qptJh-0001Yc-Un for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:36 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4064867903cso47824485e9.2 for ; Mon, 09 Oct 2023 09:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869671; x=1697474471; 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=LG2NkApx4TVidHIbE463d0CCb2MX5UuJ0CO2x3DfXcM=; b=VHPcBfdx2L7ZbR58IPP7pSCrU/Nmybk9SLs6Ki0CEKuojLFfqOlYL23ZzZ7tqGQbCW /MAHfJugVKRxbeZzuWfGerDQtP/fZpMYvdS++h59+ZPRUcvPIBmza4MOvqRyPBBNkSCh UC/nPXejCTfGMetaocCKw4A1R44WBByHO+619EbgFZjtu39O8wORv1KnODf8jBXZ3P5X QTbVPCzmz3Pa3VNam5EVh2o6NdkKxMq07n6nL3EG4PugSXeHml9GhrnCJvEE0R1UNKPD hqxgrX32/MjK1oAuDZLjtpMVKQySnODoG2xnvm4t1YyZELgWdmvFeyXV1fGZu+IsFIiI xKHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869671; x=1697474471; 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=LG2NkApx4TVidHIbE463d0CCb2MX5UuJ0CO2x3DfXcM=; b=MhiJ5wyNLt1VVIYURO+bLuhYbKbBFnMaGk+EZSrMJnQhd1QGsdqd5356228s88OkGL LfcaZlIhpEv1ExCYbXgwGLihKTIXX7VrIIZpbex5uC2K28Pp+1Yk75faZHQGtjPQsKUo sY+axYLZi/lJqYRBYUTMMZ4o2NZriaHuxueFOnyuLr1RwZHC6IGHl4MFm33mjvzcjlVK gjTepVlQf+45h/fmOkPj9D+DUNL9rrTSpT4Cq5t7Vb2ssMnkeuCOtAjcH5pAkaZEdMky w5zJvdvO9ElN01oqPY8VoOzmpTgnj4AHQMIukd64OVGDoT2uU2MzVndZLH5sBOQMZWUd Nqbg== X-Gm-Message-State: AOJu0Yw7IW6QLuA/hM5G+lTZq9vvGzNVMVVHxXfq9yblu0+PzskzhWtJ jC3dKQTVeijjBtQEXbSrAE5nMA== X-Received: by 2002:a1c:7218:0:b0:401:d803:6243 with SMTP id n24-20020a1c7218000000b00401d8036243mr13668682wmc.32.1696869671310; Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i2-20020a05600c290200b004063d8b43e7sm13939902wmd.48.2023.10.09.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2BB891FFC3; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 09/25] gdbstub: Fix target.xml response Date: Mon, 9 Oct 2023 17:40:48 +0100 Message-Id: <20231009164104.369749-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 8eea21450c..4f3762fccf 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -396,8 +396,8 @@ static const char *get_feature_xml(const char *p, const char **newp, g_string_append(xml, ""); process->target_xml = g_string_free(xml, false); - return process->target_xml; } + return process->target_xml; } /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { From patchwork Mon Oct 9 16:40: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: 731014 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312642wrw; Mon, 9 Oct 2023 09:46:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeLBuiAwZgaNso0U2QcOEimzpxDHvkXqjARm55fQM5Of16vPWBsYBsNfOYmmr2PUQlYhG0 X-Received: by 2002:a05:622a:1755:b0:414:ed76:bea1 with SMTP id l21-20020a05622a175500b00414ed76bea1mr18028197qtk.67.1696870018410; Mon, 09 Oct 2023 09:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870018; cv=none; d=google.com; s=arc-20160816; b=Ta4o1LqkSNpW/h9QHrZ1CXKMUJLntpXKITTKeR9G6mTixf2WgqJycsgx5gGMWxc+EG G9J+WRRrFN3nCDSUuncN621K99W483VXgX0dWePhlMtpLtQmre0FvdAy2zH8GNaVwzBW JkHPH+RuUC1BLasbGOtpxv2i4UPWE4VIGglOrkKFn892w9vH707cZ7XTw7tU0GJWwarh EqIwJLgihc338+ZUPgUaJH2K2/uecUM2UjkTA2OOMC7hrfU4VyN0uJKYJI3niGcQIbEX UYWl82WGyW6kM2DGyE5Z3t5WxQThCr2A5CB4s0NUk8t+BBFbXpphO/PFI26mMRtsyLOF OLEQ== 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=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=PVCGO+GLU3cPlUPXq5sjhV8+n4MllrOiaUNTbMJmZoddyW4HSDSf1FHOl9JUJvW+Q1 ekODF+zjTS9dWChEbAAPEc4C1lSMwRWlUW7EgNJb2HtTr0btth8qyIoSAGamYNY+CCCA DZsHIpp/seIltMzqJGSsbsBY0W4sEt82bILP+jUcjL1crxI5uco3e2L2WXLvYutZ0SrU 5nlSP/mKaqdRkOleMP+85UOt+Ik2jFJzM2rb4QM0QUDwJZllwpLvSt3LykdPu+I9TvcN TKfuAOmsFZPlb5clcuRW01oDBfLHV10zf9KLG9k/nkncCHDWaP7VksPKOHiqMz9dovqv ItRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rErH+6+0; 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 y15-20020a05622a164f00b00410d321b143si6296212qtj.620.2023.10.09.09.46.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:46:58 -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=rErH+6+0; 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 1qptM1-00011Q-Px; Mon, 09 Oct 2023 12:43:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qptK5-0005QI-Nx for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:38 -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 1qptJi-0001Ym-5G for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso47858485e9.3 for ; Mon, 09 Oct 2023 09:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869671; x=1697474471; 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=rErH+6+0l/ISFuO0OexmgT1kCYMLzyk65gpd9n3pBI2bxbkWccpqEpVWDYZ2Z66eCM DeJS4iv3CwGTaPrlLICCVZp+7wky0ghFr/JoqMQmbIjIsv4gcDeHP4ZhWvMhNSyZ7P3n 4DPadmPvsxlVnAY7BDQ5EpHlgEgmfJBaaxu397FHI8yaRYoeIZjqbwRL0KteRr25/vMw TgFEgeTwceDmGtIxlyyllNt5li2bxObLvWYAzQlktW2K2JZLkawQ2Z++cFPZFDgjP1hH KTH4qg0+7H4MJs1d3dHCXHbPZkbM1qRQYa+TDuy5CO7RShUMl27qjVRsTqu8YXM3ZytX XizA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869671; x=1697474471; 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=TYGL2NThFMp34Vay3hhckFzxNc26+hBXcz2YmzpJ+VHkgbsrMZXQQC7vg4Mc0n472j pXXNfWEqnneQOVNQrwemIjh5xGWvB7OnR5D3CVpLyWhZFuln0CEk30FNyMFNtVg3Iawd U9EV7EwXvDPV1z2i7SI+lvCRM7D0klZ2n5NfUjgBoC76ArKgYRz0U+5ftwIDsHNXL/Zj dmbHqW8X+fz3q2ZLUQBh1+bzeyLVLQfjjNKoB7LjoaCSL+2Dwt1jrKizNewW6zL1LUwa Ozi/JuiyZpLuwfMu8l4sJ3+gXTWmPO5AH3x2qSQHBG5+yEZvUEMNypZPR6+6elZRQNaH RhRw== X-Gm-Message-State: AOJu0YxFnCbKkn8WLCp7RUCni+UMEXiuYosZvM17iXl/+O0kb0Q5yjry G4s1qj1dIS3rxuL7dS+B7z/Wsg== X-Received: by 2002:a5d:4d8c:0:b0:323:36a3:8ca with SMTP id b12-20020a5d4d8c000000b0032336a308camr14258615wru.28.1696869671541; Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n20-20020adf8b14000000b003296b62d413sm9694532wra.82.2023.10.09.09.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 446EA1FFBC; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 10/25] plugins: Check if vCPU is realized Date: Mon, 9 Oct 2023 17:40:49 +0100 Message-Id: <20231009164104.369749-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Oct 9 16:40: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: 731011 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311738wrw; Mon, 9 Oct 2023 09:44:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCsH0uIwralSrtU5gh3T+/WO2yU+ByRXfszKRG7xtIh6L3jle1wtX6uKGWXc10Q3gj8nn2 X-Received: by 2002:ac8:5c82:0:b0:419:5c43:9d1a with SMTP id r2-20020ac85c82000000b004195c439d1amr17468084qta.68.1696869892926; Mon, 09 Oct 2023 09:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869892; cv=none; d=google.com; s=arc-20160816; b=JLdKZvTkNu5qrQnvl0fZbxoTjYxYb7UwNp9MbQkJX4gMfXlnAXfk9aBvSWUBg3p5xf +9ElaH7FCbDxspUU2L23eREHJw6p0XO+aAtUyFRr3qpe8y0bYqKObNt8quTGcasDAo5Z xGfoUb+YeRRP+DSjNW8D3QHbDB2WgFxDPXhDIumme6JldYmYylXowvEzrfKk+dz7Zf4H MZLc7deOuHVwYZbauzADlZsCLq8v0GdZht3JjRHedINCD3HWpRnwA9TJ8r/sKME+n9Oj mPxDhAfwvplBmdyFl9Ii/+MJkB1+Tjmxvx2+MbnHJ2vmyc2bRkWvCMUeNnT3wn1V865e fCQQ== 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=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=MsEevvOXjhbjk3ncZXKm+1JJ9z26xhBWXsaiyPmyKvFnuN7UDhLjgXjJiNy7OjO0QV iPffDwnBnd9UngjLwRaovK67zjIll7sRsvi+Sol6lWjFBGhiaufM3wzVApDgQ/a3jON/ 9VqpXRQNOJGKFk/UjbWrSz0Ri8zG7n/nWt7K2gJrFPin0BAPb1S8kCqaCzGTDH2IYQce uIvKL2/RD4N00ttsa1TMqEWLAkd6Rgtc1jH+4/T6hXYOAEYxCtrQ6sAOMwR1mGbuLepo cjNUwXIpwPyuCygqSPvT0jVGYe+fe2BZKWc7uCTSTWwYS9va/M/s12VU3t79SvhyUV5B RN8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=impcdhpO; 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 y9-20020a05622a164900b004199048a43esi6426224qtj.219.2023.10.09.09.44.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:52 -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=impcdhpO; 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 1qptMK-0002DX-Mw; Mon, 09 Oct 2023 12:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qptK8-0005WY-BJ for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:40 -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 1qptJi-0001Zb-GH for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:40 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4054f790190so46130775e9.2 for ; Mon, 09 Oct 2023 09:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869672; x=1697474472; 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=impcdhpOyXeD8kWDzSueYCXvqsGMhfaFS7Yu4M+4j85kacwo8pqAXh5WnWYxRwkQon Q+bvg1eJsLCH5BIq3HS9Wb/Jq+uEz41OOSVhcGBgdI1DC3juMkeXEcHEMgJBs99Kggbi qx4H7RB9d5lTvGm3ycBaXbRe0rKZj/Ir3SnNKL2j0mTXAy52hMKBR7+NlVOVlUyB/k90 zIuAhi1f/IleJcF9CgWfwP47MVe3+p7PY3u2lSXLkVCGEkLfzV5LJvGakmiHgNJiGivW 0BXXt6zhBr1e+c+2SB7yjGnt1LQ+2oJFiLwTPslgw4PHx0kOTmFC+9Wi88o5ePouiRba wMfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869672; x=1697474472; 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=TteLTHv8NVuQvZv0i+mHCr7nbtYiE2RUoTluKFDjJbXXDEB3t86jpZRJDSRn2l88h2 LmKNxyCgaXpxGP5GcIX6k3hk72ZoaTRULZm/tLNgG8IuYlEyQcdF7HKz3xdE9VEvcmXA NnOsRz9fR6OZoYfQWkYhlyb56Gz+UGbr9urU12/b494mxF7mGV2+D9iyeEfQruw4wM0p 4CgUcHl6fnLufSCiHeGTaYEhH8ZXx8CzxMLN2CGqdEcdWYN8+aSZFp2HNLu6gkoqGfrF 0umHL1Ex379HkNy8LPmn6Pt61Q1YaFfDF2WyIChYuYwuu6K5ycJZ8nuBtE/+Rry8rjIG AIcQ== X-Gm-Message-State: AOJu0YxmKEBdVsQPELEXOzqoJ0M5OQ7gkBsbY2+qK4m1BogBaqxtzcJN dcNSA1YBD4lcLzO+pikSXGRVLg== X-Received: by 2002:a7b:cb8c:0:b0:406:517f:ac71 with SMTP id m12-20020a7bcb8c000000b00406517fac71mr13937205wmi.29.1696869672593; Mon, 09 Oct 2023 09:41:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a4-20020a05600c224400b003fe2b081661sm13974906wmm.30.2023.10.09.09.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5CE991FFC4; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 11/25] contrib/plugins: Use GRWLock in execlog Date: Mon, 9 Oct 2023 17:40:50 +0100 Message-Id: <20231009164104.369749-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Oct 9 16:40: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: 731012 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311818wrw; Mon, 9 Oct 2023 09:45:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+xqSLSJAOX7SWDPHIxyjSjSUUQhG2xYIyyGxVZTbHcBRZkxRF4jbvsFbEZwaG5lZSVxBW X-Received: by 2002:a0d:d54f:0:b0:5a1:f0f8:4280 with SMTP id x76-20020a0dd54f000000b005a1f0f84280mr17075228ywd.22.1696869902520; Mon, 09 Oct 2023 09:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869902; cv=none; d=google.com; s=arc-20160816; b=Jp61RDDS9W9CZJALhG3WVIXuJAeVhJ0aZrknfFr+p4Ny9/fptbcNSnm41HBe+PH1QU e63cx2ZrmavQ490jbgCSI6ffpS+VwEOqTmPCrz7Owde8DBPuHkgeHg7LWERFG+XOxI2U /WS0sgj0PXReeVqSRGfGPvKQnmxob2cFUcTFEON0ew8WeIFRoT2S3ZrxpY8Qoa8RXMKP JJh5XrMQnPU2k2rvECRSA13wZ0TpNhQNcrcYz1p5CcrICC5DRE76x0Ri8Wv2XbqKAkeG YoI3ULXPCGw9PdmK2/Q1rngD43faVFnPWyaoL8T8Eu9sahYrH0sfkJqsP4DAQ/7APFc0 lCLA== 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=AWA+klmfy/TO5hWaoCvOZgcBSQ2FgQ8iT7JhCCX/n5c=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=pop8OuCX8xd9GtkmQoQRrFmkMfMPDdKfpZe+aBA/DXZXUB4WBCNV+PgiYedteDccIG 6ZxKGejP+8Zp88Yl8bi6F7j3kOGnl/8xq3gFYg+QZL8K+vO3eWdUZnSx/Cwa3r8Ze6Mw JnIpUWeSxL6J2A2uKROIdrySqV/8YYKM1rNh113B9dMxREsDfdTRbaZaPiovGsITz8bP Jg32fkMfMNEicSvKkjSciua9gUYF6jrj+Q5KD5UD4tSYi21T+0962deDoS9/OVaauXRz Pg1oRhKFYYOGWCvTGAi+lWr5hretzjr5SAO/LhNYxAuHkvJNR60uCCC+TGD+GHB9TAxD o5mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kDIxXYYs; 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 f8-20020a05622a104800b004198cd716a8si6207770qte.276.2023.10.09.09.45.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:45: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=kDIxXYYs; 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 1qptM3-0001H6-Gv; Mon, 09 Oct 2023 12:43:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qptKH-00064R-Mc for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:50 -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 1qptJj-0001b0-Q9 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:49 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40572aeb673so46084125e9.0 for ; Mon, 09 Oct 2023 09:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869674; x=1697474474; 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=AWA+klmfy/TO5hWaoCvOZgcBSQ2FgQ8iT7JhCCX/n5c=; b=kDIxXYYs9DPP4a3eQzE/wyi4bki3llBOu8sDpq9GRUPgYwVeCK8THzArnbfpTsRdQI zESHqU9YJsqANpKp+dOpgNjg6NnzUoQ1nedJ36SH0XzIIXncE9r8XR7JvqWh2gpHklS7 eebEBywKCBTcmWNS5/FSqwObCFBOojXURnnC3Kq2MxQkLi4odRVFnmI3mXlBZ0N9rB/Q JWIP6j0Y9+dl3T4DRZ1xmFxg1B9xY/84jHyNQf1sv3RA5adP90q9Ev9GJTKUf0g6274g iX7URgM+GB3LLOu10ho2GxJeD5Jmx5CbVww0QAmAff4km9cTGvqoAnLrAAmzyEGZrieH xU7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869674; x=1697474474; 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=AWA+klmfy/TO5hWaoCvOZgcBSQ2FgQ8iT7JhCCX/n5c=; b=TKQhLWR1C6nJovKfeoQrnkUxMZDNxIKUlqZOUnK1sgz7VyC7AN4Mg5RV7qTobQoGMY /S9m8xBvFQ4hqZIevHyo2DbxF+QaRYCXOu7AWRxQ7q9Eg4gE7Ige4MZwfULhP9Pw3eyN eDSTFivSqUdBUVfeXDN25ZJ+ogm4A4Be83YpUAce7dHpeCYAiKVi5Wi3J1E400qRiQK8 H5gX9yiHLJvxPo+iwlTFHOyrhSYnS3UMELsCHuJOVIZRt2q1GzgVPpAZxg6gFI8ZAsNv OVJ+5wWSexpoYNws8U/m0k1w2+4o1U4fQQhALneCsEbm1/8oXmPy7+u1GO9ySFMq5fRk ou3Q== X-Gm-Message-State: AOJu0YwpZWr9PefYpTH3efVDOuI/lDhT/Zbsv6Cvdnh8VNCblcXN6gyS nMxB7f7O431ZrAe7LYoAJ0BygQ== X-Received: by 2002:a1c:721a:0:b0:405:1baf:cedf with SMTP id n26-20020a1c721a000000b004051bafcedfmr14386876wmc.24.1696869673801; Mon, 09 Oct 2023 09:41:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v5-20020a05600c214500b003fbe791a0e8sm11713158wml.0.2023.10.09.09.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 849FE1FFC5; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 12/25] gdbstub: Introduce GDBFeature structure Date: Mon, 9 Oct 2023 17:40:51 +0100 Message-Id: <20231009164104.369749-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 ea91f9e804..0f421a0a03 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2836,7 +2836,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 3bb64b536c..9f4c4f2f1e 100644 --- a/meson.build +++ b/meson.build @@ -3693,7 +3693,7 @@ common_all = static_library('common', dependencies: common_all.dependencies(), name_suffix: 'fa') -feature_to_c = find_program('scripts/feature_to_c.sh') +feature_to_c = find_program('scripts/feature_to_c.py') if targetos == 'darwin' entitlement = find_program('scripts/entitlement.sh') diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 16a139043f..705be2c5d7 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -10,6 +10,11 @@ #define GDB_WATCHPOINT_READ 3 #define GDB_WATCHPOINT_ACCESS 4 +typedef struct GDBFeature { + const char *xmlname; + const char *xml; +} GDBFeature; + /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); @@ -48,7 +53,7 @@ void gdb_set_stop_cpu(CPUState *cpu); */ bool gdb_has_xml(void); -/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ -extern const char *const xml_builtin[][2]; +/* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ +extern const GDBFeature gdb_static_features[]; #endif diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 4f3762fccf..bba2640293 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -408,11 +408,11 @@ static const char *get_feature_xml(const char *p, const char **newp, } } /* Is it one of the encoded gdb-xml/ files? */ - for (int i = 0; xml_builtin[i][0]; i++) { - const char *name = xml_builtin[i][0]; + for (int i = 0; gdb_static_features[i].xmlname; i++) { + const char *name = gdb_static_features[i].xmlname; if ((strncmp(name, p, len) == 0) && strlen(name) == len) { - return xml_builtin[i][1]; + return gdb_static_features[i].xml; } } diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c index 2b7aee50d3..580e20702b 100644 --- a/stubs/gdbstub.c +++ b/stubs/gdbstub.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" -#include "exec/gdbstub.h" /* xml_builtin */ +#include "exec/gdbstub.h" /* gdb_static_features */ -const char *const xml_builtin[][2] = { - { NULL, NULL } +const GDBFeature gdb_static_features[] = { + { NULL } }; diff --git a/scripts/feature_to_c.py b/scripts/feature_to_c.py new file mode 100755 index 0000000000..bcbcb83beb --- /dev/null +++ b/scripts/feature_to_c.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later + +import os, sys + +def writeliteral(indent, bytes): + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + for c in bytes: + if not quoted: + sys.stdout.write('\n') + sys.stdout.write(' ' * indent) + sys.stdout.write('"') + quoted = True + + if c == b'"'[0]: + sys.stdout.write('\\"') + elif c == b'\\'[0]: + sys.stdout.write('\\\\') + elif c == b'\n'[0]: + sys.stdout.write('\\n"') + quoted = False + elif c >= 32 and c < 127: + sys.stdout.write(c.to_bytes(1, 'big').decode()) + else: + sys.stdout.write(f'\{c:03o}') + + if quoted: + sys.stdout.write('"') + +sys.stdout.write('#include "qemu/osdep.h"\n' \ + '#include "exec/gdbstub.h"\n' \ + '\n' + 'const GDBFeature gdb_static_features[] = {\n') + +for input in sys.argv[1:]: + with open(input, 'rb') as file: + read = file.read() + + sys.stdout.write(' {\n') + writeliteral(8, bytes(os.path.basename(input), 'utf-8')) + sys.stdout.write(',\n') + writeliteral(8, read) + sys.stdout.write('\n },\n') + +sys.stdout.write(' { NULL }\n};\n') diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh deleted file mode 100644 index c1f67c8f6a..0000000000 --- a/scripts/feature_to_c.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# Convert text files to compilable C arrays. -# -# Copyright (C) 2007 Free Software Foundation, Inc. -# -# This file is part of GDB. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . - -if test -z "$1"; then - echo "Usage: $0 INPUTFILE..." - exit 1 -fi - -for input; do - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - - ${AWK:-awk} 'BEGIN { n = 0 - printf "#include \"qemu/osdep.h\"\n" - print "static const char '$arrayname'[] = {" - for (i = 0; i < 255; i++) - _ord_[sprintf("%c", i)] = i - } { - split($0, line, ""); - printf " " - for (i = 1; i <= length($0); i++) { - c = line[i] - if (c == "'\''") { - printf "'\''\\'\'''\'', " - } else if (c == "\\") { - printf "'\''\\\\'\'', " - } else if (_ord_[c] >= 32 && _ord_[c] < 127) { - printf "'\''%s'\'', ", c - } else { - printf "'\''\\%03o'\'', ", _ord_[c] - } - if (i % 10 == 0) - printf "\n " - } - printf "'\''\\n'\'', \n" - } END { - print " 0 };" - }' < $input -done - -echo -echo '#include "exec/gdbstub.h"' -echo "const char *const xml_builtin[][2] = {" - -for input; do - basename=$(echo $input | sed 's,.*/,,') - arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g') - echo " { \"$basename\", $arrayname }," -done - -echo " { (char *)0, (char *)0 }" -echo "};" From patchwork Mon Oct 9 16:40: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: 731016 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312859wrw; Mon, 9 Oct 2023 09:47:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGicSv7xGRNVPqjohwlAaGttLTYRW3abSTrUZxnIaE5rwMdRny1sfyT/5FVixaaD16Qi2ot X-Received: by 2002:a05:620a:6a84:b0:777:1d46:fd4a with SMTP id ud4-20020a05620a6a8400b007771d46fd4amr1276771qkn.29.1696870046287; Mon, 09 Oct 2023 09:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870046; cv=none; d=google.com; s=arc-20160816; b=LBHT+3LMvxhpx8MTlEHwDtrjRQti5dEH5lzGos/iPf9CdSW4ecxaef7BJ5pAEMKXAN IMih2fEe7FITWmyzPwjwU843J3N3ciiFD6q5X58HhIJzdntu2sD+vyYRrlrKDXhGZF5s e8zUJM+IUCTqcVEiKpL+IN3qDDVVq6ArD0beRnqGK+lXwb5wICfW1AoqFFph2uKqs1PK 4rwy/CWDJq7Q8ln/yD8wjglzoG06vlydtZ5TUrPELTISFJLCw3pJoDYWG9lmirnwV2Sj RUTMlf8RLZgObS3+RGO9RZVDReKb9LnipE/FkQ2IT/tG6IV9IwSILZ94z5OUFGEw6Yox GP4g== 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=BxLMY5+XDlEqW//GnK/X2YXdg2+UhZNarbeVkfRpn9o=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=MC4bYbCxdpVeWn2aH/YXxzRQkxVNmr8GkTl3/dTKVSO2KoS4S1iACNtiv7pS5tiVfg 9SApD6y4sgtLOA4xtF/psNamBAAsJEo95xyFhxxjLndAJYxxwzZyX5RK0O1CQ3Q+4p7r Pg0nAoM5zbTz4sp63yaDREQpaLMDKTiPfDHnKF3ol5cQcYcEK1Tu0+8Y9TydW1aO+UM5 P7fo9JlnN90FwXD23N5S48voSbzYzc6D++M+8y8AVEDGVeKXaCR3Rn/nwAsRaR5kxXMa KKRQ4r9GOIHFFDuS1S052NGAcC3HcEWKlQKpHZtCuZUgvQvZxF/5x6XpOm9TdKgiaab5 lJig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ngrkyp0w; 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 s2-20020a05620a0bc200b00775cab41f38si6240421qki.79.2023.10.09.09.47.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47:26 -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=Ngrkyp0w; 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 1qptMO-0002Ry-V8; Mon, 09 Oct 2023 12:44:01 -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 1qptKA-0005ed-9i for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:43 -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 1qptJj-0001Zq-Ag for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:41 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32799639a2aso4705625f8f.3 for ; Mon, 09 Oct 2023 09:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869673; x=1697474473; 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=BxLMY5+XDlEqW//GnK/X2YXdg2+UhZNarbeVkfRpn9o=; b=Ngrkyp0w1ib/WMYkG6Luw8PlnOwYhwT1tT3fyV/R22vGjWXmfTHps9FBL8V9PYMrDv LwBOdbm8NY7l+NcgtGFbd99ev037qDQbG3ZO/wG6z6C+b+7ZM3Ed8CRglEOxJJmroRNS UhzFejCnY0A8/DV/3PBbMGg2HhCrcsplz4DLoBHpkL43Iy5eBRU5k59VsuDJzUkMsNzw 5d6LyEfd1x+wq30VpMk4tSeN6MBSunesoD2+p0e1IqC5esyRoAxDIKYhmP22wBQ4KMCe 6jM4Xg8sjOqDOUVrOA7ScKHRrO6u6Ke82l9XvwaMArFtgw45EEoZdUSjiplgnrtxmM6q DoAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869673; x=1697474473; 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=BxLMY5+XDlEqW//GnK/X2YXdg2+UhZNarbeVkfRpn9o=; b=bAiPjLCn0xMNhSlqJQtbKr9tKA6QshuSDcKbOD/ayU3M7Oau1YjRzMiPLgNRKSKLU5 uZ3yqgIZO1Vsbz7Hj5w656K3y9HMpkzgHYdw15CLSsvOR8B4schPGj0WAfvtPWtw3Rd0 CF+YwZWTr6+3XyHrKVtnZlpZOwytJJF3tTHKKetOHkPX8l6R7hJgPJ/QunVq+77y1Xm6 Oe1nAcTPNvpxtMy7pkrxojznbZUP9eSxOcBhvzy4EpLA7YUgeP+yQnWVxpOuK/osNKSE S2+Ro+dxnBYxnwOXd7ACMApkcRpQ1vyaChYYeol3tkjO+uowhUlro+z1S2ZSlw0hbw03 URlw== X-Gm-Message-State: AOJu0Yz1MUsmZ2F1DLcGI5nnmdVLqTiyUTJEQl199B1SZn6ytSi0lgFk FDSyxX67HrQwG0oytNUOdG3BOw== X-Received: by 2002:a5d:4dcc:0:b0:319:785a:fce5 with SMTP id f12-20020a5d4dcc000000b00319785afce5mr13247438wru.38.1696869672794; Mon, 09 Oct 2023 09:41:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t4-20020a5d6904000000b0032710f5584fsm10040929wru.25.2023.10.09.09.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9E32D1FFBE; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 13/25] target/arm: Move the reference to arm-core.xml Date: Mon, 9 Oct 2023 17:40:52 +0100 Message-Id: <20231009164104.369749-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 831295d7cd..b65e8cfea3 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2392,7 +2392,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->sysemu_ops = &arm_sysemu_ops; #endif cc->gdb_num_core_regs = 26; - cc->gdb_core_xml_file = "arm-core.xml"; cc->gdb_arch_name = arm_gdb_arch_name; cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; @@ -2414,8 +2413,10 @@ static void arm_cpu_instance_init(Object *obj) static void cpu_register_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc = ARM_CPU_CLASS(oc); + CPUClass *cc = CPU_CLASS(acc); acc->info = data; + cc->gdb_core_xml_file = "arm-core.xml"; } void arm_cpu_register(const ARMCPUInfo *info) From patchwork Mon Oct 9 16:40: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: 731004 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311414wrw; Mon, 9 Oct 2023 09:44:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGh7bqqlqdxBn6CA3OxLf4ySb1P+4CB6WVWoeAeRaVc2GPLFexLz8yuOHEmJ6Uh9q7FmFJt X-Received: by 2002:a05:622a:1884:b0:417:b975:6d8a with SMTP id v4-20020a05622a188400b00417b9756d8amr22748551qtc.56.1696869848064; Mon, 09 Oct 2023 09:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869848; cv=none; d=google.com; s=arc-20160816; b=fAA2WMzqvkJ+b+XUzu7KE0JVfm3ZKHGIBSANLmE2YKQkH76WRc8ciweBgevS94GAg+ E5mMXxenRUcvxipb6KFSI+ZcF0gNHJY+lSzEjWOz+WcHsi6vtyCc/2y1Wrt9YPsfXurm 4eEpbaJS9pHwo+wjcVRVR8MB/TKWcycYpWSqoimV3ShBwyg6eiS31NjQd4TG8ed/Shfh SoVOBGeC7BuRzNaueAykZSxJEhbk8LeCXHSxUu3T05i2qQuj50cq6miBsSqm8Tak3y7k RRwKjCNYje9srn5dAmkmVgzC88C4V8nLmNvGrMOoDxvdxrbVi3FTvn31k81w3Fel9d9N AbFA== 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=79/ddUYEUYvbsVTAV2nrXlWuHSUapXRbRAScP3KzMf0=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=tOs7wiDJVe1Q1iNFAGWoouT5YIE9xC6F337EY/giO3quiLIkAGY2muhD5VDddBWB5G SU9R74XIFgn9KzQBQ0emF4tiUKCUIja9ZKLb3nGC3cctBGzXd4C7swdTNcWMlu+uq//I 5/vn527oyzQbD3BqZPC4CaSWI/ypnKa+aYFeyYqTp1aDVZP88bRBfzmBAkDE4MmTuiZv MFHXBjlbBGM+GmpeXxB1yF6B17pEd19esjO4EgBkQLuEKViTMw9h/FHdl5IRfdjm/yg/ nlhbQAQYQEjceVD3RV95Psd6YgVx8vOHS1/ZDxFifmTweF2yutD3MbDuLhcQZPiFbaQg IKig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AfAttVuM; 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 m3-20020a05622a118300b0041792b0696csi6340002qtk.334.2023.10.09.09.44.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:08 -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=AfAttVuM; 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 1qptM0-0000m6-7Y; Mon, 09 Oct 2023 12:43: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 1qptKC-0005iz-1j for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:44 -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 1qptJj-0001a1-B2 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:43 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40572aeb6d0so44804095e9.1 for ; Mon, 09 Oct 2023 09:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869673; x=1697474473; 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=79/ddUYEUYvbsVTAV2nrXlWuHSUapXRbRAScP3KzMf0=; b=AfAttVuMAMcO1PwnzYCRXuMbFPCn3tmN0EP/qo2k+tmfQ7UTHUZdr+mnqI2YmpU6Y9 k6z6T5q6JWpkKQtl7IkwFOaqvcXYvKTlefyK1FpZCPdjI/JjTYHrLt7BxJOdwQrvAQBu YnUZR50TVu505VB/zUiwBF6K8rCZ62NuQV8offj+GtJveTj29BWTsMtK9nhbETVo3jUv RFE+ul6/5naTQyhDQhPhMu1hpjlRUbN5lu26J0Nmg67kLAZECSQsjEMp7GfVK+SczslX 8jXUSqKb4Wzsp1+n1F8rn6zb2mmaWVgt7A7L2Nvk6IDppykUTLHT1kdWpZbMsWJ8L1xK JCsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869673; x=1697474473; 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=79/ddUYEUYvbsVTAV2nrXlWuHSUapXRbRAScP3KzMf0=; b=dCkFY3fNugdeAdcDwHFYxJc2dvQNYKwUwh1zkCJCgbTS2U0dvec9Yq3nEBMs17sSNc rsjSuLnRi9loBRWiUqCeZpbCg+X4uyMk43V37r7NhnwBtCxvEt8+oVgKpeLsANodo2J5 U9hCFr0qoe36jZ29USsgMZhdSTF2V05mNbrVcMs9N3Ai3y0IYpdsvHQwwEEO9BVsyFFC 1fJv1UZj/hy6VIjnMLPW3Vrr9ko3fViUeFWDnoAZlC0Gsw9WtLwxXMmeYZVWcSgbAw40 k+6NLO0BMtwiQG+HPeaG9yIVx9tHvitdtzda8MT+2uKB14yG7vHJlzvsjwmIRxWzTV9k 6QxQ== X-Gm-Message-State: AOJu0YxNv8kfwS2OBtEPi5RtIFB7j/Fh96y4FraMB8X7/h8NlE+xP8fT WE92DcG2BTRkxRpMPwT31Xkbeg== X-Received: by 2002:a1c:6a18:0:b0:401:eb0:a974 with SMTP id f24-20020a1c6a18000000b004010eb0a974mr13658071wmc.3.1696869672980; Mon, 09 Oct 2023 09:41:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b16-20020adfe650000000b003266ece0fe2sm9994397wrn.98.2023.10.09.09.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D11671FFC6; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 14/25] hw/core/cpu: Return static value with gdb_arch_name() Date: Mon, 9 Oct 2023 17:40:53 +0100 Message-Id: <20231009164104.369749-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Reviewed-by: Alistair Francis --- 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 e02bc5980f..7b8347ed5a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -165,7 +165,7 @@ struct CPUClass { vaddr (*gdb_adjust_breakpoint)(CPUState *cpu, vaddr addr); const char *gdb_core_xml_file; - gchar * (*gdb_arch_name)(CPUState *cpu); + const gchar * (*gdb_arch_name)(CPUState *cpu); const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 15803bc313..c881c67a8b 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -221,7 +221,7 @@ void destroy_ppc_opcodes(PowerPCCPU *cpu); /* gdbstub.c */ void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *ppc); -gchar *ppc_gdb_arch_name(CPUState *cs); +const gchar *ppc_gdb_arch_name(CPUState *cs); /** * prot_for_access_type: diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index bba2640293..a20169c27b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -380,10 +380,9 @@ static const char *get_feature_xml(const char *p, const char **newp, ""); if (cc->gdb_arch_name) { - g_autofree gchar *arch = cc->gdb_arch_name(cpu); g_string_append_printf(xml, "%s", - arch); + cc->gdb_arch_name(cpu)); } g_string_append(xml, "gdb_core_xml_file); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b65e8cfea3..6c6c551573 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2319,15 +2319,15 @@ static Property arm_cpu_properties[] = { DEFINE_PROP_END_OF_LIST() }; -static gchar *arm_gdb_arch_name(CPUState *cs) +static const gchar *arm_gdb_arch_name(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; if (arm_feature(env, ARM_FEATURE_IWMMXT)) { - return g_strdup("iwmmxt"); + return "iwmmxt"; } - return g_strdup("arm"); + return "arm"; } #ifndef CONFIG_USER_ONLY diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 811f3b38c2..1cb9d5b81a 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -781,9 +781,9 @@ static void aarch64_cpu_finalizefn(Object *obj) { } -static gchar *aarch64_gdb_arch_name(CPUState *cs) +static const gchar *aarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("aarch64"); + return "aarch64"; } static void aarch64_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9fad31b8db..c09bab4281 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5915,12 +5915,12 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) memset(&env->user_features, 0, sizeof(env->user_features)); } -static gchar *x86_gdb_arch_name(CPUState *cs) +static const gchar *x86_gdb_arch_name(CPUState *cs) { #ifdef TARGET_X86_64 - return g_strdup("i386:x86-64"); + return "i386:x86-64"; #else - return g_strdup("i386"); + return "i386"; #endif } diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 2bea7ca5d5..ef1bf89dac 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -766,9 +766,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) #endif } -static gchar *loongarch32_gdb_arch_name(CPUState *cs) +static const gchar *loongarch32_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch32"); + return "loongarch32"; } static void loongarch32_cpu_class_init(ObjectClass *c, void *data) @@ -780,9 +780,9 @@ static void loongarch32_cpu_class_init(ObjectClass *c, void *data) cc->gdb_arch_name = loongarch32_gdb_arch_name; } -static gchar *loongarch64_gdb_arch_name(CPUState *cs) +static const gchar *loongarch64_gdb_arch_name(CPUState *cs) { - return g_strdup("loongarch64"); + return "loongarch64"; } static void loongarch64_cpu_class_init(ObjectClass *c, void *data) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 2ad11510bf..778ef73bd7 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -589,12 +589,12 @@ static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 0; } -gchar *ppc_gdb_arch_name(CPUState *cs) +const gchar *ppc_gdb_arch_name(CPUState *cs) { #if defined(TARGET_PPC64) - return g_strdup("powerpc:common64"); + return "powerpc:common64"; #else - return g_strdup("powerpc:common"); + return "powerpc:common"; #endif } diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ac2b94b6a6..f5572704de 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2004,17 +2004,17 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static gchar *riscv_gdb_arch_name(CPUState *cs) +static const gchar *riscv_gdb_arch_name(CPUState *cs) { RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; switch (riscv_cpu_mxl(env)) { case MXL_RV32: - return g_strdup("riscv:rv32"); + return "riscv:rv32"; case MXL_RV64: case MXL_RV128: - return g_strdup("riscv:rv64"); + return "riscv:rv64"; default: g_assert_not_reached(); } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 4f7599d72c..6093ab0a12 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -282,9 +282,9 @@ static void s390_cpu_initfn(Object *obj) #endif } -static gchar *s390_gdb_arch_name(CPUState *cs) +static const gchar *s390_gdb_arch_name(CPUState *cs) { - return g_strdup("s390:64-bit"); + return "s390:64-bit"; } static Property s390x_cpu_properties[] = { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index d1477622e6..5ca666ee12 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -29,9 +29,9 @@ static inline void set_feature(CPUTriCoreState *env, int feature) env->features |= 1ULL << feature; } -static gchar *tricore_gdb_arch_name(CPUState *cs) +static const gchar *tricore_gdb_arch_name(CPUState *cs) { - return g_strdup("tricore"); + return "tricore"; } static void tricore_cpu_set_pc(CPUState *cs, vaddr value) From patchwork Mon Oct 9 16:40: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: 731023 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313367wrw; Mon, 9 Oct 2023 09:48:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0HsbsiZRji9ipVdyqkZEsvXFCSiPuuHVx0fjwR5pY7n3RaKsyjgHjFM4fgNnrwuEum0eR X-Received: by 2002:a05:6870:ea9e:b0:1d6:5483:75e7 with SMTP id s30-20020a056870ea9e00b001d6548375e7mr19499686oap.13.1696870109938; Mon, 09 Oct 2023 09:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870109; cv=none; d=google.com; s=arc-20160816; b=B5epnCMoenI+I9/LIwHDhRosSZjFY9DIzLKbprFZMuoxaERitap/S3xvWpD4INHDzu Wp6V7BRuqYlY8Ill5KsdAF8ci/nt4E3mSHdWtY5hTKkyUeHcok4WCAGuoUv3kqBvW1hh Ku1TL23MBKR+HwXVCnXnexiGQ/88SxCyiwitOcDkomT+DkUxrBYp4l0YQ0EWkEb5qSAD cKTiwBUSY+5AhH3JRS7IF+ofSFJ2y2dQoNsSnwY+xd83+NrlpuOjH8vU7EsePLnoVa03 CC4iGEUa6W9DnQH/Z/tM6l0ENDG6ZSODfa0rGLFvKigpTjpA9vMmPspnaXwy8ngrO1nG /2UA== 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=BaWzj6TOawybEbZLkphNAwpwFijNfIuoCtyzRhLAt7Q=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=AV8Y3x5JERLPEYQDQMwYWKGvAnLC0zQMk9i6r/KjcM2s/3/rxAtetCMHjDtMClNN9t OFzlxsQhpN/7w2hYW/Kr89ZApxiPPawXrnhX5stKmj6DwtO8g+FwA+4b2fpiMbJBt9Vh 0FmmAq1EORZVjPoa7TeqcA1CJ2IFm+mrdL5bYZqbCeEClQDaZGLrgL2L+iXf1YuyFc9d p5pdeLt36n3/thBfP1NWbc/wPipXfB0Zz5xjlYCjLPLZzbAThgzVXDkKuPFX4aAYqOB8 3GxxuX/hO0eVPiAv46Dvx6UeZp1zWC0D9so1wlgeuaDBBd0EPTmL+wBdjzIg6PNPguki ivng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iUI60xtk; 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 p19-20020a0ce193000000b00656351ccd89si6274456qvl.233.2023.10.09.09.48.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:48:29 -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=iUI60xtk; 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 1qptPY-0005DB-LT; Mon, 09 Oct 2023 12:47: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 1qptP3-0003E0-CY for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:55 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptOk-0003Xo-Ok for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:44 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso47937655e9.3 for ; Mon, 09 Oct 2023 09:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869975; x=1697474775; 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=BaWzj6TOawybEbZLkphNAwpwFijNfIuoCtyzRhLAt7Q=; b=iUI60xtkpw4burOise8ES76WJJV8hA6xDxAUAOYqoU+c8QvQ5+rtCCs4EK3LLNuySq 0+nm6B+BzUJjWsl1h0sd2BVoJtKGxVHIGjx+U+llU3plLwYkWJMsu0V4wCzkgzyzvXN6 +xzCukTAl9lUJizcmsquB9DJbaVJaHYDgXIK9ZdT4pwMrgoZsCDD9yilqG7MYjYmnHSy FRCP9j50egevjdHC5oMMiQ4rXgtFr7ad1MTC7vB2vXWZZNPkjRh+tsME7oXj5yepvQA1 FycO1jWkfYlO4jRqE99F7Anz9+fUJcwS01XbtY/N49Fb+RQLdbtayAx2xzZJFmLOmkGb +I6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869975; x=1697474775; 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=BaWzj6TOawybEbZLkphNAwpwFijNfIuoCtyzRhLAt7Q=; b=axRWjrkdzc1n8MUSmIfXc9A1RO4evti6gExgPrgvfqH6mh7wH86TkNgLzBwkkYLINJ yU8qh+2kHZ5ZrYtlNkYVqDnLzW1WAfu2kBBsl11Ak4YqU06Sf6ForWJXX5vMQPByd2IZ FSzaTXIqmjGYmCkYZsXMwWSb8PkzfQdJlk50oCoMVzWEpBkyF9U9iW7tszhQYhxKY12R Y4ffZ22fXH9/a5saZtpwAl8VOhz1nDK9wcd4p2QGDyb2L2o/i0Gv+oz28WdCKtNtWFc3 zTfg7dDKKWyctGXKFdpkYWuGFq4WIBhg6NHZkZ0WHJ04NHm8hczAJL3j/pBKppZt1MNo XSKQ== X-Gm-Message-State: AOJu0YzcgLXJ+Gc49myj1b1koExjHw/2xPjAy0rlWA1Uv7L+Yfr3cv1+ THDx1h4TAeJL7vV23XIDx/gapQ== X-Received: by 2002:a05:600c:2298:b0:3fb:a100:2581 with SMTP id 24-20020a05600c229800b003fba1002581mr14279362wmf.14.1696869975132; Mon, 09 Oct 2023 09:46:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e24-20020a05600c219800b004013797efb6sm13936639wme.9.2023.10.09.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E9CD81FFC7; Mon, 9 Oct 2023 17:41:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 15/25] gdbstub: Use g_markup_printf_escaped() Date: Mon, 9 Oct 2023 17:40:54 +0100 Message-Id: <20231009164104.369749-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 a20169c27b..3dc847f835 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -373,28 +373,34 @@ static const char *get_feature_xml(const char *p, const char **newp, if (strncmp(p, "target.xml", len) == 0) { if (!process->target_xml) { GDBRegisterState *r; - GString *xml = g_string_new(""); + g_autoptr(GPtrArray) xml = g_ptr_array_new_with_free_func(g_free); - g_string_append(xml, - "" - ""); + g_ptr_array_add( + xml, + g_strdup("" + "" + "")); if (cc->gdb_arch_name) { - g_string_append_printf(xml, - "%s", - cc->gdb_arch_name(cpu)); + g_ptr_array_add( + xml, + g_markup_printf_escaped("%s", + cc->gdb_arch_name(cpu))); } - g_string_append(xml, "gdb_core_xml_file); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + cc->gdb_core_xml_file)); for (r = cpu->gdb_regs; r; r = r->next) { - g_string_append(xml, "xml); - g_string_append(xml, "\"/>"); + g_ptr_array_add( + xml, + g_markup_printf_escaped("", + r->xml)); } - g_string_append(xml, ""); + g_ptr_array_add(xml, g_strdup("")); + g_ptr_array_add(xml, NULL); - process->target_xml = g_string_free(xml, false); + process->target_xml = g_strjoinv(NULL, (void *)xml->pdata); } return process->target_xml; } From patchwork Mon Oct 9 16:40:55 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: 731018 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312873wrw; Mon, 9 Oct 2023 09:47:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVTFpo3+5NIbx38oWtWh8lGvOhMheZE+kmzY9LS5gYG87GQaquNPuDRSCrCDr15t23yJSu X-Received: by 2002:a05:622a:30c:b0:417:f9e1:664f with SMTP id q12-20020a05622a030c00b00417f9e1664fmr19526989qtw.36.1696870048091; Mon, 09 Oct 2023 09:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870048; cv=none; d=google.com; s=arc-20160816; b=nTpli38iVyeVm6D00NBEUusf/bVmRc6YPbJv0NNoTRgULUXQA9rpr74ZEzs0KJkeAg 1ZL2gopWyO0HoYMnVzg6evs9/UI3nG07e1fh02cnXDZSBPE1LTLr3xElh9QR/odBcLG0 ZWX/vXt2Df0cscbuqYJe2MUR3RX83So6ZgKmLqiF6h+VwZ0hiVWx44vTPRzc9pkujpc5 Mb3cxwoyXjXaG1ZWSL0++NNH22XI1lnM+IY8n7+CNMb1+EzmpM95FvY9ddXJtod6QfbT WAbN86oPGYaD+g8CaAtOeT4XyAmJe9uSW1DPNddb7NereYjo6x5i1AJsDGsdrZ+T7HEr lrKA== 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=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=ZwgvnJs+bA77xcra92WosD1xh67Vi/cToYjt5lLPR9uf8YDYwK7FA82LxF1ZWSiCbO rZMZxdqXTftOEndyZ18AzxDUe9ZBaUvGVTlmPT+HlXnaqb+UJcpiSl7hPfVdhPcBZSoi FZNFYrLtsk4R7/2RrioB2yT4XL1GoXXZT2keKCYoMDSuHsRei+kw4M2Xg9OsIXaGMbNF Zx965hAkbFpIqhnbWxZlLq1HOuv6+kw5QKpskt7NQRwLI5+Z0JewXnCdDehF2triy0+9 fAUzJiELGqIbZHhbTHhnAmod4ASFC+Mwxua7TBErGfpJTUQDxqp6BvywrN15c5b1Yovl F1xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1S01vsq; 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 a17-20020a05622a065100b00403bf9d2091si6435508qtb.363.2023.10.09.09.47.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47: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=B1S01vsq; 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 1qptPb-0005W1-Sa; Mon, 09 Oct 2023 12:47: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 1qptP1-0003Dr-QV for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:55 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptOk-0003Vz-3S for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:38 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406619b53caso43669395e9.1 for ; Mon, 09 Oct 2023 09:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869973; x=1697474773; 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=B1S01vsqV3ds4VPMz0moge7l9PDi7dmPCEtIX5Mz15oqpKERvHdC/yiStZ3MCRh4wi +MWs+Wf3u5iEAZypYYi6SMxugZkNHNghLmj+xPcHeWdgt1WUAERDTgq/zxR0PbNeiFUc D9hZWBqnhNeKhPpRTN1TSMczfUlMMd1kYN8hj5sdF24ENHbT0NJE5DIJuzv5zvqpOB6k hZYPY9wuDLZat/4STwgQdxeY6l6heTj2ED9vWhvBlNbFRMe24+sbKb4X7DPpVpnwKC61 gQLysqcK65by1KD9a2uDR4vFBzkDY/rqkRfHwgmvwInN19bE6zuPkDp8tdGI7yybj9Aj MbvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869973; x=1697474773; 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=uOecl0fUlfxoXmWVEtLJztjX0Up3FNbm8tKAGetWI0m8lCTqS2ALa3Gr5dWsiytmgG wRr8kVqYDspHQrKJZuE2y/8bq5dFFDUCd9PcFqhpxlXo1ios1EEze7dh8G3YfoyiWfcW 8mgDyn/3fT0EkwoaQJSJCy6IDv9QS+mWY5ZJ98OmKedBQu7o4/dOJrj5JdbStvOHpacB MRvQVf2pkbRGnKFem5N9KPXQpyxOM+whAzK4QCSkFYyLKeon5/iPvnNNsH9O/8TUT+Q5 tlX5y2ehHcFCLn+7GMQL7zNMOsBl2ykCzEC3LM1RwGfCPm/J1Ya+EsHD7ga5Kr2VxaLg dtUw== X-Gm-Message-State: AOJu0Yy0lvJZouVGZUUgryTx/bYzRrdr58IcWbATrfyrHEKGwrN0ruFX Dx5MGdXfH9Pr/WSu71SRuX8F/w== X-Received: by 2002:a05:600c:231a:b0:3fe:f667:4e4c with SMTP id 26-20020a05600c231a00b003fef6674e4cmr14363217wmo.12.1696869973250; Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v16-20020a1cf710000000b003fefaf299b6sm11633283wmh.38.2023.10.09.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0DA6B1FFC8; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 16/25] target/arm: Remove references to gdb_has_xml Date: Mon, 9 Oct 2023 17:40:55 +0100 Message-Id: <20231009164104.369749-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Reviewed-by: Alistair Francis --- 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 Oct 9 16:40:56 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: 731024 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313417wrw; Mon, 9 Oct 2023 09:48:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYG1rQ6zzk4WOEe/FkRBK3RxL3pMcKwnB1iWkwWPeUh0ihtw0jYcy6+dBlu9BbvlMGXpQk X-Received: by 2002:ac8:5981:0:b0:418:1194:42f6 with SMTP id e1-20020ac85981000000b00418119442f6mr19270359qte.31.1696870115954; Mon, 09 Oct 2023 09:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870115; cv=none; d=google.com; s=arc-20160816; b=sRzwMk5Y4WTn/WaeGxT//WeDB9Thn9UxpGLs9Hm95ytlK0FYNg3iBU+dyvwvmQOBPz A78iFOG7IJxpyHIslBMUC2IGTWZP9t9TmUsYSlnbr0CveSiavKxbVbznE0QdXRw0zFe1 FaFDRBEsy/mYIS2QY8qp3kj0SpYi5Srvx+mAOosj6BBtzYed6/6CGlrH0gUFjaBNAvVc PJowMtp0vFGr7QxoVTdNVzUtyLqiRdwvqq+oXn/XGFHi1iC0muJGo11uwvjfe8wjZ9Da hdPtF0OLNFdMsF2+JAl4Shbua0uka+laNbw5aFIBX5Tw+WTy8wJ5WIYG9Fi+vrWJPuhH H5PA== 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=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=Dx3NKy38zZ2fiNEBgYXmTxNaNcr+UlHc7RE5CLICHHUIeGuY6aCpJcct+Dl7HDo3eX jMZVbI0RB4yIbGYrYoBiIoSi8yCo5oGSemje8ej8tozCTQAUbfvL9kmTTIoFuSAY816T FAKjuKQvGjOC/DBHCR4gXmu1N1/1/WimVlvsc+rdThwMmBqvvW2r1VQBB5SbCRcraA96 FP3Uj1yOehFIG1N9L2nciLWjd2V2VHTym8q7CWCNBNIebJpR/XpDwGIV+1+ZvMR4QP0n B5fvT8YyjTTh11RM05DMmfpiEOuAONetPfq2+8XNGJc3DMm6Wg3hT41xPJIVTRyLREX4 CbHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gGSX6fyX; 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 e15-20020a05622a110f00b0041962bf1693si6500412qty.762.2023.10.09.09.48.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:48:35 -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=gGSX6fyX; 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 1qptPR-0004R1-Hs; Mon, 09 Oct 2023 12:47: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 1qptP3-0003E6-Qd for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:55 -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 1qptOl-0003Z1-Cw for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:45 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-405361bb94eso48167275e9.0 for ; Mon, 09 Oct 2023 09:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869976; x=1697474776; 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=gGSX6fyXLKxe5f/lt/YRLEKujMia7z4hd7yRP9qwOd6O92V2nFQe/pOZardhizG+fb gLFcq3+gf8WVpdfaJqu8yTUnNYim8yiMHpIlGb7RwS8QZeb4lDtIcuCtTgptudtW7FKX OaQVfSP5RXdeA8+lgOK42PwEwPJCG5A4FctyVkO38A2TKxCJi9R4SDLq0WiQNVXM2XXF uUlkmaBox6OjZEv6zA5FMGgcpht1430EMCAWSDj+OLRWQVH/r1EEoqb1/KvPx4dtLHmV d68uHqEWwvlxQs/AcMGM2QEkByNR+4sNmlgDRevjG+NBWiwMULQ1NeKNYwY2EfRzmocZ aoxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869976; x=1697474776; 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=mTMl9vZxFBBoncKYGm05BGcwJv6UlHt3uPI3+sq7yiYLN2WuRu7eNhvks2P88udHpR 1RoJyE7o7J+YurIvJVKeVGTrYm41McNnG34MM9Rjk7zFEt1DhhdAmM4biZVdUGYzn8DI GqnSrJdTANZsPW4jb6DkprquGcAnMsp+qVmJZ9T6s+Y/aB4OqCHnxCB58dCnwzvd/7dH hBxOToiDueNKxkeA+xZVM0/bBdugPBRWIoDlMyhKEl4YA1DIz6MaHsc4TGo8xXVZJeSo ZYoUeHraw64ORNZC4jNCPonfmR7e7KnRKXVsOXtzeJjx6PvUi2Don7SsdYk17zL/GvHD 1cHw== X-Gm-Message-State: AOJu0YzTcpgVwSaIo55naUkMXT83k2zDmVlFu1ZSyGDni7r64VonNf/u QYlRAwDvEuShKJ3U+/J2w6zSTw== X-Received: by 2002:a05:6000:4d2:b0:322:dbe8:e18f with SMTP id h18-20020a05600004d200b00322dbe8e18fmr15952672wri.46.1696869976074; Mon, 09 Oct 2023 09:46:16 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r18-20020adfe692000000b0031912c0ffebsm10119250wrm.23.2023.10.09.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2634E1FFC9; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 17/25] target/ppc: Remove references to gdb_has_xml Date: Mon, 9 Oct 2023 17:40:56 +0100 Message-Id: <20231009164104.369749-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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=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-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 Oct 9 16:40:57 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: 731022 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313162wrw; Mon, 9 Oct 2023 09:48:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqhUyokl4olEPeIty7IgOdjggh8GTiEZ4prUnbYfzZ3L3SExtXtDRAy3jWlwOAT6HANAvt X-Received: by 2002:a0c:dd0b:0:b0:647:2a0e:573f with SMTP id u11-20020a0cdd0b000000b006472a0e573fmr16115821qvk.8.1696870080551; Mon, 09 Oct 2023 09:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870080; cv=none; d=google.com; s=arc-20160816; b=WCl4jnBl30iwT7+EaW9SRBALbHRqS0jFWv0oTQmXM0eyNWrgagy7mviY1m+vNROdcQ v/Y967+8IQFflCqwnC1IfKs77/VOnzk1VLeTKoFLJxR/eVnknggPcy6ArQF/W+qOxqZl 3Xa6nVVmjueRMhi+EspbckGZcm/PdJ/aiPdgs7DctJZitSkickSsZJ7n4S9IeOYziVNT VzpDJPmuZh+n5K4STCFNL1Jicnz4UCYoqmUDEklV6npZL84lqr2ePk23BJxIw4+OpSYK gLGfpem0q/YeCjsrTG9ZWJAchXqQQ4LmEtd8u4wHxdn0cA6Mb7Pf2mAz82zhItCddJXc PoKQ== 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=N/BY4Yx13cWmH/QDWd4SZAmL532vLBHSSsqb5C4YehM=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=J7Qg101w76RvTX6NNDN4W1zx5KTfkco+LWc0fiiJhhgw1T7eUZOL6fBf/uKSkhwXm6 /bQJMRX/gmHmzR2LtUaYrVjw1rJiyGqTK6eN92nkAndikNMIHZukJy6envJE8f0SKryW +mDCguzGYlpkVny6wYzHw2KL/U9MK5JrxJjnPDtuibw1wujxh4YU9TBiNC/IVTlkhh5J ClmsbTAfqT2Nteiqe1qxwP8tKA6mUKDNZR26tiEyNODPUswDE6HgVYDLMxmRhKfOIKqA DbQHr6rJYyP9q/le6+v2G/58UMHGRUxVm+hy+HUtziG7iY5TD5hr/Cbq+N7WkZFJl+lK 4mYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gZQlEySB; 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 q18-20020a0cf5d2000000b0065881095c04si6311426qvm.407.2023.10.09.09.48.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:48:00 -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=gZQlEySB; 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 1qptPY-0005Dm-Q1; Mon, 09 Oct 2023 12:47: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 1qptOw-0003Bt-EK for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:52 -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 1qptOk-0003WM-3J for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:38 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405361bb94eso48166555e9.0 for ; Mon, 09 Oct 2023 09:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869973; x=1697474773; 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=N/BY4Yx13cWmH/QDWd4SZAmL532vLBHSSsqb5C4YehM=; b=gZQlEySB2gTqve2R4v/XmkPBPwIX7moLYj9in3SlByJhdIxnbMH9AEgMLdQXMTJ2Xc gqvsk++Tx7mZrLv+LQ3Ufci1riqcDo/M+ax14RMpREbDMYCkIhPapuaN5ul+R3x8Hvyt 6/Qv7cT+X6OePkQcgvYmKbHjplpInn3ydiS/tHEOGT4JTQzOsS3h4HmOL98ZEZnp+S1L i6pe6tWiURIOMIpOmsEXqMjTww6T/Y4xYVRGOc1R5jwe1QMPQaSkR/2LRlUiofZE8JLS N8lm6i/NpBvhxxIuMd/NyBdlzzL0I5J+S0rBaIkMYTHlSDBUhpoRiQOJFruF+BURsPQa V+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869973; x=1697474773; 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=N/BY4Yx13cWmH/QDWd4SZAmL532vLBHSSsqb5C4YehM=; b=ZB11xLT4XRt2WylsfqBMgJXiCpefYzzw5d2L2IZW/gboJ8H3hDLNI/QJrlBoWIdFJG XwRVLRxz5ylzG4LyclojPZd5lqWaHO4wRQow8mb3yObHY82NA+fzgPhNp8eb3ANmgaag 7rTnvDrrHRmwe8UVVQO0p+oK6zKCw0x66g2TsZNMvHNRElsoRAylwZ7OvJlRG7JxHgtS mWQ7h/zlbXFWvCj5EG6qZsqdl8NEyNLudrQh9XqTJLp49BdrEcEmkw54G/yDc39paYuJ 1TQgR4S1ueqIPJCWF3D8CR8RpI1OX/nA0XE5125muTyKgXjM03pJTySoeCMhXYNdsVSd icMQ== X-Gm-Message-State: AOJu0YzUfke5UFbwoGbPsC8ayS2eCgO5MkDqQIac/lrNbPnVHQF56Dav t6yDSuA8yq5XkEwDIqxzJmK23w== X-Received: by 2002:a1c:7917:0:b0:3fb:feb0:6f40 with SMTP id l23-20020a1c7917000000b003fbfeb06f40mr14863202wme.11.1696869973491; Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b6-20020adfee86000000b0031f300a4c26sm10071422wro.93.2023.10.09.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:12 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 433DE1FFCA; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 18/25] gdbstub: Remove gdb_has_xml variable Date: Mon, 9 Oct 2023 17:40:57 +0100 Message-Id: <20231009164104.369749-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Reviewed-by: Alistair Francis --- 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 3dc847f835..62608a5389 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -349,11 +349,6 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) } } -bool gdb_has_xml(void) -{ - return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml; -} - static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { @@ -1086,11 +1081,6 @@ static void handle_set_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (params->len != 2) { gdb_put_packet("E22"); return; @@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { - gdb_put_packet(""); - return; - } - if (!params->len) { gdb_put_packet("E14"); return; From patchwork Mon Oct 9 16:40:58 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: 731020 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313024wrw; Mon, 9 Oct 2023 09:47:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4Ey75G9OdjGFPVEYx2wIhmnEKbS3iFM5LgYgehwIy9Q4+4BbcnwVDmgg8v0ysXZvSP2WR X-Received: by 2002:a05:620a:454f:b0:774:19a4:117a with SMTP id u15-20020a05620a454f00b0077419a4117amr19017014qkp.19.1696870063011; Mon, 09 Oct 2023 09:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870062; cv=none; d=google.com; s=arc-20160816; b=oJGTnBpfPJA28aha6dK03psGY+asSl+UUKVy8hCvUtgsUxDvKbhRvrVFPNewaaSqSh WB8mheREaknrgSe/2XBbQzz5a4R6takcBdVu1UGEfTYKZXRH715dxL/FVBE9kzQz+0d2 n8xp0I6wB3cXCiFCE1TZsfCv2EJ+ptbZ+Mvoew+apfZ6r4tfWfOmDM6HIiEQPnR5o5Ct scd0G242uKyL2FqaobwkShH2B4om9CD0wAaU50HDxjsf4IBOLFiwFB2HFzGrYL9XQNUY BBP2EEExpbJISWLUuSvAs2F9KgaXDcCciwbzs5XdeMVbUay7rzdyABJZae1Isr75qknI F+ug== 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=AXsIaPlw697csDZKVxpgSKxnEOgDlwUYCcbw2vSXSnQ=; fh=FL21b9FDJBPKO4Cw1gBqBPIr8gb5CEXpVKTgM6hLIl8=; b=VdKnOZfC2pqQWTlN2zq6A7eQzf/RsqDjImc5YPmRuXcd8fuzjuQVetkaWIp4EiVFi1 zQNGqIznhT9CikCPplVsTFAopfT8NVEvG5kIqRm/jL60m0NCyi+437529EClUtUYhcJ/ 9VbX2GHkgy3i96qWcx0JCdq68ZIHj6Uj+vE2ik3Fl+Tn8L2yZLUVu3mkPfFfpU+5Oiop +xHoLqbWcQIZjEoM+djUbtDP0FixbGdwawGkcNTuyJjL43AxUbC1swW9ygdEUwyF5BQ4 zKYgp85pKzMvDshrTSVOvnqOnQ77EVBAOsUjeqC00x8pDZzJl0TC+iJUXvgpghnIq4xW EUEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xkdCj8Uq; 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 to24-20020a05620a4c9800b00773ff176b5fsi5990695qkn.396.2023.10.09.09.47.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47: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=xkdCj8Uq; 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 1qptPL-0003l1-LG; Mon, 09 Oct 2023 12:47:03 -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 1qptOj-00036y-7X for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:32 -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 1qptOX-0003VZ-UL for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:21 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31fa15f4cc6so4716941f8f.2 for ; Mon, 09 Oct 2023 09:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869972; x=1697474772; 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=AXsIaPlw697csDZKVxpgSKxnEOgDlwUYCcbw2vSXSnQ=; b=xkdCj8Uqt9yM9Aacw+1muk2ltnN41WTP4IrjswDWZe/SeLZisqGbV1PO5kyiCD1pxB bDES4OgaXLYEV6EtTccdVFvF/veE7lH/JE4/pWr/XK2YRBK7w1c3/lZr4OhpXe4mPDiD 2KpxwaKKg8MH4F6ahyQRU0MOCUYaQ0gkylIfrKnSNIYXGsd0C6qqiAvzsdwMwunrry0O eXSzhhXSn6MmKujl+LeZhUJ1QWd59pU2GPsOFIkq2ylVcRZkAVn/SK9XEx1QkrIV7fSf c9ijlBPdluiMFl7qsy3pBYyoGYBSOxiIgO+QMx56VN18GsgzZQNTLZXsZMiTe4q+d+y+ 12+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869972; x=1697474772; 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=AXsIaPlw697csDZKVxpgSKxnEOgDlwUYCcbw2vSXSnQ=; b=FCbPQprf3SIQn3vDTNtG3a5Vw+Ei2hmK6MmLr5ESzhS1KrXu8ckCFPO0f4BeaFE5Wr 9Y7qeMoRMthtSNHDksl16GemcITSBvGzrT9cGiALeHA8g7tbo8Ax5T3pUrowMGGQG+dO WYDD9M7aHr63qmEwZLGd7/FeGTaxVCwkVQzkDHtR/bC0LEOfwFhiU+zxHezRWJIH7z2V htF+j8wHL+G3e8+3PLF0O3ZvtQjsQreedJmoqeHK0E168JxAyTu05E2aDc7ROBr/ULtB RWrS7NI08cexSy/wpSbsDaixDqBzkgz75v18GNPyT5YzVz7/dt6CdVx1j+t0w3VvXQqg U6wA== X-Gm-Message-State: AOJu0YyWN8CsgFdWrTkROQsuPLn9tIOSkbL0SuPd4I8IjpNJRDrYx6w0 pnTmmkrznbRIFamYpXXg49O8HQ== X-Received: by 2002:adf:e8ca:0:b0:324:7a6b:d504 with SMTP id k10-20020adfe8ca000000b003247a6bd504mr16038626wrn.4.1696869972395; Mon, 09 Oct 2023 09:46:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g7-20020a056000118700b003143c9beeaesm10086534wrx.44.2023.10.09.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 61B151FFCB; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH 19/25] gdbstub: Replace gdb_regs with an array Date: Mon, 9 Oct 2023 17:40:58 +0100 Message-Id: <20231009164104.369749-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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=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 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 Reviewed-by: Alistair Francis --- 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 7b8347ed5a..3968369554 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -502,7 +502,7 @@ struct CPUState { CPUJumpCache *tb_jmp_cache; - struct GDBRegisterState *gdb_regs; + GArray *gdb_regs; int gdb_num_regs; int gdb_num_g_regs; QTAILQ_ENTRY(CPUState) node; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 62608a5389..b1532118d1 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -51,7 +51,6 @@ typedef struct GDBRegisterState { gdb_get_reg_cb get_reg; gdb_set_reg_cb set_reg; const char *xml; - struct GDBRegisterState *next; } GDBRegisterState; GDBState gdbserver_state; @@ -386,7 +385,8 @@ static const char *get_feature_xml(const char *p, const char **newp, xml, g_markup_printf_escaped("", cc->gdb_core_xml_file)); - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); g_ptr_array_add( xml, g_markup_printf_escaped("", @@ -430,7 +430,8 @@ static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) return cc->gdb_read_register(cpu, buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->get_reg(env, buf, reg - r->base_reg); } @@ -448,7 +449,8 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return cc->gdb_write_register(cpu, mem_buf, reg); } - for (r = cpu->gdb_regs; r; r = r->next) { + for (guint i = 0; i < cpu->gdb_regs->len; i++) { + r = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); if (r->base_reg <= reg && reg < r->base_reg + r->num_regs) { return r->set_reg(env, mem_buf, reg - r->base_reg); } @@ -461,17 +463,23 @@ void gdb_register_coprocessor(CPUState *cpu, int num_regs, const char *xml, int g_pos) { GDBRegisterState *s; - GDBRegisterState **p; - - p = &cpu->gdb_regs; - while (*p) { - /* Check for duplicates. */ - if (strcmp((*p)->xml, xml) == 0) - return; - p = &(*p)->next; + guint i; + + if (cpu->gdb_regs) { + for (i = 0; i < cpu->gdb_regs->len; i++) { + /* Check for duplicates. */ + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); + if (strcmp(s->xml, xml) == 0) { + return; + } + } + } else { + cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState)); + i = 0; } - s = g_new0(GDBRegisterState, 1); + g_array_set_size(cpu->gdb_regs, i + 1); + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i); s->base_reg = cpu->gdb_num_regs; s->num_regs = num_regs; s->get_reg = get_reg; @@ -480,7 +488,6 @@ void gdb_register_coprocessor(CPUState *cpu, /* Add to end of list. */ cpu->gdb_num_regs += num_regs; - *p = s; if (g_pos) { if (g_pos != s->base_reg) { error_report("Error: Bad gdb register numbering for '%s', " From patchwork Mon Oct 9 16:40:59 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: 731017 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312862wrw; Mon, 9 Oct 2023 09:47:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7sXP5hhpPsPTMJfLw3OPi7fRb3AFh9A2A8v3aL6RCZEmLc+iXHqopO9ntIxWtbwpXa0mL X-Received: by 2002:a25:b190:0:b0:d1b:c879:5e6f with SMTP id h16-20020a25b190000000b00d1bc8795e6fmr14969078ybj.23.1696870046556; Mon, 09 Oct 2023 09:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870046; cv=none; d=google.com; s=arc-20160816; b=z/uaIbOdAQ3T0p5g3CT4SCC3xmwgmgmCepeCvvZGVO3JAQNQoNl9+sTy9L+/Bb2RAT z2qZH0DJ66tQzdxQZWDwd+Z64z0k2fx1/dHbNkR1U/vMbtaCl62huo+BJ8TLrchfNUmD ZPG3NnV9AB5DCbm2arKH1F6qhDYu9eR+CqGe1adNCJWaQNdyUav3ftIMmyE05E9q5GHY jpgqSJh+vCIqjWbF0gOyWN1EuqaqAlvvuSMJRYOIT81JoCvbjFiPfeGHJvj410UM3pq3 F0jlU2o62IQpFaHpah4o16LSNNQRPe+WOFprgEHX5PIqRVBmYsN3tne7wcDFEdwQNn6O h7Tw== 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=w3ROVyIhpC0GPMfeuVN5EYglrfPgYOoqOKnIvGWt/mA=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=TiA3uJ4TVnKkpoFU5XilVXl42SjXt58npLsAa0zrvdOfA8GmNzwXM7gipVdGXt/4m6 uArEzFQ2d2YxOUAI1Kh/T8fFW/YUliDbEXEdVPlJEJ3RNb0gDCmskHVV/WfLlYn5V/Oy Wup/zwRRzXVwCb1vWWKXB/vNMClp0yOPCX8ReODSo2yg4SEEBh+ONdh8h/RVALwVPuUW y/Dn9QXO7ZGwlmiyeOr89MO5h20SV2MqwUzIn5gJmYsqn+m0oueHGBxuMIYvnLY+jpD1 XudLP4ncH/e+7KOQGb5yklLo8660qPwSNnG6hdQXUTt2EzYtC3vEL+6NXeb+LxfQi/Mu 385Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DqEG4XIE; 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 v6-20020a0ce1c6000000b00656188075a0si6277862qvl.418.2023.10.09.09.47.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47:26 -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=DqEG4XIE; 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 1qptPT-0004kq-Vb; Mon, 09 Oct 2023 12:47:12 -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 1qptP4-0003E9-N1 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:55 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qptOl-0003YR-F9 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:46 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-405524e6768so46256295e9.2 for ; Mon, 09 Oct 2023 09:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869976; x=1697474776; 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=w3ROVyIhpC0GPMfeuVN5EYglrfPgYOoqOKnIvGWt/mA=; b=DqEG4XIETsVSEoWV4aQGkHkbPIXUkAXiQawn3mP4nQvqz5J1GTjE/IE09ac83Nrb5N u9+P6b5Tcavf1BWspx30L+6ndLFhvgRIWQorDA41tFOgdVOME6tGzL4qIg5sMwsOTgFq B1Ublj0yrB6xcvIhebJYyFSh4jpGAqW/qavMOFWYaACN6nhtuMYbf7fW1qRV/ZpLci5H 6F4cbMSlYyk9W6A7T+/r0l6R4d1CFvA0TARQ4KmTJ4y649o+BOJm5JOiJfocqVYAuF7l WaHQumwdAEy1ly9YDRgHA0pCRS94XOtwJbzKkCy7RxpuVAuMxl607OFG9y5dtcpA7T4a sCIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869976; x=1697474776; 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=w3ROVyIhpC0GPMfeuVN5EYglrfPgYOoqOKnIvGWt/mA=; b=XrxaUbzfeKtaAlYs25aV7FwtdjxXf9z74gTpOCfSOEbwSFE+paW/bG5oxPNBZdxcD6 t6NZdGwikJhtUyFwMeH7tYOicO4+6lKq8lx+qRnuZJWLCJzMHnzKQUcTgTsNFxnmlZ4v E5zoA+Ct49Gcjvm0domuihVT6xlQSxmBv/4P+NE7dZbKNRmDGRdSgViHjMITlpER+2Tq 1Mv1tT5piPKih+glwkfRZibmrUQYF8mJq7IBVgVfUZoQ+9NV5VeJ59jfqEZMTn2xL/G5 7Z4Qex2ivxY9iOentcBcn1czw6XQt79O8BxdwwpQTNajOY+K94N//TULxQoax+ja8D+W /oew== X-Gm-Message-State: AOJu0YxRKM3CGaLAWTXo+VDRpcjdPP6Gmzqck1XOtxt4+fUD/RAKtcPd Bt1UhhP/BAXV8s93WUaZtPt8Yw== X-Received: by 2002:a05:600c:c9:b0:406:4d8f:9fee with SMTP id u9-20020a05600c00c900b004064d8f9feemr14580820wmm.24.1696869975868; Mon, 09 Oct 2023 09:46:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x11-20020a05600c21cb00b00405bbfd5d16sm11774930wmj.7.2023.10.09.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 82E6B1FFCC; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 20/25] accel/tcg: Add plugin_enabled to DisasContextBase Date: Mon, 9 Oct 2023 17:40:59 +0100 Message-Id: <20231009164104.369749-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 9d9e980819..6d3f59d095 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -73,6 +73,7 @@ typedef enum DisasJumpType { * @max_insns: Maximum number of instructions to be translated in this TB. * @singlestep_enabled: "Hardware" single stepping enabled. * @saved_can_do_io: Known value of cpu->neg.can_do_io, or -1 for unknown. + * @plugin_enabled: TCG plugin enabled in this TB. * * Architecture-agnostic disassembly context. */ @@ -85,6 +86,7 @@ typedef struct DisasContextBase { int max_insns; bool singlestep_enabled; int8_t saved_can_do_io; + bool plugin_enabled; void *host_addr[2]; } DisasContextBase; diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index e7abcd86c1..c5da7b32a5 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -158,6 +158,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, } else { plugin_enabled = plugin_gen_tb_start(cpu, db, false); } + db->plugin_enabled = plugin_enabled; while (true) { *max_insns = ++db->num_insns; From patchwork Mon Oct 9 16:41:00 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: 731015 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1312778wrw; Mon, 9 Oct 2023 09:47:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsFgcc0WII2zBH2qmhUO2eP9ZB1rg0kWmKu4hWl2doa035S9VJF8dX8Nij+UDeJQelGN1c X-Received: by 2002:a05:622a:11d2:b0:417:b913:7f92 with SMTP id n18-20020a05622a11d200b00417b9137f92mr18341305qtk.28.1696870033339; Mon, 09 Oct 2023 09:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870033; cv=none; d=google.com; s=arc-20160816; b=b0phCqi/5x4rPTS/kDxt7h8OqT1Uv01Q2LT7lrH8fYJdOf6H1XAd9T9v9fhvD0i23r pHdYf0JSmRyMpZRdokV81A31fUwF8qMYTow+VTr/gGEavPIoG/alcSpsUid2qIGkqlub tEnmKtmBsF3hhl1gnRlokfmcJKsoYA2hLpQ3NvBU3gHHfD+E5qdBr6gR1JJMwsS/bDeE wvpN/gPYqsCuAf3eezTbObLscVpqFccdfCvaOsprLcmZebBG0xLV9oWXG5G9bbVxcBnu K5vRQigYY9gXJfJbdc9i81ZBVwBVywOvVuoCJzl5wDVUNlhCykzEXVmd4LFXdz34OpQg fZQg== 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=e5StG+rhxOIhMaXsnxTS3HFTjNGO8160fFaP+7NtskE=; fh=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=gPGfSYIoe2jdQiZmLuMRKc4mehKwM+KtuQ61KspF814BcArGNDSoOcrFV4V9HuVxIt HD+yqc+rx5xVyt94ePOS8kuqJmfvQwIQnsIMUrMWOBZgF2+wdQ6xOp9uoFaXRgs4AU25 H8voKx/YwbIruxu1U4fx2qze/GF87i67XTPQwJ1AqSiif17NemBhdveKWKLp7sMrG8ZZ XDZz3Do0K1OMq2JD2FCY+yFWe/idF0Rj2PLKBqYrUeCkJKa7QldtVzaAi4o6zComQuST FQQ5TsJI6s54cpfm5glKGWqqYDzwR2rKuPddCFpWZYIKwULuErX3lyKdQeyfNKiETI2I nkCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HDCSE4lM; 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 e9-20020ac85dc9000000b00417ce8008cdsi6401621qtx.803.2023.10.09.09.47.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47:13 -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=HDCSE4lM; 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 1qptPM-0003qX-Dv; Mon, 09 Oct 2023 12:47:04 -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 1qptOu-0003BS-Dp for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:52 -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 1qptOk-0003VQ-3M for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:34 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4064867903cso47900265e9.2 for ; Mon, 09 Oct 2023 09:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869972; x=1697474772; 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=e5StG+rhxOIhMaXsnxTS3HFTjNGO8160fFaP+7NtskE=; b=HDCSE4lMeW6mi1SD6Bat9CQhsT8IWC1hw/KZeTQ4YVDEfSgfGZt1vM4QS8iEtK0HYq YB2WZjHwfqwY6wEOesYLkdkx+YAkiI2od3w/7Fn3lCf4yOIvmPqk2tbLMNDWdtT4eUtR kTZLNoi9l9bBMLvQS1Jqblbply9+5ifHN7dN/mLkanrKdj8rdgdqtGDoJ14vjD8W9wfj nz+9xQO3Ulr1mqOqLrJXocTl8AT+uKslKaZhpgmvdOSGxAkjrpC8ScrQp4ZH1LkPTxiy +E9YOOMF9FDfsLs4CDyPTk2yeCZL7dQ35+q2GM0Gl5LmlAocaGPUBU8jaNJ/jY/COCG7 Iu2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869972; x=1697474772; 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=e5StG+rhxOIhMaXsnxTS3HFTjNGO8160fFaP+7NtskE=; b=X1YOrEeSD09v6IOWnnHOgrwEnoRICI/ldQexwCW9pUHBj4Gtysy/EAigwPl5RRoGcQ SW8obH88PgCINUmtjMqgJ3ojogstf6sgczZe0JNlMYknarkdz/haAhiu+75RXCEEtSD8 /q7/bKA0tDpQTTKpbkiT/TM0x91kpYMaay5XjsietbBWZ1+Dk+wQK+OxLitvun0wsT91 C6pC+UyW2aVstvI+dDqKtMZSCZ47sBN9vr+pyOIknrjGtplrACuAE124R5pIxAAEGZF8 DThliMH8hl47ochsvUCrbNfN9RjVEWUG0sjsc826pVaIwroXDl1lWjOFcNgSmkH+7ssU rmDg== X-Gm-Message-State: AOJu0Yz7JB/JDyHSrlpAAIRRzniLAsRlkZVS8FH8QKPfnxOphAHIECwx U5+nG5ZVK++AnEVjlxO5trTGZ0+0fuokHOTbIm8= X-Received: by 2002:a1c:ed17:0:b0:406:7d74:a29e with SMTP id l23-20020a1ced17000000b004067d74a29emr14087044wmh.19.1696869971896; Mon, 09 Oct 2023 09:46:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m16-20020a7bca50000000b004064ac107cfsm11787284wml.39.2023.10.09.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9D8CB1FFCD; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 21/25] target/sh4: Disable decode_gusa when plugins enabled Date: Mon, 9 Oct 2023 17:41:00 +0100 Message-Id: <20231009164104.369749-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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-3-richard.henderson@linaro.org> [AJB: fixed s/cpu_env/tcg_env/ during re-base] 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 cbd8dfc02f..220a06bdce 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1816,6 +1816,18 @@ static void decode_opc(DisasContext * ctx) } #ifdef CONFIG_USER_ONLY +/* + * Restart with the EXCLUSIVE bit set, within a TB run via + * cpu_exec_step_atomic holding the exclusive lock. + */ +static void gen_restart_exclusive(DisasContext *ctx) +{ + ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; + gen_save_cpu_state(ctx, false); + gen_helper_exclusive(tcg_env); + ctx->base.is_jmp = DISAS_NORETURN; +} + /* For uniprocessors, SH4 uses optimistic restartable atomic sequences. Upon an interrupt, a real kernel would simply notice magic values in the registers and reset the PC to the start of the sequence. @@ -2149,12 +2161,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) qemu_log_mask(LOG_UNIMP, "Unrecognized gUSA sequence %08x-%08x\n", pc, pc_end); - /* Restart with the EXCLUSIVE bit set, within a TB run via - cpu_exec_step_atomic holding the exclusive lock. */ - ctx->envflags |= TB_FLAG_GUSA_EXCLUSIVE; - gen_save_cpu_state(ctx, false); - gen_helper_exclusive(tcg_env); - ctx->base.is_jmp = DISAS_NORETURN; + gen_restart_exclusive(ctx); /* We're not executing an instruction, but we must report one for the purposes of accounting within the TB. We might as well report the @@ -2242,12 +2249,22 @@ static void sh4_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) #ifdef CONFIG_USER_ONLY if (unlikely(ctx->envflags & TB_FLAG_GUSA_MASK) && !(ctx->envflags & TB_FLAG_GUSA_EXCLUSIVE)) { - /* We're in an gUSA region, and we have not already fallen - back on using an exclusive region. Attempt to parse the - region into a single supported atomic operation. Failure - is handled within the parser by raising an exception to - retry using an exclusive region. */ - decode_gusa(ctx, env); + /* + * We're in an gUSA region, and we have not already fallen + * back on using an exclusive region. Attempt to parse the + * region into a single supported atomic operation. Failure + * is handled within the parser by raising an exception to + * retry using an exclusive region. + * + * Parsing the region in one block conflicts with plugins, + * so always use exclusive mode if plugins enabled. + */ + if (ctx->base.plugin_enabled) { + gen_restart_exclusive(ctx); + ctx->base.pc_next += 2; + } else { + decode_gusa(ctx, env); + } return; } #endif From patchwork Mon Oct 9 16:41:01 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: 731026 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313827wrw; Mon, 9 Oct 2023 09:49:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgtPJZ9HcNe6WA6xI77Y5RC9stOMNbkWCpZWyHa2jLKeN5lmdHnxEDaGVGHx8GvnBZGglw X-Received: by 2002:a05:6214:16d1:b0:655:78f5:bef7 with SMTP id d17-20020a05621416d100b0065578f5bef7mr15915700qvz.21.1696870171447; Mon, 09 Oct 2023 09:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870171; cv=none; d=google.com; s=arc-20160816; b=Uc2pBH0V0O6gT2ep1lDBrxdXmuhic8+XJWF1lDcT6ENE8XdvZ0I1SrnvIkGEgB2/Xl xvck19ilJV5ubS5+vTij883fN6wWIc/7wS7OtVkCBQlHy4HYeZ3ehxnCXMvJb9Bdjygb zxIdYU9cIUXEy3QGArcP+DvHkxAA7zMvmluDZ43KIb/Bf2Ht3VJpw9IMHLyknRvoPHp4 Sv/gjXIohRPwr475FN/+GFRfnV0G7QSWMx7o62aoAwSQEgnAh43i5fQsFcjR/51E9B1h Joe7V6G5lPKty98ISAHcde1fx49kc7btr87MipP02+HaUtMG/avoFyiFCk0/sBtmktDA G4Vg== 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=2rjltn9M+XXAIv6I9KIZqs861Zafbf86k+j+c8/sLis=; fh=l2BaUp3i0InHqm79pu00tsa7hfxZRr5xoKhuetIffL8=; b=p73WDr9J26DW2upe25CzguOi3XMYDDYX7oosnNyKiLc0XMb34c1IfS+3tawL4swU+J b7H+reTfFBm9C+zvhy3mH8lKDlk/Z64IwPdrFiqsPcbGjavarnraUV1f9tTUVSzvhClt vB5ohqqAuh7E/SmV4PlNqhqjrlCDoP0jxGKfEQKN2NMD0VXOEakBvuAuPLrvMnF9I0wR mdLLFc7rG2TrOBkZqdd5Bxy+Be3RrNKqkp+vbZvOBlQM8SR4Ojf3RY19rSKHdkOcbNl7 QHiuIr3u714Rn/NLCzJMBIWmXktD8Bkif1eiRtGvHDcPwn3wy36fBZNuqmSIke1gdxiS Y+7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PmwVZoCh; 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 l9-20020a0ce509000000b0065b2d24b5bcsi6270575qvm.173.2023.10.09.09.49.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:49:31 -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=PmwVZoCh; 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 1qptPW-0004s9-1s; Mon, 09 Oct 2023 12:47:14 -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 1qptPH-0003Ri-Gy for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:47:01 -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 1qptOl-0003X0-F3 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:58 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3248e90f032so4718428f8f.1 for ; Mon, 09 Oct 2023 09:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869974; x=1697474774; 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=2rjltn9M+XXAIv6I9KIZqs861Zafbf86k+j+c8/sLis=; b=PmwVZoChq7YroltJUmKbcaVmPxkvnXuGyo85zP/J+kGJCzu5Z05kuYogSwpG7h7C7A 1lN/Q4lu6rtDGcktzEIHh4AyoLau6XRVNBGqX34XjTUjqbiTUm44SnOO6Zg+k3xRMpoJ k0YwGMWeQiFfy+fiNrzhUol+qN5gF0eBk2p5fkypOCn24//CPDps7E5YjOgCGyABhrwy 9fUjDyGdILq3N7txhCMQrMWIuTABNXlr5+YkYuX9r/YQQwqzOilBgbbtL6KirULDUNlf 6wSRPLytlJlPS/6jJLhXXpYd+q5w8K1HOlr/Yf5Gydr3lrO7iyCgSbtwofVQ28xz2Sim eJoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869974; x=1697474774; 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=2rjltn9M+XXAIv6I9KIZqs861Zafbf86k+j+c8/sLis=; b=TjVZZoQi80XsnWdQ29b2vDHMMWYmOjO0Pk0eIk5PzuFN3JRFWAeb6s8S80ET+Q8kD0 80/9tpyeSR4yhpng5BW8RZCKIXxYrNUtkmCBHYaiMle9E6TXbS9mFTqQSlYZO/Q9s/vj FNoTIK7Oltr/RP6z4Tsu7+84NznMibzS9dwjgpmjuKIAGCqIoAG8HBx1fRSUKitLQrKu M1MN6N9j/6aKRGQbiu0kdG11wKjD05nWEi7WDg71Eg6QRLmS9/nLq7RzQiCzOObMFthY B+8YkGmAJ7IuP9aqWp0eUT4CaPaSkkg9gb+Io43a075paXHAyuF4Qw4TSFrqTS7S2rFD EpIA== X-Gm-Message-State: AOJu0YyYkbJFTF+bWr+UvSfTOvKhDWA7XYMEpGCo8w2yJ9lzzwVQxtcq WJAHrRk1trxP+/EhwHlOLv5dZg== X-Received: by 2002:adf:e892:0:b0:31f:a503:c05c with SMTP id d18-20020adfe892000000b0031fa503c05cmr14688817wrm.38.1696869973891; Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h11-20020a056000000b00b00325a59b2080sm10147151wrx.97.2023.10.09.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC80A1FFCE; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Matt Borgerson Subject: [PATCH 22/25] plugins: Set final instruction count in plugin_gen_tb_end Date: Mon, 9 Oct 2023 17:41:01 +0100 Message-Id: <20231009164104.369749-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 d31c9993ea..39b3c9351f 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -866,10 +866,14 @@ void plugin_gen_insn_end(void) * do any clean-up here and make sure things are reset in * plugin_gen_tb_start. */ -void plugin_gen_tb_end(CPUState *cpu) +void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) { struct qemu_plugin_tb *ptb = tcg_ctx->plugin_tb; + /* translator may have removed instructions, update final count */ + g_assert(num_insns <= ptb->n); + ptb->n = num_insns; + /* collect instrumentation requests */ qemu_plugin_tb_trans_cb(cpu, ptb); diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index c5da7b32a5..575b9812ad 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -210,7 +210,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, gen_tb_end(tb, cflags, icount_start_insn, db->num_insns); if (plugin_enabled) { - plugin_gen_tb_end(cpu); + plugin_gen_tb_end(cpu, db->num_insns); } /* The disas_log hook may use these values rather than recompute. */ From patchwork Mon Oct 9 16:41:02 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: 731010 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1311696wrw; Mon, 9 Oct 2023 09:44:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpD9QV0M9ZjxCq7l5LPakyl/h4OP7WTtMlSCeViiAi8eGAPK9cSAOLqB4kTGLlViZ5yIw8 X-Received: by 2002:a0d:e28f:0:b0:5a7:a792:a5d7 with SMTP id l137-20020a0de28f000000b005a7a792a5d7mr1284379ywe.15.1696869886486; Mon, 09 Oct 2023 09:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696869886; cv=none; d=google.com; s=arc-20160816; b=jAQh81ojP2OLA3Yn25u2zBJhinBKpd5p2+f2SD1H2UjL/AYW5uvYUfPY6u2TvPCU2P +Zh87sJe6XEAv9rtjK7rxtjdjOjC3s0LCI4nAy9HQucEsEx+xFHA18WKvLp4Ut5XLUGN otpkAY4dBHyXKPNtH8ZORgAsnEUs9wnR1qZuSvu4FryyEnAq+heOBqWsvxAV+Ks858RN +hKDZO2TmebWLpT1B3MLMEBzcMWlD/8wtCi77jl0C+SDSSfNPrsc29xvAhuj2cx3Z0In gImmU5UV/OUmUXSEkdKS/OdYIrU0E+iveisugBMDRBbUYHhlAdHLUK53tZRudCblyp+T YUfA== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=rzyxeCxXsG6FbzTpnYEFIWodjcfjEIYS+YapIe5hXSmACuvZjNaTaIon0SfPdqWmkd YbtTn9NL/KRtxY0Nxpoy/jGI0zb/giL0/cTPc36Rd94jGBOjdtDGZu+kQrs2+xhjhTOT ZiyssmNCgz9Alty/XqAgLPdw8OMP1Zi+2JVc2lxkYGRE2lZ2Nsgb4tI5lBKF48bNxAU1 0c0789uWfKzP5uXJvgCog8AoWDXkYGXQdDTNKTauKxMjTFMgRZx87FT9tp1wFmX0DjeH HvjRn+YI4DLcFzytcWYC2qDns1RAGtYXwVeZRk6sRW5jxSZFA5FOfET8w3XysggLf7Ue IE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NE8ompUW; 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 h4-20020ac87d44000000b0041994a9c23asi6404644qtb.420.2023.10.09.09.44.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:44:46 -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=NE8ompUW; 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 1qptMQ-0002X6-8l; Mon, 09 Oct 2023 12:44:02 -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 1qptKF-0005of-5n for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:47 -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 1qptJj-0001bM-Ga for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:41:46 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40566f8a093so44170565e9.3 for ; Mon, 09 Oct 2023 09:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869674; x=1697474474; 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=NE8ompUW6GgsAgWOO72/RgzPIQ6pQyPmamEeqmKAppzqJ9KKV3F2Qa5PreMGRyM+Ij nzv+5TtXFRJcSqDj1HWWFDfZzpLNYG/88PhStLlkltHxR/ecz7Bo2U9uZbWHAM6LMnuS e3mV7/XZLalUMxXjKNpTM3HhBdUXyEPdeimKlPvNTR+j0l1E7z7ws8nqOMp+uQFxlvte JLQscbD5u87UFQhbFi/csdjKYHeF0DShQ/8LraoIfLab3a9gE78jVDVkHnDLVzCTk16p gu5AhYbvg3hZ/IZMbSIEek8yXSKQ6RbX3ZlHTVjVgfTGsNFVDHco2rqVK8hwZB+a9h+u ajGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869674; x=1697474474; 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=pUQdtDEwnt2f+4fTss2qJK3QLBgdU4zsNe1HAjL1utd6s9mbs6675ib5Ej9y4U9Gpi 8NalSkndd1m0xmWmmgLA73jfr7DG9CDMXl9dVDWWrUSBWAD8/XhR3psW0ObVh3TUJkK0 yQyPik6nl/OYtF70uswgJnxDCU0rJjwF0Uen5IpU50Dzv/HVr7JMWOEhsWm74TosJkNT hBfThmBMu0Gl+mDAutPt/72X4bFrybFcrw6oNxC8dPu1B5avIiojPdeYH81qKnzFaRqQ tnArmauBDoqXoDsRXI0bNY/kZXrOlvXj59PZoyryO2Hd7Z33ySyT+2KPGrcdlnQnmBp+ iq8g== X-Gm-Message-State: AOJu0YzyTBhUwLT1moNkbZRHOLoJ/En1AEy0IXcpaOCIykHOtJGLUk+g h/qQVW9IrX4P/mwDjbrChiXM9w== X-Received: by 2002:a05:600c:210b:b0:405:1dbd:f77 with SMTP id u11-20020a05600c210b00b004051dbd0f77mr13591872wml.31.1696869674023; Mon, 09 Oct 2023 09:41:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m7-20020a05600c280700b004047ac770d1sm13913102wmb.8.2023.10.09.09.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:41:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D4BE31FFBD; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 23/25] contrib/plugins: fix coverity warning in cache Date: Mon, 9 Oct 2023 17:41:02 +0100 Message-Id: <20231009164104.369749-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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=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 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 Oct 9 16:41:03 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: 731025 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313625wrw; Mon, 9 Oct 2023 09:49:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEF7ihMFL24Kkg/ftQUd3Nv315wrzIGgJhtZ6gljuylMxWKaDLZycxAq8Br+zMGv/0wbemv X-Received: by 2002:a05:6870:f141:b0:1c8:ca70:dd0c with SMTP id l1-20020a056870f14100b001c8ca70dd0cmr17357042oac.19.1696870141515; Mon, 09 Oct 2023 09:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870141; cv=none; d=google.com; s=arc-20160816; b=D7NfxNryGC66Bdpt8vESii9xvobYO185UEyyv+jcVE/GXYNVcJkARzy9BPCHhbGZ17 qNJNeY6qABLJNf+FQExg8AO02OASLn4RtcddA+5KGW2073z/UMeH9w458CZKRnkD46rW g36MWKnpKp/f/75PjokQRHffqX3NyTrtwQSdcnLWCMJxf5Q8x0mzq+pG4KeZ/lM15PQA Y9eu3CTnzrxvDERQK6wO8KxAMjAakpGP3GcGRl8QnE2Le38kvdW83wZ3I5e1nhZbK7/S HYsarwCAjPcEolGqvS+eR/sMSQr6vGdwe8klkZCIG1AUYCHbnbSNB5GUVSsHLj+kcLoR dNnQ== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=m7eoFxViSdcdf/MmDhZM0IxsgsK2z+mYn21YT9M40ik1Mc3WCOb+NBJasOIoYviUog GLkHTteK9oDYQ33nRquaqp5he0MNjZse3rRItyEOsf44XSt3l9qyO559YroXM1rIwcKM j8faqVVHCr9O+V8DhhaBj78QwMQLlipB2RBRqSDSc8nk1iDxC+UM+H759q4YI6PAb0jt 4xVsEGCGuiavtaGsMpRG70R9xHARl4OyrbdEd3faJmKO0St3l1lHXvZC1Wt+CUMWL/3I qQ69iyWDbJBHejKNcf6BeP9leQwXH69WkKQuXl2rDhbgmG+Pmc+KyY+pYMEcYpzm7Tmy hPOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5Lr0jcl; 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 q18-20020a0cf5d2000000b0065881095c04si6312619qvm.407.2023.10.09.09.49.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:49:01 -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=J5Lr0jcl; 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 1qptPZ-0005Ne-NZ; Mon, 09 Oct 2023 12:47: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 1qptPC-0003JD-PP for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:59 -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 1qptOl-0003Xa-Dj for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:50 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3296b49c546so2831952f8f.3 for ; Mon, 09 Oct 2023 09:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869975; x=1697474775; 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=J5Lr0jclW7J339kIM66DlxNeLzBa14n1qo/PBMaOl7bsS/yXRn5HTmqlsmNAxv3W3X zJsN4TNXJpddqyAfjfSlhP6HeWThSqZpTrrCZX2ucIrOqGMsnaui8L8/DA4yA0Vu/r9P M6bksoVSx8CYFS3zgaXaV44EJZ5fY+Dp9agVP9UZNuEwmNwqI2x2p+msvC0luwHe3igG VQ1xjqLT4txAGAbGuo+onm7vGMcMdx3VyJa97gRaxtJnfTCYXEtBl6p4VBYXekTzMF5Q jf3gqth3dkBEqlt2239J1f8K8RwIUnFFZsvAQrv2HeKFcxaLwqkcY7cZRzDrYp230fRg eexw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869975; x=1697474775; 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=rPCCLZjrKUTLPwIc5Be6xMAqhrSzQNOiMRtHAOjxhOGvxJbTHJEfwQ27z1t1ykGOko Pgtj5TEqhaxSqOA0jTDB0M1ZMaoKaavMucLUQcqixnykCA01fNi2DIa7XpjJ5C4kNj8G 2dmpuxtOsgPFHBVHuzjvZGO6vmMBczXoVkrOem09DVL836svomBmEYrkZO6pLGgVl1Sr mYpELJw1tzKOeYQ67hpUYL6eJXuVFUnf9c2/Azs1FVakLajchg3vIIfQoRmcMxVaxQ17 QPk4PlyejHWWzP72A2FqfV+RG4xoQCx57Gjn802lSrO6JwHPU3yN3WNy6CBdScxFMnYw hG4g== X-Gm-Message-State: AOJu0Yz7TyhiNVr3JmyY6KUfLO/UgSwcoIXIEhUCfFjmIgyYN5zU1FXc TDzcNhCFOj77NAztY38Vd7oNcQ== X-Received: by 2002:adf:b34a:0:b0:329:6c6a:c733 with SMTP id k10-20020adfb34a000000b003296c6ac733mr7480553wrd.58.1696869974897; Mon, 09 Oct 2023 09:46:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t11-20020a5d534b000000b003232380ffd5sm10082444wrv.106.2023.10.09.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ED3E71FFCF; Mon, 9 Oct 2023 17:41:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 24/25] contrib/plugins: fix coverity warning in lockstep Date: Mon, 9 Oct 2023 17:41:03 +0100 Message-Id: <20231009164104.369749-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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 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 Oct 9 16:41:04 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: 731021 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1313058wrw; Mon, 9 Oct 2023 09:47:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn4AJTR/GBoxtMnKH9h7BKN/BfvqCrlQHPTXhStzuIPKPzyxB0ACgmWj6amlYgNgBhuavO X-Received: by 2002:a05:620a:458e:b0:774:244c:8b2c with SMTP id bp14-20020a05620a458e00b00774244c8b2cmr20682922qkb.14.1696870065424; Mon, 09 Oct 2023 09:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696870065; cv=none; d=google.com; s=arc-20160816; b=Q3vK/rtVxbESnhO5qlOf8BlOHGSq6Uoq5X8jjv5uqcOsc4J1Kk/69c7ZXAhxV1juQ/ 2s2u6/IcW4gcHPHp1Se16WCa9Ivf95DB0jlJLhheS/+ahivb4q6qYO0HZrzOhjRCsyPB lNVdhmMoUfFIiIQLq/yqaTteq1R8Fhur4kqSdHuRZJubmEDRYCdnwcHslY+k9hHJij4t iDNNEiAoujS2ZET8DSyezTYx9k6Epie3xDNhmT9AM1TOxI1C2fOx2w7LUzhYLirdXN74 hCGXrltrrdSgV2c9bt5msUu4EmEpz07aoLcfNoDsh5Z70MQYwuzRI02v+rEhJiZHYORP Yu0w== 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=hH+hY2AOPCtQWK44NzX0H5SWS0EYJFmL3o+I0zvKKVU=; b=Uj4BlU+czdxq4/lRWh18h+9UTfDwn4rZnsak/U4UpSA+evsV/RmsH2nBTQ9wyh/IVV 4t3YBytN438DX/TGnRWJSLq4284tQkLlgOf6AHHy2F7J5mQUnlZn8ML4Pfc//uMp1vht HG9gmr50ObPRFTuRqkvQmOfAUVeGv2vY0AIEj1KOSHrKZwpvEQskx3Ui96x8LF1hd3M1 ORDlhJbvCMG0HHg4gw4Fp10YpKdJSzhJwp1D2a8q6+IKohETYd6Uxufeb8jvLMNrqJrQ S6JnC3URtadnKMFGtaA7lG8pJ/enbi03ynDl1ZdVk0Jkeg0M0LVD7bimRRK79mNzKlo0 z9vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gEPQOFgw; 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 k21-20020a05620a415500b007758c7aeafbsi6560279qko.696.2023.10.09.09.47.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 09:47:45 -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=gEPQOFgw; 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 1qptPR-0004OO-74; Mon, 09 Oct 2023 12:47: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 1qptOt-0003BP-M6 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:41 -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 1qptOi-0003VV-WA for qemu-devel@nongnu.org; Mon, 09 Oct 2023 12:46:30 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-405497850dbso44438845e9.0 for ; Mon, 09 Oct 2023 09:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696869972; x=1697474772; 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=gEPQOFgw6dKwgtTEQ9yulODQCWAXuTWPL+7uRcgBQZF/79MclLHI1M0+rpZ9XROpA5 m+hbLUrwTUILYo1/di4SSAW3V9nn5HUpX/xwcXzCpyy0/zDqmpB4njTQqCBoL/4c+2qQ b25gNrxbpAgH0abvd0dd4ftG148D1BOEifGlWyRrm/WaWg3XZ9kxjV41k4bklyIriT3a jLGXO5DvyxidagQ+8ygKVooUqLj3veElresb6WOE2JYQyaVS9yZHC1TG9FzyrccXXb5i L9HR9NptkjujN5DHLoo/a3NoYUINZA7P7XT6BAFJs13dRgylkpQbbcrdGraENPFeNuX2 F0kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696869972; x=1697474772; 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=g8bu7Y2Vx2HdKnq3OJnMNYQAqzjSk3KqYATwBZsXJ0S8h2SfTGYFaTyy7XnW7oc07C JmT7q/R8lH9AZfklvawQUGQ3JC/78jeiFlEW7M94+9ATZRpcu2YBzvsFVGYeLLchBRXY P/Q+oUN/81ZljN79Ro1owTVY5ApIoD2cQdX6AUY4HFOkJCTin047TnCv55SBFKtimAse KI+cwdQIBq5V/xB0atZsjVnR6e1KU8S3rcsWNWD5s6Eddx5rVUK6cI7f25OREWI53Uvj 186aRSN6ma8rvn/nOEWfvc9h200VyHqkBnrR08e+9/A54/CIutVmzgzC/EMvN4QmOE1+ 2alw== X-Gm-Message-State: AOJu0YxOdfdqcu9G5cUe/twF3XnTdwzWN8O4Wij9HbymZAsBsu4BlQdl 9bnCvTGWYkdyJgqu8YbbTyqWXA== X-Received: by 2002:a05:600c:2054:b0:3fe:687a:abb8 with SMTP id p20-20020a05600c205400b003fe687aabb8mr14478186wmg.7.1696869972151; Mon, 09 Oct 2023 09:46:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c3b9000b0040684abb623sm14062506wms.24.2023.10.09.09.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 09:46:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 122C11FFD0; Mon, 9 Oct 2023 17:41:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Xiaojuan Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Bastian Koppelmann , Brad Smith , Radoslaw Biernacki , David Hildenbrand , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Daniel Henrique Barboza , Alexandre Iooss , Nicholas Piggin , Bin Meng , Leif Lindholm , Paolo Bonzini , Eduardo Habkost , Alistair Francis , qemu-ppc@nongnu.org, John Snow , Liu Zhiwei , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Palmer Dabbelt , Peter Maydell , Yanan Wang , Weiwei Li , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Beraldo Leal , Yoshinori Sato , Mahmoud Mandour , Richard Henderson , Song Gao , Marcin Juszkiewicz , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 25/25] contrib/plugins: fix coverity warning in hotblocks Date: Mon, 9 Oct 2023 17:41:04 +0100 Message-Id: <20231009164104.369749-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009164104.369749-1-alex.bennee@linaro.org> References: <20231009164104.369749-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=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 Coverity complains that we have an unbalance use of mutex leading to potential deadlocks. Fixes: CID 1519048 Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- 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); }