From patchwork Thu Aug 24 16:38: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: 716555 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444137wrp; Thu, 24 Aug 2023 09:41:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjCfHu/ZAA+QQPQr8mQxF/L8i0IWvfVXX6f001BjFbL9CPtAFEuQUiIBw3JLNcN57+UYqZ X-Received: by 2002:a05:6808:140b:b0:3a8:54fe:31e0 with SMTP id w11-20020a056808140b00b003a854fe31e0mr348389oiv.15.1692895297047; Thu, 24 Aug 2023 09:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895297; cv=none; d=google.com; s=arc-20160816; b=P3uFSsuNTWeV4nMHmre1zcwkfRvZS6Rv8WNHNsKZEoETbx+n8utsJ6WHgH9/bGgX28 Ug3JHQ9ukilkQZOPjbO/US/BeDTrvNo93Uce7vj0oF0S8Ko9bVJm/oAYG4dKUMtYugEn KHCBNEF/CdpVClvmmNRgiNnQqWGLUz9KlKw8Aq1hRiRfdGi3kuf1bWzHIxr4mKZtzBlP 0ytMO4reqoqYaKIzCoyaFmTPN5dnF3w6CSPE/wYhacTjg+jwyUmkIT55GeS7pWVuujJg 6mgjPnKf9mhb4n7osYCGTXgyqkRdAiAfYcuLb84YZfj3qEv6amkriUPuB4+LajxmfXcQ n6Vg== 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=yFrqHRj+4Z4QeOb4gTibh0+O8iFD1dFK/WKj4LG+z60=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=oPBs4z8rRnxAzgK4/6iQBCUsff8lYm6grXigREV1Wer5a1W5XUAM1aBBJaiLTkmVAG MLXcxXnd+jBs7QNzW6zSceYi3pjE8EDi+ASokIf2WsStRDayjozZvvcXaNGd88YOEohR qd7lcO5X432AqpC+rYp8xMS3msASi3IEmesLNcDVWTX9Bhx0DQ6rSnboh8/fjrzV9sNj vGW7vwMqKfvqkeHXdQkSxHmy9NZJUv++fcjW503EkzF8n7yqgs91ZIsYVs1bg+4RqyBS igz3EJlZCPOK2tyQbrOUETrlKM4+X2xVOPNoPJsqcYpK4J/0TQkrAUNsJAsMmA+PaHiV L6iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ysF5MnHY; 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 y5-20020a0ce045000000b0064f36ea0bdbsi3554346qvk.373.2023.08.24.09.41.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:37 -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=ysF5MnHY; 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 1qZDMi-0006Jd-Qk; Thu, 24 Aug 2023 12:39: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 1qZDMg-0006Hw-TN for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:22 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMZ-00086R-Hp for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:22 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31c5c06e8bbso3269461f8f.1 for ; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895154; x=1693499954; 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=yFrqHRj+4Z4QeOb4gTibh0+O8iFD1dFK/WKj4LG+z60=; b=ysF5MnHY5BuchJeEHXrwOC0RvY0gXuVmauw+yivQeBiHz+WeaZg0b4z4hrNqwi3MVR CmEOZUvvp8dc0SMcZARqYcDO1Q8QaGfQGDbQIye0Gwbry41gz5EMTXrXgpFELslf59EY lecdSVk1gk+8/X4mifrMyiXIrMUzo9AKH0x8JP4MPf7af25PSQTO23tbMhlTxRNcaaMD 0+RlKnUEKk1qzO3CzXr9JyNi8VePRr2nbW6yUnsL3WvIqBB4gHx5KAORIEBZVPVnWu0C r9T+KBzZ3C15fFtXWpMWYHviDVTKk0d/1SQgw7FizKnoa/JcBixQS9pIqM5xFbhfaow9 A+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895154; x=1693499954; 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=yFrqHRj+4Z4QeOb4gTibh0+O8iFD1dFK/WKj4LG+z60=; b=Tj/GtxWvgjsQQySmew55G8I3V5fNLNb2wHgeQiggjUbmYLwP1vgJtq7dkcCfsg/Clj EOVWMBV7TcAyy+j+bmSQww6tURtK/eT6TY1SSXVZKI6dgSySbO3XuSYk6falsiQ0UrFm mEGsEbyeFyu/eqp7NnW97oTgaZ5TADb+I0TmTt2yXuLE+bhz5wrtv70XjnqJ+yNzToD2 XoG2kYyKIzKyu7CRVNv8okzQGFqdjLsIwiOSQZJswrLAh+Nmbmivv4hy+mz9ptYeEjg6 aVIDS2DizXcUNYOutVlajegO09lh5+TKUCIjz9qfaf6DVEzS6VUPKL2OkUsDwMu3hNjr 8OdQ== X-Gm-Message-State: AOJu0YzZTNvchbtAbAPmBAKsTpRmP9l5cOIgECFVo6cjM0EsYOMrUuW7 BDDdvHaIbo8NCFP3H7Wn1du23A== X-Received: by 2002:a5d:60d0:0:b0:319:62ba:5d08 with SMTP id x16-20020a5d60d0000000b0031962ba5d08mr10991554wrt.33.1692895153728; Thu, 24 Aug 2023 09:39:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w7-20020adfcd07000000b00313de682eb3sm22913555wrm.65.2023.08.24.09.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A2A11FFBC; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 01/12] gitlab: enable ccache for many build jobs Date: Thu, 24 Aug 2023 17:38:59 +0100 Message-Id: <20230824163910.1737079-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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é Message-Id: <20230804111054.281802-2-berrange@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/ci-jobs.rst.inc | 7 +++++ .gitlab-ci.d/buildtest-template.yml | 11 ++++++++ .gitlab-ci.d/crossbuild-template.yml | 26 +++++++++++++++++++ .gitlab-ci.d/windows.yml | 13 ++++++++-- .../dockerfiles/debian-hexagon-cross.docker | 9 ++++++- 5 files changed, 63 insertions(+), 3 deletions(-) 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 c2cfb6a5d0..578269766c 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 \ @@ -24,13 +25,19 @@ RUN apt-get update && \ python3-venv && \ # 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 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 Thu Aug 24 16:39: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: 716556 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444152wrp; Thu, 24 Aug 2023 09:41:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcojW+yzSorJOIcwjCjwG1TddFO8xO7dGJVkOR9PRsjHaUx9hkRMsnqZD1F/1lg2NxF8YZ X-Received: by 2002:ac5:c2d4:0:b0:48d:d3b:7dcc with SMTP id i20-20020ac5c2d4000000b0048d0d3b7dccmr10277131vkk.5.1692895299367; Thu, 24 Aug 2023 09:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895299; cv=none; d=google.com; s=arc-20160816; b=g4wwNXmzSUMEZ53OCJe79a19XjggQdFSvWJPOCSQmItGrPRZMaLRdUR+wr6z8oS8oE c/4QmQlwGn5CKe1doFczato/hfFXYQ0ofyFQZxbb7U7PXEMwe4lAbZvypMYvBFMXfU92 HJIcZ9ocNDMu34NQLmI9pb8HGZYtUone02TVB7rcAJWbSKG/oZ+tlLuJQEGTQf9Vi0Ah aX+U2eujHeqwMzBRDKY3Azjn2Exq+BmihNmtyxRvBmx3kGL0CYH1O/Bqn3DlGC5u8kOp dB4lSqAQryhb65w2zbkSFrTxDxFbLiit3Mz3T6MKepgpz8avoBZtv85DkoZUOT4p7oJa OENQ== 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=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=nuXi5fvdjnAmcvv8O0KiTbpW9hPdVNHLf5Z8K5Jx8PKGegqHd/YcxzVtS9hAcI/rQ9 IBpCzJN5rqIFa8nL7lgDmVbsn3mHjglNfAEUXs057zaB9UdNZu+bq1ZdtPf2vIK4xw0s xz9T6Mcx0sX/KSUvOi1CO3LO3nBhgYOviQorltVdGzaneFv5NPKmwNeyVORqBy7xpzmR GbRta6Irgb9atSv1DZbu6PGRDhLFvi6U7UHYdYE3E4Ga5iZFsq58HjxVWBpxIOD6J2Ep SAEwdgb3WIcXdU2MT0Ggj2Idcu67szeONqUbfaQ0g0L5tG2qiL7MimWEnVCpsUmBd0wV a/pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qEO8Zy1e; 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 rg3-20020a05620a8ec300b0076cf1fdcd65si7934680qkn.264.2023.08.24.09.41.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:39 -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=qEO8Zy1e; 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 1qZDMg-0006H8-EA; Thu, 24 Aug 2023 12:39: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 1qZDMe-0006E6-4N for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:20 -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 1qZDMY-00085v-2S for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:19 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fef4b063a7so36126065e9.2 for ; Thu, 24 Aug 2023 09:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895152; x=1693499952; 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=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; b=qEO8Zy1eDblNs9NDuEk3OYQj9FygmlkTpm8uwb5aHOZiRO3kxNIHNPxqZgKAD7iujV P5HDYEbcIcbgDDF/1v4Dc0g09sXQHq9OUmInVVbKeo/o32yR5yIfjLk9MNCWpy7lVX6A PxwQ+iTaf2M2IPXVYjECAbwbOjE5tDwLZfYTy9wFsi4AU552xRE3ePzNpVzwrKLrzd/Z DUbrwfi81dlYmMhq4+j1bSvTPUIlboRpM+xRqdcWyOun4fFcbPAFHqr+bxXARln19fMi MYyXMm4CRKHjPK2kdMISGmex39tjoJU1Oimc0tx+gdqwYFecyohV4c8TwmWWH0GB+/Vj BnEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895152; x=1693499952; 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=zI7JCT8Y6EDH1PV9qo6Yd/dGahx6z15mbByhoBXxgRQ=; b=Yz5wFARx2naNqesn/RFkzJkafURnedGh2vYvb9LgVeAeXCaWR9dlaz7TszlmIXGme+ ZGApvTxVVu2GPphwkoO39Fz7z89MPFTUNXMZ20hiJ9vLTiuHvs0cQ7Rj73c8O+nmEvnY 6wQuSHRJGC9Eoojc+LmR1wwPeMOU4St/lUVKHXkB9vJL2dRa8vMxGWiqLhE0wFgwUs0r 82Crxqix3hLu5cMmVwyfeCZD3qt2G+oFqpIlo8ddmJN3c48vDmCsXAJQIfHqQIUHz0Bl C61snltF0TC+5qLvTB0FrqnunWHARWUFJlLnNg9vdT8u0rIDoxQ6M7RYbae8M23jA+wX ycHQ== X-Gm-Message-State: AOJu0YyrzOCRnZowj+AZVIQjA1UY31rW7NaLno5cRtb1HhDXqPz3qKt7 fgL82at22KVdM7gMFygZstDEtA== X-Received: by 2002:a1c:7c04:0:b0:3fe:179a:9eef with SMTP id x4-20020a1c7c04000000b003fe179a9eefmr12104116wmc.40.1692895152521; Thu, 24 Aug 2023 09:39:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h11-20020a5d4fcb000000b003141e629cb6sm22495847wrw.101.2023.08.24.09.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 74B061FFBD; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 02/12] tests/docker: cleanup non-verbose output Date: Thu, 24 Aug 2023 17:39:00 +0100 Message-Id: <20230824163910.1737079-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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). Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- tests/docker/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 Thu Aug 24 16:39: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: 716554 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444076wrp; Thu, 24 Aug 2023 09:41:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjVJXjmhr4xb9PR4/TtMS1BjLOKFx5ttOaexrM+HaZMXugWAy7DXkUe/mQT4a9DTCnq25Y X-Received: by 2002:a05:620a:1906:b0:762:499d:d9dc with SMTP id bj6-20020a05620a190600b00762499dd9dcmr20294394qkb.54.1692895289667; Thu, 24 Aug 2023 09:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895289; cv=none; d=google.com; s=arc-20160816; b=phDphfL3ru9nREx+IoWv68geu6BljFzKWsB5SFK7F3JtQVg86PoimBQsBXJ+8zq1fE jf/oYcsQhCVqz/1GBxOaMcIXtC/2SJDg0KmpZi5UrkcE7mpZRcwzQrz7ovAM5GVEZ2BQ R7Q3F6n8bJ5fmhLFm5+JDbPEeUFoVnAQfpwWIDnOCRYKlPDresZd5+wsHeWTs0nwtIvp X0DF0m2saMTmArMD1ZDN4KCo0KDxS6JTMfSWl5O6bo0NpBUre6qF0xR4WDs1HTGCIga2 J306PiSiztBUaCAUCU7BNWpHxbzNEMTMHpkY9TjWU2F9h5lMathrUkYHKrGNbh9uJRoo ZjUw== 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=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=0zbEhuaGIXxM67iNjqb1IRnqMj1qTnISokICw4fOf2Ip9ozIKBDpHke6hw6o/DdOaU ZRe/7a33by4iD87vNAqem3XX7MVY3dFi7QapnazYaGFJKNlxZwcLv7Hz09+HMAsn8Ltz oUFd9KdUo1BYSSwF4gIrG07vI31vjtL/3kaUNRF4gFXKKO/ezCGSL7i9xPVBBSl5CveZ h0DpSqxiBwoLnJLLtSCcPeKqGi3olsl8+dkpl4L9H0XfFcXHkIEaBGe00O0Pq9uEs1Rq obo/JuiWRMqnoRsHEdtbebJAaTvuPTy1MlCF7Gyd272gAbVVD7ouPhsl0qtx58q7Qd1J 5y5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N2FSmY4r; 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 l8-20020a05622a050800b0040fbec47176si117402qtx.131.2023.08.24.09.41.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N2FSmY4r; 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 1qZDMi-0006Iv-6n; Thu, 24 Aug 2023 12:39: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 1qZDMh-0006I3-0Y for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:23 -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 1qZDMZ-00086Z-MO for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:22 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-401b3ea0656so275735e9.0 for ; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895154; x=1693499954; 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=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; b=N2FSmY4rJ/dqTSDHFZoCh/j6R16zlvPxpJMutkBiBOx1EIHIDkNms7NtFUsHnYtUBm xN693Vhd0In8k2KfMsh7929DXQNee8hkJAOXvDdCjyXQG7ec+0AldHgQe541L4pVINHA PPTh9hxez2WcgiV0qgCflK/X4QiSVWUfXG692Xa6zggnbf2JBhi7fTWk01VYdpNq97jF OHezqSYmLv2FSgKaoPY1/7MlM3ed76WoqQLRyDQB+ifLUTo9XyOo9ia+fbMkIS4KHdGB Nmgv/c+m2nS6WeuGbA0OKv06t5a769p/Oh2AbtTXri62UnLAK5bNkosQnLTEzzLVVTQU /j5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895154; x=1693499954; 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=i4cgTwYKmgY5S8ywczpvEN/MK3kalEN3O1n5Lxh3nkA=; b=R4guuS36eQscv+2rMK2g67HG6RD6Gnpsbuv+KDLKYS1hJyi8Z8FUGJZVDVrltxanDF MbrXij7D79tXw9wKoN4g1vE+AuJXqiYSRvyeHY+9SgrzyOEex5mlxER5WxLS6Sz4894Z ivus0DpDXwiTpd1pgVx0QwOLSMoxy18ZDJZBLyOH1u3TmQmnIl4fPu2FGUtnx21THPWh jWNhZuzXIl7qrkCWVbaEFMH4Zku8Zvef6CFt4GIei85yThmy7BNEJ5OSfRbuItRHf0Jq E8I2r7IVxe7Fp5bFTaVjl/QNnjLeB1TW5/1azBQXCAPhkWIQSgOfTMs21OyEacc/y+ln Bbvw== X-Gm-Message-State: AOJu0Yw4HcKd21K2g66PYVJqUhvP+Df2rmkXOoTt7Aj+FNevbL2VvxxU A6tnJ9XeU63k78kIbifeqU1diw== X-Received: by 2002:a5d:4403:0:b0:31a:d49a:38d with SMTP id z3-20020a5d4403000000b0031ad49a038dmr12013904wrq.54.1692895154204; Thu, 24 Aug 2023 09:39:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l6-20020adfe586000000b0031989784d96sm22889512wrm.76.2023.08.24.09.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 90FB41FFBE; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 03/12] tests/tcg: remove quoting for info output Date: Thu, 24 Aug 2023 17:39:01 +0100 Message-Id: <20230824163910.1737079-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This avoids ugly multi-line wrapping for the test on non V=1 builds. Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 2 +- tests/tcg/multiarch/system/Makefile.softmmu-target | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 Thu Aug 24 16:39: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: 716560 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444271wrp; Thu, 24 Aug 2023 09:41:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaPlVI9K3+Wp6Da2nOG5PRa606VFLdOsLh7nYX0BF0hLYKxjTnBZ0pi6nuzGpR2W6THuFi X-Received: by 2002:a05:6214:2346:b0:63d:580:9c68 with SMTP id hu6-20020a056214234600b0063d05809c68mr15327971qvb.32.1692895316901; Thu, 24 Aug 2023 09:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895316; cv=none; d=google.com; s=arc-20160816; b=lI/+jEWmeijpUG4Ct2h1tGTWzbEFCIM9qtEu+x9/jYdqSXrQkpb9GI0E0ueWFEwEgc U8GG8z0DTErAenuV84FgcWC7ohwojB2huXLX0VSOoiRAbDkOEP2IXG8w7kOW9MDFQi4P SU/iak7QEZkEp656nsBi9LSbGSkR42f3IYSCVzEt0bxjAgUHfrNoWgWIKyPhnzfW0LaC FSdElyrNA27QiY2yy5cQz2TADZ3xUkU3xJI3sPKl8JAS/103FkN2gGGEGYeNnvZR0s/o OF1s67V7pjwZxqchzPJduLxWz6StSjFyJUNbXuga3HjOLkCVuLoilAatnADkhfG6YL/U wvBg== 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=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; fh=aUL1Q6jN33xXfcVUXrmc30ArCAPLVMr2mlcYRZh/bjY=; b=U7ug1bRtZ/+o7nIIGBRP3WPnpy3MtTPDvLWVYijfmb17lDbPKbUnCBH32u79g2RwG7 rHB2smnoja6BOk8SdW9ActB9E6AhOmzA9P7HwIWpV268B8z0baU2zvH/JWIFX+WeIKmB pCFCBpjAWrymPPaTBepUDvbrn2TFLZw7NS9j3e5WOx1zZW622gZ7ryZC31aaGn+r/4pD c/L3ievhNEMOWOGt00xiqh7WQDY33BbEskcaL1WwDiT/tbBcyNJS2sJ2hX5TKuiOnVfw QnlBHTmbXEAxqI/io26sWL7HDjT80BUa4dMiyI3p2hHRiLaITUyudgJq2aL9/DlXTzM+ 08bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vA04Pnyi; 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 w4-20020a0cdf84000000b0063cea6346fasi118266qvl.396.2023.08.24.09.41.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vA04Pnyi; 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 1qZDMn-0006Mx-3Y; Thu, 24 Aug 2023 12:39:29 -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 1qZDMk-0006Ln-W5 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:27 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMb-00087H-92 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:26 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fea0640d7aso233125e9.0 for ; Thu, 24 Aug 2023 09:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895155; x=1693499955; 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=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; b=vA04Pnyi1MC8iOQivkJG13qqRHXhRXuNG7cUOMxumPJZedRGejr4eELLl0BrlJyUqV Vd3n/9aUMUboZS3CWZ9lfs67ilKCYueY1h+GPvUoAEg2hwJIF2ezCfTY23rQxpdGn96n AUkUD3bu5RDU2QLQB46APSKzlD6/v4AGjV3U/9/xpLDi//2nBJ+92F1576o2Y+MUr4zX /6Ewj6uwLFC0TRSeEYj0Ri1Xoka63RPdCCYj7cUt5Fh3cixZiZSR2xn+WXOCawLN2wKt tBjFnXRyU6bIG0ix4WNxK119p1EeUcp5omVUWMmQnuj4rH5ZhCFvMmXYcLpLmMeb2Pvn OB8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895155; x=1693499955; 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=iiC7cvPGqtDwu4nVf8eS+Cmc1lWchz2oWST+0j9UI/U=; b=kS6yqw+/bU8mTCR13TsnsnP71NpImMLG5PJqtj1gKAhPc+QkWJHVOo5e6rksxwnYZV 4k49mSvfzirUQmoGrK2Pe7iuJU6gwQW275/7y1U3yg+ijRv1x/QcPVRyRVWqfYY+whXL KKPaxUd74K2drAuFTZa/F+dtf1FJ5zup2HaplllbHvleCp+HBwurFrqzOcl1zKIXnUJP J4DN60Wq1HdPrIsEwEUOEUOZWvad0KPjX88IWkBlq5Wxq35ABrcggzu7uMmlA8B6ld89 C81PObxGe2/5SGCpB8nMCFcUkN95d14oDoAdPnQdMwbzW5sXOyDKLKNaPSPy8GCwgnSw A+7g== X-Gm-Message-State: AOJu0Yx0lHB2Z41VEiBShOcuyhjSMfz5SsDf4LPZtEXUzcN03YmCl2Y7 0bSEVUf90LMND89yRfl7+ro0YQ== X-Received: by 2002:a05:600c:28c:b0:401:b0f2:88cc with SMTP id 12-20020a05600c028c00b00401b0f288ccmr1218595wmk.41.1692895155495; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s16-20020a05600c045000b003fee0741b8csm3070971wmb.23.2023.08.24.09.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A942F1FFBF; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= , Stefan Hajnoczi Subject: [PATCH v2 04/12] docs/style: permit inline loop variables Date: Thu, 24 Aug 2023 17:39:02 +0100 Message-Id: <20230824163910.1737079-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: <20230822155004.1158931-1-alex.bennee@linaro.org> --- docs/devel/style.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 Thu Aug 24 16:39: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: 716559 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444267wrp; Thu, 24 Aug 2023 09:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvKmZpv1IGqqqAPQ9UWuz5E16kjna3Cxtuc4KKqyBiG/N5kGi6t8K50UpUokiM2pn+soAd X-Received: by 2002:a05:620a:460b:b0:765:ac1b:9218 with SMTP id br11-20020a05620a460b00b00765ac1b9218mr20322328qkb.22.1692895316510; Thu, 24 Aug 2023 09:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895316; cv=none; d=google.com; s=arc-20160816; b=hhJ51cKQdovUIwkpgwxTtdhlW3f7ZurpNgcnjF1YUZUJUt2JQTE0p5RR16oPYxE5cc NK1ZSK5ayEe3/yUhHttLkIE1X/zaUdmxM0zSeWavUH6QsydNUnCuunPBWuhArzlq6DCE z70l2iDZFZoNZBKtHavBYi9EqK12xeQL61CS6dGGurYpF9I8a6L0vLjcemergTeLc4VZ p8NKJprHLxMiTdq7Xz8bNMHM619xVmXOkX5IwXyCMt9scQ+x6cU3pwXuRTJ8U4m+ENJ5 xHVSBPyOgTTiFJfWapdyDgW/OKuy2+XMu2WY1UMgQCvDaJAucyX5O4B9/dB57j2YyzKz ElyQ== 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=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=Zqyb5bpZRDDq5Y9wbisCHc3kOs4QIQL+RdzkLTA81v0eYWuW0u0duCZFImGl8NjwI3 c1sv4hPGayl/K4KmIRi/Y+MD/npjABQrr40r23y+CjjvViRvway2NA7oGRyrrSKrcjo0 qrlfRT+kzXJ02tORGE5T74RIB7T06L71MlHut7lBpat3aDsaNm2cUD6YaROsQY+8p2BO gnNtUK90Jkxjvt5Q/2fPr6H5Q0SUMmKB5Xl+/aSjhSdWO2ZA3jr2fTnLAgUhkxqjXoN1 PrK0792WP5XHz7Rt+C2erbEyUGN4146fy2U2uuGzUAEWd8egBTG3WpZZyq8AKrmSY+Io NcIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p180aKlf; 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 s8-20020ac85cc8000000b0040fdc33a0acsi94740qta.794.2023.08.24.09.41.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p180aKlf; 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 1qZDMi-0006Je-Rp; Thu, 24 Aug 2023 12:39: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 1qZDMh-0006Ig-SH for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:23 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMZ-00086f-O0 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:23 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-401b3ea0656so275785e9.0 for ; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895154; x=1693499954; 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=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; b=p180aKlfum3DESaYhDrgyP0wmOAlWSN27rTdi5+nLzAXoXEosYSqJfFbcPGFEPeoUo URf9e0s9TyhJLe6ZO2Ki/uISr92JxQOGoMZ0qSkL6m1n1xrp0XnHqk/tDhBUxrDW6cJ7 sd+rWAMvmyaFUjoGlZsNGI6zDdWlbyrBHDZyXxGMF1AfveuPUBwLDzWc7lclbqsCVqsM eN/7WC47TQSH3WUr51CSg1ZNFhz+NAzPJxASPjig+JTSzgJEIIs7ELXO5QmbC6P9Xroq cz14D8P3GDTv7yFcHC9GHalq7OL6DLM+02n/W7u0y7ewjMXlbNeWOc1oQgC2vUPw7aRg b7gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895154; x=1693499954; 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=4GEwqqGD6lwuTZz4D+67GaWk3Ul1LFarK634KRjfE2c=; b=iGdLoxVkI5cLiutcpM3iODeSAtIo1EQ5toeplhCMNUGGRkzxV0Egy2M67auXDY7jBw bgo6c0GY110rS8UZpVA/lqEXjtaygFs+zoTP3ho+5Cz9cQS8QQDLS2r+1hY6asPty/Yb TADxYlIXWN+Wh+Cx3fMMbeXRU+KIQBlolCM0CftdYJmICxgKL+8KLR6Qm1o40Z47ayjK xX7OgR8tqMlZRz0OMSAOLpE6/bOpnK314/b8KhXVrRJZlMarX4zw8iPanfTq2E1WGAqB S3ArmMCrp8HwFTYC4PBqhCfJYmi09tPDgxm4aMt13AVQFjpDLckPm1jZvJUfmKJptBy3 za8w== X-Gm-Message-State: AOJu0YyJzUe9ydQRfzg8vDcGsEjzmk7N+RhZbhF2PkEetqLRcnD1TJYw Vn81BWoPXFw4ECfZcOw7K6EqCw== X-Received: by 2002:a05:600c:b44:b0:3fb:a100:2581 with SMTP id k4-20020a05600c0b4400b003fba1002581mr13163314wmr.14.1692895154412; Thu, 24 Aug 2023 09:39:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c230c00b003fe24441e23sm3134878wmo.24.2023.08.24.09.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C22D31FFC0; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 05/12] .gitlab-ci.d/cirrus.yml: Update FreeBSD to v13.2 Date: Thu, 24 Aug 2023 17:39:03 +0100 Message-Id: <20230824163910.1737079-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 --- .gitlab-ci.d/cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 Thu Aug 24 16:39: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: 716561 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444324wrp; Thu, 24 Aug 2023 09:42:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDeJZ3TtsCms3uw2jxzIh/cDAEOSc1AmC71RdQiymtIpibxx+sltOyFBbX2dT0HhGwRC5m X-Received: by 2002:a05:620a:2912:b0:76d:9bf2:f1e9 with SMTP id m18-20020a05620a291200b0076d9bf2f1e9mr22322848qkp.13.1692895323557; Thu, 24 Aug 2023 09:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895323; cv=none; d=google.com; s=arc-20160816; b=ZSsz9fWEf3C2YuVIucSwFsPe0+YLtEXC5I20HRt8KLOFGryeGTB0D3kznE5BtddlXm uMLpa8cp3uyx967F1wlhyY1+vJEsskAfGVF9oxj1HlMxobjslTrox0C48mF6zgDhfp72 QLVfEY6TbDlqa2rWwR7X4PUk2ljTx2MxhNmgyRRUt7UCF0ZPqMdEsUCnJaaHG5fRKmbk J7gj1t2R+rW4SGSzc1vgvtfaBANGaVHvl4z1icOn01wvWVZwwDd52368bkUKXOYwXEkZ hIGVhKU6UgmLplZmrZrlmNn7Ao/gSVontWVt6BI8V0+T0epEralLzCJLiclZb/kd78gd wyWw== 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=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=ZedFLtU3oD2e4uvmiUNZ6ytaxpxrT+h9KgNXZ1+3kx5R2NNHYoDtIFVWKj2LihNu8S JLvzxEYuna9HYfS08yQgebCCKx25bCfXzhhr+32kUfCnLozPtQi+shuYIa2Uo0W3wVDt Alv1ULJUf7Q+xRaPJMYEJn5df3E1rJugcFUxk462Mo9pkj3oGOiz2se1PuU1VoqYvpxZ oePAZh57JLOGzwHkAn5x9bkv6D9sXq5aiC35FNkHk0StyOhiRfTde3MrqF8aHMJnI1Xl tIScYcL3BXXoG3LCKnfVfdFpCBhSzfFxaB/IxWxjeEuPXcgwcH8OhOsB7+b9ABby8QJb ibDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NjeeNRAQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w20-20020ac87e94000000b00410ab186ed1si2514315qtj.236.2023.08.24.09.42.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:42:03 -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=NjeeNRAQ; 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 1qZDMs-0006ST-U9; Thu, 24 Aug 2023 12:39:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMp-0006QE-LL for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:31 -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 1qZDMb-00087N-My for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:31 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso59322985e9.3 for ; Thu, 24 Aug 2023 09:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895156; x=1693499956; 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=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; b=NjeeNRAQKyfZZTTxD7SkJIUtlIAvv0OfHUufP1V7o2J2FKcwIZm77hXeahIIIAeiTW yHwsYPUizZ0Zc9ICXOG5pi75oKa6MP2+OrYMqTTqS4vE1KUQPm102+BkOYIjn+OshKUy Hf8/BnTEy/Fkyla4cst++Xe6tv95FBt7zk51Ol6pcedrYuMbEmIk1CpAA+zxycJqOUnL hnbP+4A9a2VBjKBmDqjQlPTojkgqGbPCqSvRVG9+/ewWbB1aC12/9e2dh4GoHJ2ArxcM TWAf3yoPl55Aray8HKIQLls8LGltxm8zFxfk3tJ05UtO63bvPlDGz62kWfF5LLTDwXxV O+rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895156; x=1693499956; 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=HWAw3yoUeeJNMPe6CX9phpQMFB1kiw2oQRZp+zWhjgY=; b=h+Ijh6X9dYr6KDlzPBt6bJpphicye1KUv+oUgfSRJ/I/k+7Vsnb/hYi09Fbb+AlEnQ 7OBLipdujkNKMWzXGAM973C0fc4KGRusxpl+/ADLEUrM4e1jAK2wHgJoQzkLa38pFJoM QzKXnwNqcs3DTTUX99ZoZMYfKbqRRdmhyzIKxElGklBu8G0fmZqrGBry+EY2M+gQH3jc tF1pjotp0T/s8je94Mv8YfR+NJ8HTcvv9Z7MFgWRctt2mo4tibmBJGxW6/rGTQP4zI0V yeHa/+JhFNU9S5f+kf395j6/AJztS4pY129pj7RbPW71n4k7Ej+CPD7hFOUQ7kEFcyr1 mvdA== X-Gm-Message-State: AOJu0YxNzbfFt3v7olhRPLl6mu1hkIwMAMAENawTzgb0bof3KsBV7hxW 8w9Xz6WHnu3ZBHozYerLmMy09Q== X-Received: by 2002:a1c:7907:0:b0:400:ce4f:f184 with SMTP id l7-20020a1c7907000000b00400ce4ff184mr2845758wme.41.1692895155669; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v2-20020a1cf702000000b003fefca26c72sm3117952wmh.23.2023.08.24.09.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DA9F11FFC1; Thu, 24 Aug 2023 17:39:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 06/12] tests: remove test-gdbstub.py Date: Thu, 24 Aug 2023 17:39:04 +0100 Message-Id: <20230824163910.1737079-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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. Signed-off-by: Alex Bennée --- tests/guest-debug/test-gdbstub.py | 177 ------------------------------ 1 file changed, 177 deletions(-) delete mode 100644 tests/guest-debug/test-gdbstub.py 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 Thu Aug 24 16:39: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: 716562 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444432wrp; Thu, 24 Aug 2023 09:42:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcj+28SOpj69Nkrk86J9xV1L1kFQNxM176cnEHyiKVxvvJuaFYqVDqDTwlRiKYWGbCHvvg X-Received: by 2002:a05:620a:400b:b0:76d:8e23:b57 with SMTP id h11-20020a05620a400b00b0076d8e230b57mr19746424qko.34.1692895341651; Thu, 24 Aug 2023 09:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895341; cv=none; d=google.com; s=arc-20160816; b=OOzE5hxu7lGyZoQo+jXmYpS3jFVDXvKddPww+796et9VhetyoQwvYr4uHLazTJMg4j jE9A8jS2M2JQ4UgMPRvVTQV5lOD58DwS8inRb5M4cSWwQzQ9v4Ok2BS5p9a5WwYXta4p wknZG9mUUYqY2VX/ipBXGw5eUAri+B/Gny/xmuD30h+P3taF5gXB6tbvilNPzCw75E2x eH+qbZYFCJ8gPsY444sM20SpQ8lYFoU43Q8kwJJm0JDsjGePpJLEQ0Os9JhXTBzOEPuv hzHZXWBCMkKZUvoA6Qch8yKW7330+OD7In0/jyEVHH/tUue+lj039fyl2TJySVWjCcj5 F/Tw== 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=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=Yb1Etr0N6KsDbmg3+6qU5b0NK9ruat3OwP6LUebs9KVZt2CSNgG1bsbnRxYMZJdBTT L9z/9de5Jf1Dx87bxHhopLB1iCuFAlkv+iJxgR1mcFSG+/W4t7iwgLxEuthXmeqhWFqW mEKyoTo1s68BvDNzdGfMsB6e+v0ZlxS8hFt/FjBXtMI47GF6ItAlmOUP0tY2PvteuYcS iy+BVwnM1bLxrIuaST6v9ix90LmqtKTsoNt6DluUiJmlN3BGBh4bDZ/QZxnrgBtcPNVG Ctck2baAas98FKZrLBDUkUZLEUcKim4dQ3IaVTKEMQT25dvPWeWiYDVOLPNqKWTR486i uF6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zjAhkHWl; 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 s21-20020a05620a29d500b0076d743132absi1275223qkp.353.2023.08.24.09.42.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zjAhkHWl; 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 1qZDMt-0006Sh-Kq; Thu, 24 Aug 2023 12:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMr-0006RX-U0 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:33 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMc-000886-G8 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:33 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31ad9155414so5933903f8f.3 for ; Thu, 24 Aug 2023 09:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895157; x=1693499957; 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=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; b=zjAhkHWlHO6HSQPVSrOxMt0d3A4JGEQ/srQ1gvXzCwmZHdBVnkp3R7p1BImSqtxDx9 lOV4bJcZYdCdXiQ27hwH/aGSq7pNLiSjikk7YHxtkQfEf3DBevvIjCIHfuxrtA3fV+fP McnMx/3wBgZybtEZq66G3aCMDdxRZ65AQDSafdqJO9rLATFCEiODkd8p+GSHKXckXJLm bzhCuzCrtJnGww7kUbYAj/wGkgIz6ObQzSjKV1ajW73Kq86o9ur/t6czwoHFFjbMH3T4 Nb6z+Zp9ZOrjFkCJTSEC3KlvFV14SK7Wwp/OXzkBbhrqcXegQUcXERa8izpjtNF/Neh7 iPyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895157; x=1693499957; 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=9tGSqnEd6yAy1ahRBk/ob1qWehJYVA7fbTHLeHjb8QE=; b=ekZeAs55fhCf5m0SnQ3mVwvr1WvctAfX2e2rlDV8X7pZTPJfFDo6j1p6zrZr5bV8T5 eb6N4KF7uvPqRpp9xSFpAW4/3ZSqPVzEr9zN94IUI5BNhtzpZ1dDlzZx18bDpNNZCtev /6l3BIjHtVpywFAbAAg7xDt5q80Ssy4ROLtDy+GDmY9sZtUdMGKZf9eVPUXaHtOnrpHf myb7uw+oC2lPpuC9Q9QdeEkNBP1S0XM/c/jyvqBiqVgGUiwlgj9fTiQqeqXU1llkc/E5 +Cx81l+WFciyRBJcRoGmLLMLvOxn9hFs/+qoyRzhY2+MLP8baam3GRpwYI9SK5LguewI wLpw== X-Gm-Message-State: AOJu0Yxx/vgz3YCghndNNBGidw+51dsDNqkB/x1dAW4g1V2dNFN4fnV9 6nBTZ/veSI7ugKzI8WPL9tEM+Q== X-Received: by 2002:adf:e48c:0:b0:319:6753:8104 with SMTP id i12-20020adfe48c000000b0031967538104mr12417845wrm.47.1692895156859; Thu, 24 Aug 2023 09:39:16 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t7-20020a5d49c7000000b00317ab75748bsm22491189wrs.49.2023.08.24.09.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 152E01FFC2; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 07/12] tests/tcg: clean-up gdb confirm/pagination settings Date: Thu, 24 Aug 2023 17:39:05 +0100 Message-Id: <20230824163910.1737079-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We 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. Signed-off-by: Alex Bennée Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/guest-debug/run-test.py | 2 ++ tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 3 --- tests/tcg/aarch64/gdbstub/test-sve.py | 3 --- tests/tcg/multiarch/gdbstub/memory.py | 3 --- tests/tcg/multiarch/gdbstub/sha1.py | 4 ---- tests/tcg/multiarch/gdbstub/test-proc-mappings.py | 4 ---- tests/tcg/multiarch/gdbstub/test-qxfer-auxv-read.py | 4 ---- tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py | 4 ---- tests/tcg/s390x/gdbstub/test-signals-s390x.py | 4 ---- tests/tcg/s390x/gdbstub/test-svc.py | 4 ---- 10 files changed, 2 insertions(+), 33 deletions(-) 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 Thu Aug 24 16:39: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: 716552 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444022wrp; Thu, 24 Aug 2023 09:41:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMmeH5UmwdC0bJux6ZL4y9p2sRWbYReDgjeMFOTmzEXrsr42b7GbMgk8nqlEWYJX7H/d24 X-Received: by 2002:ac8:7d4f:0:b0:410:9a39:d3c1 with SMTP id h15-20020ac87d4f000000b004109a39d3c1mr13533274qtb.63.1692895281662; Thu, 24 Aug 2023 09:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895281; cv=none; d=google.com; s=arc-20160816; b=tmR6K6jxGhi8mjjS644XB6KTwvl607QvLh4zBC2Jzy03ap/IuM03OfHSJkbRGJV1Tr 2jfjiU7c60fMprLJQUK74X/x+lUO6EqC90x367fLcWjxEK7fA86aKR+kKhJes99zQ4WY RTdKGJ2trBwfauRAbAbloNZ6ujy5Q8gxSeylK2D05bogZbWAiaUkIMuq4LUY2TZlC/V/ 8vM4dB6mHntqNG7sU58FZNLxZp2sXHHKSD3nTnv8SAtyjETl9vnskE1Tf+LHfP042NHl UpgRCFRSBZpgyqvnFc0RLCk1onh1m6zu5l9v7VGF5p0guP3LppnlJJ6il6IdPE0b0kFO XJNQ== 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=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; fh=7oKnyFFGjQoIR1wptW5c56TGLTNRojjUyNfUZ3E+vOg=; b=0XYLZp4NrQ9EwFlGjE6c9eFa4d1EI4zneielg8BaMQvuXXAEFA9NUYawxzijK93Gi4 9rz6A3OsiIL2IlPNiiFOHDfRL07E8zSZyckcUJRjLLpM3uaNSSSqFZGWOvs/Y8r4FPdz Np4AkudoUoA1W//M1hLWDD9Vo0/Ppk77wAKH1oQy/lcV7Af5HphL9ZbFHPD7zLEQRQxw GLstPsEHW+CrhSjm6KvqqR2WYAic/qsaVhDBzuucdpKD0C0401fMsfFfk/n1jSG38lMo wL0XTVoFtVx0dDOfLDxVyvS4TrnkEoqPLdPE6YHHnhMgETWAFKCnkqio+bS0OkeWFsxy 37hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g1OWyylX; 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 b3-20020ac87fc3000000b004055d07b98bsi3531918qtk.321.2023.08.24.09.41.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g1OWyylX; 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 1qZDMp-0006QP-TF; Thu, 24 Aug 2023 12:39:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMn-0006O8-SX for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:29 -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 1qZDMb-00087U-GD for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:29 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso59323045e9.3 for ; Thu, 24 Aug 2023 09:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895156; x=1693499956; 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=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; b=g1OWyylXHUniLRMmrogJ5c+EJkbvWWpazU6rgmjIIKnC0ENMBE5QYApg7ayL/QTvqP CRAHdUMU4AheXY+wcDGpPPOOfPJp9GSIQZPwKM+pCwNCMb9d4vZD0MOdPTQYhUKLTJyJ o04vKz/MJjvnmA+wpZpa2q/oB5a3oe4+a1MPR048yV+o08IIllVkcWXEkq2s3YkJ6YTr gkcadQJxkOZ39Xoco4pplQqemoKHZUEIdoDZZQN50kdqaBdWgMO+D4Ml9Q2xuIQHJpGi jp6Rh0y8SUOuFw9vytPt0MAAeBVJdv8BqdxsqIOe1n350FgWkrErRRKxM6k6GKL7JPvL JHPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895156; x=1693499956; 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=M3HpoGymUAOECIzpXws+SoFW7NCUK3OvK2CLae4WjpQ=; b=Ei9OZaLSslZMFUTaAwSulAjwuGYRcCqdLdds2j7o1hwlKdaTBRvLcv+HKeHmv9Inj2 uRA0Vh3ZcIZ3JBANG3KbVd7a3NM4Iukg1dQtVF4pwj9HzVw54NyEf3iEs45C/sw6ApHM PaIbK1a+X4idx06w7/xc9E1fTOAO3dwle6Hwm66Rw1EWHMOCkTM3/AfQq29LfJyTHxau Zzrh4MbxfDtvRn7Gfl8Djc33OGdCL/4ScKoyeRTsRPlGskreCZ23WBWFAdU9COcPD6N7 nzbjjKpnq5CHCH9AX5v5Nc6ydzqClPddE8X86NwYVqn05MoNm10zwRI8g8+bOoSkIz2L wj7A== X-Gm-Message-State: AOJu0YyR+iIZcMG+z28K4wU60iDCzVQijqhVt+TxmCi86lQo0kPqEy7r JCeL6mJFgIq7GFRIGmNALFWFhA== X-Received: by 2002:a05:600c:2291:b0:3f9:b8df:26ae with SMTP id 17-20020a05600c229100b003f9b8df26aemr12135286wmf.34.1692895155856; Thu, 24 Aug 2023 09:39:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u2-20020a05600c00c200b003fe17901fcdsm3091345wmm.32.2023.08.24.09.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 35BC01FFC3; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= , Matheus Branco Borella Subject: [PATCH v2 08/12] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT Date: Thu, 24 Aug 2023 17:39:06 +0100 Message-Id: <20230824163910.1737079-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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] Signed-off-by: Alex Bennée Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1725 --- v2 - fix up some whitespace --- gdbstub/gdbstub.c | 29 ++++++ tests/tcg/multiarch/system/interrupt.c | 28 ++++++ tests/tcg/multiarch/gdbstub/interrupt.py | 97 +++++++++++++++++++ .../multiarch/system/Makefile.softmmu-target | 12 ++- 4 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 tests/tcg/multiarch/system/interrupt.c create mode 100644 tests/tcg/multiarch/gdbstub/interrupt.py 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 Thu Aug 24 16:39: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: 716563 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444464wrp; Thu, 24 Aug 2023 09:42:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZsnsauLWesmPGau2QiQwASLkfsLDEmckAWyME53DvoJjrNpUfaEp7lwm6NxKOOGWN3Pyp X-Received: by 2002:a05:622a:1c7:b0:410:9da6:7a2c with SMTP id t7-20020a05622a01c700b004109da67a2cmr12368476qtw.68.1692895346389; Thu, 24 Aug 2023 09:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895346; cv=none; d=google.com; s=arc-20160816; b=KIkt4OXC4ncVSmTU5F5HoSWw1UPRSadbGYF0Iv3bqwCm1RgaTOhaOmszYqWJrce6FN 8NSPwcfDQOCqk3mTJ5f4KobhEBZPtdeqbt1NAyjNvrrppHUElZe+puzuk04B5QCx0oo9 UFFpW26aGebJJ787JHFm76xdPUCgsx7ehScikMOfRMmgXxdyxgTkL40ITXr1H3NnnQfF 0t8Fuj0D3pPHPc6M65GWt35ZJ0JfYsPJDeG9R40WAzNasgAu0+0AYC14cFfAmn2QQIhy x1HX/qXAwEk7Wn2wO9n5aoq0z40B/5KXP/aq/ykIHPLQiiN0vL2x3wOQb0pEfdO666cd Co+A== 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=tJCZgUqtNI+daMdUYjVlrZWwj/un9QkYSZBSgf2eRpg=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=uZoHAcCrSQ1mpMe3+FC3/XOHnU+9hBKWcE0wtsIsKA2q+uAmdZBat8ci903Ah4CWRf bXLJNBgqUhCorZPBeiIFmHRaUAbpUJaBhh1vO33/KK3iZ4KZnQguiD9QHmKVadqgLRE5 Dckk2Z6lAYoJFmHKhXwSjl9kSjCX4RkANwQCbChnJZDzUuI7UdtEKDF87Y8ALwGT28+9 QnPXUisVul9kprIhju4qBQpRDlz4VG2MdFp0FAJHOVWerMzAnlXvl7DalwrbjoTDUtUN 8m2JNPqhApBT8PYAp0PqU69K/vDbcTYLkp73xlnHIXG0EK00Sjm3OrcB49Uy2C9rA7Fl 6h9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dixA/qfq"; 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 o10-20020ac85a4a000000b003eb14b07a6dsi3504521qta.125.2023.08.24.09.42.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:42: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="dixA/qfq"; 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 1qZDMt-0006Sd-Bk; Thu, 24 Aug 2023 12:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMr-0006RS-Lp for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:33 -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 1qZDMc-00088O-N2 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:33 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fef34c33d6so37862095e9.3 for ; Thu, 24 Aug 2023 09:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895157; x=1693499957; 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=tJCZgUqtNI+daMdUYjVlrZWwj/un9QkYSZBSgf2eRpg=; b=dixA/qfqucwzgavun24v6ADF8thvsjRdd+JTO8IreM+AzsLAuX1UPI9fC/wd+PANMS z+RWeneJKxjx05jPHCW4JlNu6zQ7HHCU+4edMLISyCKJhn7+DabMLTeaZh13pqJX+jSJ k+pdIg/rwDd9LafBXRZSbwWIdZ8JEWn1AFpi8R1+l9CGsO67nluLGPGU/A56s3UGog4F t92HdMTFtFUua+V7OMe2RpAzsXlAKqWdGL4UPsWx/ppJYNaiJBIcqAn6gWzUVr566Jn7 /YRf6bIbKj8NvDjWjxBcGAMAOCkLs4bm6j4Q+zrJXvORGCwxhV8YOk5BqPe5ZGfTm5Lg kl+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895157; x=1693499957; 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=tJCZgUqtNI+daMdUYjVlrZWwj/un9QkYSZBSgf2eRpg=; b=aJQlKN8xsQhDyhz47kCkTadXNLlpBqbnRPHI2wl+XlfKAAwhVKFxe29twajMYX7eZq uNJzxsXZg0NcCgfdPHJYmFODyAKxrXq/DWn4NE248fMRKZ1vT2yZJEQnyA/EV+Ua0jbI ogVGgeWteZm8dRGO2xd8D/RM/o1i4R/YrlDlfP4tR/E1f59V1D9wimOVu6lkrV7kq7cc FN61JAg2nbgrZodidwh5X1/zF/VTqKqINbY/9OKdPCfAcO3EqPByj8M3iJyT2oK3uxoD 3/aWGvj1MjgMMsjyXTmObfQUqyOrtpjwzTdAOomKsY7wp5ycfjm15tPzwmmjIhi4LpCM iGHw== X-Gm-Message-State: AOJu0YxwhFM8R/FvR12mrJP+uxNNOhTlXdp1tRy38yfZYn75z3s4ibUJ BPffUVGETbmp1pC7lkU7WLC+Og== X-Received: by 2002:a1c:4b05:0:b0:3fb:e58c:7758 with SMTP id y5-20020a1c4b05000000b003fbe58c7758mr4829516wma.3.1692895157242; Thu, 24 Aug 2023 09:39:17 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n24-20020a7bcbd8000000b003fef6881350sm3141019wmi.25.2023.08.24.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:15 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4DC8C1FFC4; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 09/12] gdbstub: remove unused user_ctx field Date: Thu, 24 Aug 2023 17:39:07 +0100 Message-Id: <20230824163910.1737079-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-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 This was always NULL so drop it. Signed-off-by: Alex Bennée Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/gdbstub.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 Thu Aug 24 16:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 716558 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444241wrp; Thu, 24 Aug 2023 09:41:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9RZsZofv891nZ2MVjr8udHWY4jQMl+lsQm/fPiHg4gQhbZ4KJSVd0fe/r5ITHC48t3bGQ X-Received: by 2002:a9d:7d10:0:b0:6bc:b6a6:24f4 with SMTP id v16-20020a9d7d10000000b006bcb6a624f4mr2776945otn.34.1692895313347; Thu, 24 Aug 2023 09:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895313; cv=none; d=google.com; s=arc-20160816; b=axoiphS0FMThkgd1qZFXFgB0TNWgnpQ78yYZr+yN5rsSUKpfK1dj3HyLP7gBu9O01N V4a+nSUOiIgUi1NQEbXD/IzQfrUUmgbsRVk6fPbpq8zR2aocq78kEl9ZwobAxTusj6yb PPW7e0NmESB/fprmQH3KQe9Wk+n1klh1k1VBiYmpUhMIDWzzUgN12ijb09DKJ4xFsEa+ zQ8J9rU8UeNT24/VqSef68wkwegKoEMqXRvgLoDGVn8bAoUUXqIMgZ4DxmfcxgxKeKTV b+ka+zNQB7a0J6SpwRFSUmj5VAWlnI9V7R7oepZRMfFOq6qhbhYU2JG/vzlWEnpHjtjo Wj+A== 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=7n08jET4sLnSCRFO+uf5UKlQj+0C0tBz07A/O5rXTPI=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=RXDq/m0sqa22dmbS+5fNE3vJigSY2kRT5DYwTQPe6R6K46rDVChfh2jRNaZaQbNvI3 LYzy1J2hcLywejQEzDdAw+m+63vkeLcMCpK8ILkTMFaP3Cxd2M22xzzljxI6MV0Ii/O5 d55J2dvEn/eHap1/q7MKsfp8eN779ex+Lj8loZ3tSiBBpYzLehw/lpVYJIPWRZioGIsw 5guPhLOJz6a4RBocQN+DZBuDn+zy7v4obeld/+wLmWIhc1bJXOUygq1PAaUnQIj1ERvC n1nyMIK/JBbwhjGze8O5ZxEYt2B2GoDeoR8Ac3hTgTFK1EtlrWNE8MgGBNkp7O5kGkt9 M/cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AULp9ltE; 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 o21-20020ac87c55000000b004109625bdf4si5262816qtv.602.2023.08.24.09.41.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:53 -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=AULp9ltE; 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 1qZDMz-0006a6-Uw; Thu, 24 Aug 2023 12:39:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMx-0006Ym-Tk for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:39 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMe-00089V-Bs for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:39 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31c71898109so1179611f8f.2 for ; Thu, 24 Aug 2023 09:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895159; x=1693499959; 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=7n08jET4sLnSCRFO+uf5UKlQj+0C0tBz07A/O5rXTPI=; b=AULp9ltE+Upm0Zre8jkcTgPU+A9Gye0v54BDFw2rxzq2XLwYSVAkNr1xZVteEC4y0T J06x0UhcaORGFiPCpN+QG69ccZge7skEiIMEyu5WfDRT9XjE9G9ZqDlePKKMTdq9xWMW RzhwLo6FnI0POZ1Y34l+saOalojyJbp5OOBJjD7Y92W8P1kAYMLYb7C21yZxk4dYztgd +0A/vRG8kz4nHRxJxWDkpxocTIkQAiXCdSGIgrO8xHECyYBHgUuzFGphy1oSYeZNcwqS v0fcbxRNr4Ldgj1qYIDv5EAADPrkFMur17fPjx3RPU2/qd9Kfuba9WmljjlUOJOLGbYB DWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895159; x=1693499959; 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=7n08jET4sLnSCRFO+uf5UKlQj+0C0tBz07A/O5rXTPI=; b=BSqMLkhtQKY/CMIV4qtkDm+Gw6wFh54ScBOkbhhha0S+Qdb9VA9SvZz7zK/cYsKL20 4NtFnhVDDWB7VjQ3003Dq86DkHWtYxXFXewWtZOfPuj648DmX3jIzalk8QbjWD49wZ4p oYZddAiutY9CbrPOnqGSNCqNL/uQlGUsXKoDb+7PRdlXiOvpkejp8MtsC+F7SO4KXWKY 4BSWeTjintuNNcbTel3LFMs584f5aWa8KDji6O4oG+lLxpnEV6OyiNWItf3eEczXLheV MwNDk0ExI3tmDeVNYm9pG3Y59B9UHOLCJPZ/1JYhQ9SbUYavOIUmEiXq4uDDxgvkX0D5 9tDA== X-Gm-Message-State: AOJu0YxHf3NnDLkMY8r7FOsnKtor+cQq2gaebF7Jr09OYGPenjDYb+2t 2km6G22RRufMXhrdhm5zVFb28Q== X-Received: by 2002:a5d:4e4b:0:b0:319:7a91:7107 with SMTP id r11-20020a5d4e4b000000b003197a917107mr12172529wrt.48.1692895158833; Thu, 24 Aug 2023 09:39:18 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i12-20020adffdcc000000b0031ae8d86af4sm20385986wrs.103.2023.08.24.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 67CBD1FFC5; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 10/12] gdbstub: refactor get_feature_xml Date: Thu, 24 Aug 2023 17:39:08 +0100 Message-Id: <20230824163910.1737079-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Signed-off-by: Alex Bennée --- v2 - avoid needless g_strndup for copy of annex --- gdbstub/internals.h | 2 +- gdbstub/gdbstub.c | 63 +++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 34 deletions(-) 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..31a2451f27 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -354,54 +354,51 @@ 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); - len = 0; - while (p[len] && p[len] != ':') - len++; - *newp = p + len; + /* ‘qXfer:features:read:annex:offset,length' */ + char *term = g_strstr_len(p, -1, ":"); + size_t len = term - p; + g_autofree char *annex = g_strndup(p, len); + /* leave newp at offset,length for the rest of the params */ + *newp = term + 1; - name = NULL; - 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]) { + name = NULL; + if (g_strcmp0(annex, "target.xml") == 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; } if (cc->gdb_get_dynamic_xml) { - char *xmlname = g_strndup(p, len); - const char *xml = cc->gdb_get_dynamic_xml(cpu, xmlname); - - g_free(xmlname); + const char *xml = cc->gdb_get_dynamic_xml(cpu, annex); if (xml) { return xml; } @@ -2245,6 +2242,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 Thu Aug 24 16:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 716551 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444023wrp; Thu, 24 Aug 2023 09:41:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5QMY6a/oX1nX+RK8Er6Wp+CNBJEBSILCmerK0gSw5WxvgfElWrKKcf8gdL9LL7J2/QlNf X-Received: by 2002:a05:6830:16d9:b0:6bb:1049:6919 with SMTP id l25-20020a05683016d900b006bb10496919mr3179895otr.12.1692895281674; Thu, 24 Aug 2023 09:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895281; cv=none; d=google.com; s=arc-20160816; b=Xa6FY0AhO0oo5eE75EjmaHQ9jRJr5UGgsg9zNDisLgrED4eMUGYR9mNfHmgwqgqhu8 d+UKBaq8vaRCZogwGQyRyD0fVWdRQwPk7cl4kdhBtPAFAt2Cwh/kOqsroyIZsIapPr3s mJdwtV1GoYOLkJSRl4ovTn8bhdIMVZSWvzDTMxCh9saPixAVQjSNCWNET4NvZkqwjd6i gC/4BxEw+JZ+i+DDdeakqb+Tzhux8/5yGgIEqIbZ1HFtw0E9FbJusMcJMtWkgpqYxD78 n4zYGge6JoQWJmqkhL/+VPMisMiakp4FtHnoElRrAC8jJWWQdyzEi41d6jN09OdGr76v I6Aw== 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=n8sZlZQ03i3sPTIpdxfGoCKoeJq6c1GtfjdswDhdAs0=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=G6rB8LIiYPLlJAAzrFG7pk7vrnt77JeO386Fa7k7M2W3QlrAvYwFy23vgIglK4bNX7 9skEeCGBeNCn+2Znx3t+SaDUDIQVJoF1YvwnvaliIICDYTQXVrv0aJPfSfE0+TvxFVgk QQQjslnKu1Mj0TUDd6aMdipn8vIvUN93v3eFkVUhdeCv6CQ4deFyMbVk6U2ZZ0OJ6m/b YsqgFubHKrCG6for4vuKpMobkONKAQam/8AeXKZnVKCK5YNGPHeaFx5f0r2oSR3y78yU q7zLJMtBUYfqfBWePw7z+x2RxC3R6sTmAPwjPQZ+3Z3A+YBgJQdqbjU/H6zo62B6hski xHiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mpWjvtPN; 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 r6-20020a05620a298600b00767ee5461b7si8913481qkp.451.2023.08.24.09.41.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mpWjvtPN; 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 1qZDMv-0006Vr-Sr; Thu, 24 Aug 2023 12:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMu-0006TW-5p for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:36 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMd-00088s-IA for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:35 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31c615eb6feso2462039f8f.3 for ; Thu, 24 Aug 2023 09:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895158; x=1693499958; 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=n8sZlZQ03i3sPTIpdxfGoCKoeJq6c1GtfjdswDhdAs0=; b=mpWjvtPN2/VrX9hgl8P6z0Vi4yDpwa7EaRnxmHfkpprX9dA6SJNPoIrJt31UIdsJmS qoY8ZRqCRGOWNFQfAA4H6eN9P39h7IjF54mncS52yG4MSSe8TJ0Zm94huWCxiu6mW9sr jxHt7tpq9YwO7/U4Pm3f73+ZWsoc+VvOtIkhn2/y9CzpaHIfaPgEkYmZRW9RxyoD6qTa C7XaEPhdBbCnDqZBlWPeDT3zNvXCYJGqJ3F0QXfbBHNS8JUCtCOqPhDN0LtQnRLkYE7A BvvM742wQ/K6n3upaPXllVYFmX54RbEINWcd13bx+e1YhZwkAefi6kyjoDRgcaXCwoE1 QSqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895158; x=1693499958; 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=n8sZlZQ03i3sPTIpdxfGoCKoeJq6c1GtfjdswDhdAs0=; b=O6/D8g407l+8L7+52LMgoCVEJISq7IXtyn9nU+mT1tjPBHeRB6h7rccjxg2iRP5rqx fvhVut/HIorG/hWApyfCo3PErmoLpHP12sNzOcAz7M+s4SEsjq5LdYDG5Mb58iSsMXd7 7dmgKv30uXQhFscouZhnXuwXpyJSE3xVjd8qOzFdh5PvydQ66Y8QzPEYATa1Bu4dAvtU Vrs5w4/6FEbAZXyytqXzEwLcojffqUbWKaKt3wEPnEbmj8KCYjtb2N4nVc9954owjhjB AXNrYoIKoO7n+KssGbDZmSAig6x4tR7zxD/SzVitYZMUkD8ZdKT0InYrwy5NxXrcMVnc Y4Og== X-Gm-Message-State: AOJu0YwlC9pBfd+TlHxv8B5mduPW3kffX200r5PDqXtxc5G86+6vGN1I zuq8b9b4pYzsyUXAbsW06+UjGg== X-Received: by 2002:a5d:5242:0:b0:316:f25c:d0b3 with SMTP id k2-20020a5d5242000000b00316f25cd0b3mr13566736wrc.22.1692895157798; Thu, 24 Aug 2023 09:39:17 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x9-20020adfffc9000000b00319756d5b80sm22859712wrs.29.2023.08.24.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8EB641FFC6; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 11/12] gdbstub: replace global gdb_has_xml with a function Date: Thu, 24 Aug 2023 17:39:09 +0100 Message-Id: <20230824163910.1737079-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 1 + include/exec/gdbstub.h | 10 +++++----- gdbstub/gdbstub.c | 12 +++++++----- gdbstub/softmmu.c | 1 - gdbstub/user.c | 1 - target/arm/gdbstub.c | 8 ++++---- target/ppc/gdbstub.c | 4 ++-- 7 files changed, 19 insertions(+), 18 deletions(-) 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 31a2451f27..10fb755390 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) { @@ -1078,7 +1081,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; } @@ -1099,7 +1102,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; } @@ -1566,7 +1569,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 Thu Aug 24 16:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 716553 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1444025wrp; Thu, 24 Aug 2023 09:41:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWF33+oBhX3o5E+QVztQ7rMh1JbAPp50fYbby2Y+33l2gqVruhqSY+s6nLZL8OGfMB5aXN X-Received: by 2002:a05:620a:46a3:b0:76c:caa5:4c1d with SMTP id bq35-20020a05620a46a300b0076ccaa54c1dmr21580191qkb.26.1692895281848; Thu, 24 Aug 2023 09:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692895281; cv=none; d=google.com; s=arc-20160816; b=1AeHat/R5BuwlECBcA0BKXPLJyR7KX6HJo7oQozWz3uFRlXMvvNUKIrvug2h+sY3A7 JuE5i4NhG9eisfpDJC2PZJMeFsgsfI/ZsCNprli8IE51oH4xM9APccCfiBIQvzZdCpCU HZEPf4Y6XacxlFavmwa5DjeJts7kQ1oXFwBPYJx9xyH+pbnGIWZDocnviup78zHrddiY ++pGpG2rkBZ5dQ6hgy2jGoLBMMxSrBYsDfe2+yGjNr73VxK7sDer6uWCaq6yemttQQKf WVamtYs3ZHzCHzIejW5t8L0Fo7T6Wou68TrIxsCeb0hmP90sR+MXUBkxaE9vff3g+its Ou6Q== 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=ZtZNNftqxouq3vcCk2anHCZag5V3OF0JED6K9SHy/Wo=; fh=xfIA8VPYm4frMifZMc5Z1SVcvuTb3HMwCNSmJWBjt2E=; b=alXIS3XFkMYnTJr0dlZJd40JbboDzaAREVG3Sdevxx8aYUEeUyX6bic3y7ZcWKS5RG fyXL/2f2F3/k6Fid8zT6+1FFqZdhv680LcBPcOGl/8x/mc1vKUDvL23qS/yVER4GGcsT 0ixI99cSZPMQ6fZtgGOgMNv6JhwyTPRX3dJhPlreqTkYeofThf6PRoxbG8OnVv3ek3A5 T1yjMJtvBAUTcXQ/C2CLpLnP1nUV3S2HVEbS15kWYpqRqljFgXlWWa0qIaSBWQ8h0dVx V7G4Hfp65GwxEImAGu38WocLbFGFq+pty8jN5zX5NuR3WWqv4dp/bz3hW2wOHpfvNBNq pCkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gwUhgCa1; 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 bm39-20020a05620a19a700b0076daad4ad3csi4518407qkb.32.2023.08.24.09.41.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 09:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gwUhgCa1; 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 1qZDMx-0006YJ-Fd; Thu, 24 Aug 2023 12:39:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZDMv-0006Vt-Sn for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:37 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZDMd-00089P-Uy for qemu-devel@nongnu.org; Thu, 24 Aug 2023 12:39:37 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31c65820134so2221647f8f.1 for ; Thu, 24 Aug 2023 09:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692895158; x=1693499958; 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=ZtZNNftqxouq3vcCk2anHCZag5V3OF0JED6K9SHy/Wo=; b=gwUhgCa1VF1Og5meDbr9JW6XInhdB9HBvcSNdVBuI7t+pzf34nRyG4AsBDpPJB491u 4hQJK01sUrpbiUlE1Zan+5hODTXGwi2b47Zp0nZjK6l7/BVOXlKo+0riqDsp1O566zGW Oot+ybvueMBlfMU4XlNPS2uQQ9K0n9UFhqjVRyqfSV7yp/XEb8MVWOU0t7BsWeR9NJil nHyzhmdjQw4qBAk9F/9+mR3C755/x8jy2p+hhRxaHivkkaqv0hDW57cMdygoYPFrgwvg KkvwEm4tYAyj8fACCWrSxA4FQrEdtO2NG/wDbhakbsNTKjnx7qgYV6O/RK0bS4iFSfdA alVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692895158; x=1693499958; 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=ZtZNNftqxouq3vcCk2anHCZag5V3OF0JED6K9SHy/Wo=; b=FxUCY9vdqEX93SMKtZuXBI247mrylO7GrdSJeDhRUYuoPbq3hne2IbugBhqaZXBG9o 3nCoLvlyIp95a25A7s7Fl+u5nY/pGqutbZ76N3c9d+P2z3/k8tfG+1WoHsXBfyf7Iwbr jtog2YFLTwTNL4/LVSVqGRRW6ynpaNileoIFDOCMSq0emm7PrhNyjQA7TN8NjdbM+BR+ fZB2HYUkr4oYL/7fMyPno7KBAH5E3mk80NDjhB4N4YHfhREshHxE6R9kFeby2HdEmPrC ECHdoOesa4fxQ9oyaQ1y3uLq3KCb+9ui2CCMkcUC+XaPBbN1O6//LoMNW7CXjP9IaoG4 CaaA== X-Gm-Message-State: AOJu0Ywg3Rd6CylLxLrykDQNWs95ZFFLLuNG53NIZ34nkVZgiGvcbKW2 a3kF7d4Exzrkt8FxkjjY9CCCMQ== X-Received: by 2002:adf:de03:0:b0:313:f1c8:a968 with SMTP id b3-20020adfde03000000b00313f1c8a968mr13880453wrm.2.1692895158589; Thu, 24 Aug 2023 09:39:18 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e1-20020adff341000000b003177f57e79esm22618406wrp.88.2023.08.24.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 09:39:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A84281FFC7; Thu, 24 Aug 2023 17:39:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Nicholas Piggin , Richard Henderson , Markus Armbruster , Yonggang Luo , qemu-ppc@nongnu.org, David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, Juan Quintela , Thomas Huth , Peter Maydell , Ilya Leoshkevich , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , David Hildenbrand , Greg Kurz , Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v2 12/12] gdbstub: move comment for gdb_register_coprocessor Date: Thu, 24 Aug 2023 17:39:10 +0100 Message-Id: <20230824163910.1737079-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230824163910.1737079-1-alex.bennee@linaro.org> References: <20230824163910.1737079-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 Use proper kdoc style comments for this API function. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/gdbstub.h | 10 ++++++++++ gdbstub/gdbstub.c | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) 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 10fb755390..1fb0db747f 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -450,12 +450,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)