From patchwork Wed Aug 30 14:53: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: 718588 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585811wrh; Wed, 30 Aug 2023 07:56:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwxW1rDl6fvLd1KQee7Q/kTBxjkP/IcVdEdTOmsv5Lcj7RXCE+J1UOON+Z65/JZHmJf2AM X-Received: by 2002:a05:620a:1aa8:b0:767:c30:517 with SMTP id bl40-20020a05620a1aa800b007670c300517mr6454577qkb.3.1693407379389; Wed, 30 Aug 2023 07:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407379; cv=none; d=google.com; s=arc-20160816; b=PAVbwDdTZMyiklMmDQ9mREjOPLBFsUk+mVWcgCIM/6iXlfbmRWEnfsVpxxno3gqyTN 65p/PATAwZbrFo3FEVlrW3PTTSib31Dkh7JX5Ke2tgIHAETfe3xmn/hZjHuEHkHLLm8w lXEThbyj4T8uEpOpALt8NBbDwgFXfK+hPL+6UC2Kw29293l8uRiWP3E0ELFyTN23yABd 9PuFFOrtAOKVJxaofVs16OT8mQN8D4m/NQZLGjUUeb5Qda5eE3WG0D2PNhrOEvHetbjr Zv7QLbkqBlpGdDn+cA91oiC/QE6nffAkIe9Ys2zhdFJ998VQcNf+zy6vEtEkdzkRG5FA M1bA== 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=+KwLHI/E94Q26mI+rQkt5YQi8gKeSm5LiWqohZsEnUk=; fh=sCYI2/Teem5aiVov5VLt7ZCc/brIo3XkB3/S2GccJhk=; b=l9+gIwebQCjNQamK9ZUEHaEevp7YmvgB0TpwDXjFXJ5n9BvC1CyBYlXJQGMEblawNf IzZQaXl3eX+dR7zstNTxHMgKyOJ8WC6Wl6X9hOqKDdUMhq0zzlelHpvtjfQ8eKXpCVWT e1saK8721MLWH4otNJMpTaRyA5u3qNeMjvVW6D7kRejdanPwRSfzNDFFIE5Po2YafpQO XGEUMh6NamrJz8bPhi0uicpD8XtzzcgW6B1zzt0u8SJZJlMb/gqIXqpg5MrWQ2xSii5L lZMuNN8DH08x1lgd51kDfbiXPVNvrvw4LouP9QZqtyPyN+5cTxJnMcEjdbyuU7JImKvB jgIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Klhxh32a; 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 20-20020ac85714000000b004039bdf7a6bsi5459680qtw.644.2023.08.30.07.56.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Klhxh32a; 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 1qbMaH-0001BF-Tm; Wed, 30 Aug 2023 10:54: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 1qbMaE-00019B-0O for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:14 -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 1qbMaA-0000jH-7P for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:13 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-401d67434daso19356305e9.2 for ; Wed, 30 Aug 2023 07:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407249; x=1694012049; 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=+KwLHI/E94Q26mI+rQkt5YQi8gKeSm5LiWqohZsEnUk=; b=Klhxh32atk0WUQpqDJ1B/ZVCP0/0YgcKjlVHmHCsOLwXIEVrR3Vm/j8vZvSk8/48Bc LBum1jkeag2alKroT7Fnu1JHQq+7JZAm7s+G2zzaJCrfK1d1YnH7AHcjswWV4zKmFLeF LORIHarKujVATleqYtbYHjm+kJZ94a2e0G8FcFNZDVK9puPfRWUd6Mpc5cLzfd3DI/1r ErfdTX8jWllOusNE0fG+Y+KPl89FiUCoHX36kd+GmCQR9Ciqia9Z6KCb38EHOqmgZfcc hbKMAXK9T+39EwgPEwhFM4DGia6erwIrH+WjWtybMR3R4ciIxSEOi+T2977o7DIPgLi9 Na1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407249; x=1694012049; 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=+KwLHI/E94Q26mI+rQkt5YQi8gKeSm5LiWqohZsEnUk=; b=eEg/wiMMoPGC2lBi8SfcnngZr9tWJlaNtLb5tyOZW+bgM6z3cFGWt7qe45LFT1X+Jg LZCEPYhn1R/TwgZ0FLsCop9kZPzaSgAoR6ys0lEAfWTCMTYDyrGzm9xfR+NU9FkjfqTd +eFJZu0Guky6dLdbUSbP2qZflKlQnKfnDkl7IPiZ8LhAjpzWf13MNxZ5TPe0BPDv8AWm Cre3Z+hJfdcRwD1q62EWHh5YcONaPjwNr+J2EdD66Uq4xLrUdc6rzeYc6kRDzsVpL4U2 BSiK5MuSy+xQWrhgxpsxnRmeQBICQcWRUNjLk3RfjdUdQrQUU5XTrMsvCyjbQTEs5aFS 6DVQ== X-Gm-Message-State: AOJu0Yx4hmTt4Ptx2J/m6yY09f8DBCHrbUrZtiQv4/sPlL9T81pfwfKp DaemUXt16rAG5qvnwqmmlJDjkWipX989aOq7kpo= X-Received: by 2002:a5d:4845:0:b0:319:666e:b466 with SMTP id n5-20020a5d4845000000b00319666eb466mr2042696wrs.42.1693407248574; Wed, 30 Aug 2023 07:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c10-20020adfef4a000000b0031773e3cf46sm16855458wrp.61.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC3961FFBC; Wed, 30 Aug 2023 15:54:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Yonggang Luo Subject: [PULL 01/12] gitlab: enable ccache for many build jobs Date: Wed, 30 Aug 2023 15:53:56 +0100 Message-Id: <20230830145407.3064249-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé The `ccache` tool can be very effective at reducing compilation times when re-running pipelines with only minor changes each time. For example a fresh 'build-system-fedora' job will typically take 20 minutes on the gitlab.com shared runners. With ccache this is reduced to as little as 6 minutes. Normally meson would auto-detect existance of ccache in $PATH and use it automatically, but the way we wrap meson from configure breaks this, as we're passing in an config file with explicitly set compiler paths. Thus we need to add $CCACHE_WRAPPERSPATH to the front of $PATH. For unknown reasons if doing this in msys though, gcc becomes unable to invoke 'cc1' when run from meson. For msys we thus set CC='ccache gcc' before invoking 'configure' instead. A second problem with msys is that cache misses are incredibly expensive, so enabling ccache massively slows down the build when the cache isn't well populated. This is suspected to be a result of the cost of spawning processes under the msys architecture. To deal with this we set CCACHE_DEPEND=1 which enables ccache's 'depend_only' strategy. This avoids extra spawning of the pre-processor during cache misses, with the downside that is it less likely ccache will find a cache hit after semantically benign compiler flag changes. This is the lesser of two evils, as otherwise we can't use ccache at all under msys and remain inside the job time limit. If people are finding ccache to hurt their pipelines, it can be disabled by setting the 'CCACHE_DISABLE=1' env variable against their gitlab fork CI settings. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230804111054.281802-2-berrange@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-2-alex.bennee@linaro.org> diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc index 3f6802d51e..4c39cdb2d9 100644 --- a/docs/devel/ci-jobs.rst.inc +++ b/docs/devel/ci-jobs.rst.inc @@ -188,3 +188,10 @@ If you've got access to a CentOS Stream 8 x86_64 host that can be used as a gitlab-CI runner, you can set this variable to enable the tests that require this kind of host. The runner should be tagged with both "centos_stream_8" and "x86_64". + +CCACHE_DISABLE +~~~~~~~~~~~~~~ +The jobs are configured to use "ccache" by default since this typically +reduces compilation time, at the cost of increased storage. If the +use of "ccache" is suspected to be hurting the overall job execution +time, setting the "CCACHE_DISABLE=1" env variable to disable it. diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml index f3e39b7eb1..4fbfeb6667 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -2,11 +2,21 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache + key: "$CI_JOB_NAME" + when: always before_script: - JOBS=$(expr $(nproc) + 1) script: + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE="500M" + - export PATH="$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build + - ccache --zero-stats - ../configure --enable-werror --disable-docs --enable-fdt=system ${TARGETS:+--target-list="$TARGETS"} $CONFIGURE_ARGS || @@ -20,6 +30,7 @@ then make -j"$JOBS" $MAKE_CHECK_ARGS ; fi + - ccache --show-stats # We jump some hoops in common_test_job_template to avoid # rebuilding all the object files we skip in the artifacts diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml index d97611053b..3e5f4d9cd8 100644 --- a/.gitlab-ci.d/crossbuild-template.yml +++ b/.gitlab-ci.d/crossbuild-template.yml @@ -2,10 +2,20 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache + key: "$CI_JOB_NAME" + when: always timeout: 80m script: + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE="500M" + - export PATH="$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build + - ccache --zero-stats - ../configure --enable-werror --disable-docs --enable-fdt=system --disable-user $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS --target-list-exclude="arm-softmmu cris-softmmu @@ -18,6 +28,7 @@ version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)"; mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi + - ccache --show-stats # Job to cross-build specific accelerators. # @@ -29,7 +40,15 @@ stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG timeout: 30m + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" script: + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE="500M" + - export PATH="$CCACHE_WRAPPERSDIR:$PATH" - mkdir build - cd build - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS @@ -40,7 +59,14 @@ extends: .base_job_template stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" script: + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$CCACHE_BASEDIR/ccache" + - export CCACHE_MAXSIZE="500M" - mkdir build - cd build - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index cd7622a761..12a987cd71 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -5,13 +5,14 @@ - windows - windows-1809 cache: - key: "${CI_JOB_NAME}-cache" + key: "$CI_JOB_NAME" paths: - msys64/var/cache + - ccache when: always needs: [] stage: build - timeout: 80m + timeout: 100m variables: # This feature doesn't (currently) work with PowerShell, it stops # the echo'ing of commands being run and doesn't show any timing @@ -72,6 +73,7 @@ bison diffutils flex git grep make sed $MINGW_TARGET-capstone + $MINGW_TARGET-ccache $MINGW_TARGET-curl $MINGW_TARGET-cyrus-sasl $MINGW_TARGET-dtc @@ -101,11 +103,18 @@ - Write-Output "Running build at $(Get-Date -Format u)" - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink + - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR" + - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache" + - $env:CCACHE_MAXSIZE = "500M" + - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode + - $env:CC = "ccache gcc" - mkdir build - cd build + - ..\msys64\usr\bin\bash -lc "ccache --zero-stats" - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS" - ..\msys64\usr\bin\bash -lc "make" - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;" + - ..\msys64\usr\bin\bash -lc "ccache --show-stats" - Write-Output "Finished build at $(Get-Date -Format u)" msys2-64bit: diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/docker/dockerfiles/debian-hexagon-cross.docker index 153fc7cfb3..7c38d7c9e4 100644 --- a/tests/docker/dockerfiles/debian-hexagon-cross.docker +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker @@ -15,6 +15,7 @@ RUN apt-get update && \ # Install common build utilities apt-get install -y --no-install-recommends \ curl \ + ccache \ xz-utils \ ca-certificates \ bison \ @@ -27,7 +28,12 @@ RUN apt-get update && \ python3-wheel && \ # Install QEMU build deps for use in CI DEBIAN_FRONTEND=noninteractive eatmydata \ - apt build-dep -yy --arch-only qemu + apt build-dep -yy --arch-only qemu && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc RUN /usr/bin/pip3 install tomli @@ -35,6 +41,7 @@ ENV TOOLCHAIN_INSTALL /opt ENV TOOLCHAIN_RELEASE 16.0.0 ENV TOOLCHAIN_BASENAME "clang+llvm-${TOOLCHAIN_RELEASE}-cross-hexagon-unknown-linux-musl" ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/v${TOOLCHAIN_RELEASE}/${TOOLCHAIN_BASENAME}.tar.xz +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL" ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin From patchwork Wed Aug 30 14:53: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: 718578 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp584896wrh; Wed, 30 Aug 2023 07:54:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaGezinmGFTxSCz/uXzq1ltaQajgle0yzNUcZlQKP1ZxACvzyNybPnelLQp3SYwmAj73Ng X-Received: by 2002:a05:6102:490:b0:44e:c2d6:cbd0 with SMTP id n16-20020a056102049000b0044ec2d6cbd0mr2355474vsa.15.1693407272019; Wed, 30 Aug 2023 07:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407272; cv=none; d=google.com; s=arc-20160816; b=UShYhkgqg9D6Fe7ud3Fwt1X9O1r4ao5cBFN6CRGK/mRN/YvLYFCZUS3jyYPqaTgRqI MXAIeV5XCI3ACeuBwk0wvGlOCwZxpHCq0CQ5+E+Pfd7l/ohMP9IqEWpE2J2l3sTBtzH2 s8m3wcqMiDFdilUrjmv6Z3FYK0DX9TIgBKBux/TMOzbLpbtoZXF4dRTyX3BttVBzAPVw RmFSTj0I9jJcidVIsnBv37w2tIMMzxlQWj/hBU2vipNQD/iB5MluofBrTd16lgUk37la DtQjmAhW0PXrK3AAw0IBovdn3pNbTuXLytAXsXgOThzN/mn29vSf8dnTWZoyk8W7yKOC AueA== 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=8cg7lXi99py9TiXtzqC5JVNbbz3iUJEdseyNMZLjwS8=; fh=MB7eYd7rnLrXI3nJ9rdxTzQtDWXNOvVrI/pGOS81ev0=; b=g49S1d+OuM7OkkT0YNzF6JttTbEQMrCi3nfBWmWjI452vMpfYepVKvOvfK0lliR7Mu Iby8zN4xQWB1VUFaz1GxYrJm3gCRJDt8UlqWGbQLDiOOWP9EDE8Ls8U2QWNmR65vsM21 RPP0MYOvP/JMxLWLQSgq4HDqGLs1EaVAmva8lSExtJ9RUmRKDJ/JymogPic7KMXoIX7Q HeOrWgOFrF0hs2xUwFu0/wdBO4z/bg7oM68fDFN1yHo+mv3mhYUJyjwaLh7glW965Id8 cajvHgaB7Zgq2T9iXMsRsUT5JSTbwXyPA8B8SCzl3MtQ80GDXM9yygxQyaZPkmUqPA2M Csog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jH1sPRJB; 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 l13-20020a0cac0d000000b00647111ddef1si7339919qvb.265.2023.08.30.07.54.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:54: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=jH1sPRJB; 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 1qbMaE-00019X-HR; Wed, 30 Aug 2023 10:54: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 1qbMaD-00018p-Am for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:13 -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 1qbMaA-0000jM-Ud for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:13 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-401da71b85eso15324605e9.1 for ; Wed, 30 Aug 2023 07:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407249; x=1694012049; 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=8cg7lXi99py9TiXtzqC5JVNbbz3iUJEdseyNMZLjwS8=; b=jH1sPRJBNvm62X8el2msjoKnfgLwRH130boP4EAALgG8cc9cliNlKBjHaaleqS8FrT D6c/nItcm4nLTLEek3vsuTG8gESIiTFuT5UqTyDniEmmPv78OJA47rg3af8Jh5Jqa8+t +5yI88k2iTJDcUjS5zvTh4mmzPoLwNzY08XfnQ9+18224il4cnvl/GOL5JpJuFcYJvKH PefLkwajFdhtAOw9pqERIYGHU0mLPOBxbPzpJh7/dTBDODBEHd6b0M54q/cGiGDw6Z4d Fue7faVEDeD3evv4wU4oyqdrbmFO5pBm7hqG2KC+Y+qj667WdBIOOyGeYa/XQgIJNA2o Y3IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407249; x=1694012049; 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=8cg7lXi99py9TiXtzqC5JVNbbz3iUJEdseyNMZLjwS8=; b=d6mp69TyBmxFXkqT47w/mC0AusQI9x3erLbPkmBcjW5LicH4CTxktN/D8raoMu1GHL nfUKbqmavXZ8NQ0163TiXrLQZ5zmuFqdrJKrrFNWn9WjaojnXvxNMlL6Egj0m7hXeYJU w6Y933poXkrWnksb8FeL6vR8ASYff5OwDOSb/AdmQ7Dv+PE4sy8YTRigtj2U9F5VlQve 4QwW99aSimQQJZmkmelzjuigcQEjfaeMayLAFI9+3qInEVE+791otS7VJxugHZzVbVdW xPdCq8PasfPvtxaUV4ZM05G6uImEhIu/qYvOs3dQSZl1KfBtuY+kkdkaZqaOP9VOlgp4 i3gQ== X-Gm-Message-State: AOJu0YwoH2p4mKTLHU9LN68+Qbujpu5NmaV0Bd4bMJED85WldqbkB6DK k8hcy1SoHDYbLj4yDobHo9tpwg== X-Received: by 2002:a05:600c:3b10:b0:401:daf2:273b with SMTP id m16-20020a05600c3b1000b00401daf2273bmr2329760wms.12.1693407248751; Wed, 30 Aug 2023 07:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n8-20020a1c7208000000b003fefaf299b6sm2514008wmc.38.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D23081FFBD; Wed, 30 Aug 2023 15:54:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 02/12] tests/docker: cleanup non-verbose output Date: Wed, 30 Aug 2023 15:53:57 +0100 Message-Id: <20230830145407.3064249-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Even with --quiet docker will spam the sha256 to the console. Avoid this by redirecting stdout. While we are at it fix the name we echo which was broken during 0b1a649047 (tests/docker: use direct RUNC call to build containers). Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-3-alex.bennee@linaro.org> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 142e8605ee..dfabafab92 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -46,9 +46,9 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker --build-arg BUILDKIT_INLINE_CACHE=1 \ $(if $(NOUSER),, \ --build-arg USER=$(USER) \ - --build-arg UID=$(UID)) \ - -t qemu/$* - < $<, \ - "BUILD", $1) + --build-arg UID=$(UID)) \ + -t qemu/$* - < $< $(if $V,,> /dev/null),\ + "BUILD", $*) # Special rule for debootstraped binfmt linux-user images docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker From patchwork Wed Aug 30 14:53: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: 718579 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585103wrh; Wed, 30 Aug 2023 07:54:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEamMWP/U2NNWo2qW7CCFNWS5rNOwjdMuKOBAMbBAUww+RFcaep5uaJVJMGhxstrfgdxYeZ X-Received: by 2002:ac8:570f:0:b0:40f:e176:ddb7 with SMTP id 15-20020ac8570f000000b0040fe176ddb7mr2637622qtw.37.1693407297867; Wed, 30 Aug 2023 07:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407297; cv=none; d=google.com; s=arc-20160816; b=Uem3TWBc0fS6C5HqKcztJtQ2u+T3PrOuQcL95/demfQPPl0Oc2JJA/LewGZ+cZZGZb nRBpQ/G/3iQiNWqQW0u1lBnzMw6XkcWxln2l3NcGGWait/JuUhJh5+9MUSEsbQceDKeT h83r1T2At/HW0mDZrTSbYbrPAZno1n2/HQe/5lVe8TBC8HoQvTaORgHk4tiG1UYqw+4u zw6kLzMCyY+ClplXI5ojnCrzR9cOzT3vuz5yKyAtwbp8qYQ0EEvKQ9LsypN/Hf0FudcX k6BvYkjN53R/PzprUu/BJCWzLmFpxSoVi1HcwOoGRVD7AWHMghOCrup26ctXEkRLWeCy aIjQ== 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=P7ocu0L6Gz7VaIaqOkaO8eCcLjZTZ6F0+6GPe6A31H0=; fh=LkLRa2TvX96vEhUMtmPTVSftmtuj5rc3ChuwgSxkkQw=; b=o6yVc/SH70R1jCYgujrkb9MmvAiuV7P1FhC5OFkIQA8gKfJzSrUS4iWNfqUYx9isil CdLeCV/2KrPKBE941aolxoII8zc97qI5+U3ur0x1CQ1n1sgsMgDo4AOQRD7vpnFcnVui EUkmDat4p+3hEDZ7cQ9AOzyaYcD7t25RnnqHyfOm/H+S0hFEEMom11x7GgfMtLiQgVOl uM2P99dyMyUoUSnmmYE7iZ1vgVOicVotmJFbs6Y5IKSee/Whbl0yD0p/DN2aoyacDHBg 2rACBYtphDRhssVzWnuYcoUN9hMlbH46LeXoH7rMz38kkUihK21e3P+CKb9FA7hmbp56 pEVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KJ6MUdJo; 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 i7-20020a05620a248700b0076dac954f77si1817661qkn.541.2023.08.30.07.54.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:54:57 -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=KJ6MUdJo; 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 1qbMaG-0001AL-3g; Wed, 30 Aug 2023 10:54: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 1qbMaF-00019i-6N for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -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 1qbMaB-0000jZ-9R for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:14 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31dd10c2b8bso2255747f8f.3 for ; Wed, 30 Aug 2023 07:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407249; x=1694012049; 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=P7ocu0L6Gz7VaIaqOkaO8eCcLjZTZ6F0+6GPe6A31H0=; b=KJ6MUdJoa2eP2Wnrycw3mU+326ngTNZoxro/jQrvgdXJefVcPh479IbR61D9co7eRL 9urY4Xww571f7s2FGEmjwn29xNm1kPmxtaw0FbvpswAoY6uAaWHln1zICeShf9RKBgFm /ZtzuGZLQRsrYdCnFbkhIHgtn5FnrTg73bBjC3viMyOd9BoKnIGdht7fy11UNEPnDwUN wR7d5+9Juk30OfoQe9EOJ72JJsRTO57WJ/C7QKZgsi+JLsq/g8UZ8Gq5jKuGnbgdUnQ9 0XZPhVSZWYGF+OQe59dY5gkjtE2M4dNEdRaviVjLopqCQkkLIYKCaHVaOx+Vc/+dBzJm MgRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407249; x=1694012049; 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=P7ocu0L6Gz7VaIaqOkaO8eCcLjZTZ6F0+6GPe6A31H0=; b=W/Aw8TiYTikr10hWRhLbpaZ2zNCXtA/uXb5ysAnzfblR1Wqf5pqU9CkvdQ/ZGKsF0y +0u/7e+Qpi5DfxBra6B3oOXBHDsWZQfTCqc9hw1wifQktf/ynalFDUgRFME1j7GBzq5m rzfbX8y1pd1rsd3jR9IVQoBGSDEceF7MBweHOn8KHOZdqzY6Ei1OSQX0I/Ja98WHgxm6 mouDMKuMp8x123ccXqWAH6a3Nn98CQ/m7hogQSbuoG85251mNQC7oJBDBUEG/i+RhoFq 48dszxwcloUTw0sYB2/4SgMolAY2xSVMM3WHL7RuH8BKxP/L3YqrhoMREisARs6vFyZ6 8gpQ== X-Gm-Message-State: AOJu0YxHLb6RK8immqtleqBH1xfemBG6LuqswnguofP96+o1LGuJttfd q36l+Y2G/0zThBI6G20Umq76Lw== X-Received: by 2002:a5d:595f:0:b0:317:5b32:b2c3 with SMTP id e31-20020a5d595f000000b003175b32b2c3mr1949401wri.6.1693407249796; Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g26-20020a7bc4da000000b003fee8502999sm2503436wmk.18.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EA9CC1FFBE; Wed, 30 Aug 2023 15:54:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 03/12] tests/tcg: remove quoting for info output Date: Wed, 30 Aug 2023 15:53:58 +0100 Message-Id: <20230830145407.3064249-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This avoids ugly multi-line wrapping for the test on non V=1 builds. Acked-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-4-alex.bennee@linaro.org> diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 681dfa077c..b77bbd9b3c 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -14,7 +14,7 @@ AARCH64_TESTS=fcvt pcalign-a64 lse2-fault fcvt: LDFLAGS+=-lm run-fcvt: fcvt - $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)") + $(call run-test,$<,$(QEMU) $<) $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) config-cc.mak: Makefile diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg/multiarch/system/Makefile.softmmu-target index 7ba9053375..a051d689d7 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -37,10 +37,10 @@ run-gdbstub-untimely-packet: hello --qemu $(QEMU) \ --bin $< --qargs \ "-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \ - "softmmu gdbstub untimely packets") + softmmu gdbstub untimely packets) $(call quiet-command, \ (! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \ - "GREP", "file untimely-packet.gdb.err") + "GREP", file untimely-packet.gdb.err) else run-gdbstub-%: $(call skip-test, "gdbstub test $*", "no guest arch support") From patchwork Wed Aug 30 14:53: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: 718580 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585110wrh; Wed, 30 Aug 2023 07:54:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8eu8LIk0ndmXXMwoECQoB8/2fWhGCMFLUmxOerynT8w22wxIZLml2wp/4bSDtRvSWXX+M X-Received: by 2002:a05:6214:2b85:b0:63d:3eb5:4d80 with SMTP id kr5-20020a0562142b8500b0063d3eb54d80mr2165959qvb.42.1693407298833; Wed, 30 Aug 2023 07:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407298; cv=none; d=google.com; s=arc-20160816; b=duvJQGxAMeJsJpyjx0nugQsCPze6dn/2TsGSnsIr7G1bnEHd90HHifISMC1A7k89uu cFnTFoOMhC70NuokwPBxAZKmlRh6gIiGNsJcTw4SMjS8w4C8nmh34urpmSrSJiHO7YM6 rd7SA52TvIaaVWvJrYBtMyiZMP3mrtfBTM86c7edXCEjzISa9Tk/hthGOmDiy5rOWBJB ZUjulOb4iWnbjfAZSwp1K8TQNZ8m/ckn1e8DPgNLaTWwXIOAkYfUCH9VqxODGZWdI1nK jtCJrODvhwanrT5t2ldrVjd/CHuZ+hV57ZHsZSlOEaYrOoJuJSKRYYgHRge/azapfBpz m1ZQ== 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=uH3otyEIeLq3dLGPNCMZELh485heJIDu3uWi+lqceck=; fh=4cQC2NIX/GHEzRvNd1Zau9/BfIoEE2kRGDXXAngn3G0=; b=j+6sj6CHtwnKCvu9cNgiA8O/w6I3hP5HFWdJo77Uic1jhRV433VFWcAbjRCUGdR3R+ focg1CWqXKTqaT8VMxE0x6OFDfkc6c6ui9XOXpGABB0NQDqHrFCmMeVvoeGNVzYUZ//Q Q/V1txyDa9fXI7vBSBHgbUSRDBZ9+DsHtWr0GE0MBHdKBIN5YDlGJf+0PakaCtPu2xXV zVYjvZ/nx1VD2YCKq26ViuqGr1kkk8nFdqdNniKraR5UyF6wqA+jRaxwRtffhJke3zeX Y3LzDmOdl7a/wc7Sd3/9vJPUB4vQja4Hwzs2Phw7kLuvbfM6tcP4TwRSQle8Rg0uYPrQ Wnng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XZIceiIl; 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 qs13-20020a05620a394d00b0076f2c73cff6si791348qkn.697.2023.08.30.07.54.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:54: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=XZIceiIl; 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 1qbMaG-0001AY-NV; Wed, 30 Aug 2023 10:54: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 1qbMaF-00019t-HS for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbMaB-0000ji-M9 for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-401b3ea0656so51730515e9.0 for ; Wed, 30 Aug 2023 07:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407250; x=1694012050; 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=uH3otyEIeLq3dLGPNCMZELh485heJIDu3uWi+lqceck=; b=XZIceiIliKeKjndId2v9ttLbfJlYZOmm9rGJTGUlVYHgpDvalnBTk1PN+Y1Y+0ayov JZAtYTAXadOpFB0Z4Lh7gXA5oNtcDOcWzh5zR1MmgTxXzNoyGq7m/rukCechDJIGtZwa QWGCH1QZ3Diva4PRJuE6ghHOTiAGsUYLCIsBTJQVGcwa8OgO2UB8S6ONzqG0tjPX8dsV jm+mNPCEjupQuCg9n/G9ZQ1zjMLoXYtVEfk60ov/8VddAU2oaIlmhcoYMFP3/CpgaPR9 +6vsSJTmjVJVcute7KPsZ3Ns3H415sICn7qIxtuIGwBMDcQAb8ajSR74eZ/8LIU6bPjP lzeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407250; x=1694012050; 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=uH3otyEIeLq3dLGPNCMZELh485heJIDu3uWi+lqceck=; b=jefdpDMLt7zRnCvdGeAeWPM8E3oobl2hUiFwORm0w0sqDmawRqX8K4Vh+MI5EDq3dZ A8Uj1pkgrOyyEBRFIV9LHhnOU7d99/JwC6uTOMvtQdIuyGfoqyAl6ijQJUAXk6AM0hjW WpMlfD6BdNzMf43GI0pED5JX/L/qiuT5TC1gdEHo6qkOKofUZrCxrvl15g+l9M+z2Aln QIxsxGN8bS3BpVsgjhZev0kMtWTn6PYtajxeybTpbABnOIubeNJu4VndDxAQzDlGpFpy T5ohz3Kk+CvwhZzJ8Je4W5R6Y0dVFBvzCIydW6jszNrKNZAt7rRCaXT09uTDsym3hzzC QpCA== X-Gm-Message-State: AOJu0YzlvaqPYMnn/KgMrgNf2BeblnuBARZ21+uB/4nCzBu1ZsPxcyZQ 88BaUPsjQypoYq7DBF+cIJ17Fg== X-Received: by 2002:adf:cd0b:0:b0:317:f18b:a950 with SMTP id w11-20020adfcd0b000000b00317f18ba950mr1751701wrm.26.1693407250072; Wed, 30 Aug 2023 07:54:10 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b4-20020adff244000000b0031423a8f4f7sm16871369wrp.56.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E6D31FFBF; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Markus Armbruster , Thomas Huth , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Juan Quintela Subject: [PULL 04/12] docs/style: permit inline loop variables Date: Wed, 30 Aug 2023 15:53:59 +0100 Message-Id: <20230830145407.3064249-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org I've already wasted enough of my time debugging aliased variables in deeply nested loops. While not scattering variable declarations around is a good aim I think we can make an exception for stuff used inside a loop. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-5-alex.bennee@linaro.org> diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 3cfcdeb9cd..2f68b50079 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -204,7 +204,14 @@ Declarations Mixed declarations (interleaving statements and declarations within blocks) are generally not allowed; declarations should be at the beginning -of blocks. +of blocks. To avoid accidental re-use it is permissible to declare +loop variables inside for loops: + +.. code-block:: c + + for (int i = 0; i < ARRAY_SIZE(thing); i++) { + /* do something loopy */ + } Every now and then, an exception is made for declarations inside a #ifdef or #ifndef block: if the code looks nicer, such declarations can From patchwork Wed Aug 30 14:54: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: 718590 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585872wrh; Wed, 30 Aug 2023 07:56:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHP0YGP2Fa33lYp5bDI7pjExxIL/w2zfFTXp2H7bpjD2mYaS+gCtJ0k/s9ImjKa68e8YZN6 X-Received: by 2002:ac8:57c7:0:b0:410:401b:6041 with SMTP id w7-20020ac857c7000000b00410401b6041mr2942256qta.41.1693407386997; Wed, 30 Aug 2023 07:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407386; cv=none; d=google.com; s=arc-20160816; b=SAVRF4wqgOUDnQaWkJtfKj8Pa57+wMgT7GP705fE2qEyREB1Z1KpVJvI3nAwABE9bY ov6E6rWhSD4RyrbfZUqjM3E47soarmUFZSAh6ATCCC/NOS8tC8DWXF65bTAQ8PWd4sKK cVp7oejo39DWzq+iRHP5FbQ6u1mk7BFzgcFy770AFNdec2MS+9H5GadKUi1AxZvXajeA 0+aHLcjlHwbmOYmWel4Af9wWLOg6hYN0WsRa3dIfSkwylym4QrqKJWCaT1IwkWt8jCr5 ujJQBvzrALDWSveyMnHGQPn7GZ3TYPYjEULP5yIlHXUe8v5KRvIx1NO3mK5LPwYV5Vpq 2QQw== 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=7CAQcCHxhhzOkaK3t8ZyiVpaGWR3QfKLpmoXkKlWorI=; fh=r2hhRKrNlXKqscjtnRXwkYHQBBz9bYX25wPkyZUR9iY=; b=XlCBUvGD64yL2pTXymaonEDDi1A2zjWUOHnaorxdTCYczvJNBTT6FkNs6Z4/KA6eQV 6eYCWKuFebKn0uYaERkLrE2G76yKMVecu9+MqI3C8sg6eIcqGeh/eD9QBolGLWoDduPJ HAbtpFC+wSNvcYJuhwWi2lw5u57jGqsFKxQrGKIer/eBeyP2enUbFYYd4hwNZ82Zx9e1 EYElQ2gEuXFBQwobMsc18D8fp7vd1RCZ3hEjt/xrPfm6IG3g2OwXkUolYjMZlOvm0U/p d57WzvTzXW1Tuz7fyswpGaDVTNRVPWX6jwv9862dL6UoobXrxZ44USnOhQTp6PrK9NFp TaSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B5Ym9j3w; 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 11-20020ac8574b000000b004008393b23csi7582162qtx.334.2023.08.30.07.56.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:56: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=B5Ym9j3w; 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 1qbMaI-0001C2-IZ; Wed, 30 Aug 2023 10:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbMaF-0001AC-Qg for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbMaC-0000jr-83 for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31c3df710bdso4532304f8f.1 for ; Wed, 30 Aug 2023 07:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407251; x=1694012051; 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=7CAQcCHxhhzOkaK3t8ZyiVpaGWR3QfKLpmoXkKlWorI=; b=B5Ym9j3w+9mechIcDJ9NXZ0jO5Rwqv91eeXmwXk9SgFdUqtoz0zyNb/J7NwoSfNRqY VbYvhNGh0fuJbZVr902J/UtCzHdOPI8NuJalNbBDyaW/6wZhhMEyy5GztSGbkz8fn9tK xN0DJ8ARBHW7Aio39iEQnMYmEF/AoVwNi01LxbhOYgBjBpbBIiM0qFVSjAM17UD7wlOw EwsKS1OKd2coW5rvF74YS/8QkyloO6TQlNclB1Hjlp3ak5MkoC3Kh7doPeNv1kbcuP0k lp63fe9iL5LbQqx8wGwcaQF6UjYM87QY8H5X4DUuEDRIMDNPpIn3i5GbLR7gAwAu2S6i jhHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407251; x=1694012051; 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=7CAQcCHxhhzOkaK3t8ZyiVpaGWR3QfKLpmoXkKlWorI=; b=GpG4oKbY5E4MPRBO1vJ95BUge13QyA2zEu6rkwJjkXQ7FiJt2fd0tKVJr7/6n5175h vcf0yHwzBt+YTcKulBAl82IQhhhWSUQvQpkrphbtbPdqM5vAssskwJ+0TZZRo9P/D1vZ UFeWMxv/8MzP+sP1T4MbJYNqO/Py8uIPKMExCmVenZjTygGNVQLuh/s9dZYux8Nc+EOA 2zcEaITkAlPmrSrbdbyGnp/R8P8wSFw8zhq2WLi3IH+3Xts6U+TxiCWRGXbJGyGY+xkN +MmE6B4S4i8W3EhgcsXkWGqXDnPCcB7fi13sHh4WMe9e72fb+VwzNyoT1YhmLrA6h92j JS6w== X-Gm-Message-State: AOJu0Yxg2zOoN/YiXMEPz7dJl4jA2TqxSuTAzxENlcpBWeGSvQ5rd/Xf GDRr9v2LbtSJ5qmBZchIRgiJhw== X-Received: by 2002:a5d:568f:0:b0:31a:d3fd:221b with SMTP id f15-20020a5d568f000000b0031ad3fd221bmr1784043wrv.20.1693407250857; Wed, 30 Aug 2023 07:54:10 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j4-20020a5d6184000000b0030ae53550f5sm16998302wru.51.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 242601FFC0; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Ale?= =?utf-8?q?x_Benn=C3=A9e?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 05/12] .gitlab-ci.d/cirrus.yml: Update FreeBSD to v13.2 Date: Wed, 30 Aug 2023 15:54:00 +0100 Message-Id: <20230830145407.3064249-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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: Thomas Huth The FreeBSD CI job started to fail due to linking problems ... time to update to the latest version to get this fixed. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrangé Message-Id: <20230823144533.230477-1-thuth@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-6-alex.bennee@linaro.org> diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml index 1507c928e5..41d64d6680 100644 --- a/.gitlab-ci.d/cirrus.yml +++ b/.gitlab-ci.d/cirrus.yml @@ -50,7 +50,7 @@ x64-freebsd-13-build: NAME: freebsd-13 CIRRUS_VM_INSTANCE_TYPE: freebsd_instance CIRRUS_VM_IMAGE_SELECTOR: image_family - CIRRUS_VM_IMAGE_NAME: freebsd-13-1 + CIRRUS_VM_IMAGE_NAME: freebsd-13-2 CIRRUS_VM_CPUS: 8 CIRRUS_VM_RAM: 8G UPDATE_COMMAND: pkg update; pkg upgrade -y From patchwork Wed Aug 30 14:54: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: 718581 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585234wrh; Wed, 30 Aug 2023 07:55:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGm7wZlxnQkbpvkZij/Qrm0at9Tzv1llNdOHvQCSEySv3C1jsCXRqkQnIvpMdSye47Hgo8j X-Received: by 2002:a05:6214:4253:b0:64f:8756:e884 with SMTP id ne19-20020a056214425300b0064f8756e884mr2377004qvb.31.1693407314362; Wed, 30 Aug 2023 07:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407314; cv=none; d=google.com; s=arc-20160816; b=o5Tmp4zA5LvWf9oei74udCnwX88q3lVEenHH0EdYXihHo8c97FeRT9Q0WiiY3jFPvZ KGsOoY8mgp5BvgVhY/AH21BhFkCaltEAxrDnztI88VviRo38hRjp3COOEBI9z9tM0RnV 5eB6XewM6NHpP7mFyB6pBVw/dyTyQu/0KVEdP+61awBxqmf8yds1QKFUI18Y90PWXmQd R9xvm8KfDQbkLbOBlhXMUjAOwv8jgCcosgYbBmTPOnREoF1z7hjFAgyYsYnpvkpdoVCl JJ4rEsK2mXYnGygRkZ0jVDeLFIUbrtc/M2SeOZHbhgbQMrhCyPPrW3bFxfCCfMgYLr8l XtYA== 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=RUJU7I/ZCoEcB3CxWQsoadwO8esnJuOP81/I/ouJ2ZE=; fh=OMMbDy/vaHhJu0vH6+b4Kpb+BOXgoDYkxnV/deXBpmU=; b=rSe/QU3qFPZB/3m9+hwAeZL7NCn2qceoSq7Qcw1xe3yPyDNCbKBZHwwEYq2By0NuLg H6PxFkk4W03IR/ZXLMX5QJ8yMB5fG/ljEOBOksX11u35Akw5dZGcUjmF0/JEz83uYwrO q8PcGEWVYeaa42cuFExBhMBysHBaGLNefbJ+FfmxnzRedVTx5wtW6OS0836DY15idKH2 xB21uVUlwI00IRgj0QVfyyeCn2/XvBv1pBkwJbXcjDPQzEF9BC/3x+GBsm7DLRT6tlZc KP07zVchGDZ0Izneggj57j0W3BGzAVn8LgMZzBYIAsIOFL4WHzg8fgoS8REoIZK17zmt QyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ak/g7ZxG"; 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 i8-20020a0c9c88000000b0064f4d3bc784si7193803qvf.144.2023.08.30.07.55.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:55:14 -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="Ak/g7ZxG"; 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 1qbMaJ-0001CM-Au; Wed, 30 Aug 2023 10:54: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 1qbMaG-0001AM-63 for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:16 -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 1qbMaC-0000jw-HZ for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:15 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fef56f7223so51457115e9.3 for ; Wed, 30 Aug 2023 07:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407251; x=1694012051; 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=RUJU7I/ZCoEcB3CxWQsoadwO8esnJuOP81/I/ouJ2ZE=; b=Ak/g7ZxG26UCmJViIpR7uKdc3arGt36xDIKI1JiK0hgyAh8UVFvDPPYP5I2gjRSARw LfuDLJGfpr1eFrTGGNI8jtzU4gAMkEPudMFwO3K1R6j7d1Ny2mQ5GqsSLNc2za+OFV2Z OvW/7lmVG9ReyJPM9MpdhRZwYo1xncRmlK/V4RrVNP77tSP6BzWjb1Ll9xLusyA1q/cG Iw6syV6YsphKaAWjDlZmW8GlbgfvT6MhwOxxauvC2KOucBsshWvVD0aLDQ06xw8/+t8I h7oFAbhS82DznzOu1nygcu7bAQP0tpX8M2OJpzxXsKrPGson5tT4JM2Drh3whWwFpWgm dTqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407251; x=1694012051; 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=RUJU7I/ZCoEcB3CxWQsoadwO8esnJuOP81/I/ouJ2ZE=; b=PlwlYdL7JbtNbJWh59KVHJ8EhkjcQFeiLRnlv2n1g0ZVaoZRlRIQJP6oMcPFG/sGya LOrwHhCr4aIeDMJaj1C8SzhWk1stNqSh5brJujbfQ6/hO9Q7cLaOzioF5+0qzIP4eGSy 2X3pKoLWDHBQsdz28xXxUOAweAw9I+rCvZuHxmqLdJn9OsK9/3LP0EE1JG57NUDWkvOp yfT2F72VsQFdnJ8jTf0nYqjCIdJHLmabS1D+y+Vo8LMlvRhBlV7Cs3raTHymplrI4o1U NkWcZSrRybB99OPPki7JsiGZLAWXowO+WkZRFVcsLzQDk9CJ59/DMqlTUFpk8hc39mWW 3ufQ== X-Gm-Message-State: AOJu0YzvW6/qaFKKUZCcs8aflv/P+lSArHOvIWw9xljZIN9qTOHLYIXe dOg7K0DTqdof8CHcV9v2Nibf+t5fGYGhirydLnw= X-Received: by 2002:a7b:c389:0:b0:401:b705:ebea with SMTP id s9-20020a7bc389000000b00401b705ebeamr2301291wmj.12.1693407251067; Wed, 30 Aug 2023 07:54:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f10-20020a5d664a000000b0031c79de4d8bsm16858223wrw.106.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3A4EC1FFC1; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Subject: [PULL 06/12] tests: remove test-gdbstub.py Date: Wed, 30 Aug 2023 15:54:01 +0100 Message-Id: <20230830145407.3064249-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This isn't directly called by our CI and because it doesn't run via our run-test.py script does things slightly differently. Lets remove it as we have plenty of working in-tree tests now for various aspects of gdbstub. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-7-alex.bennee@linaro.org> diff --git a/tests/guest-debug/test-gdbstub.py b/tests/guest-debug/test-gdbstub.py deleted file mode 100644 index 98a5df4d42..0000000000 --- a/tests/guest-debug/test-gdbstub.py +++ /dev/null @@ -1,177 +0,0 @@ -# -# This script needs to be run on startup -# qemu -kernel ${KERNEL} -s -S -# and then: -# gdb ${KERNEL}.vmlinux -x ${QEMU_SRC}/tests/guest-debug/test-gdbstub.py - -import gdb - -failcount = 0 - - -def report(cond, msg): - "Report success/fail of test" - if cond: - print ("PASS: %s" % (msg)) - else: - print ("FAIL: %s" % (msg)) - global failcount - failcount += 1 - - -def check_step(): - "Step an instruction, check it moved." - start_pc = gdb.parse_and_eval('$pc') - gdb.execute("si") - end_pc = gdb.parse_and_eval('$pc') - - return not (start_pc == end_pc) - - -def check_break(sym_name): - "Setup breakpoint, continue and check we stopped." - sym, ok = gdb.lookup_symbol(sym_name) - bp = gdb.Breakpoint(sym_name) - - gdb.execute("c") - - # hopefully we came back - end_pc = gdb.parse_and_eval('$pc') - print ("%s == %s %d" % (end_pc, sym.value(), bp.hit_count)) - bp.delete() - - # can we test we hit bp? - return end_pc == sym.value() - - -# We need to do hbreak manually as the python interface doesn't export it -def check_hbreak(sym_name): - "Setup hardware breakpoint, continue and check we stopped." - sym, ok = gdb.lookup_symbol(sym_name) - gdb.execute("hbreak %s" % (sym_name)) - gdb.execute("c") - - # hopefully we came back - end_pc = gdb.parse_and_eval('$pc') - print ("%s == %s" % (end_pc, sym.value())) - - if end_pc == sym.value(): - gdb.execute("d 1") - return True - else: - return False - - -class WatchPoint(gdb.Breakpoint): - - def get_wpstr(self, sym_name): - "Setup sym and wp_str for given symbol." - self.sym, ok = gdb.lookup_symbol(sym_name) - wp_addr = gdb.parse_and_eval(sym_name).address - self.wp_str = '*(%(type)s)(&%(address)s)' % dict( - type = wp_addr.type, address = sym_name) - - return(self.wp_str) - - def __init__(self, sym_name, type): - wp_str = self.get_wpstr(sym_name) - super(WatchPoint, self).__init__(wp_str, gdb.BP_WATCHPOINT, type) - - def stop(self): - end_pc = gdb.parse_and_eval('$pc') - print ("HIT WP @ %s" % (end_pc)) - return True - - -def do_one_watch(sym, wtype, text): - - wp = WatchPoint(sym, wtype) - gdb.execute("c") - report_str = "%s for %s (%s)" % (text, sym, wp.sym.value()) - - if wp.hit_count > 0: - report(True, report_str) - wp.delete() - else: - report(False, report_str) - - -def check_watches(sym_name): - "Watch a symbol for any access." - - # Should hit for any read - do_one_watch(sym_name, gdb.WP_ACCESS, "awatch") - - # Again should hit for reads - do_one_watch(sym_name, gdb.WP_READ, "rwatch") - - # Finally when it is written - do_one_watch(sym_name, gdb.WP_WRITE, "watch") - - -class CatchBreakpoint(gdb.Breakpoint): - def __init__(self, sym_name): - super(CatchBreakpoint, self).__init__(sym_name) - self.sym, ok = gdb.lookup_symbol(sym_name) - - def stop(self): - end_pc = gdb.parse_and_eval('$pc') - print ("CB: %s == %s" % (end_pc, self.sym.value())) - if end_pc == self.sym.value(): - report(False, "Hit final catchpoint") - - -def run_test(): - "Run through the tests one by one" - - print ("Checking we can step the first few instructions") - step_ok = 0 - for i in range(3): - if check_step(): - step_ok += 1 - - report(step_ok == 3, "single step in boot code") - - print ("Checking HW breakpoint works") - break_ok = check_hbreak("kernel_init") - report(break_ok, "hbreak @ kernel_init") - - # Can't set this up until we are in the kernel proper - # if we make it to run_init_process we've over-run and - # one of the tests failed - print ("Setup catch-all for run_init_process") - cbp = CatchBreakpoint("run_init_process") - cpb2 = CatchBreakpoint("try_to_run_init_process") - - print ("Checking Normal breakpoint works") - break_ok = check_break("wait_for_completion") - report(break_ok, "break @ wait_for_completion") - - print ("Checking watchpoint works") - check_watches("system_state") - -# -# This runs as the script it sourced (via -x) -# - -try: - print ("Connecting to remote") - gdb.execute("target remote localhost:1234") - - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - - # Run the actual tests - run_test() - -except: - print ("GDB Exception: %s" % (sys.exc_info()[0])) - failcount += 1 - import code - code.InteractiveConsole(locals=globals()).interact() - raise - -# Finally kill the inferior and exit gdb with a count of failures -gdb.execute("kill") -exit(failcount) From patchwork Wed Aug 30 14:54: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: 718587 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585706wrh; Wed, 30 Aug 2023 07:56:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFA7BhB02wthH2IyU997zgAwDRxriKg8QL8UEd5Z5lQcLZGOilgj7gkbAme62eR7Vdy8Iw4 X-Received: by 2002:a05:622a:1997:b0:403:a662:a3c1 with SMTP id u23-20020a05622a199700b00403a662a3c1mr7969920qtc.29.1693407365508; Wed, 30 Aug 2023 07:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407365; cv=none; d=google.com; s=arc-20160816; b=Gkpn4lJkSDPBDOF03243neaheo2swLRyOLm114GNW7A9ldxrCVW6/pkwBnh/Dz4M7x Ylh3Rbjv5wbmGaVSli9KeINFvOVjdJQQpzJHR2mITnH6Aw/b+x8IBWB6Yog5NjW0rGhh HovTf+9/GXUKlCfOv/7RJOmx3y+hoF+RPKlowSe2AKU7rnh1wkUybFffmtT5nqktVw2c WvA6GyGBB9zRZ295BvRC/3g0xNrVjEQ511lA9s84NKAbhWg3tEOGQ6naDeNt+At3kOsX tS7r9PBMZAVtOfQW8A8UzvMONxXfWO6mqCBq/JtmzUeCEu/bMnzZl6ztvSfiWOXRQawC +Pjg== 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=G9E1DuNxaXu2Lv6KCbenlgvIsuAZILViDISYbqMbTqM=; fh=JHIflz0wy+IHO3PjzyLhBu3F2JnxW5wrdoi1X5ccAzI=; b=uFIE70cHwXBexzklO1+GQBfMDOc/Elr1pBlCmcne4U+QWPg5uzz0xlvRdher/ei03C +7yxUJn5Axeo/43e3mGCyH5VCTvm3jfFgHpMEjyzHgov+Pno/kKEytsr4uxp6fcJ9iDy KITP+hfPrBUmmCvqoVsoDr2NGpLORpM8BX+BDQoxdTdhe68thrHNwHQknPDAgz0h6tKo 1KEr0TCNTmqFLhBfZUmu7tXO6P1e37tWATmc2jM/Oo8qeYlQPtx6gHUD/cT6zIeULn/d 90VE3KVcKJvfrikGL+oSw3xlHqDV4EupwwbaYrGIuBG80fwqYyFiujphUEI1tzwEKNAf rUyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cwCwzgMH; 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 d4-20020a05622a100400b00403ca7e1846si7353377qte.519.2023.08.30.07.56.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:56:05 -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=cwCwzgMH; 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 1qbMaL-0001E3-1L; Wed, 30 Aug 2023 10:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbMaI-0001C1-Fa for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:18 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbMaE-0000kG-6M for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:18 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4018af1038cso53920025e9.0 for ; Wed, 30 Aug 2023 07:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407252; x=1694012052; 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=G9E1DuNxaXu2Lv6KCbenlgvIsuAZILViDISYbqMbTqM=; b=cwCwzgMH564NbywI15AulOwIDAmVpLPbI1DYxz+H8sS6assEuxTnlvCFV5i/EXaTuK YpLajyIHk0hNX/zHl4ISQ3U1t1T/UnKxwRk0IFm+BdewRn3NcCjTMTKP3N0l5OVm45xm iD+fCLoiU47lsXgoZ7Vb3+VzZa8lglVEYUOHAhydMtey1eJki+W2pJq06znzqcA3N+Qn jK/0D3QwMpFzCuopZp6r2qwcTqoB/ejpkv6GRlUqx37y0KZu3N0cTBMId4CSWxK9ZfqN YgSHwC/QMGyWONIe3eSrwlwPO/t17Kip9FgNABZlKSMTHyC68d6UrSANr+pxywc9gq0C oHKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407253; x=1694012053; 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=G9E1DuNxaXu2Lv6KCbenlgvIsuAZILViDISYbqMbTqM=; b=jjP4GrKE3ZMkeIhbLFzM/SisH0D7H7p6WUhVQxOr5dx+mvthH5o7mTzMGkiFLz8ouv k9PBKKrcLIpVg+8kC8aZSSOjQ8FWSG1wnM2WfiJE5tKrS6ClykTnDqQcNvIGPlEHsLeX eE7yNcRKOluN92n8qJwZiE3vPOu3T6i2QYFd84ALKC8NrILYMUeU0vuRu5sWVlC0L4m+ QSXw+SC6hJSdoj5ok4ifLg0HIkSZeYfA+tNgdeU9J1yq1mApSTlO10MSBPbJRvAZmy9S TZiTm5aAYWP85G1MJZqbksWp7ghddccLs9L5vAzcr4m4yT4TSgNHdDw0OcL7h3qnujgT i0yg== X-Gm-Message-State: AOJu0YxFVh59sXmxeAeT7AxU63AbSkUpg5TnMbCuPaMrdYdtrLOG/UyN l1+0nxIDcnZ9Yi62fUGs0qIRpcd9u06O++70F+Y= X-Received: by 2002:a5d:5450:0:b0:319:650f:60e2 with SMTP id w16-20020a5d5450000000b00319650f60e2mr1859962wrv.11.1693407252747; Wed, 30 Aug 2023 07:54:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z8-20020adff1c8000000b0031c612146f1sm16659748wro.100.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 66A6B1FFC2; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell , David Hildenbrand , qemu-arm@nongnu.org (open list:ARM TCG CPUs), qemu-s390x@nongnu.org (open list:S390 TCG CPUs) Subject: [PULL 07/12] tests/tcg: clean-up gdb confirm/pagination settings Date: Wed, 30 Aug 2023 15:54:02 +0100 Message-Id: <20230830145407.3064249-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 We can do this all in the run-test.py script so remove the extraneous bits from the individual tests which got copied from the original non-CI gdb tests. Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-8-alex.bennee@linaro.org> diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index a032e01f79..b13b27d4b1 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -83,6 +83,8 @@ def log(output, msg): gdb_cmd += " %s" % (args.gdb_args) # run quietly and ignore .gdbinit gdb_cmd += " -q -n -batch" + # disable pagination + gdb_cmd += " -ex 'set pagination off'" # disable prompts in case of crash gdb_cmd += " -ex 'set confirm off'" # connect to remote diff --git a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py index b9ef169c1a..ee8d467e59 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +++ b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py @@ -76,9 +76,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except: diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbstub/test-sve.py index ef57c7412c..afd8ece98d 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve.py +++ b/tests/tcg/aarch64/gdbstub/test-sve.py @@ -66,9 +66,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except: diff --git a/tests/tcg/multiarch/gdbstub/memory.py b/tests/tcg/multiarch/gdbstub/memory.py index 67864ad902..dd25e72281 100644 --- a/tests/tcg/multiarch/gdbstub/memory.py +++ b/tests/tcg/multiarch/gdbstub/memory.py @@ -115,9 +115,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/sha1.py b/tests/tcg/multiarch/gdbstub/sha1.py index 423b720e6d..416728415f 100644 --- a/tests/tcg/multiarch/gdbstub/sha1.py +++ b/tests/tcg/multiarch/gdbstub/sha1.py @@ -73,10 +73,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py index 5e3e5a2fb7..04ec61d219 100644 --- a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py +++ b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py @@ -51,10 +51,6 @@ def main(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except gdb.error: diff --git a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py b/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py index d91e8fdf19..926fa962b7 100644 --- a/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py +++ b/tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py @@ -42,10 +42,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py index 798d508bc7..e57d2a8db8 100644 --- a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py +++ b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py @@ -45,10 +45,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/s390x/gdbstub/test-signals-s390x.py b/tests/tcg/s390x/gdbstub/test-signals-s390x.py index 80a284b475..ca2bbc0b03 100644 --- a/tests/tcg/s390x/gdbstub/test-signals-s390x.py +++ b/tests/tcg/s390x/gdbstub/test-signals-s390x.py @@ -61,10 +61,6 @@ def run_test(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except (gdb.error): diff --git a/tests/tcg/s390x/gdbstub/test-svc.py b/tests/tcg/s390x/gdbstub/test-svc.py index 18fad3f163..804705fede 100644 --- a/tests/tcg/s390x/gdbstub/test-svc.py +++ b/tests/tcg/s390x/gdbstub/test-svc.py @@ -49,10 +49,6 @@ def main(): exit(0) try: - # These are not very useful in scripts - gdb.execute("set pagination off") - gdb.execute("set confirm off") - # Run the actual tests run_test() except gdb.error: From patchwork Wed Aug 30 14:54: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: 718582 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585369wrh; Wed, 30 Aug 2023 07:55:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMpWDJt4FGRcmZbxI0X4RWjULu49THdjYI++1meu/+Fo1DXt+D+URZ890LewyTSyKeRghZ X-Received: by 2002:a0c:f789:0:b0:647:18a7:2e28 with SMTP id s9-20020a0cf789000000b0064718a72e28mr2203590qvn.61.1693407327658; Wed, 30 Aug 2023 07:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407327; cv=none; d=google.com; s=arc-20160816; b=YR4qiBPTbeyGUyu1tlFaZUB4bliQSZnWg2gq47Zpb0tsn2uI69oxhDqIlQ7LFDp9Oe bAwf86/asO/WKclCIHUNRiFzVQoiacUKQB9KWgcGiWZXMVm2vV0/IcJJ0EPbvHeMDmRp UMAH+gaoDEWySo5VS07WxPzGtOyft0VtzHN+YIncwjN2838+6p0fPIl+ocdnCFT5vqfE urCSGf9M9i5eTuCXYt5zSDUID0mhFV9fiVUPCtTFAapF3teTMqYy0PnlX4+Wgj2rytL+ BNYfU6Hxf8FT6wFDrYWz/Gdz1uKSqN+A50B64nznbLJNPl7kwDJ2wIuyqU8cMdNe70wQ ZZ9Q== 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=/xMHxg0y53JN4TLoRHDzXOhPXJYR1t6X3GOG4+zpqXU=; fh=pEH54Lanj025ladN+77nE4Xm6Dn91YpjIIivJX/SXw0=; b=UE/lyPtoTvvUhuJ92h2p1//RNCUKmWELqaOwRRPQeX6HYx3+UQtfB+tJw/0CbNF5xw NsSwi20N0ebY3v1AIKa6Tyh5sseMAMOkQZCpEotDLpJezaRYFY9EF+l5rWdvEPgyWx7m b8O5NtivJlvhDh3pmIjtUE2KaNDTNE15f/M5+QV3e4DLkIT1oraMvuboZJi2x71Obr1Z x5ODgVsQIx3xAtOdcxLB+foFecsAJZlz2Wt3AwtlSSPESVNGdzrtIMS++7DjC7oxgmWV crbn2y+YzuWkjxiVEIYfHQrOhr/RHFBWcwwylUf5eKhtz7M2BuJHWt4KgPukU0lL47PI 5DyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ACTcTJK8; 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 e28-20020a0caa5c000000b006471933731asi7314138qvb.235.2023.08.30.07.55.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:55:27 -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=ACTcTJK8; 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 1qbMaJ-0001CO-GG; Wed, 30 Aug 2023 10:54: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 1qbMaI-0001Bd-5e for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:18 -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 1qbMaD-0000k9-QF for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:17 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c3df710bdso4532326f8f.1 for ; Wed, 30 Aug 2023 07:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407252; x=1694012052; 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=/xMHxg0y53JN4TLoRHDzXOhPXJYR1t6X3GOG4+zpqXU=; b=ACTcTJK8waim6t7kC7LAhybS2nHfY3+CHPg3h1Fnox6RRO6wo4BHdOR5oNFhBQB1kh m2S0xdCM6qchbv4R+YAbwbx7NqCBa1AsNnesklc6h1o1FIu+OlXfrBj3TY3rObxY+LCn ub2tGJYy36NXKKOOK48W6OKiZzKhUW8aX3mQZMhbUnL+t6nh7sIn7F5A67UTOBzDq5mf BXy7saqoDrog+lnlNQ/hzY3XSbA6uPggAw68JXlWhF6aQFrxLY/7C++3XgmNB+LbuTL1 hx6E5RtKz9IA9U9DRUWmi87piWrl227LhqEK3VRmZhHPxX/Qufqz2YFL9ortJNkzDSol 7L4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407252; x=1694012052; 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=/xMHxg0y53JN4TLoRHDzXOhPXJYR1t6X3GOG4+zpqXU=; b=PaMIZxvQhNlRhQjcb1MjFJzxa3KYo6MIqJs5INPB0EvXpe15pb98MYOysZxiHmNIQa /Fef75WUo2wOzQKKHZpwvwouQ966g7/nFadm51en2eoIdKgyALbqeCuAZhOV/3YX1vjV xaKyxIIgQOXZDfvttoXBh/meoAdSrCIHHTkFzP9qPAWquGIgviqe0OedqAYbSAs8KCo8 reBeJDAIbMsuwI8ce/bFUZlpZpzLimntjo7mjJ1k2GpzWLHjJk2WWOG8DCNKrsy3VLpQ 0R3PEzp+rwjIN3oopKpgmKktMGCyYvm2OZSHoO6XK3Fuu73ngGSdjje0+xwfGbDsGJo9 ALKA== X-Gm-Message-State: AOJu0YwqmUdDIGlCQqjNLkKyw7iV48hOH88N6cpndSn+IhYgftuLerxd p8zmFHQnD7mROuALSsCoSKtotA== X-Received: by 2002:adf:ea41:0:b0:319:7428:9caa with SMTP id j1-20020adfea41000000b0031974289caamr2313798wrn.38.1693407252372; Wed, 30 Aug 2023 07:54:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l13-20020a5d4bcd000000b003141e629cb6sm16730710wrt.101.2023.08.30.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 86DBE1FFBB; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Matheus Branco Borella , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PULL 08/12] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT Date: Wed, 30 Aug 2023 15:54:03 +0100 Message-Id: <20230830145407.3064249-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-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: Matheus Branco Borella This fix is implemented by having the vCont handler set the value of `gdbserver_state.c_cpu` if any threads are to be resumed. The specific CPU picked is arbitrarily from the ones to be resumed, but it should be okay, as all GDB cares about is that it is a resumed thread. Signed-off-by: Matheus Branco Borella Message-Id: <20230804182633.47300-2-dark.ryu.550@gmail.com> [AJB: style and whitespace fixes] Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1725 Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-9-alex.bennee@linaro.org> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 5f28d5cf57..e7d48fa0d4 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -597,6 +597,15 @@ static int gdb_handle_vcont(const char *p) * or incorrect parameters passed. */ res = 0; + + /* + * target_count and last_target keep track of how many CPUs we are going to + * step or resume, and a pointer to the state structure of one of them, + * respectivelly + */ + int target_count = 0; + CPUState *last_target = NULL; + while (*p) { if (*p++ != ';') { return -ENOTSUP; @@ -637,6 +646,9 @@ static int gdb_handle_vcont(const char *p) while (cpu) { if (newstates[cpu->cpu_index] == 1) { newstates[cpu->cpu_index] = cur_action; + + target_count++; + last_target = cpu; } cpu = gdb_next_attached_cpu(cpu); @@ -654,6 +666,9 @@ static int gdb_handle_vcont(const char *p) while (cpu) { if (newstates[cpu->cpu_index] == 1) { newstates[cpu->cpu_index] = cur_action; + + target_count++; + last_target = cpu; } cpu = gdb_next_cpu_in_process(cpu); @@ -671,11 +686,25 @@ static int gdb_handle_vcont(const char *p) /* only use if no previous match occourred */ if (newstates[cpu->cpu_index] == 1) { newstates[cpu->cpu_index] = cur_action; + + target_count++; + last_target = cpu; } break; } } + /* + * if we're about to resume a specific set of CPUs/threads, make it so that + * in case execution gets interrupted, we can send GDB a stop reply with a + * correct value. it doesn't really matter which CPU we tell GDB the signal + * happened in (VM pauses stop all of them anyway), so long as it is one of + * the ones we resumed/single stepped here. + */ + if (target_count > 0) { + gdbserver_state.c_cpu = last_target; + } + gdbserver_state.signal = signal; gdb_continue_partial(newstates); return res; diff --git a/tests/tcg/multiarch/system/interrupt.c b/tests/tcg/multiarch/system/interrupt.c new file mode 100644 index 0000000000..98d4f2eff9 --- /dev/null +++ b/tests/tcg/multiarch/system/interrupt.c @@ -0,0 +1,28 @@ +/* + * External interruption test. This test is structured in such a way that it + * passes the cases that require it to exit, but we can make it enter an + * infinite loop from GDB. + * + * We don't have the benefit of libc, just builtin C primitives and + * whatever is in minilib. + */ + +#include + +void loop(void) +{ + do { + /* + * Loop forever. Just make sure the condition is always a constant + * expression, so that this loop is not UB, as per the C + * standard. + */ + } while (1); +} + +int main(void) +{ + return 0; +} + + diff --git a/tests/tcg/multiarch/gdbstub/interrupt.py b/tests/tcg/multiarch/gdbstub/interrupt.py new file mode 100644 index 0000000000..e222ac94c5 --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/interrupt.py @@ -0,0 +1,97 @@ +from __future__ import print_function +# +# Test some of the softmmu debug features with the multiarch memory +# test. It is a port of the original vmlinux focused test case but +# using the "memory" test instead. +# +# This is launched via tests/guest-debug/run-test.py +# + +import gdb +import sys + +failcount = 0 + + +def report(cond, msg): + "Report success/fail of test" + if cond: + print("PASS: %s" % (msg)) + else: + print("FAIL: %s" % (msg)) + global failcount + failcount += 1 + + +def check_interrupt(thread): + """ + Check that, if thread is resumed, we go back to the same thread when the + program gets interrupted. + """ + + # Switch to the thread we're going to be running the test in. + print("thread ", thread.num) + gdb.execute("thr %d" % thread.num) + + # Enter the loop() function on this thread. + # + # While there are cleaner ways to do this, we want to minimize the number of + # side effects on the gdbstub's internal state, since those may mask bugs. + # Ideally, there should be no difference between what we're doing here and + # the program reaching the loop() function on its own. + # + # For this to be safe, we only need the prologue of loop() to not have + # instructions that may have problems with what we're doing here. We don't + # have to worry about anything else, as this function never returns. + gdb.execute("set $pc = loop") + + # Continue and then interrupt the task. + gdb.post_event(lambda: gdb.execute("interrupt")) + gdb.execute("c") + + # Check whether the thread we're in after the interruption is the same we + # ran continue from. + return (thread.num == gdb.selected_thread().num) + + +def run_test(): + """ + Test if interrupting the code always lands us on the same thread when + running with scheduler-lock enabled. + """ + + gdb.execute("set scheduler-locking on") + for thread in gdb.selected_inferior().threads(): + report(check_interrupt(thread), + "thread %d resumes correctly on interrupt" % thread.num) + + +# +# This runs as the script it sourced (via -x, via run-test.py) +# +try: + inferior = gdb.selected_inferior() + arch = inferior.architecture() + print("ATTACHED: %s" % arch.name()) +except (gdb.error, AttributeError): + print("SKIPPING (not connected)", file=sys.stderr) + exit(0) + +if gdb.parse_and_eval('$pc') == 0: + print("SKIP: PC not set") + exit(0) +if len(gdb.selected_inferior().threads()) == 1: + print("SKIP: set to run on a single thread") + exit(0) + +try: + # Run the actual tests + run_test() +except (gdb.error): + print("GDB Exception: %s" % (sys.exc_info()[0])) + failcount += 1 + pass + +# Finally kill the inferior and exit gdb with a count of failures +gdb.execute("kill") +exit(failcount) diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg/multiarch/system/Makefile.softmmu-target index a051d689d7..90810a32b2 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -27,7 +27,15 @@ run-gdbstub-memory: memory "-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ --bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \ softmmu gdbstub support) - +run-gdbstub-interrupt: interrupt + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(HAVE_GDB_BIN) \ + --qemu $(QEMU) \ + --output $<.gdb.out \ + --qargs \ + "-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \ + softmmu gdbstub support) run-gdbstub-untimely-packet: hello $(call run-test, $@, $(GDB_SCRIPT) \ --gdb $(HAVE_GDB_BIN) \ @@ -50,4 +58,4 @@ run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb") endif -MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-untimely-packet +MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt run-gdbstub-untimely-packet From patchwork Wed Aug 30 14:54: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: 718585 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585550wrh; Wed, 30 Aug 2023 07:55:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF29759gqSoDLlogeUln26cSssLqoeZZWsGHkPEof6MoTdbKq2r4Io2ORjVw6LMR12AJgUV X-Received: by 2002:a05:620a:2991:b0:76d:9dc0:bcaa with SMTP id r17-20020a05620a299100b0076d9dc0bcaamr2738813qkp.5.1693407348778; Wed, 30 Aug 2023 07:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407348; cv=none; d=google.com; s=arc-20160816; b=iUsA5xVtOAyzASPyYZ6kqVuejmTcs2ni1zyzhjgDwNKsAHtQNxG3B6OIVUntRJ304B V9DQTjYP/EJfEWTC4PvJDAWMikCTQtTIHlYMQhiYZz7rwZpVb4sYT/aLMmMQRz3k1cvr guMluldDsu8xoDiDXEsRb/VUnCgnd1ECmNrA+Dg2uKpLOwfdX0vJ2WKe5M9c6wWJlOHQ 1Ho3EJfyEAu5greBxuarHZGGilDrJzf8FGd8sVThtmTMrhg23cxbXRELtvv0/aLHXDui 728UwaUHPBUV28L060BBOkOQGW5QkSwKCGE91Owad4nRHw8YMIpY4NHMq6B7fu8OGOBk YqdQ== 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=J+4c/0Q7/eLM71cRhHLrdgn3bw80ZIKHk11jFduNmfQ=; fh=qqH/FLbC1fO7d2XrYAo9j7LNBuuWUyrGRnrSY0FPNCc=; b=PfiX4KZm2nlt6MrutYUoSdV5+ys/4i+PsQV3rBxUNqgGINkwWgRLPqZSaTbC5cxnA9 +ymhTaWT4C2g+mwP+Ij7h6w5EAz1LQiVGksIAX1M/FFj8Y0AcNi/LSoFvM8YC1ptXPdt ONG4LivsZuSfrviEYKxd4VZd3c3Zr36E+NCTefncTi8KyCtMyNoaqnFvJDPZTr5WBvNo 7cBCIxFdcXTgKe3CfV/1sBJmTgiILbc118+YkH75FjnFNTThTrVQHf92DImLBtK9zXOR Vi1y/PWNGQUuoLTHlYQhO8KOYSo1nVO3FSeVKbZk2lR6ao/gey1IwLc4yFf+17Hvsh33 6MGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDVWffmN; 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 w18-20020a05620a0e9200b0076f0cc82e44si4515958qkm.718.2023.08.30.07.55.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDVWffmN; 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 1qbMaL-0001EF-73; Wed, 30 Aug 2023 10:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbMaH-0001BE-QZ for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:17 -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 1qbMaD-0000kB-Sy for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:17 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-313e742a787so634726f8f.1 for ; Wed, 30 Aug 2023 07:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407252; x=1694012052; 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=J+4c/0Q7/eLM71cRhHLrdgn3bw80ZIKHk11jFduNmfQ=; b=fDVWffmNd2+y6E8EFV4pwLMM7WD8JINn39nRkXhuZ7l0KVfuV1XUP/tcowZPnbob7L D6q5PmhiXYScCxyvOtv9IM/kiFDecxewREfaWkGte9aceamZiUGlV24TOwtOu6b1mMWd bJklnYTCJ6aabolLqPGrEjEsVjO/zDoLQNZVsQJqscH9+A3gR0wW/jkB3P9WJgekzg8s izQkiYew+eiVTwMdlIq75O0BYJzHWGi/EG3fB/qAn4N43C24amP/tbx7gbefa5sgCbBM 2c1BXR0DAEJ2y4Hdwrxb8Wac5wA8h25GVFaBT9m7yd++AfG8Nv8RLVPvSccBHg/cILOj m+pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407252; x=1694012052; 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=J+4c/0Q7/eLM71cRhHLrdgn3bw80ZIKHk11jFduNmfQ=; b=MpRVrCPcbiGDNUvupaOid47WEa/Ez1/9a/5vG1zMpUoAqnPizY/lOwX4gL3od33uCg DtChPZUxNycQLggTKBQwwn8ZKSsR44nVbjmret74/Q2F70RUqpuNAUvruaUiGndjMV9v UZ9eSqmOwJQQUeUaTn3UKoeuG1jtWtlPKL4O7ztOCnJvFRd/VSC/4dzCLM9LB87E5p0n IrOSeUTCWq6l4HDHzdBz6fVpGmRy/ZCLmp7ILG9mcUTDE+DI6v9XJ58TPkYJCApJFz7L 7U3zWbTtSYQ4bdCcfWUZaXht0ty566EfuCLp3sf3ZPeJKAcJz1uPjfBRDWNSmBlMwzUf ifHQ== X-Gm-Message-State: AOJu0YwtueGgI72CgbTx4dOMXVm+lJ7gCiOKBXpFhCklHNVl371qUp22 rERBXy0KOf7ronj+0wtAR1NaSA== X-Received: by 2002:adf:e54f:0:b0:319:7ec8:53ba with SMTP id z15-20020adfe54f000000b003197ec853bamr1938558wrm.14.1693407252565; Wed, 30 Aug 2023 07:54:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a9-20020a5d5709000000b00317b5c8a4f1sm16858004wrv.60.2023.08.30.07.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9E5141FFC3; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PULL 09/12] gdbstub: remove unused user_ctx field Date: Wed, 30 Aug 2023 15:54:04 +0100 Message-Id: <20230830145407.3064249-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This was always NULL so drop it. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Ilya Leoshkevich Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-10-alex.bennee@linaro.org> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index e7d48fa0d4..8e9bc17e07 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -836,7 +836,7 @@ static inline int startswith(const char *string, const char *pattern) return !strncmp(string, pattern, strlen(pattern)); } -static int process_string_cmd(void *user_ctx, const char *data, +static int process_string_cmd(const char *data, const GdbCmdParseEntry *cmds, int num_cmds) { int i; @@ -863,7 +863,7 @@ static int process_string_cmd(void *user_ctx, const char *data, } gdbserver_state.allow_stop_reply = cmd->allow_stop_reply; - cmd->handler(params, user_ctx); + cmd->handler(params, NULL); return 0; } @@ -881,7 +881,7 @@ static void run_cmd_parser(const char *data, const GdbCmdParseEntry *cmd) /* In case there was an error during the command parsing we must * send a NULL packet to indicate the command is not supported */ - if (process_string_cmd(NULL, data, cmd, 1)) { + if (process_string_cmd(data, cmd, 1)) { gdb_put_packet(""); } } @@ -1394,7 +1394,7 @@ static void handle_v_commands(GArray *params, void *user_ctx) return; } - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_v_commands_table, ARRAY_SIZE(gdb_v_commands_table))) { gdb_put_packet(""); @@ -1738,13 +1738,13 @@ static void handle_gen_query(GArray *params, void *user_ctx) return; } - if (!process_string_cmd(NULL, get_param(params, 0)->data, + if (!process_string_cmd(get_param(params, 0)->data, gdb_gen_query_set_common_table, ARRAY_SIZE(gdb_gen_query_set_common_table))) { return; } - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_gen_query_table, ARRAY_SIZE(gdb_gen_query_table))) { gdb_put_packet(""); @@ -1757,13 +1757,13 @@ static void handle_gen_set(GArray *params, void *user_ctx) return; } - if (!process_string_cmd(NULL, get_param(params, 0)->data, + if (!process_string_cmd(get_param(params, 0)->data, gdb_gen_query_set_common_table, ARRAY_SIZE(gdb_gen_query_set_common_table))) { return; } - if (process_string_cmd(NULL, get_param(params, 0)->data, + if (process_string_cmd(get_param(params, 0)->data, gdb_gen_set_table, ARRAY_SIZE(gdb_gen_set_table))) { gdb_put_packet(""); From patchwork Wed Aug 30 14:54:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718586 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585658wrh; Wed, 30 Aug 2023 07:56:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeoji95ovm4QEx0VnyEugjc/s1wSGSCPtx+RVKodEqlHVaFsYfKdYymN5ku7kKwHpJn8zg X-Received: by 2002:a0c:ef54:0:b0:649:980c:4eea with SMTP id t20-20020a0cef54000000b00649980c4eeamr2122511qvs.12.1693407360543; Wed, 30 Aug 2023 07:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407360; cv=none; d=google.com; s=arc-20160816; b=qQAidvr231Iw28Vna47Xuz/cQh3vJGMWQWpwaKjnuSsCNah8nNB79ezJPvtL//emM/ eJOZKAXjcX1zpvXC+VN4UM8e43RalsKG8QbEwtmtu3ztJLrXJuQBkWWGx8wyIxMC24ZA e7es5qY5gKZMVq58YsiitjnYMCojsG36J/Ya9Ckudruw7aI34p99kN5cyZnF1TwItHx/ RXE2NkJOg/lA65t8ijodvt9FdgIaJrJR1C/NMOi4jGHAHbDzu2l/QOI/UIsCets0WTeg aZuQxFquFAcSx7qP6XayM38+ZiSHkK/Tn/ZOTglB0JD8OPOfBdoNGFJZIfWRcNhQHssm 7S0A== 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=SQNWyEt/hAb1sq6x2ShrI2jNVdnDYAzqYtnrYXK/jhc=; fh=AyMD/Fxc6WQ7heF6Q0y89Q38tKr6/erQHXlFkgZJT1A=; b=LqLMxzmTr0yn3ugxgHA3DnZ7s5amCt2jTDEgcJV6cn8v5nLPMqyQmdGvaqu6xPQ5SR uTj5ARh+qbSgBcnPFZ7bmOJoHDbZfHHojtbEUrxnttL/WoBN/pd+uBD4YmYG7jv40Sdq jySY/Hyy+r8sDWCpGGZvMgxEHKUr+jOOO+/ahmfkHly08EOtkLltivPqI6bU9brqej5t QkT4NxvGMW5bceOaqxRmXDnT8INLOvXZ7u7cFUtPxnnVNrNzXCLA/5uqe6umFQlyqYQs S8U4AgdMeMjJS5WOOu3UySg+8IfCOScMET7JSXuIRsuwAm8qEpZplgGrGZX9rdrlm5jy CT/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SPvRqdfe; 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 e11-20020a0ce3cb000000b00651739a206asi2258617qvl.216.2023.08.30.07.56.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:56: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=SPvRqdfe; 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 1qbMaI-0001CA-NQ; Wed, 30 Aug 2023 10:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbMaH-0001B3-Ab for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:17 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbMaC-0000k0-UG for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:17 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-401da71b7c5so15201555e9.2 for ; Wed, 30 Aug 2023 07:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407251; x=1694012051; 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=SQNWyEt/hAb1sq6x2ShrI2jNVdnDYAzqYtnrYXK/jhc=; b=SPvRqdfednxicQJHYxe6VAFjOAnT7bseLZ4FcO+tKM2EQqwgWiTUlZ+C13A1zqYLpl /wMC3AJ2kNJu+mtnfwlLthKiFHrSacgNmJN1M46wsEXrrFYcspj8ryoysFbQvbC+CqgQ j1PWl77YFu5v8SWlNYqhyWLWnwnCMqiC458oQXwsbmqO1HOkDIZhO9btraVIzlf5++vO eQkc7krN8snfJpstF48F4rNCQGAaTvaEZ0CV+y+HcMJvp271wfOWPls+/4GuptjZrY0w 4yaTlr8bhJ0y8BTwHOXkEfeG9EDpCJucY3e1l3bHc7C1gED+8yX14pev6To/Ss1i5vIy Z9xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407251; x=1694012051; 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=SQNWyEt/hAb1sq6x2ShrI2jNVdnDYAzqYtnrYXK/jhc=; b=Q6y3t2REKOgyUn9cnbWoJrlsdsGr2/IYfwO45k07Daw7VrYz4mBshaRfVz0qzfhGfT fdSzPr0x9cx3QIDv1syO7aNOW7qon8NgDE14vdbH1hCr7djeboXfMoSG8DFpDFaKunQT hCN2NrwmjAUdqDnOF6TmOk51cRBIdZ15QlW8L4PEPGp8GGcWM8VDFXCcxMOj2FMygBCI LHJXKiwdxvCK4fpFiMf7plP+lmQZEGL/i4iRORCGiKVpa8n0uPRH0AHhIKi2W1Xe1IQM brsfj0ZiGsUru+rpFvH0+BcvQZW2z+2LcVbKjdW/3x+R8vLRRgUzuW8HbiXPc9ubcixv 55Ww== X-Gm-Message-State: AOJu0YyKlzw48F1mqFOMMxTKBoxYa9WVdEmn73d1NlNNrFtEQYk13CgX UE4iMse7kL0BvQ2bIDlEz2L4bw== X-Received: by 2002:a1c:6a03:0:b0:401:b652:b6cf with SMTP id f3-20020a1c6a03000000b00401b652b6cfmr2081629wmc.13.1693407251610; Wed, 30 Aug 2023 07:54:11 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u7-20020a05600c210700b003fee8793911sm2521092wml.44.2023.08.30.07.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B76831FFBC; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 10/12] gdbstub: refactor get_feature_xml Date: Wed, 30 Aug 2023 15:54:05 +0100 Message-Id: <20230830145407.3064249-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Try to bring up the code to more modern standards by: - use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls - don't hand hack strstr to find the delimiter - fix up style of xml_builtin and invert loop Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-11-alex.bennee@linaro.org> diff --git a/gdbstub/internals.h b/gdbstub/internals.h index f2b46cce41..4876ebd74f 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -33,7 +33,7 @@ typedef struct GDBProcess { uint32_t pid; bool attached; - char target_xml[1024]; + char *target_xml; } GDBProcess; enum RSState { diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 8e9bc17e07..729e54139a 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -354,64 +354,67 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { - size_t len; - int i; - const char *name; CPUState *cpu = gdb_get_first_cpu_in_process(process); CPUClass *cc = CPU_GET_CLASS(cpu); + size_t len; - len = 0; - while (p[len] && p[len] != ':') - len++; - *newp = p + len; + /* + * qXfer:features:read:ANNEX:OFFSET,LENGTH' + * ^p ^newp + */ + char *term = strchr(p, ':'); + *newp = term + 1; + len = term - p; - name = NULL; + /* Is it the main target xml? */ if (strncmp(p, "target.xml", len) == 0) { - char *buf = process->target_xml; - const size_t buf_sz = sizeof(process->target_xml); - - /* Generate the XML description for this CPU. */ - if (!buf[0]) { + if (!process->target_xml) { GDBRegisterState *r; + GString *xml = g_string_new(""); + + g_string_append(xml, + "" + ""); - pstrcat(buf, buf_sz, - "" - "" - ""); if (cc->gdb_arch_name) { - gchar *arch = cc->gdb_arch_name(cpu); - pstrcat(buf, buf_sz, ""); - pstrcat(buf, buf_sz, arch); - pstrcat(buf, buf_sz, ""); - g_free(arch); + g_autofree gchar *arch = cc->gdb_arch_name(cpu); + g_string_append_printf(xml, + "%s", + arch); } - pstrcat(buf, buf_sz, "gdb_core_xml_file); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "gdb_core_xml_file); + g_string_append(xml, "\"/>"); for (r = cpu->gdb_regs; r; r = r->next) { - pstrcat(buf, buf_sz, "xml); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "xml); + g_string_append(xml, "\"/>"); } - pstrcat(buf, buf_sz, ""); + g_string_append(xml, ""); + + process->target_xml = g_string_free(xml, false); + return process->target_xml; } - return buf; } + /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { - char *xmlname = g_strndup(p, len); + g_autofree char *xmlname = g_strndup(p, len); const char *xml = cc->gdb_get_dynamic_xml(cpu, xmlname); - - g_free(xmlname); if (xml) { return xml; } } - for (i = 0; ; i++) { - name = xml_builtin[i][0]; - if (!name || (strncmp(name, p, len) == 0 && strlen(name) == len)) - break; + /* 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]; + if ((strncmp(name, p, len) == 0) && + strlen(name) == len) { + return xml_builtin[i][1]; + } } - return name ? xml_builtin[i][1] : NULL; + + /* failed */ + return NULL; } static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) @@ -2245,6 +2248,6 @@ void gdb_create_default_process(GDBState *s) process = &s->processes[s->process_num - 1]; process->pid = pid; process->attached = false; - process->target_xml[0] = '\0'; + process->target_xml = NULL; } From patchwork Wed Aug 30 14:54:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718583 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585396wrh; Wed, 30 Aug 2023 07:55:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1/Zr9WHuVDFZVzPA4dTPTc0qF1mf+v0XZRJoXMFYljU0s2QenBwP+qQDJM5MF0SnlD627 X-Received: by 2002:ac8:7c6:0:b0:410:8bfd:1696 with SMTP id m6-20020ac807c6000000b004108bfd1696mr2045477qth.49.1693407330284; Wed, 30 Aug 2023 07:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407330; cv=none; d=google.com; s=arc-20160816; b=BQGJcZxl3KOzhAglJBq/W7azJoru6/X9PR+j4MD9di5XEDcMSv9thXesTa/pH67ZbW eCY2tJsascUulr97pvXJvV1tWbwMM1INMVME2qRDGFwynMUtd4M/OrndWf0IMtWG8N6s 0zudxMUAXDwuXCpCplnylm8rxTsPRHJ5ct9PEJz2K/J3jtfoaNbH0si7QqMKX1F7Zgph 2ZFGm/m9ZuvU+jfM0FJm5vpAZJ8PganVUvvLperRHk82tY4YSj6Y71XYTOEGza6EX8UG uXIgatuZzuGKSG5gjRA18mFsTHo8P//epcXYXoJvH2Y8Kg63Tnuoy4x6kOqfQTyaCZRT BPqw== 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=FIIWkIImEVUr1vcFkZ9mfJXCWjjR9U+tUkLobigHVPM=; fh=cNBNjIifkXlfYWcC4LzEAnGhDOxvJxHY2iXKqabQbo0=; b=ZRAksAQ9ANtZtEJI0mH9LPQOwK8rY9IRj1UHq2eRHx1EfMyUCiCVTa0eudSOIt26hQ KQPeqj9ksG0bL1xtIny8xrCKAFTONYA7J5VB1SsN5tlPmZiuY/g8PgoTipCgACCsBecu dluHlVIO4pMr1+2OgOFlkH1SNJEUn++oEtuLe1VwcGHTWHwNvA+pvAgI/aEx/ojr3+tS cqLZBON/NaZ2IiiPymRAiQV4JoRe55MOvGIdHv0yP97+6Tg3r8THPOVVkO0U0XZOv6B9 0B9L7RJgtHi1Ix4RcbTdj/m1ThogjDlKUOtV1wHB01LQ2zF2v0r0sleK3OF/cbFtaQxe Jz7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7COO35S; 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 eo11-20020a05622a544b00b00410a249beecsi7146514qtb.277.2023.08.30.07.55.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:55:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7COO35S; 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 1qbMaO-0001G9-1k; Wed, 30 Aug 2023 10:54:24 -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 1qbMaK-0001Dq-Hh for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:20 -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 1qbMaF-0000lH-9L for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:20 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40037db2fe7so53705235e9.0 for ; Wed, 30 Aug 2023 07:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407254; x=1694012054; 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=FIIWkIImEVUr1vcFkZ9mfJXCWjjR9U+tUkLobigHVPM=; b=T7COO35S88ANfT8GnupCiA0KH+UMe9X8yaUpz37HbEqx+43UjLJO7hTTNMeHTJVIjy AUgb7IHyPebTNiwk9H7REK+c2NNZipQJq3NJtZGT3+BASie6ed7QkWGlJcJdWGNVC8tL rOtbDwk5VqcnY3ik8kRYye/Jd5BKjGC3IXKBzPuqGyi30vL5ubdf2ifGIRkQ69G3MnZ1 9UNBFqdZma7ZQ3koFd9uDlD83gyDXIJH133jUkUweRlbghBWUatrppDDPcScxSF3jxW1 uLzfWfn/pBB3e4PHgdylVTEVpkOrjKlUkLokku9dn35B8ML7VfCot4M4VGGr3NkjRs5a TzQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407254; x=1694012054; 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=FIIWkIImEVUr1vcFkZ9mfJXCWjjR9U+tUkLobigHVPM=; b=NaTtjg20o6zwrrB0tuii5Y9q8TF2bc1WC/3ILL1NTdihxUHLZ6V3Xp0nPPH4oti98y FR61B2CMPOzY/ddJ42o/vzi8ICiXEJ1xc6lR1LOerGrSfrE2Es+CDay+iMWvyyX2/Pps oPVXrMTasaGmjrnZOhPsn0O1OTNs2QJ0YOPipTiyw+K6P/LRDC4POhifEiKwKMvWi2FU 6UYIkWE/u6STI+jifnX3oBn/OhCk0WCPfThGYjD670AzfnUrq5zTHNYm9zqWjNN4pPeE epFIrK6SK+L+abmPy8COFvQkurAmq/MtPHJh7JsMVXIiCROfYRAMou6Mkh3083MEpAnZ 4dFg== X-Gm-Message-State: AOJu0YwKyU96z9BSBn2Sln//CT28RQoODIotHpQ49o07Z72pu051yh7J DifbqvXMvAcoqafP8I7qz9vToQ== X-Received: by 2002:a05:600c:b50:b0:3fe:c7fe:206e with SMTP id k16-20020a05600c0b5000b003fec7fe206emr2253566wmr.16.1693407253709; Wed, 30 Aug 2023 07:54:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n8-20020a7bcbc8000000b00401d8810c8bsm2501252wmi.15.2023.08.30.07.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DE1081FFBD; Wed, 30 Aug 2023 15:54:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Greg Kurz , Nicholas Piggin , qemu-arm@nongnu.org (open list:ARM TCG CPUs), qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs) Subject: [PULL 11/12] gdbstub: replace global gdb_has_xml with a function Date: Wed, 30 Aug 2023 15:54:06 +0100 Message-Id: <20230830145407.3064249-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-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 Try and make the self reported global hack a little less hackish by providing a query function instead. As gdb_has_xml was always set if we negotiated XML we can now use the presence of ->target_xml as the test instead. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-12-alex.bennee@linaro.org> diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 4876ebd74f..fee243081f 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -33,6 +33,7 @@ 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 7d743fe1e9..0ee39cfdd1 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -31,12 +31,12 @@ int gdbserver_start(const char *port_or_device); void gdb_set_stop_cpu(CPUState *cpu); /** - * gdb_has_xml: - * This is an ugly hack to cope with both new and old gdb. - * If gdb sends qXfer:features:read then assume we're talking to a newish - * gdb that understands target descriptions. + * gdb_has_xml() - report of gdb supports modern target descriptions + * + * This will report true if the gdb negotiated qXfer:features:read + * target descriptions. */ -extern bool gdb_has_xml; +bool gdb_has_xml(void); /* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ extern const char *const xml_builtin[][2]; diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 729e54139a..fdebfe25ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -75,8 +75,6 @@ void gdb_init_gdbserver_state(void) gdbserver_state.sstep_flags &= gdbserver_state.supported_sstep_flags; } -bool gdb_has_xml; - /* writes 2*len+1 bytes in buf */ void gdb_memtohex(GString *buf, const uint8_t *mem, int len) { @@ -351,6 +349,11 @@ 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) { @@ -1084,7 +1087,7 @@ static void handle_set_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1105,7 +1108,7 @@ static void handle_get_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1572,7 +1575,6 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx) return; } - gdb_has_xml = true; p = get_param(params, 0)->data; xml = get_feature_xml(p, &p, process); if (!xml) { diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index f509b7285d..9f0b8b5497 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -97,7 +97,6 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent event) vm_stop(RUN_STATE_PAUSED); replay_gdb_attached(); - gdb_has_xml = false; break; default: break; diff --git a/gdbstub/user.c b/gdbstub/user.c index 5b375be1d9..7ab6e5d975 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -198,7 +198,6 @@ static void gdb_accept_init(int fd) gdbserver_state.c_cpu = gdb_first_attached_cpu(); gdbserver_state.g_cpu = gdbserver_state.c_cpu; gdbserver_user_state.fd = fd; - gdb_has_xml = false; } static bool gdb_accept_socket(int gdb_fd) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index f421c5d041..8fc8351df7 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -48,7 +48,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) } if (n < 24) { /* FPA registers. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_zeroes(mem_buf, 12); @@ -56,7 +56,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) switch (n) { case 24: /* FPA status register. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_reg32(mem_buf, 0); @@ -102,7 +102,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } if (n < 24) { /* 16-23 */ /* FPA registers (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 12; @@ -110,7 +110,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case 24: /* FPA status register (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 4; diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index ca39efdc35..2ad11510bf 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -56,7 +56,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 32 ... 63: /* fprs */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 8; @@ -76,7 +76,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 70: /* fpscr */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return sizeof(target_ulong); From patchwork Wed Aug 30 14:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718584 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp585547wrh; Wed, 30 Aug 2023 07:55:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMIJEJKlIF10IuV+VvNTYQpfex5uaoJH0MyMMfLf1AGPUTjfEAAzGKx5+xw9uluCm5MdqS X-Received: by 2002:a05:622a:1495:b0:403:ad6d:fbbb with SMTP id t21-20020a05622a149500b00403ad6dfbbbmr7675qtx.14.1693407348456; Wed, 30 Aug 2023 07:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693407348; cv=none; d=google.com; s=arc-20160816; b=LpXySIjnfe4krb2WqjthdYYrOl8M4RwxA+U7aOvUtuQbPWcH4/D+cgbtbSBDYixvPE GK7GhRZHjlu7iinF0R+X4uc3nLEKfT088BTTIB1wm79/hxZLl3nmOnGafV3wvi32i6MZ p8rvCbjIRNzFOAuLDu0egAXial10MwoXuEjbHo3+DO2p5D1Rop5djii4KiE6H6A9/suK r7TAkx9MQch4LOJLqgbt0pirPzOKokK2KGDr1j1mS/8BgkUoDj9hHYflE0eyYGt1X/JM E5gRQoEgdRfZzsPXBCerbLfPxknA6w2I1gRj04TKv0vT19O8LOssMscI6STcgxSQ6ZIQ 7DkA== 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=XKjAgQoj2FFsH6qRrmv8SNeV5ivWp4tXeZ8rykfRKz0=; fh=WhxHrTvkXUd+iMXCSKFEwh518tntpsC5XXAxrOX+Ze8=; b=W1fgXuQeJkhy3Rxa4PCb9KXDfUykDgwOyD2WRwfy1TR2hv1UgH7YrULVf9XPwAqbt3 oMy3hCzFZJ3DT2WZuIoG1viP2v4vQ1AlOoy4DIZf5avOqlIBsE1XvFyOWTmKZ3SBMKvx yiFbJ7zvKz3rRnPUUc7pPox25bW7s1NkBqmYSgwIOSjbEaFyhLgx5QrbhJaKJCAzysji ygNevlg6/lEqJ4MRQKYjHGn86LBGjblWh5IAGV7IaoHEfE00ReCYcAVYMTCoGRK5CjBi 9X+SM0LPlJ1UsKkTU1gr+U53/98FmHf3TxfIHAuffb2Lpv7QutVNAwEvtrr6RLNG8RzH Gw3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=swZJNEGX; 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 s7-20020a05622a1a8700b0040fd27a4366si6071852qtc.679.2023.08.30.07.55.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 07:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=swZJNEGX; 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 1qbMaM-0001FN-FQ; Wed, 30 Aug 2023 10:54:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbMaK-0001Dr-K0 for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:20 -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 1qbMaF-0000lV-Ia for qemu-devel@nongnu.org; Wed, 30 Aug 2023 10:54:20 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31c8321c48fso631075f8f.1 for ; Wed, 30 Aug 2023 07:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693407254; x=1694012054; 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=XKjAgQoj2FFsH6qRrmv8SNeV5ivWp4tXeZ8rykfRKz0=; b=swZJNEGXqnTMvy1jFN8vxOx1D/68V5iyROcHqkELnQqZIWK052mHjALCX06QsWBnT7 0238cPdGWQtl6G9ocsB9p0w22FaqhRfOhLS+4yOy838PJWlksxbmdqdRHMZ2TEpLESQ7 ZTfCEQf8XFc7RRMS5uoiorUtvyDt6j7hF9W3y/2Q7lHC1Bf6dj5tGqhxvJVgYnWDG9ER P0/eAMTv4jzuCVp/TRIysjO6kiQyCOoizUrh/TN5zH1g4hC5TrJTtEqMpeqSWH5dbBWd b6FPIjWWTdwLy+xrjCGsu3JcY2TRKUCbmIjtyZJwMIzXHI1Y1IixeoswZtvqDhedt7/U ml9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693407254; x=1694012054; 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=XKjAgQoj2FFsH6qRrmv8SNeV5ivWp4tXeZ8rykfRKz0=; b=Qpri+AkHJgdTa+EEcoofeEzlTweKW5pHX/6ZXA72r+i3oULb6GwRhPEUX3VYRv8tYI NljGK/+dBr6pPfn/n7genJYCWhbkGOgIoTHAMIs4zwL0XUp2uvz3ZnKZyyFNhxk0YMAl +RxgYR9y0xZL8ICeG2bsZWtzG/BwQbRkx5jlSyiMjolNHpki9kQB/zlxRL9hV8fmrrdW WHzoB1Q3EjpqzjHRAw6e3VsiyBTKVZhnzhEome8DIj1Uy2eZoDyLvE9kOyLS2aLlgOwE 8it0HqWpB+ICK8QzRD8TZ0LqLs5h5dNSnSiJAaGcgz8jv8g0ZRPzZYtPqDSE/BlwNMyF UVYQ== X-Gm-Message-State: AOJu0YxvkP8CtzF2pJqMct6jzjYHxSLcxgAymD5+778mCwo2EWcvjGKx erk/59CpTJgxadbU/m3Q4SxeHQ== X-Received: by 2002:adf:f7c1:0:b0:317:6734:c2ae with SMTP id a1-20020adff7c1000000b003176734c2aemr4673187wrq.11.1693407254211; Wed, 30 Aug 2023 07:54:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s8-20020a5d6a88000000b0031431fb40fasm16810212wru.89.2023.08.30.07.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 07:54:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0305A1FFC4; Wed, 30 Aug 2023 15:54:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 12/12] gdbstub: move comment for gdb_register_coprocessor Date: Wed, 30 Aug 2023 15:54:07 +0100 Message-Id: <20230830145407.3064249-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830145407.3064249-1-alex.bennee@linaro.org> References: <20230830145407.3064249-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=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 Use proper kdoc style comments for this API function. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230829161528.2707696-13-alex.bennee@linaro.org> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 0ee39cfdd1..16a139043f 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -14,6 +14,16 @@ /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); + +/** + * gdb_register_coprocessor() - register a supplemental set of registers + * @cpu - the CPU associated with registers + * @get_reg - get function (gdb reading) + * @set_reg - set function (gdb modifying) + * @num_regs - number of registers in set + * @xml - xml name of set + * @gpos - non-zero to append to "general" register set at @gpos + */ void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, int num_regs, const char *xml, int g_pos); diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index fdebfe25ea..349d348c7b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -456,12 +456,6 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return 0; } -/* Register a supplemental set of CPU registers. If g_pos is nonzero it - specifies the first register number and these registers are included in - a standard "g" packet. Direction is relative to gdb, i.e. get_reg is - gdb reading a CPU register, and set_reg is gdb modifying a CPU register. - */ - void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, int num_regs, const char *xml, int g_pos)