From patchwork Tue Aug 29 16:15:17 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: 718222 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68072wrh; Tue, 29 Aug 2023 09:17:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGykSlF/LUnJe0ezFW4f38UFialnzRXCTQh5Pzc/KQZv/ohqd3wzSuaBdxyZkf5OBz75LAr X-Received: by 2002:a05:620a:400c:b0:76c:4388:faa7 with SMTP id h12-20020a05620a400c00b0076c4388faa7mr42123767qko.4.1693325836296; Tue, 29 Aug 2023 09:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325836; cv=none; d=google.com; s=arc-20160816; b=S+YKNhAax5bt+jjNJIizYJxjkYGmCB3PmVQMzrYjEMkF+d5tLT167mhLHL6bWdSjLE 0mKJOuMtpZ0WPjKQuNxhT/9MVmEMqAI/ngBXdWW6U2b94w2iEfQIqxQ0smNzQv+RR3ga sxy2i8Qf90HD7T10H+hgTV3oG+ODDo2Xm/nPLvx57fqn/vcH2wUbHVM7ALO/a9zTad3y 1RpF/szB46OPjjcyhn4WWer7CPtrrY6SrlhWnhPV3P5mUka5E78HyinoUMyCK8x5QpNU ov0nP3qm8J4hmlLfIPN2NSPQsuJJoeSS8qmjxyZ8U9kof3/nJefQtia4Y9VpCYhCm0/W fQpQ== 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=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; fh=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=o1K53beLleQ8oU/16J2jigLXP2p10RRP31y/kVLHv81jbpXBHB9UJNKiiMraoR8Mtk BPdYH/23kXs/Eg951SL1KD8UkdhWao3EE9r3iQzrpp+unbh1xxGCi1n80ijb6VEQIBsN uQ6lbUJiUpfX6Wf/t1CQ114M8Aw5sEmOpgWpwokWz8YfcEJ6MxCaoC3LcrHCPmdpB590 XVoKwYRtor7pqSUbWi8VcL2tg+kgS2gVmf1YQjQDAAalRzC46azjVQZTilO+BMRvn1Kb YgQnktxcm18wIm4LBpqzX0ddryJjMcjFwpLYmaAHQjEdnx0IdCRMu1dIayNgNTttQWx6 7YLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OPjuIq+l; 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 bs39-20020a05620a472700b0076efe86cb67si4502524qkb.446.2023.08.29.09.17.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:17:16 -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=OPjuIq+l; 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 1qb1Nj-0004xX-Lw; Tue, 29 Aug 2023 12:15:55 -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 1qb1NT-0004mc-Ch for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:39 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NL-0004My-Qk for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40061928e5aso43074655e9.3 for ; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325729; x=1693930529; 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=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; b=OPjuIq+lhacqGmPEEuRb4KKwIJLkWdWDU75MDpFI19c38aMl9YMeWS7aDrZRFNMYPy cOvuiP22HyY//7/UPdBWIkjsFzBg0O7+4uOlsdGiUSZKsFTbRyLJ2gLEp4R9UNpVCGRR fEt241fdzGQ2RSebqevQuiQ+r8mCLNi1xfTnd/uxJ2vPJRLR9AV1MN85jogH/mNfRsOx gSt5UmvFhTq7KOKiuCRJ6X/EXDGnI3uqhhjZA/mwtOmItZPRn2BEwS7vL4rHjWX6Ow3J WKJGO8KM5HYGCKUJUITBB2R/8fWNPw/D/NYMljM+tQEn4GalJLZbJ7uLHy7iV15MWsnw 6WFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325729; x=1693930529; 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=usp5SVkYHvuBXbAycyRbEhDIRIcV18Phf6H25qHm2hA=; b=N20aOznsA2ddFe4NOLPUrPZz7B84sbjEeLPHhEVuRjJnR74mR7guxvQMpwY9ix2uxw 7sIRx7DlyhsmZDj2yQlYOwZ+jPiV+oMUjROgfbqPeRtWTTfFgRWSJE0EkfkSPuBFLd8n HRS4qTYefYIHEZD0Iq4GLcQ7BVPcEyETOB+y83Yjjei86cCaqmb+cwoWrAyzyrMyem7z iEiUPhhEwWOTyrRqQNoS90xmonAcAL5CoPLBaiQDdcd4JjpWv9k+ayL6qUqQa8IS30wi kM8l9eHGBhvc/T/Wcdw+6gIST2e7a31KI4tSAuCnACwclzFd6I0jPMdJmdtHAIljJXE5 s4uA== X-Gm-Message-State: AOJu0YxQRkSzgCbbW2JDu5d/I0Bs4+iHKTlcWOQvSJIaH9SG+7WuCP83 oUOkk6oqkpYGWKuZWeMgVu8FwA== X-Received: by 2002:a5d:4f8d:0:b0:319:520b:2228 with SMTP id d13-20020a5d4f8d000000b00319520b2228mr21352389wru.27.1693325729234; Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p24-20020a1c7418000000b003fef60005b5sm14230907wmc.9.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5D00D1FFBC; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 01/12] gitlab: enable ccache for many build jobs Date: Tue, 29 Aug 2023 17:15:17 +0100 Message-Id: <20230829161528.2707696-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé The `ccache` tool can be very effective at reducing compilation times when re-running pipelines with only minor changes each time. For example a fresh 'build-system-fedora' job will typically take 20 minutes on the gitlab.com shared runners. With ccache this is reduced to as little as 6 minutes. Normally meson would auto-detect existance of ccache in $PATH and use it automatically, but the way we wrap meson from configure breaks this, as we're passing in an config file with explicitly set compiler paths. Thus we need to add $CCACHE_WRAPPERSPATH to the front of $PATH. For unknown reasons if doing this in msys though, gcc becomes unable to invoke 'cc1' when run from meson. For msys we thus set CC='ccache gcc' before invoking 'configure' instead. A second problem with msys is that cache misses are incredibly expensive, so enabling ccache massively slows down the build when the cache isn't well populated. This is suspected to be a result of the cost of spawning processes under the msys architecture. To deal with this we set CCACHE_DEPEND=1 which enables ccache's 'depend_only' strategy. This avoids extra spawning of the pre-processor during cache misses, with the downside that is it less likely ccache will find a cache hit after semantically benign compiler flag changes. This is the lesser of two evils, as otherwise we can't use ccache at all under msys and remain inside the job time limit. If people are finding ccache to hurt their pipelines, it can be disabled by setting the 'CCACHE_DISABLE=1' env variable against their gitlab fork CI settings. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230824163910.1737079-2-alex.bennee@linaro.org> Message-Id: <20230804111054.281802-2-berrange@redhat.com> Signed-off-by: Alex Bennée --- 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 153fc7cfb3..7c38d7c9e4 100644 --- a/tests/docker/dockerfiles/debian-hexagon-cross.docker +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker @@ -15,6 +15,7 @@ RUN apt-get update && \ # Install common build utilities apt-get install -y --no-install-recommends \ curl \ + ccache \ xz-utils \ ca-certificates \ bison \ @@ -27,7 +28,12 @@ RUN apt-get update && \ python3-wheel && \ # Install QEMU build deps for use in CI DEBIAN_FRONTEND=noninteractive eatmydata \ - apt build-dep -yy --arch-only qemu + apt build-dep -yy --arch-only qemu && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc RUN /usr/bin/pip3 install tomli @@ -35,6 +41,7 @@ ENV TOOLCHAIN_INSTALL /opt ENV TOOLCHAIN_RELEASE 16.0.0 ENV TOOLCHAIN_BASENAME "clang+llvm-${TOOLCHAIN_RELEASE}-cross-hexagon-unknown-linux-musl" ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/v${TOOLCHAIN_RELEASE}/${TOOLCHAIN_BASENAME}.tar.xz +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL" ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin From patchwork Tue Aug 29 16:15:18 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: 718226 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68823wrh; Tue, 29 Aug 2023 09:18:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ71NRcfVXiGtbfBV+tuyeo3E4n5LXAjfgeC0xe8+20ZS8uuUXsHpA0t/CngRMaTq8S1di X-Received: by 2002:a05:620a:4414:b0:76f:8ad:22eb with SMTP id v20-20020a05620a441400b0076f08ad22ebmr10954272qkp.32.1693325921817; Tue, 29 Aug 2023 09:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325921; cv=none; d=google.com; s=arc-20160816; b=NKpWOAKgKkUzRWgTHC/XdryExNnaktWA8nZgR2pHiGdDo/o4Bvu+WCJzpIBW7UQH5g B1I4nnhENjqlni6By9ueVlPeO4ISzbLFjJ8q/R1JFWhErWqd60BVsIu4ovE/BziiMlDE vqSRpTXg3f1g4Q7vqsCDypm5f+hAmNzUlzPpEkAN25gRiM+s8+XjFhtikpvoSEQ5+2Vy y9HaY4jbprJDQwrfWeedOwufPapM5zcK9vdfymHQLd4cAUQEy6MeX3uocQW1lq8WG54K p+M5fzWNMp4XYxw+xlkfYZgAIE9+OtwBaDbkIR5OlcjgHpwhLukbEH3FZJ4BrdOItR4h MrCg== 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=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=bFnSranOEgiB1w/FJvOg8OtgAbWsTCTrzZKye+ZY6z+Dp3ejutxgaLF9KumHcfLKDR q47eSKm2jhZ8S5ISydsNC1e/EyHPvRDabgm9Agh0citJ2Vcz+7tFCuO939A4iyIesmml mZ35eMiFHCOy4qeSqNrfW7rmMHypDrd8axoZjFV/RKyPosRcxH4e4Q4zPmnK2EBi/Vzq 8Hh1aqvaEhkHaXWrGVla2VoTXlR11wtYVF0dxI+A1cPTVq7SGpvOPs3uM1RZC3A+L6yk wXM61MBon+hpGqF/5++c6zUSsfYp3UUqaQP0qzy3ImYhMzOiR+aCwy8FnERlr4AtPv3S 6oew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RfNV7JpG; 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 sm5-20020a05620a944500b0076da64decfbsi5795434qkn.63.2023.08.29.09.18.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:18:41 -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=RfNV7JpG; 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 1qb1Np-000564-1Y; Tue, 29 Aug 2023 12:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nm-000515-6g for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:58 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004N8-Qf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:57 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31dcf18f9e2so1641417f8f.0 for ; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325729; x=1693930529; 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=RfNV7JpGpTXLU4D803M+5ff/KJsHaquxIMZhbgjNLgjPHbd6h596//0IGv+A1rGzd4 oYtRW9NL8HWN4Lw/ilaE9QcPy7ANgL02jS9RQcgj8YF1VZZLO0VPPbUGUHXGL0gpY+BU Srcj7IO2RjKFYGhyR1keAYGj9QbHkLyEW5X2vxbxA4gg4YuOJiDy+cudYCoHm1PW1VMq wonZ3Qern6C+P0aNKEN3UYH0D94NwrT8AfENT6X9JoRYWvOAqGziDnafpiJL6/sWpt1Q jQI6OJD1fmnCA+ieyf/YbOhtcwfdOh3X1EiW9TKdGAcaE3lOKW9PCphTf0WijISXdp+5 9gRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325729; x=1693930529; 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=aC+ulwex1c/jSCyiimqKg14HaoV1zwd2F102ePhzr8yqed/98jjzcT6SAKlW1hJsiT NUyu9f4AkX2sG+64B17g4bKyx+uQ0mD7t5zA7koTnKn+orI0qynZ5NPS0nBxJF0149B7 UY63zsHJXztdt89S/yPSOYagxjbDL53jSCmxu0iJgdiYpxMbgKYvgRiWyY+R6H7vwnvV t33nYvdRPRhg0v0yajbjRaGx+PMpU4CjuV6wxzNfeVq10r3yIkUqJJVSqrnGBsghJwei lGskQzo9EwgXuuxqsVG4v8mIn2ahB/AdCs2mxP2fDvQ6YUsxdCL8WXsvLKbXUEhPKrFT bcNQ== X-Gm-Message-State: AOJu0YzxO5NxovwnbHyrCmPz906J85nco5Z86A+dRw4FORa1XVPiWItf JhFZtdOqiRsciTFyeDiwJhtyWg== X-Received: by 2002:adf:f9c4:0:b0:317:5d1c:9719 with SMTP id w4-20020adff9c4000000b003175d1c9719mr24199159wrr.9.1693325729483; Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 21-20020a05600c231500b003fc0505be19sm14371693wmo.37.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 747951FFBD; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 02/12] tests/docker: cleanup non-verbose output Date: Tue, 29 Aug 2023 17:15:18 +0100 Message-Id: <20230829161528.2707696-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Tue Aug 29 16:15:19 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: 718223 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68203wrh; Tue, 29 Aug 2023 09:17:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3/sy8N80/dmWdFj3DVR/yWq8tS+JpQWwNgOVR3UQyJLTuz1sQjdGUCulJkjhSyURa3MUR X-Received: by 2002:a05:622a:120a:b0:40f:f860:f025 with SMTP id y10-20020a05622a120a00b0040ff860f025mr33969896qtx.40.1693325850083; Tue, 29 Aug 2023 09:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325850; cv=none; d=google.com; s=arc-20160816; b=uDeQMbodJSy8B2lLLtU2oqqmg1fhIL82F3wxLwZZMGANpm6uoZZoQ7qs87EMhPe8nV 6Ra4Icfv5ueaIaAIHKcGz/HZXJJLQRWkT+wgxX5ZlY/qNpfAalaFALmRF7AeupY/lDAo bTBFGTl5nfQcpK3jHWDsp8uh0rn1JTZXjve4pdwY08HkUb4iklvhEddNL3cWelUcudIp La3zxI6EcnKMuRHHQxMy/Xotku7SB0Y/WM6ZyEKADe6tjZJV+oPDoW4l6nqViD9FA/rA LPkfq+c0ZhtTL1wyDLcSFSQHp76611i+7beyxkuL91S0Vf30WKY8RzoEdBQQ17QCIkQk uvJg== 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=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=oJIWNELGMQU592hwfDdP5FU/aQFuTSPhkGTglzy6mT8DeTKhvW7/0+bIIEULyrUE1N kduRFUtN5BZn8du028uSD7iQJdGPA2B3nS8dI2I2R6VVUhzdq+azIr9FYuWS9MKC59MN uujWfIjne9qKOp9d/tEfyfbMAPgZknn6oqSY2YoKUZ1/v5SiSTYcpBTY3LkWJ0/mktkn wmkfUU9pMOcHUGGXHQQFfy6Gok7bsxYg51jdTWbzGaky0ZjuAcbaWkALuOXwTRmpyO4r M3WFQC7JUmodEMWbMfZTLavlGNXIrWL2H5g72IbpyPX2vMIN7aNtLxP8aCRdXLr74dDK IqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DpwcIjKm; 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 c15-20020ac85a8f000000b00411f7e63bd3si6493301qtc.522.2023.08.29.09.17.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:17:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DpwcIjKm; 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 1qb1Nb-0004pI-HG; Tue, 29 Aug 2023 12:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1NU-0004nG-Fx for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -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 1qb1NM-0004OM-E9 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:39 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40078c4855fso42862305e9.3 for ; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325731; x=1693930531; 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=DpwcIjKm/Se76BIRTXWEvwjIqhZbcgDN0FFtXqaYm9rkSU6rtYsTMUL7YyZRHtx3// Q5jSjKwbV/GRtd7wGWCB8mR8iH0pPcVIukQGRsUW3+pv0Hv0p0qrHXY8aNQDX7l7MRfi WDx8htSXGg4z5EQo/0wMfVPeiJb5l14PDywO1F2i5N043MlCQBYgnK2Z2oqz9Mb3K5/Q BrvaCu+lKdesyNMNfifaxXfz10UfhySEiXWW6xNh6LkHm+OeFXcECH1duZ4x/pEQYk+w jYERSJkXQUlbxUZ1t4UGbGBXgm00D9qAspAB93mHPLGgw5Uy4rg8Nb73zg7G3bMrGk93 lVWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325731; x=1693930531; 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=MqkRkmwuzfdXgP7sgk8+kdZCoHWt3xH+zKMDkJARtqyO+lInyNwxaOw6LJUyQoXFPz RbFkgRi6B7pa6YTnh13ELDHbfQgcK4Ctl6O8KfUIAIczf6Y8urxPVOMuOimy+t/c8xZv ESjGIohtHerUnCfAp7TaS0a+yRS32eUUfFm076q3/KX7whtM3hDPLK3S92n9bcvEZkTc E+kKGGXMsX1nZ6FirNv1J68epLZgU8MOtkQk51QOOdt+ipbjPyYITawLN+yoWoWb9wq8 0IupG75YksAC8uSCsN9PLGmrTkATNeCz+OP82oas9VVD2t+K9/aVdIazBFOBK9FMwvE5 B58Q== X-Gm-Message-State: AOJu0YylVYfG1IMVZW7Y37lFPxj39rc8WxH9bgIfXhJRJR7kwzRztCyZ ZdMKlFN62pMLRf2mYNBnDmfnJA== X-Received: by 2002:a1c:f304:0:b0:3fb:e4ce:cc65 with SMTP id q4-20020a1cf304000000b003fbe4cecc65mr21255098wmq.25.1693325730869; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 13-20020a05600c228d00b003fefd46df47sm17577554wmf.29.2023.08.29.09.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F0CE1FFBE; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 03/12] tests/tcg: remove quoting for info output Date: Tue, 29 Aug 2023 17:15:19 +0100 Message-Id: <20230829161528.2707696-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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 This avoids ugly multi-line wrapping for the test on non V=1 builds. Signed-off-by: Alex Bennée Acked-by: Richard Henderson --- 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 Tue Aug 29 16:15:20 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: 718220 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp67876wrh; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9tXr+f8Wn+r3z8u7RHHkeRMjpMJpeGqadIsufBKeThDjMsQeouCpvsdyFjJerGkaJOA3e X-Received: by 2002:a05:620a:2699:b0:76c:b3cb:a9e5 with SMTP id c25-20020a05620a269900b0076cb3cba9e5mr34693674qkp.51.1693325818379; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=google.com; s=arc-20160816; b=u3/ZMcNBuwka3IBuESNFdzn8DWLX8vEQU3YP0WoWoUJ2wZn/m9EJSWEEfVqzLjum+Y qGnXrEwdvrlFVnwKHCGhFKpSCyX2hzYOQ3y4BH4rca7MTJk2gebvhctA5JAehirJiEyY +Cz5WXQrwvdy78sBvISIqUM1TR4FQJP6uAQrTyBg3xEqo1Cy3F6gpF0GEo7I9uWIWZSd rU+HVUr//Kr9fYeN2rfRH/sQMvlegrtpKBC0Lbq4Q6MreIF0t6X6qNCOg2IcekSepAGc JnMEIdLpudh9KoTq04ZCUaAnpcxeJfUzohPA6P2MdV19vDCSVYlOvtp26WBz+LMaNjTa lReQ== 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=5MURN1YsAtDJ1zexjwK7J1EK9QhRDD6Or602h6CmThA=; b=Vx9cm2s4UAPtyz3M/Xev0R8ElFqOrCPxJi6cq6Tms9neLMFo0uGyiNo2GmoSQZaMfj lHIUGsyrJ8MK0D23KWkaw6M5eJcg6q3q0lgolaGWEUoOqkWKO8iVJYhbiSw/QVsD1o5Q QfsnHzwuIxOUZMQXnwbMS1yoUHt6VJ/UROaKqojOVDu1YjRFPTMWY4DRV/eMzo39qmc3 g11hfoMD3cJdysvHoXo/626Tv4/QrlDHczu+zw/i1ZksJSJXklb9VciUORVB9838CcEo ldxVUZ7xPbxk75DTjd8lSiheMFDUU4tiOlzpFpVUUsQnFQySJaswgxrIKG16zyvsVsmi MdoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AxZnMkqn; 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 f12-20020a05620a280c00b0076cab6e9e69si6168162qkp.158.2023.08.29.09.16.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AxZnMkqn; 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 1qb1Ni-0004uk-TZ; Tue, 29 Aug 2023 12:15:55 -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 1qb1NU-0004nH-G9 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NM-0004OH-DD for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:40 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fefe898f76so45071975e9.0 for ; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325730; x=1693930530; 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=AxZnMkqnTdFfPhoc8pKiUmrB9AxxnzwWR+eetooDI0+GxpNyCaM0orLmp+0u2QMzmg 7liHZyijK/5Gwrcie/qY3QrSTCgKGNuIkyvSpEI2BBGH/KEvzl+deEKTig4wxWa5UF6h jD6YMbSm8qx1QlPx09Wp7YQqVUrD0BYvAjaOT1JTeTuEs3HwdYR6g2ramsSJawt0kTYL 7XX7D0pvHBSW5pzVjgnciMe0RxJBiwaObjC8AkeTivWD+tYZlgE2KI5RK155hxbmppzq A/h76wJ0GbrhPDlfR8eiTy3rmHmMhfIQupIgyCAFbjb3jzRznaCRUaOYf8LOwQRGR/qM jLWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325730; x=1693930530; 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=L4uyRdW4wIcHpkF1I/NlVv1qFo5Aj4z17kzazdAl1FT8tllffH4PymmWKQr9i6OL0q xxDnDz3eRDQM/jreX2ZWB/u84TbCe+k3tTRgJX2YvckuPuZYlItfLZM4IEZJRf2AxRCD htcMNYdB1ZJJNrEXoM1ZLg6QQovlJ/mhvq+uwFdlyNX/L7rqFYq5ReLzCJPKGeZRWokJ eYu9SHycd0jdUblrMbmGve7gsy4MKTmZWLkKBskCrR8gCAthh6iABGfykq9aan2t7q2c daGQs4wteuQq/BbZlwgNZSGrNAQGp+IOkbNZ+9V32Y8l2U+RZdYZrSNDl/mS2qO68SYx 9KBg== X-Gm-Message-State: AOJu0YxLRICE26yNjjTQzj2uDwCbxcRmiy/BN5/qABzXbUBpjsl7C7gp SraXGVRSi3dInBRna3K3Yat7rA== X-Received: by 2002:a5d:6282:0:b0:31a:c6ef:5edc with SMTP id k2-20020a5d6282000000b0031ac6ef5edcmr19002628wru.12.1693325730643; Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l4-20020adff484000000b003197a4b0f68sm14357588wro.7.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A70E91FFBF; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Stefan Hajnoczi Subject: [PATCH v3 04/12] docs/style: permit inline loop variables Date: Tue, 29 Aug 2023 17:15:20 +0100 Message-Id: <20230829161528.2707696-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org I've already wasted enough of my time debugging aliased variables in deeply nested loops. While not scattering variable declarations around is a good aim I think we can make an exception for stuff used inside a loop. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <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 Tue Aug 29 16:15:21 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: 718229 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp69130wrh; Tue, 29 Aug 2023 09:19:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpLNOTlqAFQ0/5aT8CEHzpMmA4PEV7X3ae0sxzi/MZOkRxuMKbjq51Zq/FMHLoLhhSilJ6 X-Received: by 2002:ac8:5dc7:0:b0:412:21f4:6fa1 with SMTP id e7-20020ac85dc7000000b0041221f46fa1mr10367993qtx.56.1693325955845; Tue, 29 Aug 2023 09:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325955; cv=none; d=google.com; s=arc-20160816; b=UyiXi/8sVVI88p9ZuY8wHTC9HQPxVRsAofbGVIZDk5ra4Fnm8D0YjHztAuRCtmCw5E yoU5Js4HYGoWZAPVDFCCvchfLJR/9qrawtuGHdAhMPDysfdU7NBLZ8SdsA/3zfrTZKr4 LqxLhUGu52oarUT+MprTQawfzzETFGnnEmKxREOEQJcFSWl/CNCuTdP/KDiCsT0u76iX VFnxpP2CjuxveA8RObvEruj0vMsrez6nRgbZGvSsDvuGdUWZNYr5rRFyr8Or04gj1JIt kN1H7NJSstXxJ+EGmXLvmKoNDM5zvWCbwXQSWuIJtqIAPWy46Aqz2PuHE6Htq02N7qQm W7yw== 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=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=m3tm/BL8HrbHv4OD4s+o/xqAgKO1KhsurAfzPgG+BVi6gg0GbXFFR7hHrvicg9G9gG g5QXaQx54sWriq9DhuuONj3pyb+FPEidJVNh9uiakbSTYvkYs2gETsHTbDZvMUl72/Lv pcIQosK3o61DUewdyt8et6oBYlMPYVSYrBtfV31VlrncDPhGZJ96YS3M9KHtBWfJJzxs 93v9reijv5OihUlxC3lz7crHgRwt4TKepscz//hojFrr2/MGQWaarfyEJjPHoRa8He8a ODqY6FGvCH3Xy8A0gJvHBBKzt1CMpGIWP9HuvfMx5zdvpf+p/4QZBpxwcDYNLIDZF4ii nilw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cw+YPilq; 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 w2-20020ac87e82000000b00403c3fb27d8si6197816qtj.678.2023.08.29.09.19.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:19:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cw+YPilq; 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 1qb1Nn-00052H-0v; Tue, 29 Aug 2023 12:15:59 -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 1qb1NY-0004p4-D4 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:45 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NP-0004PG-PA for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:43 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401d10e3e54so14428005e9.2 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; 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=cw+YPilqNTOPDy2QcgniekMAJi9dZpoGNYDsCQ/s4m5nosMOFu0Yr0nGrmYz5DlTFl XyYdJlAbwR/XTy7Gnik8u5/qF+zYAk2Kqgs5Z4o2lBOlrsBjJHZmwpK80EEnO4cadUxU VqjIKvq5ZjMDtExlPOl2hchFEUWNy3RY5EcO+kjw9EClGyoR9IaoX1LAEZS2Odm8DVc9 rDy0uIARoGzmBFmOlRTcq6IGe9bmZmX413Eq8/tXWdr8dINtKvjYyoShWe23Oyw1QS6y Z0GDpebYQ2DeA+bbyt91WLU00jwmXorjB+O/tjzj+AKM6n3ryRZGIBcERYs0lNEMiGSL hk8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; 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=l34R7GP6PbiL+EISHinld99n1WcPyC9FvKzDTC/HjxMOGZZX958+QElBCdM1FuoBN4 xQlmcZ5CXedoQx5LEVg3XwL44zhfX3nXiAAsAUSxE8xf2zVE8Ynyji0wae1ZS6fsqGJ8 /D/aO2ZpxuwfERlorcND2UYlD5eeMLM7Cqvto/qJSvQ9bfgWBd5Yq9cc9M8hZJsdZOj9 Rdu2FNC5ELZlaI1B2WZ78vWwB8CqsE55tTwMNWggPPRXWeHDbUWOlYn4NNhGdkncjUlX UJ86HC7wH8jP8y/I3eubVDaY2RInbxibOTnokMSQcLoHpzEUm+OyO8VRR2bbiPmlNijc TYlg== X-Gm-Message-State: AOJu0YyAPJAn8w915Ry5tnvUob+fjGzDGz0IE13+0g6a/eiZRnyGooI7 bgAr/4ed/IEiZudqEPycB9pQ/A== X-Received: by 2002:a05:600c:1d1f:b0:401:d803:6241 with SMTP id l31-20020a05600c1d1f00b00401d8036241mr1580739wms.21.1693325731804; Tue, 29 Aug 2023 09:15:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h14-20020a05600c260e00b003fefb94ccc9sm14326506wma.11.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BEE061FFC0; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 05/12] .gitlab-ci.d/cirrus.yml: Update FreeBSD to v13.2 Date: Tue, 29 Aug 2023 17:15:21 +0100 Message-Id: <20230829161528.2707696-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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 Tue Aug 29 16:15:22 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: 718230 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp69214wrh; Tue, 29 Aug 2023 09:19:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcWpkQC/nKMTDUs3+dwBqhDz4FJsLiygDWFOOYVbMQjqpJZPHU2QywnDJTO9wtLJ961m0D X-Received: by 2002:a05:620a:29d2:b0:765:5f40:426a with SMTP id s18-20020a05620a29d200b007655f40426amr40567325qkp.47.1693325966309; Tue, 29 Aug 2023 09:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325966; cv=none; d=google.com; s=arc-20160816; b=dV4bBQBlmvRCMl7M4vGCsVIMk4RXirGuD6L0WTJ039h40K8vBqU6/gbRzjcAo9LJCW sSJStw2bryxHFqCnUeJZK3gLlVQN/VrsWOHTDdZo+GYIwWh1UTAQGNFd7AGHsi+UCSVx Ze9nTr6qfHzBESrNyIOUO+eYXhonAiebkkzxnPManbDXQwW8pIT2nU1oiuq3Tp6ouysR 3wYlw0CopsmTY/WHuFxWODI+IbW65qZVfW5bBK1oRZitzoSqwDZLYlf1UXh5r7LbvsWR 7jaddSqq4zbQg6/cKet84nU5c3FFxeVVkGX0BpjC9SX4ZyNqG7ewAlT/BBs13UaU6afE tjeQ== 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=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=XY9ag0ji+2Qp+BKJdmK36G1H0rQx4zG6pQRL3ItXy1fCh0OPy/8lurf3tsvmAj8c9h 4Y678xhuzRvKHrBvDafIYwgb0n+yk2D0be6t892R8R16C7daUUyI0JwGqqwMKV7fm5LU aUStbg4rY9wNcS/INVSka695fvBe7YUHctoe1FizCaB7RLz3phnmS2TI6T/eIke/8eMP RtnE814lYyPbh+S6jWkPm/yB1yKXMsQeCiFFqD5beAOWg/Z7Hr+aj/67XNrcX18fup/4 sEJy+NoMxDT7h5PzHlZcv1Do7dp3IQyMr6U1Pc3M7AP7cQwKlN0Q7T8ViGjJ5WuPRfKL j9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tSHJ2RHu; 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 qv6-20020a05620a8ac600b0076dbbc2aaf9si3995444qkn.179.2023.08.29.09.19.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:19: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=tSHJ2RHu; 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 1qb1Nq-00058y-6n; Tue, 29 Aug 2023 12:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Ng-0004uO-9t for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:53 -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 1qb1NT-0004Pa-7c for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:52 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4018af103bcso29005845e9.1 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; 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=tSHJ2RHunsRg7Clom3CMqvc0+KPdhsEyi4+oGGI2r+RCvogE0b8MVB0zUaVblz6aq3 8PouThfWdLySns7ER3elFHDZf7BsZ2dtjCjzynA/zGLrZjf8fRtWuLNY4ZOelhVBcam9 sXG4WoWEc6ZqADMhtYjNgtZ3kl+QjR51OnuEPZbSuX8e+qBIpj7Gch8AhOPgvAN6yBUK 2X/rI25KwoX4bNBfEH4K/f0MZSSykyPuztQ8sjCE1I8uSwPmvzCQHCKh73+hZkpWE++y 3AXyrv4fIHFico+AYW51WSUAU8/lj9NtefbQJzs+AqBCoQH4mivXvc6BoePgG+Qpo8/i jvPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; 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=LkP2ZMJ/fSIboRlP2EiLPq9hwvxGZ7gjYLFFx4MUqYFHm5CmLnHLF2I0B/Pdcy1XdJ D4GQiskgwhjQhVlGfpuixzldZDAotB6Ho5N2WVuwfopLqFXyWIplIpAI1GJmPW8IVr+X HDROovyu7OEnLEZYM4pQQHDWci+UtcFDU1vHhw1tYBJyYuLoLakesNZ+0Dfaoev5G04+ QY1MEoQWqskGpk3p60iv43ChlamobiTvCPQ/H5hMKkLHutsH5oFCXEgF7ZDepQjAUnau j7cvuzvXP/iwpKNXwKBwSBUwvGvcj73GsxWGxSoydEj9wSNNnhs21QNR/eP+9y4QEF/2 Z5gw== X-Gm-Message-State: AOJu0YyngDWHPCsNpE2B0eg1XZwUAJWfq+vJ+KXZ2LS5h8DpiOhLvBfE jBxq5DzdcagXDwSd3b6HB3e/zw== X-Received: by 2002:a1c:6a11:0:b0:3fb:416d:7324 with SMTP id f17-20020a1c6a11000000b003fb416d7324mr2446803wmc.6.1693325732031; Tue, 29 Aug 2023 09:15:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m24-20020a7bca58000000b00401b242e2e6sm15458189wml.47.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D68671FFC1; Tue, 29 Aug 2023 17:15:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 06/12] tests: remove test-gdbstub.py Date: Tue, 29 Aug 2023 17:15:22 +0100 Message-Id: <20230829161528.2707696-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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 Reviewed-by: Richard Henderson --- 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 Tue Aug 29 16:15:23 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: 718225 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68450wrh; Tue, 29 Aug 2023 09:17:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZwug/lDYr8h4aAEuB6KZb3sGu8wWsqQMyvw+rlf4gtG4KxUIpNajJbBZQWEJhO1PVcfkm X-Received: by 2002:a05:622a:191f:b0:410:acd3:38f1 with SMTP id w31-20020a05622a191f00b00410acd338f1mr26301015qtc.2.1693325877370; Tue, 29 Aug 2023 09:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325877; cv=none; d=google.com; s=arc-20160816; b=W5B+iGC3dZQT9tm5Kb1edqRY+1VDN/Df9uT1hGlFMBvzgz3Qa6rybKr9rmI2MtgdzP vNj51R/+nSIcWabKo2z43GJOYjF9WSTbIbxdm1p4HtA7XNzZ7ntjXojcnsHq5/mM/mfG ka7pe5PCwTXk3VTl1hn8mKWc5j5Nd08orIp+LjAus4OXhfVrO1ZQrsetqsPYWSTKAMP/ LS0SCyL10yiuFip0Dz/MEM2Xp1FLHHbuMG/3hr/ei0MvQ5uw/7NDcOY5sfkb6HigdSDR CRgzRwgX0CxmcYUwwb2Z0yjRz9s5I4MLhodrTwihptGcNJrGWobo/FxHM1SiUOyVRJ9A HXtg== 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=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=HtIeuQDvTbx7gCjVuoUCaMEtOWJZ4ale1+LwKMNWQyHJllJZsc4nfbvq8UOe8yAPi5 7RRtYYu0ZXlFZ2Ne51ItM+6YCOYy9ssHACRobLi/nCaUF+1e1PgncFv9kSreIr6DdcJT HDPd4cygTyxguLApcM783SFmc5p7BpMUYsMfk4HjaS2SjbWcPfX1bt9MMRhhQY1ZjkBC C5mm45n8UAehVm6fANL9/Vnk2t2ste7Kp0uGhe30DML2VJgzl19sbMKptq/XvKKJV6vT TgRLDkRFCSIfQvxtnE0DbVEGE9HIQaTdEmMwRljBv01SA4p75Ecl+RtKcXDmhjWn9E+E LRGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rFpVuyaD; 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 a7-20020a05622a02c700b00403b84be504si6198409qtx.580.2023.08.29.09.17.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rFpVuyaD; 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 1qb1Nl-00050O-0H; Tue, 29 Aug 2023 12:15:57 -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 1qb1NX-0004p2-Rw for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:45 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NP-0004R1-PP for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:43 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-31aeee69de0so3902777f8f.2 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; 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=rFpVuyaDuoi2aLFOSDa7GEJpmojOc4JLRnK57/ALAKYOQ6Z+n9NLzRY8Faeap2+THD zeloGHkkUfyBOvFlVwuIXHwC3+U/7MtF6CN+pGjniIJMZiIZZkKDFLlQMxHxzd4CWywC PU1xDVenumllTqJP3663ZJ3oukOdPkkaTxxJLSLnuSpuyCuKKlmVfUCra9Ak+mVTNTxH PF05R00PGLjUIZa282/hbsUtpWD5+4WD3t6JAzqXga96xHhq0eJkLg/pYm+Ujcg99xBM GrT11FJt0dcFz0FwdDzl8jZbzLWdRrpu1zR8S9GyeveISV7MBPqww5fhsHRTvOog7T2G aNKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; 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=SZPFESJkyMYCJPU96ZJtpqsl9bp1ITV8IZZJnGoPVivPxBr3/iInwdDpUzxUOnz6rG 1xmWvhgvxrxMUsq4FMsXM05JjpQU49D3zH4zVT+diDLRMaU+ihxbsYHdgPERQJIkeY8P +owXkADrYscpIlPtxBdwVS3lSt10F92w5TCL9o9QOx9tR+gmFnZeDhcla8uydfvZ/fmw JzDnChN/urh7Hnh/gWAjizvDK/wEtifrVYCozE/xT72njz/yB3mi+Jmi3HlSyi/V4HX1 m1/UR21PO/jd+BSpw1o0sgvF9RVWT52+cQVrs6llctZX/WyFnAjiLem/83cSCy5zGsvB Siuw== X-Gm-Message-State: AOJu0Yy7Ub/85Yh6M3/1kohN2g7fZ+DTA5Uos2PK5tr4O6+CGZNZINoO T241oDBAPD43dJy+vfswHOLLgA== X-Received: by 2002:a5d:65c5:0:b0:317:70cb:4f58 with SMTP id e5-20020a5d65c5000000b0031770cb4f58mr23092298wrw.63.1693325733547; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o12-20020adfcf0c000000b0031ad2663ed0sm14191827wrj.66.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 10CB61FFC2; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 07/12] tests/tcg: clean-up gdb confirm/pagination settings Date: Tue, 29 Aug 2023 17:15:23 +0100 Message-Id: <20230829161528.2707696-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Tue Aug 29 16:15:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718221 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp67885wrh; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7N2gH9WFVypZdParIMSYLjNpXfKwYBoWgCj/nu6ltA+Ausrl+5KUtx3XH5PRBaf09PKSZ X-Received: by 2002:a05:6214:12da:b0:64a:3320:8a8d with SMTP id s26-20020a05621412da00b0064a33208a8dmr3676750qvv.30.1693325818418; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=google.com; s=arc-20160816; b=hpkt0GkJdVFS+HT1f5yw9C2Ji01lKPS6AFADppvhAgRY/qXWZ299stbsPr6oxhiJGo CbkeGcFDgA885c4o1K7VLhnoibV5knkHWuO+yCEh/KO0vTVO6jJA88LQdRx5Dm3s/uEx zeQzFBQHuSgfLeIh8EMpBR6GuzwgRdFgrFLGtqtsS5llrz44e9gJYj2HT1wK/QNKJPP3 BX6TDifl5+nLfVV/Hi+jRiAPIHws8SIkVrKnLKMneczam8UMpdllZN2o2Z2/sYDknvly tYT9cVEyk7B/lTOfDeKCkCNexGWLv3xYSFf6tV99JT1JgbASM/mbU1BNIMkjE7J3sQYl tYJQ== 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=jHSoIYwJilbDFQToVbFas5A/XFwuejwyQpYY568nC5c=; b=pQCGZeRRJRLRMkTVkq8hv8QQ9JYdBgK4nBCxVAztnmFOpQ0ka1WmUe/L2WKE5/6bm0 Ida8MvMnxjWV8YaU77v172vpuFSA3F+uCev77XmQVNrjNz3Dns/IgQLEN6/WHsEVUKg+ ZmxOk25k8WYpq2MxTO+Gz6y3fegIwQm0LxY8Zcv7tC4fyoVuARyqcvc9i9AOI/f7POCw k7yEN7NZN6dfDeApIzXH9FmeydHZ2kKKCdyfd/SVzZOtYGicDi3ac0kJFr5HcY/qQHPP p5IpRC5JgbamHmS57XEDU3VYS9VuYuLZ5VcYyl/PfIg+Aj1hiTaAkoPA54IegKFM7TEv dVDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HC+Uzw4p; 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 e8-20020a056214162800b0064f9333d5d5si4009843qvw.427.2023.08.29.09.16.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HC+Uzw4p; 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 1qb1Nr-0005AN-Ct; Tue, 29 Aug 2023 12:16:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nk-00050D-Nf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb1NT-0004Pj-QS for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-400e8ca7e38so40109435e9.3 for ; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325732; x=1693930532; 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=HC+Uzw4pJ58SrxhsrVx0KmFa/C21po8OGLJYGH4et8xnoSBCqw3Y88JvWxapRKKttF uRyUyWQmjlOPlh0oQyUIT9LJXcp14boa3FmYJYZxoF8mueuR2yIkcGIarmZ7xYCWKnpH bB3CUH8sARI0FmzaEHa0dS5JMOkeQIcKrEwSjk3I5E4DGwMN7RFADALfiCu1UxWzb1MD 0gGFvlpcReZD0KWNQfNrpHxnjgF1WNKPSP6Ia1tOpiI5bYaqBCWFjlMik/n3wQojSWh/ 7nZn2VljQGidgZUtLnDOYc9fRI0JCEd0xO2ZS0EyTbPXLBCc0BLJ2AR9dIWw73qnk9gw Am9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325732; x=1693930532; 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=ANsM3vnFZE4VmiLI+1opZy89LYx58RtxUmiV46IvRINoaWbMAixxAqvcwBNKtYiGf+ cTFhaF4kuTnraQqdjka3RPa+GCDDp6TpFOeqJH+L/smikDuvkssxxAufUYLkSk5lUlRV v2jndMAr2V7xx9+DRWs/SEz7xvJ7DpDMB6ycT8dUzGTjP1NZlg8k6eXlXxfA0vu34oUR NLB/Sfcr0AN+fnaTdl2uriGWcm21kALD3YSv/+lNQ1iMuYYcEmrD7wMhiwv68cgBSfoI owQfmgMQXJa1OLP9DMOCQ47/8eA2aMjMRY/ClUVwtXAUwIFyne1kNuUy+14BEl13PmCA NlwA== X-Gm-Message-State: AOJu0YyonNECVsZ/pGnk5EjS3qyyil+dsN2Wp9jvxfiq/Uag4TegGOF9 O4EXd4sm3mc6hfEglumURVZ+Kw== X-Received: by 2002:a7b:c3cf:0:b0:401:6800:7032 with SMTP id t15-20020a7bc3cf000000b0040168007032mr11574070wmj.18.1693325732269; Tue, 29 Aug 2023 09:15:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o23-20020a5d58d7000000b0031980783d78sm14210412wrf.54.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 30B2E1FFC3; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Matheus Branco Borella Subject: [PATCH v3 08/12] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT Date: Tue, 29 Aug 2023 17:15:24 +0100 Message-Id: <20230829161528.2707696-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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 Tue Aug 29 16:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718219 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp67882wrh; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ7lBsO9uy3vI7af7QBCbDSYawCN1y2wLO2MbhIQ2TFvHLRvV4T/4VLiqkHkUPcfNBi+YZ X-Received: by 2002:a0c:f5c7:0:b0:63d:16b3:1fec with SMTP id q7-20020a0cf5c7000000b0063d16b31fecmr18079679qvm.51.1693325818515; Tue, 29 Aug 2023 09:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325818; cv=none; d=google.com; s=arc-20160816; b=BFxGG4dut9IEwCXNAcLXAl/7wKpJvAOf/GjI9mERrLigEkuEr7pHLneBq5OJu0dw8z 63fRssEMax0mZr7cE1xcksQqHOdHGdX6W12XnlleGTDOeFCVIqI6nw8NmUIE7m49nHO/ x8LofwJNOjTXQJFqPZZ4mtEiVQc39sacuOnLDlsUo2E3D8sUn5+KirNVGiuGrbMoFrgE 75T8pu2kPpbm98QoH8YJMRf1CRIM2yTd6UeBMR4CAl4jbr0dMw4WmVFSdcqX7ZYHCGbr HuvQkWADxL/l3lLRplRg3RDa2GCLA49sqN6nAj/h8Y7pNGhdpEoRaZlJpDwKG0PUanO6 FuFw== 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=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; fh=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=hylezP0XAa2bNn2foKhpZ43Vzt7TGJItaco90/b4saMJSs6RGVPPFNlc0PeFgAs6gm xG0xXOfIKyiHnTp+0/3BioNrbGyboPbGgBx2AAy+xy9f9CSzxHrNQmnTXnfA02ZTOXHg oHimpyS26vNuY1eTHGcGgmuZcSzxPSVtOJqibJ+4Z+UjlNW64uLihtnohx0onTwxY8Nn UAOADRKodhn8qTREYNTHdR+z9zGWxxVO0AFg1RFSp2XRHckwC+f13heZfoyl9iZgougW pLQ+7iURTX/+2Y3SSgfR+3WEZ4bndTjeGGQ+CaTBOGyB3zcxo5mmmgvhfwCkoqKooSRX Icaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UivZ0wvU; 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 y13-20020a0ce04d000000b00636c603c9aesi5988913qvk.525.2023.08.29.09.16.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:16:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UivZ0wvU; 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 1qb1No-00054P-52; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Ne-0004s5-IN for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:51 -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 1qb1NR-0004Qd-NW for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:49 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-401bbfc05fcso39404665e9.3 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; 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=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; b=UivZ0wvUW5A9ZGRXyvfdZXfxbJmx1WcjRElFaE4x50wffeRqrMI5XjFpJX/I3qdcEv rju4cTq+xMiSeDw0XU2AmqQx+mm96TTlE0UDM2RoZGSj4wu9xjK8uxUgGXi1IlHxYHNs kipjpAOH+5RiJCHofScnQ6INwHCr2rXQJmnR4NFgJLHguXtcRuKNvSimTuxFplEYmCq5 VPmQocpN8Y/+X3dRWapp6f2Ixt7yH1rGrhJrKeE2y/Ane/OfYhJO/uPmwebeILO39ymL jRcpyqpgFUAKJMHflW1KGUfDmDIVY0eRgrcuZWumxlBiMRs4JzL6iWokbgcEO0FYku8Q 2SeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; 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=nuqfv5PkPoZO60tE0HLdiXGXAYOAnNfi4gjeg/+lqO8=; b=kimRKVH84S11CTY4Qrzb7a5xlkqelKqgREz8fJW1YEljOtzsCeL0ovuqjv+pw030hy +/HrolCsWbqYOoD7VEUJpbbRwy2DvOEPAzKotDKsEycCqG4Sw3IkJi+DW8fo5SULZpO4 /2xV++MZF2Fy2yJjdc74EOxJY0CQu+I9EYYsIGsggJ+HvPYA0OiZmWm79ezd7PxPqn1T T9MiP/O1DB5gtSBTdbRAoIb1+AL9RD2tFMbkiUDUFxuJPJAF4KKC+1zl7e1aaV+H92lt cnLc9A9tdd83zql1zAAJfeYorNbIdSEmHWfdhr9ay1InwiVcA+BHfLlmRUpbGv0K0pbr dFug== X-Gm-Message-State: AOJu0YzmVlG4utnVu25RoaTyBd8T2XXSR13NDMgGXkGokiZDy6QsOvD0 xxwYDVoB9HnFrP2F0tYLwxnG1Q== X-Received: by 2002:a05:600c:2807:b0:3fd:30f7:2be1 with SMTP id m7-20020a05600c280700b003fd30f72be1mr20129226wmb.39.1693325733178; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n23-20020a7bcbd7000000b003fef6881350sm14585160wmi.25.2023.08.29.09.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 49F281FFC4; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 09/12] gdbstub: remove unused user_ctx field Date: Tue, 29 Aug 2023 17:15:25 +0100 Message-Id: <20230829161528.2707696-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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 This was always NULL so drop it. Message-Id: <20230824163910.1737079-10-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Acked-by: Ilya Leoshkevich --- 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 Tue Aug 29 16:15:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718231 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp69231wrh; Tue, 29 Aug 2023 09:19:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYJc9nbdoQWxmjXX2DM3fqZmvF2zETINJRy/AyhHBv3n9vmmKDCvXErCYbsRoUP52Zm0ru X-Received: by 2002:ac8:5acc:0:b0:410:8ac5:3084 with SMTP id d12-20020ac85acc000000b004108ac53084mr4001298qtd.7.1693325968868; Tue, 29 Aug 2023 09:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325968; cv=none; d=google.com; s=arc-20160816; b=IbSxRSbkbSxlixs2O/b/+nTP9zfqr0llNH3x9CyXdLWTDiGpNiBjk+u06UCVQdVOSn EDwvkylTVKoCL86vVwl7kv44qnzq0QRx1FfehYJNK49e8qr0hX+btyA91GgMbhd6ohI5 242PmIiRMzMMMc5mtRiOGVU7Y8Wh8Plq9u1uH9dNq7SgVU4AiSTpsqViBO1NIHW6l6N5 J8oQID4CYpGAAVdCrs0XcNPDANhE/dVM3tAWp4MApGkzS3+Yu0h0EJliN7h7DKrcD9t8 LCpmWx6cufKBx77/tompVZ0GgiXFqduB9ZExQJsTcxfWWLMGm80+pR8aFZxjC81NaZ6h SH9w== 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=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; fh=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=fKLY+0v+NfBp/RQFObJHfkAfSm5I4fLUj6d+mm3UHqWE2QmzBzV0z+7eNrfkGdBqmC FwPdnA8kC2Phtu/mke37G3M9Rf5/77nRVw2FkzbNJWyrhBpKeeHUVUUifDJqoxYw1+8D evSna69+bfaCfkwBPawh+SpKjY0EIlQruVgw3LXfwGfi2pojXL2TYmJogT98k3f2Vh+0 AMVFhgH8kiw1G21aIg5+Smh/0Cio9HtlMx0XKfuzFCi8CwttfagiUmG8w1F1ubg6Fgtk /5PmFb10WQvYsO710gSvcX2eZzWxjt9HiwUm1jDkWjUxKj2XG1cmHjeekvhB3IC7VL1q mMcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZkemELLT; 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 x12-20020ac85f0c000000b0040e4daf543dsi4040118qta.624.2023.08.29.09.19.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZkemELLT; 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 1qb1Nq-00059M-Nv; Tue, 29 Aug 2023 12:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nk-0004zI-1t for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:56 -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 1qb1NT-0004Qn-Qf for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:55 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fef56f7223so41377755e9.3 for ; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325733; x=1693930533; 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=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; b=ZkemELLTwaRba0RloTHPtfkxAVroB/+6wJhKBgaKY+4/I+ckfY1JLV06QjsuUIKYHW g2MhgyDaE0+Y7huDAFwzkMQDg7N1UdwXAetKrBZBMMal1Cg7jUqW/tga8fH1iymqbCsw LmJX1vgQXdgU+Xeor8nr5OwdLmgZp8Iir9le4oLqyPrbCn1lBQK4QVdFTs4xmovtcDwV FWZ89Z7Mizwmissg2CIfK8ePo7AnF0YqfA6cQGy+RLMTlAIC0GC+xfEmxOQEhB2kc3ZL VBcr7RqN4hrsOSntNLPLCZlwVxu6gvsn2WqF2Nb9TniFqRaA1rVRRn0d6zlwG3FpG3Gk Xd/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325733; x=1693930533; 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=eGuSlOFUAd6anPdd5Y5MZCMek8dhfbyzWA0wz58Vex8=; b=hiFtC/aMmSzFbBoaDpwox3ODAril276HP6k5M/OSw/bbtmRwo1kdSzhm9xfXTrK2KG Z5qpgFC9DaUR13Kh/FbbB0HTJXySyf2nbyK8jiSXMZ1PMQE0OvKWPKQfB3fnWLCxFLx5 ftADuEON7GnFaeeyu6e3Gie5JQV4GGmm5mXE3PWT+0oqwVXEUjpsYlYLbjbNlLk5R7iH aP80DwyT23ZhW8pJql/2Ibe9/HYgsPUTmmzDo0D5UAzBbCnU0LBeB2w1V5KKpR+/2UMA d/Q7FBUIJZsxm0X0MxLPVq2f9iUvrRbFIfPdKi1tkiGKaEYqx8yIuAYRuiXl14USrnH7 rLWg== X-Gm-Message-State: AOJu0YxHd9wJmnDSr9RQKKB0MroO1cs9at489HSw0vNjQMWlKu+IgIk0 yHVmsVz6hdNNdNvr/d8KrtETFw== X-Received: by 2002:a1c:7303:0:b0:3fb:f0ef:4669 with SMTP id d3-20020a1c7303000000b003fbf0ef4669mr21407138wmb.17.1693325733334; Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m9-20020a7bcb89000000b003fee777fd84sm14309471wmi.41.2023.08.29.09.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 681B11FFBC; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 10/12] gdbstub: refactor get_feature_xml Date: Tue, 29 Aug 2023 17:15:26 +0100 Message-Id: <20230829161528.2707696-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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 Try to bring up the code to more modern standards by: - use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls - don't hand hack strstr to find the delimiter - fix up style of xml_builtin and invert loop Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v3 - also clean-up xml_builtin loop - use strchr and defere copy for only xml case v2 - avoid needless g_strndup for copy of annex --- gdbstub/internals.h | 2 +- gdbstub/gdbstub.c | 81 +++++++++++++++++++++++---------------------- 2 files changed, 43 insertions(+), 40 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..729e54139a 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -354,64 +354,67 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { - size_t len; - int i; - const char *name; CPUState *cpu = gdb_get_first_cpu_in_process(process); CPUClass *cc = CPU_GET_CLASS(cpu); + size_t len; - len = 0; - while (p[len] && p[len] != ':') - len++; - *newp = p + len; + /* + * qXfer:features:read:ANNEX:OFFSET,LENGTH' + * ^p ^newp + */ + char *term = strchr(p, ':'); + *newp = term + 1; + len = term - p; - name = NULL; + /* Is it the main target xml? */ if (strncmp(p, "target.xml", len) == 0) { - char *buf = process->target_xml; - const size_t buf_sz = sizeof(process->target_xml); - - /* Generate the XML description for this CPU. */ - if (!buf[0]) { + if (!process->target_xml) { GDBRegisterState *r; + GString *xml = g_string_new(""); + + g_string_append(xml, + "" + ""); - pstrcat(buf, buf_sz, - "" - "" - ""); if (cc->gdb_arch_name) { - gchar *arch = cc->gdb_arch_name(cpu); - pstrcat(buf, buf_sz, ""); - pstrcat(buf, buf_sz, arch); - pstrcat(buf, buf_sz, ""); - g_free(arch); + g_autofree gchar *arch = cc->gdb_arch_name(cpu); + g_string_append_printf(xml, + "%s", + arch); } - pstrcat(buf, buf_sz, "gdb_core_xml_file); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "gdb_core_xml_file); + g_string_append(xml, "\"/>"); for (r = cpu->gdb_regs; r; r = r->next) { - pstrcat(buf, buf_sz, "xml); - pstrcat(buf, buf_sz, "\"/>"); + g_string_append(xml, "xml); + g_string_append(xml, "\"/>"); } - pstrcat(buf, buf_sz, ""); + g_string_append(xml, ""); + + process->target_xml = g_string_free(xml, false); + return process->target_xml; } - return buf; } + /* Is it dynamically generated by the target? */ if (cc->gdb_get_dynamic_xml) { - char *xmlname = g_strndup(p, len); + g_autofree char *xmlname = g_strndup(p, len); const char *xml = cc->gdb_get_dynamic_xml(cpu, xmlname); - - g_free(xmlname); if (xml) { return xml; } } - for (i = 0; ; i++) { - name = xml_builtin[i][0]; - if (!name || (strncmp(name, p, len) == 0 && strlen(name) == len)) - break; + /* Is it one of the encoded gdb-xml/ files? */ + for (int i = 0; xml_builtin[i][0]; i++) { + const char *name = xml_builtin[i][0]; + if ((strncmp(name, p, len) == 0) && + strlen(name) == len) { + return xml_builtin[i][1]; + } } - return name ? xml_builtin[i][1] : NULL; + + /* failed */ + return NULL; } static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) @@ -2245,6 +2248,6 @@ void gdb_create_default_process(GDBState *s) process = &s->processes[s->process_num - 1]; process->pid = pid; process->attached = false; - process->target_xml[0] = '\0'; + process->target_xml = NULL; } From patchwork Tue Aug 29 16:15:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718227 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68841wrh; Tue, 29 Aug 2023 09:18:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWVfujHY5MjhCIEp3ZzbJe2hkXmLGdTnaUuhkNYf6XiN/65f80/IDDEgVESkA8UoPtjHGP X-Received: by 2002:a05:620a:4095:b0:76f:199d:64ff with SMTP id f21-20020a05620a409500b0076f199d64ffmr4975714qko.55.1693325923408; Tue, 29 Aug 2023 09:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325923; cv=none; d=google.com; s=arc-20160816; b=UiVUVJM6JARvVRrB2wjTGGmVnFKJFQVFuBqYdskBSojTGSiXmuAerzU8vhCLdoMZo0 Frf5hDGX3BumGpOjluNlo7kZ8oNabmnWqy42e4JucD664i1VcHhCMzlUEmU2lwHkz4zU lCJD6JQ6HUKDEL2YkYaN76H81z9nUE0nXjPvD6sgy5ISvlwzhU081eQhbLCTC+UdiHc5 LqDyM5AMHCNuLfO02eiu6utvM9Nbs7qgZ369EmrBKF2pj51Lnehyb9DCDC+4EJYPLf9A j9eOw4dJXBYhExqRF6khDxqTYlhXK8c/ai7OpGPIvFzIsHcKo7s2ma0lXXmfzcRSIJ4p 2Q5A== 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=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; fh=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=cJLwP4UMWjbvXJykXvtJObRBMTDYRoiF7XlEiXin1rYUerq+pUYjuNZFQ0FiNwYeOW kTl9ZvJVZqejk2vy9ARMHmlQUavbJJJSZktQXEY1HHGVvIjFvnz5i54KC764l4BLRTEw oLQZqwJUmxHbcPWJsRSv6WIyhBsJU7Ga026tsWnRQJDFU2K4Q7tVgcmMx44NF5LwaWWs nc7Mls+j2sUHMemyhGqrEHZxhyAHZ/utXUY78cQVXClCvD5s2K0PE3aMSv2UXE3cEo2L pk4eAyBo7KhB3pQpFlicTjWvrzxg7F2+PKcbALPNdtVmDUEm7iXFOfeYQjP7Dg7xLeFK 0oSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MDXHc7/8"; 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 rr4-20020a05620a678400b0076daec99772si6252970qkn.36.2023.08.29.09.18.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:18:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MDXHc7/8"; 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 1qb1No-00055s-Um; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Nd-0004qy-PR for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:51 -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 1qb1NR-0004Rn-5n for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:47 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31c8a710545so2783924f8f.3 for ; Tue, 29 Aug 2023 09:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325734; x=1693930534; 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=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; b=MDXHc7/86yBaD41yaQCelIhjePy7PUC23souAJuYNbOldyIT0tcoHwVXOtu09kTvAT 5e2xsOJHfBveqlK4+UvVdn9shERcXnyYmwj4eCNOKliRj0Dy3DEJ9HAb2QY0SU22LVfA jbIrJRMNBrcHDEQB52Pg5jfRd82S+dFk36R6iK/JULIrui5lpvmq/ncWhQR+/pfZI8mo 6nHFVoTkalZANi6qihqOl5fwc58rwP1FH43BykKzQhyRPXzR8V2egbreIXrC9682F5vw 40KRTa3ner5NKUbnmTunsWbY7DaQpdDxHYBXxODj/nVARlJVoJWheQAcZ/FlO3uiUpqC h4nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325734; x=1693930534; 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=4nhstB+7y2v5rRbwGKxHabANkJ31CBKONQBTbKxT/Hw=; b=A8Rqn+PlQkMeq03HbAQEtRpGQ1zKlZ7eCdNoIe93hjQMt8Nem5K1WCpdpSMVYKWNFz LtcZdzkHX8WhRZ4BeHVmBVtZgij6/0dF2bhFW+cMy4ru56jy5vTPphuAU2vBwFAqrhAT CwJupXQzRB15T8CIxtkI88JOHtdzLuV2QCleQIepqamX0TOwbWqp3xP0FSdeuEPEaODa annyRF1QWqpVn4RxLUiO/jtsuiKJ0DpzBJDf31qqu8B213WmRyEMoAN6WhlByV1pGy6Z xEf5Nzi6aTwAJcDq4nyjYWScUv4oe5haxzcCenW8sgbcGW51PgSbfMF942UuqmvMDO3W 6SUA== X-Gm-Message-State: AOJu0YyKBJjt8ZnLmjLQm2WBAX532twbp6cf6/SOfgsAIAQE6jdyZrbi JYH6/gKNp4VVu9C4q3mzQzgDrw== X-Received: by 2002:a5d:604d:0:b0:319:71f7:2427 with SMTP id j13-20020a5d604d000000b0031971f72427mr23584258wrt.66.1693325734496; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z12-20020adff1cc000000b00317f29ad113sm14208277wro.32.2023.08.29.09.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F3EF1FFBD; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 11/12] gdbstub: replace global gdb_has_xml with a function Date: Tue, 29 Aug 2023 17:15:27 +0100 Message-Id: <20230829161528.2707696-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Try 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. Message-Id: <20230824163910.1737079-12-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- 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 729e54139a..fdebfe25ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -75,8 +75,6 @@ void gdb_init_gdbserver_state(void) gdbserver_state.sstep_flags &= gdbserver_state.supported_sstep_flags; } -bool gdb_has_xml; - /* writes 2*len+1 bytes in buf */ void gdb_memtohex(GString *buf, const uint8_t *mem, int len) { @@ -351,6 +349,11 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) } } +bool gdb_has_xml(void) +{ + return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml; +} + static const char *get_feature_xml(const char *p, const char **newp, GDBProcess *process) { @@ -1084,7 +1087,7 @@ static void handle_set_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1105,7 +1108,7 @@ static void handle_get_reg(GArray *params, void *user_ctx) { int reg_size; - if (!gdb_has_xml) { + if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) { gdb_put_packet(""); return; } @@ -1572,7 +1575,6 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx) return; } - gdb_has_xml = true; p = get_param(params, 0)->data; xml = get_feature_xml(p, &p, process); if (!xml) { diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index f509b7285d..9f0b8b5497 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -97,7 +97,6 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent event) vm_stop(RUN_STATE_PAUSED); replay_gdb_attached(); - gdb_has_xml = false; break; default: break; diff --git a/gdbstub/user.c b/gdbstub/user.c index 5b375be1d9..7ab6e5d975 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -198,7 +198,6 @@ static void gdb_accept_init(int fd) gdbserver_state.c_cpu = gdb_first_attached_cpu(); gdbserver_state.g_cpu = gdbserver_state.c_cpu; gdbserver_user_state.fd = fd; - gdb_has_xml = false; } static bool gdb_accept_socket(int gdb_fd) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index f421c5d041..8fc8351df7 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -48,7 +48,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) } if (n < 24) { /* FPA registers. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_zeroes(mem_buf, 12); @@ -56,7 +56,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) switch (n) { case 24: /* FPA status register. */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return gdb_get_reg32(mem_buf, 0); @@ -102,7 +102,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) } if (n < 24) { /* 16-23 */ /* FPA registers (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 12; @@ -110,7 +110,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case 24: /* FPA status register (ignored). */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 4; diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index ca39efdc35..2ad11510bf 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -56,7 +56,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 32 ... 63: /* fprs */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return 8; @@ -76,7 +76,7 @@ static int ppc_gdb_register_len(int n) return sizeof(target_ulong); case 70: /* fpscr */ - if (gdb_has_xml) { + if (gdb_has_xml()) { return 0; } return sizeof(target_ulong); From patchwork Tue Aug 29 16:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 718228 Delivered-To: patch@linaro.org Received: by 2002:adf:d20a:0:b0:31d:da82:a3b4 with SMTP id j10csp68981wrh; Tue, 29 Aug 2023 09:19:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2TLiImiGLscDGYVRI290TAXNj7NuYBvLkT5xctyT58JBxv2n5bQSeE2u+nilCmRDOj5pa X-Received: by 2002:a05:620a:1025:b0:76c:9ac2:3f22 with SMTP id a5-20020a05620a102500b0076c9ac23f22mr29644046qkk.68.1693325939993; Tue, 29 Aug 2023 09:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693325939; cv=none; d=google.com; s=arc-20160816; b=jj5fKNJgQTrzF0oBmGCKnfTcm+oYfV7zPh4H4WoItXwsWj8TdQt0FPJLRYEmUO2ofv WERvPhkrM0Z0XJCpxXJaie/csAw5rBNijJ6uZiWC0YPoe/tA+gZJi7sdoqaG5a/Qfpbn 0gQrO7t+8l3qxDwTjERus8xSYilGbvmnHARhfnn8VjZBaCfm4IEEbCct1XiPHcFHFZlR pqKpNNXQmLEjseaIbn5zS2QzPC2MkboAeiZ2KPDbfrHeKEwPtH+9y2FAZS2LJgqtwbbi +8Ph+w0J7XlaFDe3Ye9iI+xnCmGMg3/3Viirn4QnH8XtsydfjfEFjGrbqDFA6wsadu56 N8jw== 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=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; fh=XRGxpyqI0YVzcp3Q9gBEMVQOmsG743peAXTGmKRj5T0=; b=dKmsw3M63RCivWQsc0c4P+hsJeL415lj/c79AG6n8L1YVWxmG8aAKpNzTKOHwFa+Fe 3BO3wfzdR8XVjad91vq18nO3lmfAmVjGm+S1WbI6Q9iNkXg0yPLz/HBKGIRTmteFQxyL 2aw+Qg0xXqV9KJS0004QZHbaicHykpTL90Lmet85WWkDZ8bkcnTt4A0u+u7c3CAHDfQk ZnfHlZqANIFSdyguog86KTUoC/KRXrMOcZiPM9EqJD/HT41rx+6TZOkqnfpwmBtTJglH ldyy4xhSgjpUmOnFi5Yseo9KNIxr0fHS4qnnvDh5COii9D5QfB5onCctNSc9bxpT5QAS 2DKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oc+Q4mYZ; 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 r7-20020a05620a298700b00767d2097bd7si4919484qkp.322.2023.08.29.09.18.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2023 09:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oc+Q4mYZ; 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 1qb1No-00055H-MU; Tue, 29 Aug 2023 12:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb1Na-0004pi-J1 for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:47 -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 1qb1NR-0004SD-5Y for qemu-devel@nongnu.org; Tue, 29 Aug 2023 12:15:46 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso4118071f8f.0 for ; Tue, 29 Aug 2023 09:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693325735; x=1693930535; 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=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; b=oc+Q4mYZf9/YHUG03PttxTVHFvT1xT2vGYHyCh4rrs60RwD91QqzQqpgRs0TKgw2S6 MnVaPRftVh87nHiwrwh1O2JUbaPkskurVoQ5cf8uELspi4IhL/Hi/p0jtV3JFFyOeFCf fVU5RMgkX1BbMRb6onmgbcF2K/sA6/JkavA/R0Ah3zuuncVYW84CV1viVUQBQmbVVTdI JvRRbia7XjmUJmyJZZ5gc95XBiJ/9X6prrmYXRUXoxYWLAVudGtEoBYwXZ/9xXNAkQct zKNhXpBGjmfzTLjszj6j8Bqz74MacONsd+rb84kM3+UFejMp/fdP5GLzTpFOIdRlqFAh MX9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693325735; x=1693930535; 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=641GYd2IB2M0B+j3IAYf6vUTBtf44JLc2SkA+xJFKp0=; b=GCypZo3QfYMsAHyZoQ9MgVaBrL98NBa7OPNEyjZ1NoJmZay9xJwUIxo0Tg0ZI6omzN w+tbmmDsS915TAqP+8YL9wCk5VPSGW0W0wY5q/NGDvFl6XqGhlJytiTdIIfFtwCdgUrd DTdVVdaOwv2udZJr3zJaL2TVSv4HuTiiZsof4kjisvzacOkfpRwMd9fSdMsMkvENYBEs qPpVbCEqx124PYDvvE9DaKNuG0D1A069osSqEJ/rT5YR3GQSzHwzXn3Yu5cFSSdaoGi0 +nZp+Y1WjWkqkkGBxAnimSox/8WeAiOw0py5BTMMedkND/qhWzZfZAlP4lseKjjpnuox qbmg== X-Gm-Message-State: AOJu0Yztf31DWGdUtaF3Unl7OHJucWm8MxgZkebWyEaWhfIA2vEnu8Ez z6WPuk1xR6a9dXEfoUNjYjIzow== X-Received: by 2002:adf:f9c4:0:b0:314:420c:5ef7 with SMTP id w4-20020adff9c4000000b00314420c5ef7mr21104043wrr.11.1693325734714; Tue, 29 Aug 2023 09:15:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d15-20020a5d538f000000b0031ae8d86af4sm14142002wrv.103.2023.08.29.09.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 09:15:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A8E3F1FFC5; Tue, 29 Aug 2023 17:15:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , qemu-arm@nongnu.org, Markus Armbruster , qemu-ppc@nongnu.org, David Hildenbrand , qemu-s390x@nongnu.org, Greg Kurz , Nicholas Piggin , Akihiko Odaki , Juan Quintela , Yonggang Luo , Richard Henderson , Ilya Leoshkevich , Peter Maydell , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v3 12/12] gdbstub: move comment for gdb_register_coprocessor Date: Tue, 29 Aug 2023 17:15:28 +0100 Message-Id: <20230829161528.2707696-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230829161528.2707696-1-alex.bennee@linaro.org> References: <20230829161528.2707696-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use proper kdoc style comments for this API function. Message-Id: <20230824163910.1737079-13-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- 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 fdebfe25ea..349d348c7b 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -456,12 +456,6 @@ static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg) return 0; } -/* Register a supplemental set of CPU registers. If g_pos is nonzero it - specifies the first register number and these registers are included in - a standard "g" packet. Direction is relative to gdb, i.e. get_reg is - gdb reading a CPU register, and set_reg is gdb modifying a CPU register. - */ - void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, int num_regs, const char *xml, int g_pos)