From patchwork Tue Jun 27 16:09:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696869 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865233wrm; Tue, 27 Jun 2023 09:12:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Zf/Dr3kJhL63WoDncz2gUDRGN8F9EmMdE7TytN4I9vhn6TTEyDgNLnGHBm65a0eojc1U2 X-Received: by 2002:a05:6214:ac8:b0:635:4693:e400 with SMTP id g8-20020a0562140ac800b006354693e400mr11331317qvi.7.1687882352199; Tue, 27 Jun 2023 09:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882352; cv=none; d=google.com; s=arc-20160816; b=QUuCRYbXwWJRWrjvurKqmqjK+a6VwFAEk/vDB6OK7ryujQMNAUo4WSxX9dsoH5T4e/ 0VQSTcz1kSsnKSOQ2Zp4cH24PjGrBP8mqhK5zQT6FiGB/hCzsiKKdFrtXPdfXatZ6GCj /3KSRzgf8cfHcgH7xKv0WzifIsk0NT9TjE3AsOwIqdO2KR+g8GOIGOzvh7MnB0MFeTby LXuvPpW6tdxEqalo1wzDCeOS7+wvCSq8zfs+v6KIv9ufFUlyhBKPoEDa6RrxsbNbgnqO kH8vxNjGi3KhBk156XxAlsznl6tq94hrnzXWak7cTtbqdup2P5paoYK7g9ptJi0hppLP b8DQ== 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=lp6KR88j71QtkzhoL0VNQhU+0wKLrKZSfG0XhX5V00g=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=u3bgsORpfju2JF8b0IyZ/3jHoboloQoxGieLUs5vVasqMEVpwY5Cr5u13x0i8y+kVg feon4Fy8VnkYatu7D/mOi0cCkojKYxJJWPNTH6eeWBMISWb6G7Ry3eSkSY4EDFFAAX99 FTdA17WaQgO/Lcd+uiuARZYLbBNMfDW9nRC5Qagobseq/zwOaWNZhyG6T5DJJzoyEkVi XnH8uOMX1sbHyD6BzOuhQg4HueOD0maK9Boy32GdyNqufx+5UImThgbLMPXMj00pY5eG gfOy6CtRkqiObbs1Gq+GS3kV/HXMYw4DvOiqgf02vx8s4R1n5bgL1bMWm2FTjGxXkZI4 aZCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avrPSdph; 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 kl6-20020a056214518600b0062fe3ca10b5si3479409qvb.186.2023.06.27.09.12.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:12:32 -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=avrPSdph; 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 1qEBGL-00087i-RK; Tue, 27 Jun 2023 12:09:53 -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 1qEBGI-0007lG-GM for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:50 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGE-0005mE-Fy for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:50 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbab489490so3652575e9.1 for ; Tue, 27 Jun 2023 09:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882185; x=1690474185; 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=lp6KR88j71QtkzhoL0VNQhU+0wKLrKZSfG0XhX5V00g=; b=avrPSdphFNnoKpd5wAWXzCBGmTQh19SGXRW3saRBwtSfhLBGkv/N/evNr5rfyMQ+UM KYeGNvNdV2UANPSauIoOGYiWkTN1UWHTj3Bnm9kX3SEfTZhLYuvQC8AQ4daiCj0MU3eo igp4Fos883p4biTUpGEjpnU5HW+vt0yKPDcoUs3zYx7T+P8Q+nFEFJ9TLlB/rOCSNxAK 0OcseXGwcisSxNsbG39SILdtT3Kn0qcXcilQ0gdSf3CzDStgrlt/eih9ikqmtxX4+qcF Kk3v13anYATAQolYNjrgT1EtO3Mj1LjMvPYD9BeQ/iMO93bLHDpuNsVkgLZ/+wfq0rUC H+lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882185; x=1690474185; 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=lp6KR88j71QtkzhoL0VNQhU+0wKLrKZSfG0XhX5V00g=; b=OxFCouPdnHluk7ZmDBcy2qeH6nXqa78LpjBZNHbZ/I7Xcgm8Hrsjc6rGizOEWBXjiM 1m4XUhXjJ/iBMwAZrVAmhN3Ecnsql/UnMA0Iqx8BTxyq3rR0QBNc0HR4WUdcxtVcAYS/ Vg2ck/0ajoI0dzB3bOsl1IUJe3N/mIo5ZMO6MY5vfOD4jgeKT4wPCsmNGcBLIvI1Yudl 1AMznzvZdk5Df02oniCbpleNf9vT0iodzmUy+Ue5sQZ2MKYG4sXrskBrlJdrjyNHutNJ YAWqzc+hktC1pBhUhp2khz61agmhez1R0c7qq4uFeHu8T0bo9UohSinVDLTFq80YtMne mQDQ== X-Gm-Message-State: AC+VfDz8uFZC4F++kGzwnCzhglPgwcw9824sLyHMCrK3NAhVahOx4UnU oZ3elCCl69OaNdYSV/627TD+JQ== X-Received: by 2002:a05:600c:20a:b0:3fb:416d:6358 with SMTP id 10-20020a05600c020a00b003fb416d6358mr3221537wmi.16.1687882184940; Tue, 27 Jun 2023 09:09:44 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y19-20020a05600c365300b003fa8dbb7b5dsm7523406wmq.25.2023.06.27.09.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0F74B1FFBD; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 01/36] gitlab: explicit set artifacts publishing criteria Date: Tue, 27 Jun 2023 17:09:08 +0100 Message-Id: <20230627160943.2956928-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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é If not set explicitly, gitlab assumes 'when: on_success" as the publishing criteria for artifacts. This is reasonable if the artifact is an output deliverable of the job. This is useless if the artifact is a log file to be used for debugging job failures. This change makes the desired criteria explicit for every job that publishes artifacts. Signed-off-by: Daniel P. Berrangé Reviewed-by: Richard Henderson Message-Id: <20230623122100.1640995-2-alex.bennee@linaro.org> Message-Id: <20230503145535.91325-2-berrange@redhat.com> Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest-template.yml | 4 +++- .gitlab-ci.d/buildtest.yml | 2 ++ .gitlab-ci.d/crossbuild-template.yml | 1 + .gitlab-ci.d/crossbuilds.yml | 2 ++ .gitlab-ci.d/opensbi.yml | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml index 5da61f4277..f3e39b7eb1 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -25,6 +25,7 @@ # rebuilding all the object files we skip in the artifacts .native_build_artifact_template: artifacts: + when: on_success expire_in: 2 days paths: - build @@ -53,6 +54,7 @@ extends: .common_test_job_template artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + when: always expire_in: 7 days paths: - build/meson-logs/testlog.txt @@ -68,7 +70,7 @@ policy: pull-push artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - when: on_failure + when: always expire_in: 7 days paths: - build/tests/results/latest/results.xml diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index aa833b62ca..24bba061cd 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -462,6 +462,7 @@ gcov: coverage: /^\s*lines:\s*\d+.\d+\%/ artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} + when: on_success expire_in: 2 days reports: coverage_report: @@ -587,6 +588,7 @@ pages: - make -C build install DESTDIR=$(pwd)/temp-install - mv temp-install/usr/local/share/doc/qemu/* public/ artifacts: + when: on_success paths: - public variables: diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml index 6efb0d2a54..d97611053b 100644 --- a/.gitlab-ci.d/crossbuild-template.yml +++ b/.gitlab-ci.d/crossbuild-template.yml @@ -55,6 +55,7 @@ .cross_test_artifacts: artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + when: always expire_in: 7 days paths: - build/meson-logs/testlog.txt diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbuilds.yml index 1e0e6c7f2c..34f9df2be9 100644 --- a/.gitlab-ci.d/crossbuilds.yml +++ b/.gitlab-ci.d/crossbuilds.yml @@ -169,6 +169,7 @@ cross-win32-system: CROSS_SKIP_TARGETS: alpha-softmmu avr-softmmu hppa-softmmu m68k-softmmu microblazeel-softmmu mips64el-softmmu nios2-softmmu artifacts: + when: on_success paths: - build/qemu-setup*.exe @@ -184,6 +185,7 @@ cross-win64-system: or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-softmmu tricore-softmmu xtensaeb-softmmu artifacts: + when: on_success paths: - build/qemu-setup*.exe diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml index b4d7eef688..fd293e6c31 100644 --- a/.gitlab-ci.d/opensbi.yml +++ b/.gitlab-ci.d/opensbi.yml @@ -63,6 +63,7 @@ build-opensbi: stage: build needs: ['docker-opensbi'] artifacts: + when: on_success paths: # 'artifacts.zip' will contains the following files: - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin From patchwork Tue Jun 27 16:09:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696862 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3864843wrm; Tue, 27 Jun 2023 09:11:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6R4w+a0zNB3Mdf1IjxTxpaH2Tpheq3zk8qTWCyCPwBmT2UXA05rc1ATsEgRf/RLrbtAUBg X-Received: by 2002:ac8:5acc:0:b0:3fd:e5dc:adb8 with SMTP id d12-20020ac85acc000000b003fde5dcadb8mr29084747qtd.36.1687882311812; Tue, 27 Jun 2023 09:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882311; cv=none; d=google.com; s=arc-20160816; b=AB+y57lylyWTdYx7qAm+NVG7M/e/yHqWxjET+u0OO4Xw3Xki21fP8e6WNPSloSlVsr PY4f3lkxxeDJ+h5CQyx93aluoPYx5q23Pc7wV9SGGhNs43SRBhJrOqJo/CwqLCqVdmRO bRu8hM+WlN0AePTzfxwrsml11T6hR/qGJr9sOz2QeyS1l8/bdIMO/QJSC7Ctj4S6wJ9c oK6RETq0N20KyOUFOmXOesDxge6Xv0EG8h7xTWk15jVq7BgazNOdOsasHRN/rmmE9gd8 zkGfGDl4e3l97TjpIDGdvyFUq6j3XTke6nV23fYSi5rnSl9MeoLlDhAIw/5yFA4ldTxb JL2g== 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=PkkwaC5weGbOgI6TyHV8oGFM7+1AeUMfWTRfSlmxtvc=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=A7ICb1BxwRmYQeFeAe3t+3ISuAf1CIssYxAYnwlhqkpstL2Meir9fFiErUaOb1gf6j uNM7HsBjhw+EuVAOPwVEPQqgNHl+LQn4/rf5itX81aBmqTFG8AiJ3arkQNZ7q27xwZbi +eUBVzxVmntd5XrqgVt3RKB5uv3rGYFhDU+4kpQ/FTu7UrfkwXDLxlzkwveTCbG3VZ4W CZpKYRTA/iAlBElohWD3gPuiM1Rmt37phQ7QxPtdKLrdYlqQ7zp8aTxTn7UnkPfimrCb tbO38CHsM5LlBIwGjtP+cHovEorciImY+XWcikO+ftlE1/EhbJLv6h8WjmhhOXV6bIm5 MYqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8VYKF+a; 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 r14-20020a05622a034e00b0040079ebf6aasi3327784qtw.677.2023.06.27.09.11.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:11:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8VYKF+a; 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 1qEBGJ-0007ru-HT; Tue, 27 Jun 2023 12:09:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBGI-0007lF-Fo for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:50 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGE-0005mI-Fl for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:50 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fb10fd9ad3so21272615e9.0 for ; Tue, 27 Jun 2023 09:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882185; x=1690474185; 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=PkkwaC5weGbOgI6TyHV8oGFM7+1AeUMfWTRfSlmxtvc=; b=H8VYKF+aj3uQUkJUOHgyaaIOvghuKGCU4pVr0fiDwnot6W6rrkVFhwbFUIJj78JvrH LVMC6MkTl3yEH7n4/q+cYWQSkoDaWXN9o6tyDw+25jEQ45ZOTgH0PfaH5rzA5AGpig8R aJXVGoVXnXaPiLRfnGqVQqm5LZQuFTrz8t01CRH/zzIb/E3ArD+kXLGD+G1dNPWLUixX pJsGuOyoXjVxOO0yGraN+33K9rzCqCI6A+Jjc4EMhyUi7MTvv7H0vTkUPexHcG2Za8Y/ +uwPsyTwshoMB+BWPcagsXqPgYW0kdzrYfiP+Bml7WmDT9hQZHmVcvWpOWr/Q7aYTure lNwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882185; x=1690474185; 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=PkkwaC5weGbOgI6TyHV8oGFM7+1AeUMfWTRfSlmxtvc=; b=S5aaP+2K1eMFnyWGEIDsn3LBt7pawB3ytVbpeMAaclEZp1Nu8YD90IHS8oO7WfiqhZ PNCtX2zO9WBfOJCUaYD7JeeEY6eAaqtIIlUg2GuvSGtWvfsPepw7yztfSmdzJp1i+zKY HLTdxqAwS6UZfT1BhJjXl+XM4P51RODydFCnrt14k50MeQ8erjO7OzISfw0Z8g2aQBPO xi+dMwjLRqFKXKOVXBVVBWcF5jbmHft/IYCRr+Ptqglly+EIjbjIfHHSkVY3+RqG55go vyccwbbTbkSZrD23GSFAriYdMBba/sndCBdapSO5t7IOydph51Itliiu33ydGyhy28B/ vp3w== X-Gm-Message-State: AC+VfDzGFDDvOrMf3hMBbjN6Ln9O4vs/pa2MOE7GN40PQds0gllE9w/j RHHFvbVednV+mmfSixl00xNqBQ== X-Received: by 2002:a7b:c451:0:b0:3fa:9850:8b1d with SMTP id l17-20020a7bc451000000b003fa98508b1dmr4194529wmi.30.1687882185165; Tue, 27 Jun 2023 09:09:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f9b24cf881sm14133645wma.16.2023.06.27.09.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 286341FFBE; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 02/36] gitlab: ensure coverage job also publishes meson log Date: Tue, 27 Jun 2023 17:09:09 +0100 Message-Id: <20230627160943.2956928-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 coverage job wants to publish a coverage report on success, but the tests might fail and in that case we need the meson logs for debugging. Signed-off-by: Daniel P. Berrangé Reviewed-by: Richard Henderson Message-Id: <20230623122100.1640995-3-alex.bennee@linaro.org> Message-Id: <20230503145535.91325-3-berrange@redhat.com> Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 24bba061cd..a8fd9a0c1f 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -462,9 +462,12 @@ gcov: coverage: /^\s*lines:\s*\d+.\d+\%/ artifacts: name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA} - when: on_success + when: always expire_in: 2 days + paths: + - build/meson-logs/testlog.txt reports: + junit: build/meson-logs/testlog.junit.xml coverage_report: coverage_format: cobertura path: build/coverage.xml From patchwork Tue Jun 27 16:09:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696860 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3864573wrm; Tue, 27 Jun 2023 09:11:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oDmM5SC3jQWwxEEzze/W+z+nUnY55nBOJ1/7Z86/LGOuRg/vN9Xf6S9Tgy5gXtK76qLVi X-Received: by 2002:a05:6214:493:b0:62f:ffcc:337a with SMTP id pt19-20020a056214049300b0062fffcc337amr46143741qvb.25.1687882282472; Tue, 27 Jun 2023 09:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882282; cv=none; d=google.com; s=arc-20160816; b=gCu+pP9qo/AJh35jMeKGqBB+R1Yu0xhXaAsp1n+NGgNor3zbp5xDVVAjh/bXjmiisG ciWTorh9hZKR7Ql+G9jsdTAvyGRuiC34lFI02Bv6UVe8cLf4rO1W8mTPcg0pR9JMQCxH wkWBvlL5Pk7nnDDuC9TJsdAzwWyMW1O+iDgjbKjA3F10Y55JTzHRlHEPP7huCD4qNt5C cNoKf1IFsp+kVcBG+a5l4EyrOaVHMW3kV/pSq99RqXROt4DHy/g7RqHdthUGjEbC3d8S 0g30uyzNnEgvEg84Ws8fdOUPhBwZP8YIRl9hAoLSHXrdBUVM1NbxWXB09udyZa7hP5UJ 7Giw== 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=VTHkiiEsGJjQzyOMxbcLNdH7rkjQKhZ4rW+u2UfYIYE=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=uCLNAuzLIA0XTZZihfIZVWFAGxOv54i4YxRUQ547MkWs8aDICUi/dAtc66uJzfvBGu 7U0Mx4mG9SCz3/Jrz7tY+oBQe/zp3nbSpoiWV2GveIKexxCpPSMEgMD2AK7Fcqtvdmmm mw106phYv8LE2UpSGgWwoQF0GgKxyCOjvSRq9jYLTtSK+S4BxvVmjdE0yuj2BqBkZgsa Fvrvcf1cqoeUAB1m5oXcwk8JJSCE18M3AcGT7B0OhdIMCX3MSbAabbO3x1gAboV9+A20 Cgg1bwGLPBJWs15WlXrEU0AAE5krFP0EuOn9uh9BnklcOybR9lO80KsPLq3zHyv8i/xf W++w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s3oijeXy; 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 fn6-20020ad45d66000000b0062f1f2b0c19si3472305qvb.53.2023.06.27.09.11.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s3oijeXy; 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 1qEBGN-0008DV-1H; Tue, 27 Jun 2023 12:09: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 1qEBGJ-0007uR-Ua for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:52 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGE-0005mR-Pb for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:51 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fba9daf043so5515065e9.1 for ; Tue, 27 Jun 2023 09:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882185; x=1690474185; 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=VTHkiiEsGJjQzyOMxbcLNdH7rkjQKhZ4rW+u2UfYIYE=; b=s3oijeXyWscwSskEJei5yO8vQHamNrFbnc4RWKUxI5xTpvIGwgKQqudPcSJra4dNdC Q0UaiMi9R+lBpQM9qstTpNvwc3HgNmmveDqgVlh1yFhuNO8Jr+2nL3wu7RrLiS/aaIay jE2IMz/H1AJ/BMyGbfw+Xc+m2gRq40nlZsmKBUrpGembZd2Gqku4zerEHI+dyZRML8or R1UyVBx8zfxuscVeyztoFy4waX5DuXjj09qHpANQH+NiLVmJvni9xNlLzY61eiBf5cD2 t2f4wMNuDmy2U6VJCjboyNTB9W4wxuZDkUUVwCnh/D92uLBX45T4vLZ8yXlpzYUixPhQ attQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882185; x=1690474185; 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=VTHkiiEsGJjQzyOMxbcLNdH7rkjQKhZ4rW+u2UfYIYE=; b=SuzHxsPn6wyNAK6cmHIprZr9gybO7nYA4KK/IC21C6vATX6HcLD6QmmvO1/LffxvDA 9qtgJV2e1vcMd9GRUgfLJaeSQ1h4dmuwPuKmzp1q7+iV/pxn4+G4ge6DYeOGiENtBQYE 5R9C4sXK/SbCrpTQglXZCPuDQZEUlvjc4CC517jjE/msGMGlwgtbTRNq96XDX+kGuUcb dNncIJnq1Vg1QY0VsZDoLegXj4wVXzrri94zmKgYRK2Vq8cCjjublROT7Sz/nVfymB4K saIKfZR+s3LvhfKooPK94Zf2hIRibl0GVgfKzF43W+nEmGHSzgPxqqU1YEwETzhfaWJp n3Tw== X-Gm-Message-State: AC+VfDwGJXpLDRSPfjuP2D0TnA3KrkyvJbqMSE16a7yNgxvNUFUdZsub 66SJXZ8ipyj8BzMDtbP0pUaXIA== X-Received: by 2002:a7b:c8c9:0:b0:3f9:b955:5584 with SMTP id f9-20020a7bc8c9000000b003f9b9555584mr16630166wml.34.1687882185356; Tue, 27 Jun 2023 09:09:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v14-20020a1cf70e000000b003f9b2c602c0sm14205358wmh.37.2023.06.27.09.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 403BD1FFBF; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 03/36] gitlab: reduce testing scope of check-gcov Date: Tue, 27 Jun 2023 17:09:10 +0100 Message-Id: <20230627160943.2956928-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 keeps timing out on gitlab due to some qtests taking a long time. As this is just ensuring the gcov machinery is working and not attempting to be comprehensive lets skip qtest in this run. Message-Id: <20230623122100.1640995-4-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- .gitlab-ci.d/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index a8fd9a0c1f..77dc83a6be 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -454,7 +454,7 @@ gcov: IMAGE: ubuntu2204 CONFIGURE_ARGS: --enable-gcov TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu - MAKE_CHECK_ARGS: check + MAKE_CHECK_ARGS: check-unit check-softfloat after_script: - cd build - gcovr --xml-pretty --exclude-unreachable-branches --print-summary From patchwork Tue Jun 27 16:09:11 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: 696874 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866288wrm; Tue, 27 Jun 2023 09:14:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/d9vj4oLMG49pJHPjD4yrlqC+RF4JKpulurzt3PmXZ3HE2Inv0giGcOnBIkfOKr1iUtNs X-Received: by 2002:a05:6214:2508:b0:635:db0c:df5f with SMTP id gf8-20020a056214250800b00635db0cdf5fmr8078980qvb.1.1687882464812; Tue, 27 Jun 2023 09:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882464; cv=none; d=google.com; s=arc-20160816; b=BjMdZGUt5grXf4DqdVFRpwlTHDYTSE3DF/YZPdz5SxuLb+ujtONWYIMZRwN2iuO0jW gTRZuzEdZt09sMQBKYzRTe7hf6oSZv1lBUZWR4/5XT8p62AqkAKTKWVAvX9j2GHtlREP NHZhph0Dzg9SGfRWN9CBsfr3l4BF7kG0qOtEit494HNJUYOFqSjUNJfWsP+f1tGlAwfD He4cI5ACo9jpFnkFqI0yr3hQgNoiyx4kMQs409fCO0iOjO/GN2+x9GulF2POQ+osmNG5 bBwtrhx0VRk+ak9a/e7MRICPfyX5prXZWwvVs6oFx4eo1HKil2AssA1Cl7wFBO5y6Uae aTow== 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=hn+zKX2ZU5kJ7IFfmWrHts4Msqz+nCT2HShGHhdqu5E=; fh=UWYnW1U3ElmagJZfLzBYN43uMWpFZC1VK6uWwJPE4v0=; b=LAMW3AqQxM7vmFyKUKQVZisH5TQvfI3wlvm2kMXUYS2KYf8ZgeiBVJNnUg9AEpDQpx YfK/quhpoJqYcys52Vb7yA9BCooHrn68o+lGPqrRsjOtaJjagERlD1WZgfU0Ha+3HPxX ysugCTWNzvJsxQYWd3jo1M/g3hfK1GXZoYX89NAkiYwa3KM3ZrkWbIDp9jmptlvU9NvH vOl8ZSsxbPf65ePzxnks0j80lQiKb3QriwffUq8nxrSCkXO9229kMLYr0MueeEGKX6iu /Xm7nc9BP6fUitpB/kWLAgDOojAZwY7YnpaUkdGq8X+olmkgt0yUldyCKwYnIRjgj4A8 zJxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VdGrfPA6; 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 2-20020a0562140d6200b006237b7ba84csi3471531qvs.108.2023.06.27.09.14.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VdGrfPA6; 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 1qEBGP-0008MK-2L; Tue, 27 Jun 2023 12:09: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 1qEBGK-0007yR-Ej for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:52 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGF-0005mu-Lc for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:51 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fa96fd79f0so32613885e9.3 for ; Tue, 27 Jun 2023 09:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882186; x=1690474186; 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=hn+zKX2ZU5kJ7IFfmWrHts4Msqz+nCT2HShGHhdqu5E=; b=VdGrfPA6puzynaTrxTFdyHjJSEEkIgsO6RsORbiy5JhNRfN9QsMoj6jtRHHMbUUvMV BiHAj0em54V6lf/Rl5gOk5quzoLvPFci4XTZ7SklZP8sf4x+UKZvuYDOsQvS+Js1et4V RezQ9Gg5vxJmmzCw5SgOeRmr2HKLVrR0NhJdTd2AJkFB+3hCKirvOafPER5wM+COCb50 2S/7gH0suykPW60tSscOzGTyAFOZmnu7nrgqpLIcRb0D/qYot2qgrQctFfldeJkFW3+x MdcprhveDXLEjfHSrFz8y3pzpZtLwJD+D8HQgORuMHWol+XTPw3Vry+QU/TpC2ut7bU/ RKAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882186; x=1690474186; 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=hn+zKX2ZU5kJ7IFfmWrHts4Msqz+nCT2HShGHhdqu5E=; b=YSdwCRCSpp0XwkB/Hp0pWSgK+dOfKTQW8bCaBLSir8xokrZp3SHBO0MQ1jVykAuX5a /V4ASiZsQzwMyM1/LIgOlMXav4LMjS8KvM9URRl136+IQp5NVpn7KpioklfNAJNPzK2t KLwAm3rYUbv+gGxFi76MWpPL9CKTur+sQshf71z4JySlW5zp5AgzlfVqurF7BqS9H6/7 j2wYNfyg/Pzcxk0b87DY+826AmnXXqbeaAtd/24ix1G6BMh+5HCvyVfkJEQAK3SMecu+ 60qI6uyUw3QzF0iVH5apEcnAuN6NvSTEuCEkBQ7z7PF+IR77KwVNchDD/9zd7o5zCg7Q 4FOQ== X-Gm-Message-State: AC+VfDzPOmKJ1x/aU9brUfOoL9Mi5SrEn4apvKUgTMkkNFuTOZH0hqU9 7TQhHTSdfAXbq13Jd4JaPqpRRGEok4EBEk4HNdg= X-Received: by 2002:a05:600c:2284:b0:3fa:8219:9163 with SMTP id 4-20020a05600c228400b003fa82199163mr13570168wmf.21.1687882186358; Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n9-20020a1c7209000000b003fbacc853ccsm80148wmc.18.2023.06.27.09.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5964E1FFC0; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha Subject: [PATCH v3 04/36] docs/devel: remind developers to run CI container pipeline when updating images Date: Tue, 27 Jun 2023 17:09:11 +0100 Message-Id: <20230627160943.2956928-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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: Ani Sinha When new dependencies and packages are added to containers, its important to run CI container generation pipelines on gitlab to make sure that there are no obvious conflicts between packages that are being added and those that are already present. Running CI container pipelines will make sure that there are no such breakages before we commit the change updating the containers. Add a line in the documentation reminding developers to run the pipeline before submitting the change. It will also ease the life of the maintainers. Signed-off-by: Ani Sinha Reviewed-by: Daniel P. Berrangé Message-Id: <20230506072012.10350-1-anisinha@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 203facb417..8f18052ba7 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -485,6 +485,12 @@ first to contribute the mapping to the ``libvirt-ci`` project: `CI `__ documentation page on how to trigger gitlab CI pipelines on your change. + * Please also trigger gitlab container generation pipelines on your change + for as many OS distros as practical to make sure that there are no + obvious breakages when adding the new pre-requisite. Please see + `CI `__ documentation + page on how to trigger gitlab CI pipelines on your change. + For enterprise distros that default to old, end-of-life versions of the Python runtime, QEMU uses a separate set of mappings that work with more recent versions. These can be found in ``tests/lcitool/mappings.yml``. From patchwork Tue Jun 27 16:09:12 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: 696873 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866248wrm; Tue, 27 Jun 2023 09:14:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5NSh3rJkBAtlTKjA3Gq8RsEtuTH+j2oTa1v8xwIsb3Qo/1azEgwwUl7jYWwCJ5L2Cyu84J X-Received: by 2002:a05:6214:21eb:b0:635:f640:676a with SMTP id p11-20020a05621421eb00b00635f640676amr699931qvj.47.1687882461696; Tue, 27 Jun 2023 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882461; cv=none; d=google.com; s=arc-20160816; b=Vskbvb05blAdmhPhK1D26harR7T5ZPOFqS/yvFNgSiogi9tG9a2fJdRIYLPorovLS5 CPy7ocVdbTYw2qn7BfVZbttotqdNzteD3kuzgzVnp4N646eBLsGkzv+ELwhshwvPLCdQ IqQ7CkaWnqxVQIHo9QCcSS4h0zXHf4/0nrY1lJOsA4kx35u8I8HEIrhdrfyW1Hyv1lkU mIAQ+sCWCenRAIYp00tt/CJmikzNig6hQj94NrAoXaEY4tW/x8lyuVbIjUPj380Y5jV6 Q5IY/0+k7x+e87h+Og7B3Hqhr3to2UCUvGUp+LlZH761om4DMuEZRU4HiB8Ur63ziBhh kpww== 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=I9YIwoz2syzBIvgIfb1KrTiedkOwekCcwMFZMGMcvn4=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=LYL39NFFZBPAK5Z+c2Up1gPSgqD/8YHVSjuh6tiYo34bwdlgp/HOmQDpca0Y1jig/7 ozleY6PXV1IOAXsnIfpqHKdgobAad28k1BZNkBAEh5Qxkbg/IsJnS+vH8d4nE0ltfDYw nY8ytPRCAZtnJuUlt2ZgesxoqxWB3g+n4JIKvtIfiRvkitZ/45ixnwTSFKKQm0V5qY92 gCHb9doW25T49Iv/XomxnRlVgfpZuxzl2M4i9u/uY5cyboT9AHVQU0CLjA4vyJIrhCeJ 0k4W5HYfCYLApQJXJuGgJka59dQ2ykAjOlK7omElBW7jZR5EJt9WG+o6DN/x7BhR0ZJO myZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6DxqWEp; 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 i11-20020a05620a404b00b0076717c67077si388970qko.466.2023.06.27.09.14.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6DxqWEp; 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 1qEBGM-0008CE-QN; Tue, 27 Jun 2023 12:09:54 -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 1qEBGK-0007yz-GZ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:52 -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 1qEBGG-0005n5-EZ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:51 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-307d20548adso4301297f8f.0 for ; Tue, 27 Jun 2023 09:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882187; x=1690474187; 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=I9YIwoz2syzBIvgIfb1KrTiedkOwekCcwMFZMGMcvn4=; b=N6DxqWEpDaZFMfJUwBhRUYwjTDHR2Xnnw+CMoIDrWw1VxmyyEqK6K9KspgCmDLKFNF TEZ8ZabNFHuQVNo/4lc+Wzkn2Iee++V89cbrDnh+quQR20BpLwIwMwKyhC8Y4I7E6TqF 2wm/SweLa7gasuTTObx2P1/A4A6tLGbwV4RbJkwwoC/WX71LgmInzk45vEiaF1Oi3NSj 92cnaHUxSMrCfzneYKW8Z+kzIQe2jnywzLNdvie0J/1uupZRO5Sn6ELItZhNq57D1lmK FLvJ0q9/IMS/Okd5TSCYiNngLmJ5Li3j1G74tS2IV4HN1az66EC9/dW0x7OjAEY6Pcn8 v2Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882187; x=1690474187; 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=I9YIwoz2syzBIvgIfb1KrTiedkOwekCcwMFZMGMcvn4=; b=KHmOdsYjq2mpnU2neXifm8XHn6UInUsfzYKH3MwmNkgMFrXVgLOwe6sMG10X3t4wL8 We83yW9HRkdT8YcQzjT8bMbUUbCnCi3Q95aKlm/yhrsjA/Nd8Ti68QobAsoQy9YGa6+T QQYlNK6YKq1Hct5m0TFeNoG16BUxQZpevChKyRrWAx/qPAkkpgMqeyCSP+T1EpAStWQ6 SIX4MuphE5ilM0lqIHWdI4xPKmGeq8Wre7cdj19WbSs3AF31MIB7PiHq2qI0fDcGn+UK 1ZSLRMDxCQd6WHdTS+u4B2QKZx3fNgm/CBmaRxvGXwHROXfH7aaCIyC/nQZYFL2YV5e7 /ApA== X-Gm-Message-State: AC+VfDzWGVGCEs0k68s+s3NxgWR+AHeTFYvQG2ENGXkhKs4Svwn2xDzs Nm7VK5Hry4CSLd+TakGLFkdWJw== X-Received: by 2002:adf:e90d:0:b0:313:f623:4dbe with SMTP id f13-20020adfe90d000000b00313f6234dbemr3823646wrm.58.1687882186688; Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f4-20020a0560001b0400b00307a86a4bcesm10877402wrz.35.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7269F1FFC1; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 05/36] tests/tcg: add mechanism to handle plugin arguments Date: Tue, 27 Jun 2023 17:09:12 +0100 Message-Id: <20230627160943.2956928-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We recently missed a regression that should have been picked up by check-tcg. This was because the libmem plugin is effectively a NOP if the user doesn't specify the type to use. Rather than changing the default behaviour add an additional expansion so we can take this into account in future. Message-Id: <20230623122100.1640995-6-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/Makefile.target | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 72876cc84e..2462c26000 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -169,13 +169,17 @@ extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1)) RUN_TESTS+=$(EXTRA_RUNS) +# Some plugins need additional arguments above the default to fully +# exercise things. We can define them on a per-test basis here. +run-plugin-%-with-libmem.so: PLUGIN_ARGS=$(COMMA)inline=true$(COMMA)callback=true + ifeq ($(filter %-softmmu, $(TARGET)),) run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<) run-plugin-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \ -d plugin -D $*.pout \ $(call strip-plugin,$<)) else @@ -189,7 +193,7 @@ run-plugin-%: $(call run-test, $@, \ $(QEMU) -monitor none -display none \ -chardev file$(COMMA)path=$@.out$(COMMA)id=output \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \ -d plugin -D $*.pout \ $(QEMU_OPTS) $(call strip-plugin,$<)) endif From patchwork Tue Jun 27 16:09:13 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: 696890 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868314wrm; Tue, 27 Jun 2023 09:17:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hghk0xvxs2179hUBiDIA1GxxjyXNbPAqx4DoFnku/O+j2q+9yrkBUoCCOs4VB7ICPIUvv X-Received: by 2002:a05:6808:14cb:b0:39e:cb0c:c639 with SMTP id f11-20020a05680814cb00b0039ecb0cc639mr38507733oiw.4.1687882666420; Tue, 27 Jun 2023 09:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882666; cv=none; d=google.com; s=arc-20160816; b=VTZkRb0LTHneUKdXhrFhrxZG8r7MF/+MLX1t1tOA7o812CiKxj6EQppbTQLvT+MM2Y oKILPmuuAOLCLdSGrq0d7ODxBzjiRGrhfV8dhWrUYSOdEp/uz/SP9dKFBNAwr/3CeIa5 UM23O1KSBZrXeKcwAdApjOYJJgcbeL1MFsTvEXCYPpHUtCTWtm/snyiHkx5kicXGONaV L/TTHcAEXeh2gsPal3gRjwfwW7s/YTd38QtxfRPjbMaN1sV8jzj6u7HIPhBxANbCuPtM aApWZxml0kC1/7fPNVoB1pdrTV3CJBEXb0RY+8QsL6btUOYXqLHrsd0cq06Pk2yhQJ1I T3dQ== 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=JwYXISrmUwYEeEBYbvf+rC+BgUtqy99AwD9pTl/rVpc=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=qHhJ8KJT8TfOERYqmatbTWufasbPNxTrzR0Jd2XH0h8lb26V0g4JcC9jl85JEZkMjE aTORaDvTjeUcn7H6PjY8P31KmPsxMHJ8CdAo09Q98qnft0qv6t8lqlC7Fiw5h2fFyh5V pJPOKaSeAjsL21rtDOrxT/gLbEYBwUDV5eCWVhQUFcpXY8BorgrGKMnYUwcARopkP9BW IcA+Z5fuogmgd//WO7pf70qRJ0e5Td9Qx1kAb84z0pb7t4CIxlJzluC/GDVwVrHTxySp hX8A4zLtZ84m7ck/n55HAb9aUNHpwuoe6hcmsh3Ryrp2X7mdlttHBoVbwllfYPe1Xl1G R22w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xlQSGBHA; 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 z9-20020a05622a028900b003f9ccf932f0si3304807qtw.605.2023.06.27.09.17.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xlQSGBHA; 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 1qEBMP-0001CV-MA; Tue, 27 Jun 2023 12:16:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMK-00016f-8o for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:04 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMB-0008A1-QQ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:03 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fba66f3e1dso8276105e9.3 for ; Tue, 27 Jun 2023 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882554; x=1690474554; 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=JwYXISrmUwYEeEBYbvf+rC+BgUtqy99AwD9pTl/rVpc=; b=xlQSGBHAk2dlQ/9WRsnCMFXkgv65KdRtfZR8wjkzDURh0rA+Xn0rOje23/4U6kR/+L /8Gd657+oq0w80zVTq3nu6bWy6yIRE2/7yngjIiNfQOUiVixGQTiDC8/AYkug6nTMXVW Rstq4ZxyztYo+QnejsGgUFBN/iDbNski2GM9N+UoooKZi3lyAaRozGGRKT+FeLLMdTrq ExS7hzKhbbABjo//yXgml79yariHWw2P1f1x+Qbhp/iESC4m6isPc7Xdv7Qkk/GY8gw7 F2UI0foP2pD8zWkmq4EkM/DEezcqsX+IJOkegLgZ9iBaShHhE/Lg2n/UdSz3mzrqSYni /98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882554; x=1690474554; 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=JwYXISrmUwYEeEBYbvf+rC+BgUtqy99AwD9pTl/rVpc=; b=H6EO0ie2C+7BQrcV9Z4IDWI0U5TF0ePogtBF+NxwtFyCg9XQeD8MdRgocv4w+YzQ/Q jV+c0a1AS1TocBwVs+C9JK4yXeG4YwPyncX55ejgzjR7PPmL3paP1xbttpnGXGFgrK5K qWqnwMUUd+w+A3dnJmjTk97Wdc3QTnEztNt4Z+nIWf1ipzZrHbOUXeQx2KddBOoyWFt3 a8IcSVh7mqJ7TkCEtTq2CajDQHdTzI240Nl3DhHzddWuJQwvdwpgjX2raP3zvHXymZYy 6m3UrCH/eBeOhAYpd0R00hWncdoo4hrpfxV/fvdHJZY51CDAQWNaILIitwX3BhVNM8Fj 7o1g== X-Gm-Message-State: AC+VfDyTNFVHhZdoIOjXUjZlw0fCHuNlMWNoNHs0FBpkcyjUdMDkNxUv 8W6dTdPu4VCamymYgN7uwOeAgg== X-Received: by 2002:a05:600c:2903:b0:3fa:7fb1:11df with SMTP id i3-20020a05600c290300b003fa7fb111dfmr7395796wmd.19.1687882554404; Tue, 27 Jun 2023 09:15:54 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m13-20020a7bcb8d000000b003fba97b1252sm1302569wmi.1.2023.06.27.09.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8A6EC1FFC2; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 06/36] qemu-keymap: properly check return from xkb_keymap_mod_get_index Date: Tue, 27 Jun 2023 17:09:13 +0100 Message-Id: <20230627160943.2956928-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 return XKB_MOD_INVALID for AltGr which rightly gets flagged by sanitisers as an overly wide shift attempt. Properly check the return type and leave the bitmap as zero in that case. Tested output before and after is unchanged with the gb and ara keymaps. Signed-off-by: Alex Bennée Reviewed-by: Juan Quintela --- qemu-keymap.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/qemu-keymap.c b/qemu-keymap.c index 229866e004..8c80f7a4ed 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -140,6 +140,18 @@ static void usage(FILE *out) names.options ?: "-"); } +static xkb_mod_mask_t get_mod(struct xkb_keymap *map, const char *name) +{ + xkb_mod_index_t mod; + xkb_mod_mask_t mask = 0; + + mod = xkb_keymap_mod_get_index(map, name); + if (mod != XKB_MOD_INVALID) { + mask = (1 << mod); + } + return mask; +} + int main(int argc, char *argv[]) { struct xkb_context *ctx; @@ -215,14 +227,10 @@ int main(int argc, char *argv[]) mod, xkb_keymap_mod_get_name(map, mod)); } - mod = xkb_keymap_mod_get_index(map, "Shift"); - shift = (1 << mod); - mod = xkb_keymap_mod_get_index(map, "Control"); - ctrl = (1 << mod); - mod = xkb_keymap_mod_get_index(map, "AltGr"); - altgr = (1 << mod); - mod = xkb_keymap_mod_get_index(map, "NumLock"); - numlock = (1 << mod); + shift = get_mod(map, "Shift"); + ctrl = get_mod(map, "Control"); + altgr = get_mod(map, "AltGr"); + numlock = get_mod(map, "NumLock"); state = xkb_state_new(map); xkb_keymap_key_for_each(map, walk_map, state); From patchwork Tue Jun 27 16:09:14 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: 696870 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865965wrm; Tue, 27 Jun 2023 09:13:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EsUFXzHGIuXGxQTFQH7KhnzY5M+/CxS38k5SOeoi3fO3UhwPMMQnEVrBr5I007Deeu7bS X-Received: by 2002:ad4:4ea6:0:b0:62f:fd5d:4ff with SMTP id ed6-20020ad44ea6000000b0062ffd5d04ffmr32808642qvb.21.1687882435019; Tue, 27 Jun 2023 09:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882435; cv=none; d=google.com; s=arc-20160816; b=KD9xHfBXfjdGtv8ZeD2Z7C3i0jFOefFV7stkzVohrvFQAIw3Isv4NwRhL7v+VMM3t2 jIC1AVV9spNY8gd+w4hliFDGIx1cQNcn3ImS6tvvL9mrJ+XunmKayGRL4cnN001LgkNp qxivTwfCH4hh0Zem3MSjwGXhbsJdzS1gvXHOBgeeAQLM5mevxrW4k1/pEto2I31kiI1e XNJeO4Ai8NMSJe9rqBNLo1mPUTB86ABcsFcK7gLHpF3nJ7vcqIB9Rjy8Gazsv0llVF6Z YI15wtPATGmEHUxKOlx1+t1v9No9dJ9e56rtRVUtkgLjZjKa1RURzPaotsYTi1qZwtyz b69A== 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=GnP8f96S0GKF3CO1A0jcmqKih6bOlzq38Er4YTCNWjo=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=wBHYYBt5DQJSNFtG03QYaq7xp6vDtjWvoFIFh4i6r541Tb7h3qWgfbtS1Ox1X8/BWx QpReZYU9NK6q8yzsWTCglOJIN5TuY6CWG3EfrObTjnM6DHooL/U+ZVmDyRyNol2DrcvO I1IP/xGB1hnUj/w2VNosVGBEYKvdiTFAbaX3q/qZjOEfXZkGlTiCHQsSUy1OInRljZlo +Eq/FdFZhJmoq91hXaFk3HdlZfBDwucVoj92YhZOiHn3n7QAtsIKHEZ5DZypkfZTL+nf aBLgHHjz453kT5HhbvdaPWXxwrwdof/Iv8BFIFqIalkKXp1sqkT81CNxb4O8Ztg3aaAf sOYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P6UlGJmT; 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 gf15-20020a056214250f00b0062388040b4csi3487932qvb.203.2023.06.27.09.13.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:13:55 -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=P6UlGJmT; 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 1qEBGZ-0000jO-4m; Tue, 27 Jun 2023 12:10:07 -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 1qEBGQ-00007E-Rg for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09: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 1qEBGK-0005pr-Mw for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:58 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-313f61890fbso1935886f8f.3 for ; Tue, 27 Jun 2023 09:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882191; x=1690474191; 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=GnP8f96S0GKF3CO1A0jcmqKih6bOlzq38Er4YTCNWjo=; b=P6UlGJmT+TbDaUgumTWmmGYJX8XbOZZvbmobWDrKapo7Q1Gd0aq9Kdu0njqoXDtCMI DkMHBiNb8M6Snqr+7mq3CW+qNFhFe0Cha1uvId9WRQtbYZEJdlFcDW8u0HDLjF+dSh09 ecHuiQITg7Oql0YyASU5zh4ZnF3Oe+xNk7dYeoMfzcspup1dKJGLtedSeYd7u38HN9/d 4APQ+cO0GNiHpgKvm+gHvcpvA0y2NArEbIYZMe1aF08GGjr7xmPTbpB/8RvJ0/DM661s oNxhdOm5sDRVFWxlJpHJ5wBRhuEKN/27oLmIIFgWPJVmh8bgglXyCQnBEgyFIbO1gMqZ sPxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882191; x=1690474191; 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=GnP8f96S0GKF3CO1A0jcmqKih6bOlzq38Er4YTCNWjo=; b=M1CSzTaxxpmIWevgqYekNzPVy8hd8gk92UQkaGSAH9WPw2nO/Tdjbfw4pWwlabYKPL duVoMiH505Wvsb2eaR8rCJVu8bbZ6fSJ79N7K7sW7PXNvBAdTCGncql4IK8j8+kfgx1W +VTqSPL7U0ZBM/4XrSv+Kxqka/6ar3nYBSFAMUQXLxUOAFkzlctbpUKD/n2S/ACwpUmS fY0kuAWNakHUQpJmE6Fw0NDWedKx/hy6An2OGZQc7jSx+IlPt8vd0GEbXllsf/GiuVf8 L0Y+2WZYG9SnLE5/FyP0J+n0nKj8R13oAJwkb+DOD4oifjxfiSwByyg8cA0Scw/yBHBq HHIw== X-Gm-Message-State: AC+VfDyModi9n/3q3U/GA5GNhAtyeyHyyjAEtMnHT/dYpFtlBWdzBxaL 0hwCnodd6Mfon1FvO61pBNFKdw== X-Received: by 2002:a5d:4fd2:0:b0:313:f0e3:2fdc with SMTP id h18-20020a5d4fd2000000b00313f0e32fdcmr5074710wrw.2.1687882189255; Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d13-20020a5d4f8d000000b003063db8f45bsm10820461wru.23.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A2E891FFC3; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 07/36] scripts/oss-fuzz: add a suppression for keymap Date: Tue, 27 Jun 2023 17:09:14 +0100 Message-Id: <20230627160943.2956928-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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 When updating to the latest fedora the santizer found more leaks inside xkbmap: FAILED: pc-bios/keymaps/ar /builds/stsquad/qemu/build-oss-fuzz/qemu-keymap -f pc-bios/keymaps/ar -l ara ================================================================= ==3604==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1424 byte(s) in 1 object(s) allocated from: #0 0x56316418ebec in __interceptor_calloc (/builds/stsquad/qemu/build-oss-fuzz/qemu-keymap+0x127bec) (BuildId: a2ad9da3190962acaa010fa8f44a9269f9081e1c) #1 0x7f60d4dc067e (/lib64/libxkbcommon.so.0+0x1c67e) (BuildId: b243a34e4e58e6a30b93771c256268b114d34b80) #2 0x7f60d4dc2137 in xkb_keymap_new_from_names (/lib64/libxkbcommon.so.0+0x1e137) (BuildId: b243a34e4e58e6a30b93771c256268b114d34b80) #3 0x5631641ca50f in main /builds/stsquad/qemu/build-oss-fuzz/../qemu-keymap.c:215:11 and many more. As we can't do anything about the library add a suppression to keep the CI going with what its meant to be doing. Message-Id: <20230623122100.1640995-9-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- scripts/oss-fuzz/lsan_suppressions.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/oss-fuzz/lsan_suppressions.txt b/scripts/oss-fuzz/lsan_suppressions.txt index 02ec0a6ed5..7d90c280d0 100644 --- a/scripts/oss-fuzz/lsan_suppressions.txt +++ b/scripts/oss-fuzz/lsan_suppressions.txt @@ -1,2 +1,5 @@ # The tcmalloc on Fedora37 confuses things leak:/lib64/libtcmalloc_minimal.so.4 + +# libxkbcommon also leaks in qemu-keymap +leak:/lib64/libxkbcommon.so.0 From patchwork Tue Jun 27 16:09:15 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: 696878 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866434wrm; Tue, 27 Jun 2023 09:14:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RZX5u2DMRv7eNh/kB1pySQoorH6f+GzKl89uRXyZylZerbFAVTyxMDh7S8qRkiCMYr0n6 X-Received: by 2002:a1f:bd16:0:b0:471:5427:39a4 with SMTP id n22-20020a1fbd16000000b00471542739a4mr16698382vkf.0.1687882480518; Tue, 27 Jun 2023 09:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882480; cv=none; d=google.com; s=arc-20160816; b=XgNzXEoL8daY7B/p4rwMjF3eTU6YK6y/docfkHrOTaUD16oJtJGN5WZ56n2TW/hPBK tBQWS7Ta0ThFNh/hc7cqputRzMYbf5qk5KmPI+BlHdV06LYj/8VVcoMtNQkQ1qN6lwGN eG6sfEoa3xv/lcVw5TdFaFVmTflnSCMn/GSLP9e1nqU34nyBq7DZZeAkJ8WS2cSr1kIn 8ARomOQRoN/O5hda/lkRHtpJnBx244A/5J9lSQcqUIhJrb4PVseuRBufU7myAzHfBqvC SAPTLUALoB+FQ1nsIaC1LHl3q7cy83dU4m+AobC2srE6oy9yhaFoPJsmmRy6gH/ChXZA 1MtA== 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=o65EU6QKm/ZKlwjUjomTQSbG60nANx/Rf8AOn4I397k=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=QXOePRiRNsZmBPnpvY8uO2BdjmpAPdbfyr4KNj1bntS13+hryL7a81ZfHBXbIYjFD/ 8QNDPspjc8GNkUCVbh1OaL/8QUwxArRwvG0Im4qXPuvzHXVea14r0vWp9j2LJNpoeh+J TnZ+QmZUZMdWSKYDzIAaj06iutazaxhNvFI9bUWUAr3irv4M18gb2Z/HcuH9DBg732OO XZpB2Nih+PTp0eE/PyjhpVDcdM6PEODwLhAtXrTiqPaimSkxQAoQb7y8Tq6A9F1ANJ9i jbvZAGU/fwk5IVg/8ou94/qT7vuUJTPqi8tHCL9QzkMrw1zYB+TTHnNt1pDxt8H9WcKI iUMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z6l8XgUa; 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 kd19-20020a056214401300b00635eff82ba4si906667qvb.483.2023.06.27.09.14.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:40 -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=z6l8XgUa; 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 1qEBGR-0000A9-HM; Tue, 27 Jun 2023 12:09: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 1qEBGP-0008MY-2H for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:57 -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 1qEBGJ-0005ov-Bq for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:56 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-311394406d0so4324784f8f.2 for ; Tue, 27 Jun 2023 09:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882189; x=1690474189; 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=o65EU6QKm/ZKlwjUjomTQSbG60nANx/Rf8AOn4I397k=; b=z6l8XgUa87qoqU3s8E0ZUwL2ww2TcPPQXh2Ve2wgoSSUUofGErpeL/3MO8E44tEEFP igSX1Fmq6gmcd/Dh3gbtvokTWKCL7XWawwl30EcKb+Zi3ljgkezdQhpHRG1faB+b256W 74EqYB0rgHeI6miUFkPjIDBfE9dOocO1Tee+wz7B8rg8hv58beaX+hhmdfhiamjfohKw r39ammUp4GPH1qvmD5cA8uiukRznChW3J7x0inV2MBnTl7Yem4vPzoIzsIDWzEFJl/7J auWxj6ThhFbQ0aEFdei6NR00B1IpA4Wc5aYh0O5mZEjVeoD94MZiGHbluHwQoNrm10CF bxiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882189; x=1690474189; 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=o65EU6QKm/ZKlwjUjomTQSbG60nANx/Rf8AOn4I397k=; b=AS2M+4qqo+WjFqcGvZOzH/YcR4fM+oVvRXxqAVPb5LKFwFjkT6XxI7TTSKUghadwvV usPbpaMP75Hh7EJPvBmsNcrMggOLdyAvyp3gsSa86S1OBglgjvFj5Nizn4SuuH2szugj 7qo/s9IMU1u6g08pN/O/dqVkV0VJbhsGG5jKWOqGucCBcCdFHwTV4SNg22lr9CUXSljT FJkjuDZ7xv/st6EoQVdaWMSfvnnv29hAFyhkGxFo7t8+ZS87w0NHUSsfQ106jyh4/+cB UsSmAWJrUXUHIiR62Ib0Qs9DZt9q60cI48kNjbOpmJjQNPzbjZfBIkF9sJSk8QXEGlHO l+WA== X-Gm-Message-State: AC+VfDx5bvX7BHguIGURC01Fysy+2nnbxWayz6eQuHj0NXtv518zqB0/ N3Wad0GCLGbsz8+FZs90ybpfdQ== X-Received: by 2002:a5d:4eca:0:b0:313:f548:25b9 with SMTP id s10-20020a5d4eca000000b00313f54825b9mr4251639wrv.40.1687882189591; Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a7-20020adfe5c7000000b0030c6751a49dsm1371386wrn.115.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BBD271FFC4; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 08/36] tests/qtests: clean-up and fix leak in generic_fuzz Date: Tue, 27 Jun 2023 17:09:15 +0100 Message-Id: <20230627160943.2956928-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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 An update to the clang tooling detects more issues with the code including a memory leak from the g_string_new() allocation. Clean up the code to avoid the allocation and use ARRAY_SIZE while we are at it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- tests/qtest/fuzz/generic_fuzz.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c index c525d22951..d0a59f7475 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -954,17 +954,10 @@ static void register_generic_fuzz_targets(void) .crossover = generic_fuzz_crossover }); - GString *name; - const generic_fuzz_config *config; - - for (int i = 0; - i < sizeof(predefined_configs) / sizeof(generic_fuzz_config); - i++) { + for (int i = 0; i < ARRAY_SIZE(predefined_configs); i++) { config = predefined_configs + i; - name = g_string_new("generic-fuzz"); - g_string_append_printf(name, "-%s", config->name); fuzz_add_target(&(FuzzTarget){ - .name = name->str, + .name = g_strconcat("generic-fuzz-", config->name, NULL), .description = "Predefined generic-fuzz config.", .get_init_cmdline = generic_fuzz_predefined_config_cmdline, .pre_fuzz = generic_pre_fuzz, From patchwork Tue Jun 27 16:09:16 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: 696877 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866415wrm; Tue, 27 Jun 2023 09:14:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7F6Pq/2PcPOlGrJ3QS4SAsCtJ9ZFTRLXgX+jnz5hIqUxaN0FH3jChkMLQELC4QbXTb2ROl X-Received: by 2002:a05:622a:14cf:b0:3fe:36ba:5a5e with SMTP id u15-20020a05622a14cf00b003fe36ba5a5emr31263123qtx.14.1687882478210; Tue, 27 Jun 2023 09:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882478; cv=none; d=google.com; s=arc-20160816; b=HTcEbVv6OF9+hq16yclnnqr2v4LPsj+l3o3YoSP2AlmEri36Cjr3r5Uih9QYwasSUN 22YqZ06BUNu73sWRBEs9MTGOIKdUqm4Y5RZ06ZxJKefc+nDrSv0AM1jSlIeGTr3svqZx AVfXp1LEZlW/IdMU2GqYqGkqCHd+8/xYb9FQCdLhZnkQx18DyAgosukEd7b9WAXJfyjT ADnB7NM33kb2PUX0WDroI69sHEcUilVwkTJCEfW3U5GxygYnkLN2ATZhy/cXnXqmPceT xTvl/OKRtpq+LnCNrFE68yj9648aiGOI5R1H+1EMP8hlStadyEjrAau4Wj4ZWKbY1t+p gP+w== 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=OoH/DOZFZDe6ZD+LHfFvG2TjLm3SJ3G2i0MfunKyFLs=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=ASxOckpIR9AcKjmCwtTe1IJ5ZK68BnvM9n1WRk9jHItsJwBCbmOeVvfSI+CDwduXnB po3sViuZNAF2w6rfmf9+z8+rYD6g3nbUGzkOeQ1wOxiUYvICGTbdd3trD1tIJOLQlHFP 1dXuwPZbNWQHAG5qbfYXDsux9p+1Pr1MnyxhXZMEs3AZtEBqosuT1o0C5AWTyNq/QUCY tx5lPGmibDyNC7hOMUTTbMe1EYEZ6YgUJOm9t+OEgYyAwjEsboum75WPIMjzwEfWWYGl kO8xtawyG/qiINbJJ85tE83WT23V/5LGnMzrUBDgIJwJJSLEHDmBy4ZPbRRn9vOqojVh NLoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GZDB24tU; 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 h2-20020ac85842000000b003fde966959asi3050251qth.254.2023.06.27.09.14.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:38 -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=GZDB24tU; 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 1qEBGR-00007n-3T; Tue, 27 Jun 2023 12:09: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 1qEBGN-0008Hb-Ny for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:55 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGH-0005oC-Qb for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:55 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-313e714342cso3812898f8f.0 for ; Tue, 27 Jun 2023 09:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882188; x=1690474188; 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=OoH/DOZFZDe6ZD+LHfFvG2TjLm3SJ3G2i0MfunKyFLs=; b=GZDB24tUP16+wbjP14G/r3MTxXacPNS1ryHB55f7dww87AElnA5OMgA+A/IHe73dsG crD1e0SXM7zIDZXo6LWHxx6/xj+zTQAdVRP3uZ9E7n/NvIYpdeWY3vkJ0DkuWEUY3Ss/ Ngyjm/grXi0UYBjdf59JpbF8WZN9cRR/9g7ssuoKnI6h3i3GbFIOEXxI9EPw3hF8hw0d zlfS/DyQl+uorChPjjC0hhxfOqn9k0LngzH2T1xcKwMzhmo/P+KEWBRuo6ZoDNerGCgH dvrB+eZTTYq1NNt/RXL/d4AX3zSjfTVswlXRubVZ6X5VcZzsCL+MfZlMAS7jJRwlaMkm B8sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882188; x=1690474188; 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=OoH/DOZFZDe6ZD+LHfFvG2TjLm3SJ3G2i0MfunKyFLs=; b=QbV0ZjLTSGM2YXqDfcNMkwBGJhYBnJE31soAhhbYAYJMGspAPfMctskFiM26I77Old 5FouElMrUtUnfWY/3FCY/vs+AR/GHvHflme0/Zk3IQpYhsI0d72OkxWhyYvgPHkgYRHi 4jx3eruFnYssZoI3IFHdNyM6+CdWdcEZYoSN7VonTOolvaq8ENldt6iBHGjROlNI9YfD Nq9i/3WmC2PDWA2H8dRNWUNG/+xKdUA1+qBhwP2Bkp12CjRSIXvRUJsNef8jrmlg18JH MA0WV+cgU0DYcfxaVfn8pVXx0Axpi+BT98opJ0oH7ShGmNUNqXLvn+meRooIjXdbxL2G QnoA== X-Gm-Message-State: AC+VfDzdZx8tpZdCye4Qylo+q2F7yPrJgZwCmVZ459rsAGotmzgvtV5P ibs8Q6RhrSvSeJpJibiqV8Ujqg== X-Received: by 2002:adf:da45:0:b0:312:8e63:71c with SMTP id r5-20020adfda45000000b003128e63071cmr15491827wrl.32.1687882188292; Tue, 27 Jun 2023 09:09:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l7-20020a5d4bc7000000b003113dc327fbsm10833942wrt.22.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D88D01FFC5; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 09/36] tests/docker: add test-fuzz Date: Tue, 27 Jun 2023 17:09:16 +0100 Message-Id: <20230627160943.2956928-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Running the fuzzer requires some hoop jumping and some problems only show up in containers. This basically replicates the build-oss-fuzz job from our CI so we can run in the same containers we use in CI. Message-Id: <20230626215926.2522656-10-alex.bennee@linaro.org> Reviewed-by: Alexander Bulekov Signed-off-by: Alex Bennée --- v3 - checkpatch cleanups --- MAINTAINERS | 1 + tests/docker/test-fuzz | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 tests/docker/test-fuzz diff --git a/MAINTAINERS b/MAINTAINERS index e07746ac7d..3cfc389db0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3106,6 +3106,7 @@ R: Qiuhao Li S: Maintained F: tests/qtest/fuzz/ F: tests/qtest/fuzz-*test.c +F: tests/docker/test-fuzz F: scripts/oss-fuzz/ F: hw/mem/sparse-mem.c F: docs/devel/fuzzing.rst diff --git a/tests/docker/test-fuzz b/tests/docker/test-fuzz new file mode 100755 index 0000000000..7e506ae1f6 --- /dev/null +++ b/tests/docker/test-fuzz @@ -0,0 +1,28 @@ +#!/bin/bash -e +# +# Compile and check with oss-fuzz. +# +# Copyright (c) 2023 Linaro Ltd. +# +# Authors: +# Alex Bennée +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. common.rc + +requires_binary clang + +# the build script runs out of $src so we need to copy across +cd "$BUILD_DIR" +cp -a $QEMU_SRC . +cd src +mkdir build-oss-fuzz +export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt +env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh +export ASAN_OPTIONS="fast_unwind_on_malloc=0" +for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do + grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ; + echo Testing ${fuzzer} ... ; + "${fuzzer}" -runs=1 -seed=1 || exit 1 ; +done From patchwork Tue Jun 27 16:09: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: 696863 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865033wrm; Tue, 27 Jun 2023 09:12:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7aF3R844smS5GkpXZNcuIZmZu1Sd3htagJ6201Kti1uj/5tw3bTXVD+paxZitUXTMjih8V X-Received: by 2002:a05:620a:1923:b0:765:4f29:33e4 with SMTP id bj35-20020a05620a192300b007654f2933e4mr14061049qkb.30.1687882330579; Tue, 27 Jun 2023 09:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882330; cv=none; d=google.com; s=arc-20160816; b=LN80clVhI/i1rHISPEFXZuSvL9KwPTMix+BRO8ZebnRHj8xDE5PdgA8I2yYPbI9Ild dOK2aBHY+hefZb9PXhlhOzq+OHJ2yu7jfoPIEEbhjEpa54jJ/NwiY7Zg575XvV+tIzkz 2DC3J+tuonhRvM8+Dsf1LvmxtHljuGzGDpEfdU7PtM+0KgGy30evmWhb0o4l9tRWiJEX Dj2vUBqemKPuhNdRPj4ePLkclZXGckePiGottwV0ampZzN65oawax5dr8xJXy0gahTsJ Hwd0iMDZA9YLbt9QgoAATMRDTaFI2bYC80K4oE3yf80hcciEh8/bFmNSFGUFgGLbkb+6 lEDQ== 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=cf5ti9xDtG3D2s3Jcs/OJus8Ga0lob29HRcRChdiZSs=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=wJDaT92D7OLbZ2XgFQsJx/rZlfDC/EcsPvOGJXmT8j/396j8Y6RAOggpucE4bAAQxt cHRKxFgLOki2afzqw2dVx0FifgcGVK45O/7F1AvdpbosGxCRD9SB3QBfP9Az+Z4y/Ifo SQvVQRmcLg4k6x6m56m7hbxyRXRuEh5EKrXcHV7KzrA5YDKm5qNP8L7iI2RzqKsXxTmG VW8zS6pchl20RnXMDvbxKTapKXMQfCQytDjVC9TAPf/u7WPegfDShGcV3/0JYt+KNyT9 6hCBl2luU/ae/H3pY80k+AkvOn/dgpgdOsRvptKM56AeVyFivuFeZFMQkhI1zJ59tMrq FuSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAA9Wc3B; 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 e17-20020a05620a209100b0074676f15d3bsi3388234qka.25.2023.06.27.09.12.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAA9Wc3B; 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 1qEBGZ-0000kt-LC; Tue, 27 Jun 2023 12:10:07 -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 1qEBGN-0008Hl-QL for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:55 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGH-0005nw-S4 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:55 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-313f18f5295so2735943f8f.3 for ; Tue, 27 Jun 2023 09:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882188; x=1690474188; 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=cf5ti9xDtG3D2s3Jcs/OJus8Ga0lob29HRcRChdiZSs=; b=uAA9Wc3BHGhSifP+YwBHCxbLaCw9OF5tJ3c0nSaPINAhkDGACtO6o25z9+fkUr5f84 fT7Ax1fymNtsXLoFRGfCZwgeaDrfEy9PvNy52CD/beq6BFUugXAw6zQDs50IutX6xPVV tCt/r6YWSHCVmSrWhD7NOjIMFkyPdLqe5wW3Yqg4mKS8lPeaHHipb8oBAXJ84LjoWkom k1eQI8k3C11T6q/eZpM9KS8qY/rEp/4tEsgNuqURrVBUQ8nxrP6pZdp2yZYq8WImMJCa oTue+vRMoYzJqMDhNxxJ9AJdO4EPEOgDODpTT+1fgNvd7+JLOipzLOzgKhg/HdEREFRV 5ZtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882188; x=1690474188; 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=cf5ti9xDtG3D2s3Jcs/OJus8Ga0lob29HRcRChdiZSs=; b=gfYaYNQhZFcX8Aqk8Xa13IKkGX2mfXjQJoYExwi5Bu0R1aOLkrHwRyNOJBRrmlCsOn cL15+/Zm/Dt15onSmkxTSweq4/RKKnphgpnZ67dbksrCWk7dSGdOXZSWrQh0WkAYCmxC LmkBweAvI7ZpLfN9uy/V8Kdx4getZxMzezXSSC0Tj2MNUJiOaOn212e58E6VqLqWvbAR twAsjAOMg23UbemaWHl6OkJgx1LnqB2KyqI/1Gv4JFfrAFmcM9EOBkqdjT3docNRV7vM 5HUsPibiKcHEfX/0zmHRNksf3KV0YoXgkuFyV678iBPhOE6A+KVIl09MZ6fyTfUbukWm DrxA== X-Gm-Message-State: AC+VfDx+yMGJMZys2wOiu34PDxNStb1RqLB8/oRx356LvqLlwCbvmQar oTK878M3uDd3DC7UxpqVgin0EA== X-Received: by 2002:adf:f787:0:b0:311:f77:6a91 with SMTP id q7-20020adff787000000b003110f776a91mr26071425wrp.31.1687882188070; Tue, 27 Jun 2023 09:09:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bf11-20020a0560001ccb00b003062b2c5255sm10812234wrb.40.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F25DE1FFBC; Tue, 27 Jun 2023 17:09:44 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 10/36] Makefile: add lcitool-refresh to UNCHECKED_GOALS Date: Tue, 27 Jun 2023 17:09:17 +0100 Message-Id: <20230627160943.2956928-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 is yet another make target you usually run in the top level of the source directory. Message-Id: <20230623122100.1640995-12-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 804a5681e0..5d48dfac18 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3) UNCHECKED_GOALS := TAGS gtags cscope ctags dist \ help check-help print-% \ - docker docker-% vm-help vm-test vm-build-% + docker docker-% lcitool-refresh vm-help vm-test vm-build-% all: .PHONY: all clean distclean recurse-all dist msi FORCE From patchwork Tue Jun 27 16:09: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: 696875 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866317wrm; Tue, 27 Jun 2023 09:14:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ666rIutNAZf543nAriWEvZmD5zLaNT75ohtVcuWzYc4Pw0s+QXcqydsFlVEKvjjw1/PPVP X-Received: by 2002:ad4:5c61:0:b0:62a:d17d:9a15 with SMTP id i1-20020ad45c61000000b0062ad17d9a15mr38780538qvh.49.1687882467756; Tue, 27 Jun 2023 09:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882467; cv=none; d=google.com; s=arc-20160816; b=Ep3fmy5JxYhsDKQ45BYo3syuFpG+hQO7sA4/4czoZuPuEUjEYhoDHnTw4CuanDCJfT 8GtQLjLTTU23tDnINGzqCHyRrX1i0enGosdR44RmEBKfJX4Y8xrckx0kn85fz1yhATxE 0RO5vtWQYJgYuYPZWjCgeLDwcTARB+FUQJVPoAY3QKhJIQS8Ncsooymz8F1IA0UC+vbE nvRtriPQ8smwJpCAzRjiRmVc+9Wk9CxiK/vUHN2cIMfu6P8vXc8Pthf1RRUR+fXj8ZEI CBOSv3pJp/fhHwXdRWVN9zoFgXYBi+HDwoRz8RUU4VPmHIaNcfeebOQmQJTAXAsmCnoH /B0g== 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=tOV9EOnx/XHsK7XQyMJxy5drdvS9UgZO7Cmh6YX5vFY=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=h0DhsKY5oTbqQU2jbB7lgdAiWQO1W5itMbaQEYiRNLkDmmrtxAyo/n/hWRbmSA+FY/ FpslTj4BdBj3YCtmL87TgDx6I02JLaLLqMepXaXB6a3l1c+0ZTi7KrpYmUJVqhbyEiQd SouwRRFiNtouOs+vIxx8yH85gnyxzLo0AQtEGrsp9wpHAeehGQLpNZ4wlAU/OVHGXGyj r99bQmo7B7hJZOvkUr7gSQjUk+Ei4WF8/w9R9RsNVEIu8Cjqnj+WANfcwt2dkpHZCLPq j3g+1huUWOs9D8MOHggMKAlAvCJEpq4NFxlMWV/0SpUFgMpXcuS14Zt2aVA107KXG85J GPbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sxik2LxI; 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 fw5-20020a056214238500b0056f2ba3d7c6si3515361qvb.33.2023.06.27.09.14.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sxik2LxI; 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 1qEBGP-0008Sk-Tz; Tue, 27 Jun 2023 12:09:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBGM-0008A4-6V for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:54 -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 1qEBGH-0005o2-LD for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:53 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3128fcd58f3so5543324f8f.1 for ; Tue, 27 Jun 2023 09:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882188; x=1690474188; 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=tOV9EOnx/XHsK7XQyMJxy5drdvS9UgZO7Cmh6YX5vFY=; b=Sxik2LxI19zvXfC/z+8skLdpHU43rdZVQ0urzjDrTjsQaZ97+R+dCAFTjyf432cIA9 QY99hcRnYsL1ZS11MwbtrcdOOde1AXwTiuTD6wkwmvdpvYsZnOKThZ+AoQ8Dd+D6k3Pi FocCT05kinZCFYSjqqDcXQviLLMiapllf6g3EVhmNXwXvm23DinZhC6abJ7kNiFHi5Mg lzrzq7PS0vJ6cMM2A+ZflfnY2U+nMEbtEeP4zIwwUY+hjgGZ7CeA/coogAnTp6IStAYV bgjfI8iMsdYCFtDKUrN5z9fydxeEbomHwj7Hj2rkHX0WcWdbFULjkW+vLvpGwUhMLrf8 iM3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882188; x=1690474188; 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=tOV9EOnx/XHsK7XQyMJxy5drdvS9UgZO7Cmh6YX5vFY=; b=Rc/LiQqHSIcdBV6OTd8Kf+7reUhI2WMOLKMrNQo2Dgzv0bRZj/YKtBRkVi2qPJlnmf XwyNasmibPF/xcRyqoPH1XmelbuyzzRluw+SjUPt6QijlPdoIsX/nlRL41CPXLsT06kg 4+6HERsBrlPAciQ6gzibX8apuy0uYAPNVkkpSgVmhg+ZuANOuh6VEiBVJ1WyysUXMPw3 KJU4nSWbxs8jexfXJ+F6zrqOr6YjMaEFK6w0c5RJSLGxHgqsW3On4Z6hA6AK4Seyh2ZR rUjPXj0i2JZ8YjjeRR0Dek5UiqVNX71Q4/D7fx6ehXKmm0GyVNlWsF31b4lImKvlybho mn4w== X-Gm-Message-State: AC+VfDxLuqDYZufMpF4TdZmSz/BIfNmUhGi2VFHhJ3G37OS/3wDwVedI htGH0h0TB3Jj101hOSxfsJnw3Q== X-Received: by 2002:a5d:5269:0:b0:313:f124:349d with SMTP id l9-20020a5d5269000000b00313f124349dmr4998232wrc.17.1687882187491; Tue, 27 Jun 2023 09:09:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g6-20020a5d6986000000b003047dc162f7sm10825408wru.67.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1B9931FFBD; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 11/36] tests/lcitool: update to latest version Date: Tue, 27 Jun 2023 17:09:18 +0100 Message-Id: <20230627160943.2956928-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We need this for the riscv64 and gcc-native mappings. As the older alpine release has been dropped from the mappings we also need to bump the version of alpine we use. Message-Id: <20230623122100.1640995-13-alex.bennee@linaro.org> Acked-by: Richard Henderson Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/alpine.docker | 4 ++-- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/refresh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker index 0097637dca..43370f7b36 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all alpine-316 qemu +# $ lcitool dockerfile --layers all alpine-318 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM docker.io/library/alpine:3.16 +FROM docker.io/library/alpine:3.18 RUN apk update && \ apk upgrade && \ diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index c8971e90ac..b0f44f929a 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit c8971e90ac169ee2b539c747f74d96c876debdf9 +Subproject commit b0f44f929a81c0a604fb7fbf8afc34d37ab0eae9 diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index f1570b54df..5d36a62b10 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -115,7 +115,7 @@ try: # # Standard native builds # - generate_dockerfile("alpine", "alpine-316") + generate_dockerfile("alpine", "alpine-318") generate_dockerfile("centos8", "centos-stream-8") generate_dockerfile("debian-amd64", "debian-11", trailer="".join(debian11_extras)) From patchwork Tue Jun 27 16:09: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: 696871 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866168wrm; Tue, 27 Jun 2023 09:14:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/GOICfnmCwr+4WkJPpCfXTk5zogxSv/0d+5Y6sFApTa3aemI6XYmzcHF5IJpYyzyymldu X-Received: by 2002:ac8:5dcc:0:b0:3ff:2fae:b4bb with SMTP id e12-20020ac85dcc000000b003ff2faeb4bbmr25811313qtx.37.1687882454042; Tue, 27 Jun 2023 09:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882454; cv=none; d=google.com; s=arc-20160816; b=Qb5T0WBIChaHupjtrMqw0MSGWH9YKUJ8YTv3t2sHfz29ppHywfcUBr06oV0Blpr2Bf bdvEh+cH25SZA9iqAJQRtG2RJwpcWXOWlziFS2LPFswczlUUu2nVClWj4ZlZpqHKFk9f Nm84E90pSKG4nk/VYm2HPQNt7HgCqLg5BKbx5Yz6LtOL8FUuVCCZXIY3QCseC9EqunsZ fZ+A50oIJ9Ih/TsrDOZnEpbzSd/0VF1rwBPUyMPGTuIgIjtEsxoSCymbWot6OkCX9PQX ow36KNi0mAZKM21nNFO6oKDq8CDSQOlfIojU2DwrEuXfJzxxz7qiRrg4qndwbkQlfMRI qTKQ== 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=DudiICXjsv3m9urKUi2tH2RtAEiqXNFzr67H4vIREuA=; fh=ScdiTuJB4ooDwCwOqVkrYF/v3TTWN88r8nouqigwUP8=; b=ZQ/RFRg2uVvSL/ZZTKW+DbKCuM/1k05sNChWlTHLj8HZUaSLH/vp8NJQCbL+wfluDi UryzcJryqU6yOVPrgJSLsrzELCu15MXva1urOxVDMayGJRP04KB4vA4Ng1C21qQaSuK/ 2fwRftGCWOAcAzNwcR+GfiraG6PIDKFJ8RarjaFiwhklq4AnXVVy7kGaO7I7fiiXnCBn S45sM205UFWBtp2/YPcUSJPcaPHnjrVkJP1xHJQV5boUl1CMrWO5O5shdV5cpIwQMpgA yKtDnrPuKkup4r/w1hOJZu41n4HzyzTCyyiAUm7U67lPrPDzpZm8u199DQE4VnuGtInN BbWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WyyjRv+3; 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 y12-20020a05622a120c00b003f8a00e78ecsi2175824qtx.5.2023.06.27.09.14.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WyyjRv+3; 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 1qEBGP-0008Op-Ky; Tue, 27 Jun 2023 12:09: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 1qEBGM-0008A1-66 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:54 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGH-0005nK-7m for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:53 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fb7589b187so3641326e87.1 for ; Tue, 27 Jun 2023 09:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882187; x=1690474187; 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=DudiICXjsv3m9urKUi2tH2RtAEiqXNFzr67H4vIREuA=; b=WyyjRv+3t88vSdGYUsjDeCty4FtdbMzwro9rPT+TXqjh+/CoajKMQDpzPuk7vGaraD k6OfoOJXwKwphz1VUc8oogthA4Q64L+19b/0bGTCRMsSHlIZcqTEb0jNr9fJxY85qxi+ HTQRFmBM2pHK13RQpsvDJy0f8EDZOe4sAwd8yqMU9Ap+JhKYsXEHZKWGMvSIx8x5xatx hG0w1ArW2whI74CwkDkFt6a2z+oX+uAuaz5XA+1Khk2yHozbnY2AC4LvwdzcQgKsq0lr XRb9oclZppRMCQU2mXwQ56ZQs133wfAM3XmHn+LIX2xaw9IITP0Me67p146X3w41rphS 5Tkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882187; x=1690474187; 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=DudiICXjsv3m9urKUi2tH2RtAEiqXNFzr67H4vIREuA=; b=iV7MNgSmmY/kaFLucczb7Uiz/0E2XPn025aH5McY/rjiO8Fqfb0WYoCE1/z/grO66z fRi/WrHY8jAHKtDF+KaJJUHNr7ZBq+EmvSfmFQu0FK/DcL5uomdEoVzNCXG9qENLIc4U N8cLR0JBITIX+xgGwfzmIGpWI2dUQf9olfUqnMPI4AobfFazxmT3AWuqF94XZmJKwrfz iTMSxGH0swVYo8Istrhh9V9PUIFnU1G0fsVcBgwVD+5eRw8kCw2Nzrtfu9jk6GzEY2pf mthEuFLecosnl+obay/yD/J5m1kBTCWHPrG4l3md9Z4n382DAdJwaIzxFrsVJBOGjFzh SOjw== X-Gm-Message-State: AC+VfDzojh/mTJ771niOvJqOqCJhCysaBpnFscslGSb41VIBsXSW4gJ1 h+ILc3YJ0hbajj05L6vb5aHQaQ== X-Received: by 2002:a05:6512:3e2a:b0:4fb:889c:c53d with SMTP id i42-20020a0565123e2a00b004fb889cc53dmr1624376lfv.10.1687882187113; Tue, 27 Jun 2023 09:09:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id hn10-20020a05600ca38a00b003fba586100fsm2240688wmb.6.2023.06.27.09.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3C0D31FFC6; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Erik Skultety Subject: [PATCH v3 12/36] tests/lcitool: Bump fedora container versions Date: Tue, 27 Jun 2023 17:09:19 +0100 Message-Id: <20230627160943.2956928-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x136.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Erik Skultety Fedora 37 -> 38 Signed-off-by: Erik Skultety Acked-by: Richard Henderson Message-Id: <20230623122100.1640995-14-alex.bennee@linaro.org> Message-Id: [AJB: Dropped alpine (in prev commit), reflow commit msg] Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/fedora-win32-cross.docker | 4 ++-- tests/docker/dockerfiles/fedora-win64-cross.docker | 4 ++-- tests/docker/dockerfiles/fedora.docker | 4 ++-- tests/lcitool/refresh | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker index dc72ae9cc9..a0a3cd9e5b 100644 --- a/tests/docker/dockerfiles/fedora-win32-cross.docker +++ b/tests/docker/dockerfiles/fedora-win32-cross.docker @@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross mingw32 fedora-37 qemu +# $ lcitool dockerfile --layers all --cross mingw32 fedora-38 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 RUN dnf install -y nosync && \ printf '#!/bin/sh\n\ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker index 7eb4a5dba2..b6c1a6a339 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all --cross mingw64 fedora-37 qemu +# $ lcitool dockerfile --layers all --cross mingw64 fedora-38 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 RUN dnf install -y nosync && \ printf '#!/bin/sh\n\ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 3a69eefdda..8a35a17617 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -1,10 +1,10 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all fedora-37 qemu +# $ lcitool dockerfile --layers all fedora-38 qemu # # https://gitlab.com/libvirt/libvirt-ci -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 RUN dnf install -y nosync && \ printf '#!/bin/sh\n\ diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 5d36a62b10..5e06fb2cf5 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -119,7 +119,7 @@ try: generate_dockerfile("centos8", "centos-stream-8") generate_dockerfile("debian-amd64", "debian-11", trailer="".join(debian11_extras)) - generate_dockerfile("fedora", "fedora-37") + generate_dockerfile("fedora", "fedora-38") generate_dockerfile("opensuse-leap", "opensuse-leap-15") generate_dockerfile("ubuntu2004", "ubuntu-2004") generate_dockerfile("ubuntu2204", "ubuntu-2204") @@ -169,12 +169,12 @@ try: trailer=cross_build("s390x-linux-gnu-", "s390x-softmmu,s390x-linux-user")) - generate_dockerfile("fedora-win32-cross", "fedora-37", + generate_dockerfile("fedora-win32-cross", "fedora-38", cross="mingw32", trailer=cross_build("i686-w64-mingw32-", "i386-softmmu")) - generate_dockerfile("fedora-win64-cross", "fedora-37", + generate_dockerfile("fedora-win64-cross", "fedora-38", cross="mingw64", trailer=cross_build("x86_64-w64-mingw32-", "x86_64-softmmu")) From patchwork Tue Jun 27 16:09: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: 696865 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865065wrm; Tue, 27 Jun 2023 09:12:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/Y23kj9lC6qjIApkBbLpeqkYqDi7x6HWlWLSR0iWJ9yF7f1fGiVegfAIS8iVR0y/PB/oL X-Received: by 2002:a1f:e1c7:0:b0:471:13f7:548e with SMTP id y190-20020a1fe1c7000000b0047113f7548emr10629555vkg.9.1687882334685; Tue, 27 Jun 2023 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882334; cv=none; d=google.com; s=arc-20160816; b=Fi6UNseRyQsxFPXgxKvI858ao9zYldZH3F00hzY5ggs1FNSyuey6JeglwcpfoERdg4 9dwVDx13eJe/A11CFgpbjqvZ2MGinTcPgHuTa9FYaZpqidTPtRSz3lbqCfoJE5l9F6D5 2qzVg9hmrqj+Ojvr2lEEoM5LJu6sfOuNOgPzntkOkwplSkhwYiVrol1urj7cvNZQvjfg POEboRJpIpO/RiJiCzY++j15NDaCPAJYkqi0l4X0h8U9LmfFPFSfFDdeK69zPCHEkcyH 0jJEGcrYPrmWUtaOMI/Qtu0642PBzm/DmhlLowIuznJEFahV1ODy8olLi20o+AJnmRca joqw== 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=YjcBvoRPGdwmtkpSOh5Jr/t8a2L1GvJT/Iq1phAB7S4=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=kB9rJ+IuFXGRVmX1LgIUROIJgKgAXM6JMfOtp3bdRn1aLOLdaaiRMiSz4hrhfAMYAo 3RiXK1EtVnLo9VQXuJ7v/cT6mxYZzUiI3BFYV2cf1PtVifnJCtam+w8eQX/sDevY9YTr EbOxDuGwlI0iISUzS/ZYoqCtpBlII+tSM1KnJKwPMZilnJMJ0IfYV/olkKqAuhcNQGQC HgzuBKPYEhbUxC+GwcrqLu8LKIZvqIOHdXBPxU6C5c0W+US7qqNW836kug7C79vrlkh7 5QG4Z0p/vBKehIjmyp1QFAdhomif64VnKqQJ3umvXxX/uqSAgGZcVaPP8D2p3tTNLVrH ci1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8r4TByv; 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 fq7-20020a056214258700b00626291257a6si3413504qvb.305.2023.06.27.09.12.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8r4TByv; 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 1qEBGS-0000El-PM; Tue, 27 Jun 2023 12:10: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 1qEBGR-00007z-0Q for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:59 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGK-0005pl-C6 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:58 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fb4146e8deso19761415e9.0 for ; Tue, 27 Jun 2023 09:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882190; x=1690474190; 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=YjcBvoRPGdwmtkpSOh5Jr/t8a2L1GvJT/Iq1phAB7S4=; b=A8r4TByvJKL+rtZjXdxZjX0yAe/0Rm28sDgxd/oUyzIEKRsB1PvDPz/+02prpTRslI bpr2j5SZaL/niYVYKW8rufW8W0QR+c52i4V+uwDEi0rRTV+S7DiJPsRZ1m6X3WyiVgM0 V5jOKP60PyrSFX3Zb4vX8XVq6q6q4sIVH+yLfkL9dexwDRAwut3LiS1XwYGAcmiY9Sr8 OaJIcFBAPLJ6/ioGwnzLmrQ9LSSRkTS8eBlNNO4EOwjWBMZBgbtbolaTxsEeZjGgUtRt 8UtePQkvozfWSeDiZz8z60Hb+vGz5XWNE14QPst0ocqbJu5CGfNxuYZxa0aMJFr55TIT BX8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882190; x=1690474190; 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=YjcBvoRPGdwmtkpSOh5Jr/t8a2L1GvJT/Iq1phAB7S4=; b=KXssycXSdFGIs4rNk91poJ4+xdCCHKCVFJdqtr/1ZN454RIWoi4Gx9eLLu2FCLpZcN 5ItL+mhPjSY6kva1oAL0rN+8x31acXQfuf56gNxg0oQKASht/hLh9xLtVKuC8Qq7onrF yyYgEq7LNNLxEW/UzcJsZcHAWz1VMianLkIzQme17/AJg0VocjlRC+2lwCIAGRX6ONMH SuYtqeybH2sF5zhHjxpWPJl0F7sM8fh8d3sGSveBjRQxx2o1eFCkttrSZQiEALhmlzYh +S8LbVypQhwPZOYP8lpnWfYaV/aKsRaKGsM56gv/iQL2zm7BPItEMSlHhtsc0vJBGrul JfQg== X-Gm-Message-State: AC+VfDzupk2I8WAvRFHdMVOQNmR+CLMgpX/P4Z5JCsld+kYtjr3nHeVm mHh84JQHwiOk+BNGAEcoTE8DeQ== X-Received: by 2002:a5d:453b:0:b0:313:e897:67ef with SMTP id j27-20020a5d453b000000b00313e89767efmr11605067wra.47.1687882190757; Tue, 27 Jun 2023 09:09:50 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id da16-20020a056000197000b0031274a184d5sm10906551wrb.109.2023.06.27.09.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6FAA41FFBE; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 13/36] tests/lcitool: add an explicit gcc-native package Date: Tue, 27 Jun 2023 17:09:20 +0100 Message-Id: <20230627160943.2956928-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We need a native compiler to build the hexagon codegen tools. In our current images we already have a gcc as a side effect of a broken dependency between gcovr and lcov but this will be fixed when we move to bookworm. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987818 for details. Update the packages while we are at it. Message-Id: <20230623122100.1640995-15-alex.bennee@linaro.org> Acked-by: Richard Henderson Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/debian-amd64-cross.docker | 1 + tests/docker/dockerfiles/debian-arm64-cross.docker | 1 + tests/docker/dockerfiles/debian-armel-cross.docker | 1 + tests/docker/dockerfiles/debian-armhf-cross.docker | 1 + tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 + tests/docker/dockerfiles/debian-mipsel-cross.docker | 1 + tests/docker/dockerfiles/debian-ppc64el-cross.docker | 1 + tests/docker/dockerfiles/debian-s390x-cross.docker | 1 + tests/docker/dockerfiles/fedora-win32-cross.docker | 1 + tests/docker/dockerfiles/fedora-win64-cross.docker | 1 + tests/lcitool/projects/qemu.yml | 1 + 11 files changed, 11 insertions(+) diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker index 40a2b6acc4..016c2321f1 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker index c99300bbfa..3c114efa11 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker index 5db5c78b31..dfbd47db89 100644 --- a/tests/docker/dockerfiles/debian-armel-cross.docker +++ b/tests/docker/dockerfiles/debian-armel-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker index ae6600b25f..4e0084e896 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker index daa2d48e36..88adf333e9 100644 --- a/tests/docker/dockerfiles/debian-mips64el-cross.docker +++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker index 5af04e2054..256e8b5dfe 100644 --- a/tests/docker/dockerfiles/debian-mipsel-cross.docker +++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker index 1eeba7fcab..4d19cd2bd7 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker index 52e89a6dab..642bbde3d1 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker index a0a3cd9e5b..e3dfd68bed 100644 --- a/tests/docker/dockerfiles/fedora-win32-cross.docker +++ b/tests/docker/dockerfiles/fedora-win32-cross.docker @@ -29,6 +29,7 @@ exec "$@"\n' > /usr/bin/nosync && \ diffutils \ findutils \ flex \ + gcc \ gcovr \ git \ glib2-devel \ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker index b6c1a6a339..0e15c9643a 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -29,6 +29,7 @@ exec "$@"\n' > /usr/bin/nosync && \ diffutils \ findutils \ flex \ + gcc \ gcovr \ git \ glib2-devel \ diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml index 566db8313b..21fd3d2cf9 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -24,6 +24,7 @@ packages: - fuse3 - g++ - gcc + - gcc-native - gcovr - gettext - glib2 From patchwork Tue Jun 27 16:09: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: 696857 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3864149wrm; Tue, 27 Jun 2023 09:10:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BOK7drmA2ZG4gXn+K1RJSmzIgcti3HLwWriT9pHIdyoLJOzy8R85iLhue79z1aJal3rFq X-Received: by 2002:ac8:4e4b:0:b0:400:81a4:2ab3 with SMTP id e11-20020ac84e4b000000b0040081a42ab3mr17629963qtw.22.1687882237359; Tue, 27 Jun 2023 09:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882237; cv=none; d=google.com; s=arc-20160816; b=ypECsjia2UrPfR7OKh2/kbnKfekOdLquTt1FepbdEpDhx4VeHKkd89jkLuZVb9I0e2 B+6N2MrYk/V8wfg0mjS5U4W1VkLmCqxYzvExiZqLcDAAi2ly9eLVspsI6h+LOsdusgcF dk+nMZNvMnHFXuovu0bGHv/dSOcokFbchomFOlu1M9y1ym2FEiTZK64as+XVRggTKQm1 8O/FoNgqSydC8kYJlxoZHLqJ/uIZaB82YUsXUBAmK9WuMnSiqM4ur/C0Hpc4lR5iGlQ8 g5y/tYdIaPHnj45fMC2DNlgzYCSmYT6uBKEN29q3EK2PaZIC45Mpl0pFak22rIXCcQNT 2kXA== 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=mrxZa7XFEUbEabq4wBcL7gzCxqp+QvBtMc1otNNsIiU=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=ZZaw05WDE0MlGHIRGsunaxezhVv8bHcHCalqdwkBA1lH5bTJiU5pwZh9zThvsS1A7N Ygo5Ks/l0CZc+LzQ8FmuLv4+6XaV50erPw1txIEjspe13KLQPmlaWBtx1yx2w9s0Y+vQ pYI6mdFTrggVsmB8TvdCZddV+FSZVEriPuG5uEQW6US4ErikTUTQtnmApsaV1wU8QJ3a fIzxGiv/KUa9hxAutoq+9pirqPeoyglcDbPxiZRV7lJ4PbyFXZ0BFnxA59PpbwAOOxqN WD5rdHlb8n7pz4jVbjOKNouhfsWyQ55+SBqUtcWnR7ZClLX3bfR+p9SQkSNwxwwc33TW FPaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rEcvdMIK; 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 n6-20020ac85a06000000b003fde415351bsi3298255qta.68.2023.06.27.09.10.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:10:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rEcvdMIK; 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 1qEBGU-0000N0-8t; Tue, 27 Jun 2023 12:10: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 1qEBGQ-00005I-FH for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:58 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGK-0005pe-K1 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:58 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fa99f6a4a1so23895565e9.3 for ; Tue, 27 Jun 2023 09:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882190; x=1690474190; 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=mrxZa7XFEUbEabq4wBcL7gzCxqp+QvBtMc1otNNsIiU=; b=rEcvdMIKVD3+c9CuHBOrBYBoq0anuNfXBfzbv2q3r9FpbASKmS8ITnh53TmiFYCdqU fMc9Fe85bh7wl5z6J5lFpakelGDpTiUm5qSpxQ+w7pwLibzOiJzGwaysFH981TVwDmuu TZZDdUcwZQosMFSO14TSQsAahxQmTYTK/aAHrTPSoFR3xJEYxMHymewlDOWqJhXAGLEf m8MuQfwzByiT1SlBbjJgDGkYQ/O3tgubY1NPhHz7ywTvgZc3pyD5528dZao0K2rTckhm kd5GwEa4KbN78k0u19Z6/evDG5amvm3d2qlffjDqWZKgd4c8znKmJ2snBRT7lNZK4qtA mGKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882190; x=1690474190; 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=mrxZa7XFEUbEabq4wBcL7gzCxqp+QvBtMc1otNNsIiU=; b=Zp6RdAfCIRKyTaRtUoN+JZpSpjk/0BDAUlbWhJbYEK4OlxDKM8mfBfnevOYwcktTWs MogNtthEVm55FoLES5CLxKrFTrmU3uHIczvAeMko44Z2vCEBpx4vaIYZoz18nXX13fkN pLsOT9oPXszhDI7nTSf/TFfqD6EvrZUNM8oQfWvQu5P+p5+o7nveHw/FSwf1vXY6H736 sEJYL/Kx+etM7E7YiLFpkR/Bw6YPLTDdaU0kwYqGSszWGwSWnZi6UCoHpmprV1Aj5Qwo s1m+lYqLFAoHGnURDXub52njMUlCbtlr9PUE/+LXq3PIS3mufOs2tt9yds9lHYNvsD+c uZsw== X-Gm-Message-State: AC+VfDxBbkLaLB/L+bKUKNNtp1vI4u8+GKHec03QHPPQeKrTqIDVkVUE FGazDmUhZsbmZGQILwErlQvoHA== X-Received: by 2002:a7b:c392:0:b0:3fa:8fb1:50fe with SMTP id s18-20020a7bc392000000b003fa8fb150femr5676627wmj.15.1687882190595; Tue, 27 Jun 2023 09:09:50 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p9-20020a05600c204900b003f93c450657sm11187352wmg.38.2023.06.27.09.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 87DA21FFBF; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 14/36] tests/lcitool: introduce qemu-minimal Date: Tue, 27 Jun 2023 17:09:21 +0100 Message-Id: <20230627160943.2956928-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 is a very bare bones set of dependencies for a minimal build of QEMU. This will be useful for minimal cross-compile sanity check based on things like Debian Sid where stuff isn't always in sync. Message-Id: <20230623122100.1640995-16-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- v2 - minor rewording --- tests/lcitool/projects/qemu-minimal.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/lcitool/projects/qemu-minimal.yml diff --git a/tests/lcitool/projects/qemu-minimal.yml b/tests/lcitool/projects/qemu-minimal.yml new file mode 100644 index 0000000000..b60fec715c --- /dev/null +++ b/tests/lcitool/projects/qemu-minimal.yml @@ -0,0 +1,23 @@ +# Very minimal set of qemu packages, used for minimal cross-compile sanity checks +--- +packages: + - bash + - bc + - bison + - flex + - g++ + - gcc + - gcc-native + - glib2 + - glib2-native + - glib2-static + - libc-static + - libfdt + - libffi + - make + - meson + - ninja + - pixman + - pkg-config + - python3 + - python3-venv From patchwork Tue Jun 27 16:09: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: 696876 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866340wrm; Tue, 27 Jun 2023 09:14:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YBT/IdtbyhON7gNUmRmynIHOVr0qMeUK4KN7ixV/BrW60NWCBLeMmPlZukHj3panY4KJk X-Received: by 2002:a05:622a:5c9:b0:3ff:2233:6cab with SMTP id d9-20020a05622a05c900b003ff22336cabmr28869695qtb.26.1687882471454; Tue, 27 Jun 2023 09:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882471; cv=none; d=google.com; s=arc-20160816; b=Nilk8Bi0NQOhQ09d2lVPONK0JuHXbKfaR+9dFQZhbKjArZYT1nhkg/vBmPz95lL3Pw nchDyhT1Zuuud1oswJprlvmLGcbu9oNSSJarPX969kWBX8Y0wmmOeiMpobC7ge6971Vc kv6LUy6aX2Q911+BFNqrRlZiySqhaGa0CMl/R6bFnmrwqJoeDM3zr6JiPg4eq2jwCXQn 4fp3RT7RfJ6+l5p4nqxShKyAyg4zLSmd97zyohflxcV6iS0tl7Jq0pKuTRRn2lqgbAzf WIKGxyef/hnjaSuVbXeOUHsD+3BOS6Z8Mx4CXRkwUq1t0AAS4/8FCGtWCeorrUqKCDeU 8gyA== 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=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=T9OH+QzPu//+wtPje/qJ0wD8Y14a/u1vmbWlj8O+iUIjdhHdHyMuAKXIZALYXt+lp9 /kOiQxb5SHxhKDiMqPsmk3XcBxmHr+pAMf2cpq7eIQrulGLknc2ZapGpPzbdnVh813Lc 2Nxydrn1Q54lTWnAxn84Ux0tM812kqnpMGkDvJdSLUpxVNTy/LQPRXD7hMedV+FOvH8k MZUdd3H/ShNTC8NsDGgk/dfiO80S3Vt/69jVbUE/eBQf2yG1ELtejquPVRH26adv67bJ kBzW8ASB0aVCEbiqC3Tpe5pWpBL1ZdaXSJgfoJx2oOe3fKPEUjvASeX4M1SSOxvzgJRw GqPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RSdoGeIO; 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 v20-20020a05622a189400b003fff01022f8si1777492qtc.520.2023.06.27.09.14.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RSdoGeIO; 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 1qEBGa-0000mc-8b; Tue, 27 Jun 2023 12:10:08 -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 1qEBGR-00009l-Bl for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:59 -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 1qEBGK-0005py-PY for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:59 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fb4146e8ceso18828005e9.0 for ; Tue, 27 Jun 2023 09:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882191; x=1690474191; 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=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; b=RSdoGeIOhjPGBh7hnRqlIiKjmplaUDhh5qegHRToHsrfsF+BAXO2Pn9+jzLeP0akNi fsAzMg7RR6U/tOsTI8To/qBK1YAhmjvueWV7Oj/sxaCMy+f1z3+vWAlWf39jBnYWPxaT jvVTdH2G0Uasfk0j37yWG+DIKk4gl8eFRIYOv6Al2ve6IylmEii72lDpr0wcxXb/89GB m66FzDiDRypnDUAL0ZfRw0Rf63lJrojZJckX9fYi2ePCoImY1IoJcVxtDD/iwdFXylzS bJOMsAD8DTloVFkKa7ef2kGjatlLFjDWhWk9pJRlEvCP7qtNCviiXu7Fwqhs/AyKpNDT +akw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882191; x=1690474191; 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=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; b=UMRA8cvyYfBYLS2v5h741g+sjP7poNUJ+famWJ+KRoyXqtnzCrvgcoHs/JFEO+xO5R I3gSyflci9ZwsTLProoLYOa7NHW5gFS4zTbpyyySN9Aef6Sor08V7NOLsAOUwWZLbZsT dtE9HbXzt2Xu40kkgvg5zQeTfVbApKCzMBQTKvhQypF6FiLpv1z+zmEdY3RmQKLjn6rR 4XlU43km8DZfsOsUYRfBLNTe4ETttl1RcKMUXOLZQ+Bi0jAKWRFyjyO4V7NaCVhx4MJ+ e+aYpsiApL1SrY4N2pMCGdAOVRIxS1hbP0BjNrVSKdOoYkfw+Ls6aUl8Y/gHX59RGuMo b/3w== X-Gm-Message-State: AC+VfDzvrkUl13Ayvk6jNMM0M4ANtHsVOFF0ncG004otKvt0vp/NGWHI 2/HXEui7LlCaV2kjHNq7RCQGUg== X-Received: by 2002:a05:600c:295:b0:3f9:c8b2:dfbd with SMTP id 21-20020a05600c029500b003f9c8b2dfbdmr13605224wmk.19.1687882190973; Tue, 27 Jun 2023 09:09:50 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p23-20020a1c7417000000b003f9b0f640b1sm11192228wmc.22.2023.06.27.09.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A53901FFC7; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 15/36] tests/docker: convert riscv64-cross to lcitool Date: Tue, 27 Jun 2023 17:09:22 +0100 Message-Id: <20230627160943.2956928-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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 still need to base this on Debian Sid until riscv64 is promoted to a release architecture (or another distro provides a full cross compile target). We use the new qemu-minimal project description to avoid bringing in all the extra dependencies because every extra package is another chance for sid to fail. Signed-off-by: Alex Bennée --- .../dockerfiles/debian-riscv64-cross.docker | 119 +++++++++++------- tests/lcitool/projects/qemu-minimal.yml | 4 + tests/lcitool/refresh | 10 +- 3 files changed, 87 insertions(+), 46 deletions(-) diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker index 081404e014..a2d879ee1f 100644 --- a/tests/docker/dockerfiles/debian-riscv64-cross.docker +++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker @@ -1,54 +1,85 @@ +# THIS FILE WAS AUTO-GENERATED # -# Docker cross-compiler target for riscv64 +# $ lcitool dockerfile --layers all --cross riscv64 debian-sid qemu-minimal # -# Currently the only distro that gets close to cross compiling riscv64 -# images is Debian Sid (with unofficial ports). As this is a moving -# target we keep the library list minimal and are aiming to migrate -# from this hack as soon as we are able. -# -FROM docker.io/library/debian:sid-slim +# https://gitlab.com/libvirt/libvirt-ci -# Add ports -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=noninteractive eatmydata apt update -yy && \ - DEBIAN_FRONTEND=noninteractive eatmydata apt upgrade -yy - -# Install common build utilities -RUN DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \ - bison \ - bc \ - build-essential \ - ca-certificates \ - debian-ports-archive-keyring \ - dpkg-dev \ - flex \ - gettext \ - git \ - libglib2.0-dev \ - ninja-build \ - pkg-config \ - python3 \ - python3-venv +FROM docker.io/library/debian:sid-slim -# Add ports and riscv64 architecture -RUN echo "deb http://ftp.ports.debian.org/debian-ports/ sid main" >> /etc/apt/sources.list -RUN dpkg --add-architecture riscv64 +RUN export DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y eatmydata && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y \ + bash \ + bc \ + bison \ + ca-certificates \ + ccache \ + findutils \ + flex \ + gcc \ + git \ + libglib2.0-dev \ + locales \ + make \ + meson \ + ninja-build \ + pkgconf \ + python3 \ + python3-venv \ + sed \ + tar && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ + dpkg-reconfigure locales -# Duplicate deb line as deb-src -RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" +ENV LANG "en_US.UTF-8" +ENV MAKE "/usr/bin/make" +ENV NINJA "/usr/bin/ninja" +ENV PYTHON "/usr/bin/python3" -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - gcc-riscv64-linux-gnu \ - libc6-dev-riscv64-cross \ - libfdt-dev:riscv64 \ - libffi-dev:riscv64 \ - libglib2.0-dev:riscv64 \ - libpixman-1-dev:riscv64 +RUN export DEBIAN_FRONTEND=noninteractive && \ + dpkg --add-architecture riscv64 && \ + eatmydata apt-get install debian-ports-archive-keyring && \ + eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main' > /etc/apt/sources.list.d/ports.list && \ + eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleased main' >> /etc/apt/sources.list.d/ports.list && \ + eatmydata apt-get update && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y dpkg-dev && \ + eatmydata apt-get install --no-install-recommends -y \ + g++-riscv64-linux-gnu \ + gcc-riscv64-linux-gnu \ + libc6-dev:riscv64 \ + libfdt-dev:riscv64 \ + libffi-dev:riscv64 \ + libglib2.0-dev:riscv64 \ + libpixman-1-dev:riscv64 && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + printf "[binaries]\n\ +c = '/usr/bin/riscv64-linux-gnu-gcc'\n\ +ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\ +strip = '/usr/bin/riscv64-linux-gnu-strip'\n\ +pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'\n\ +\n\ +[host_machine]\n\ +system = 'linux'\n\ +cpu_family = 'riscv64'\n\ +cpu = 'riscv64'\n\ +endian = 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-gcc -# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV ABI "riscv64-linux-gnu" +ENV MESON_OPTS "--cross-file=riscv64-linux-gnu" ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu- ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user # As a final step configure the user (if env is defined) diff --git a/tests/lcitool/projects/qemu-minimal.yml b/tests/lcitool/projects/qemu-minimal.yml index b60fec715c..d44737dc1d 100644 --- a/tests/lcitool/projects/qemu-minimal.yml +++ b/tests/lcitool/projects/qemu-minimal.yml @@ -4,6 +4,8 @@ packages: - bash - bc - bison + - ccache + - findutils - flex - g++ - gcc @@ -21,3 +23,5 @@ packages: - pkg-config - python3 - python3-venv + - sed + - tar diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 5e06fb2cf5..b54566edcc 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -63,12 +63,12 @@ add_user_mapping = [ " id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n" ] -def generate_dockerfile(host, target, cross=None, trailer=None): +def generate_dockerfile(host, target, project="qemu", cross=None, trailer=None): filename = Path(src_dir, "tests", "docker", "dockerfiles", host + ".docker") cmd = lcitool_cmd + ["dockerfile"] if cross is not None: cmd.extend(["--cross", cross]) - cmd.extend([target, "qemu"]) + cmd.extend([target, project]) if trailer is not None: trailer += "\n".join(add_user_mapping) @@ -164,6 +164,12 @@ try: trailer=cross_build("powerpc64le-linux-gnu-", "ppc64-softmmu,ppc64-linux-user")) + generate_dockerfile("debian-riscv64-cross", "debian-sid", + project="qemu-minimal", + cross="riscv64", + trailer=cross_build("riscv64-linux-gnu-", + "riscv64-softmmu,riscv64-linux-user")) + generate_dockerfile("debian-s390x-cross", "debian-11", cross="s390x", trailer=cross_build("s390x-linux-gnu-", From patchwork Tue Jun 27 16:09: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: 696868 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865089wrm; Tue, 27 Jun 2023 09:12:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+l32eMarorn1JfoZahX+3nxfHFIx8hGIEC/7CeO25SVuRP52PCha5eHjhWCJK8kcGn/CZ X-Received: by 2002:a05:620a:3844:b0:766:fa53:35b3 with SMTP id po4-20020a05620a384400b00766fa5335b3mr4156215qkn.33.1687882337027; Tue, 27 Jun 2023 09:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882337; cv=none; d=google.com; s=arc-20160816; b=gVZt16TvCOHEieOGothahBi0Ci5PIKrDGFUtfvKN8e7jXrHI29sosVgpoZGwU4vuAN 3KvUExcEwvAVUhzf4pQu146JDSlGAbf/EKOjWw6tGepiCUHwE6jyRETkmfkIxYcrePSR j9n7O0Pu97yn/xtVDt19E647mIP6rg6T8n6tUQrU6ouxVagWunnIHIQ9OXLcPZ2GVFRE n3Goym5B4hMlmwsamX+RmNzaygFi6fFVUpP6xnePV45xOmIFIWLH71UiQqUzfUoRKtbf d0STFjaWS4/wD08VrRZuaefjda132LfHHLEXqfIYl3FBpIvIGGn/NPE4wmqeUjrzosCX eLDg== 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=AouWM1m7VIgcxf/wQ9k/4ktgNJVDqALSrdqBKb0paEY=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=M5qNoeOpd5mtf+KVkVFzTed7OUey5k+QITLaZnSGBia5mGEujOwyfHAlHaNiRHnAQh vQu8+p0l+cXqw3KNkgW9znrNSs+893zvfyBFDxYy/x2IAtYnsiVMHb+r9flFLFmLCk++ ZRyJ27+h6HFctrDkrF5Tbg//JS1AXNmlN7F+OZGEPxmHGJqDGSkaT/9jWmnxX6dB63BD szL9HlalgEWRnfHpI9zo/x2t/GkvxH/rcExkMggfayhvtw+mv0DwVMmBVIQbIevCt+MK 6RickSfSHRrBxyNjxK4oXQBpbxbPgxpwJGj2ihn8eQ3eHHmLM7iIdfeWN1vLPkO3JuQk WKHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvW1HvP5; 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 az17-20020a05620a171100b0076714b541ccsi662707qkb.487.2023.06.27.09.12.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:12:17 -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=wvW1HvP5; 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 1qEBGX-0000Yi-Co; Tue, 27 Jun 2023 12:10:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBGS-0000GK-Vv for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:01 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGL-0005qq-Ko for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:00 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fa99742be2so24583625e9.1 for ; Tue, 27 Jun 2023 09:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882192; x=1690474192; 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=AouWM1m7VIgcxf/wQ9k/4ktgNJVDqALSrdqBKb0paEY=; b=wvW1HvP5yacSa0TCKJyExmhxaw2dfkqufC6nOxOHNAL6jR649ZIw2e7bYk825U85J/ vkXUaTLLCLIrOmcDM/cLqXLpfUQd8Cjn9WEWkwJwFKcm3nFmFRvM4TOu9qhPvhFX/s5F dklH0YcRLh8NPqjV7DFe4FvufX2aunp1zMUVk1gNJ1FBFndENTnOKbEjc5D/Yao8XLr2 LaKSwawvb/JEVWT+MQZ+Kxi8dm/QAN96XN2DF74kc65fzATATPcXQs76TyMS+Vk7YzBw H86EYZL7C8gvA0DPFeL9rlD6F6dNzHx0SCA5nQyh41vwOc/hAzOJHlqQgppbmRfjl9AY DTuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882192; x=1690474192; 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=AouWM1m7VIgcxf/wQ9k/4ktgNJVDqALSrdqBKb0paEY=; b=i/tzrzSujsVTFGNNTnGd06MrWUtES5ibsOVL5gdlNPgQYEKC5lxctg5xBYVdLWhcLr U0iPBrV0Cmlr80elcQhRZwyJKd3fukoyTEJwSvKU2PqIDVPQIXQhYRQ3fpE2hlEh1nBy u+04NeyqLkbYy2jnzac7doGkuNJ3piscZTfpk8wNyeoDpskYzmNve6qQFXLguOwF9S6h c2GYgCPT95Mun7jJHP2xKKZKVCOdp+9nqyt2T2/U37rRocTrU/tU4HK9GHQb5FornViL RMWZk9ADvLuNVWe7fkPDoW8fr2zXpNTCifzoljOYQHlIBmQJ5/EhAB2Bmpk75G5ie87C 8qIA== X-Gm-Message-State: AC+VfDwhxACEI6Ammis6VhbSNtRY/TSP8BBChpoX4g9uHXpiA3WMts3J 5ovFbxpvBmsgdTmo/mlY9dO4UQ== X-Received: by 2002:a1c:7705:0:b0:3fa:c3e8:901a with SMTP id t5-20020a1c7705000000b003fac3e8901amr3686273wmi.25.1687882192195; Tue, 27 Jun 2023 09:09:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f4-20020a1c6a04000000b003fba2734f1esm2525151wmc.1.2023.06.27.09.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BE23F1FFC8; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 16/36] tests/avocado: update firmware to enable sbsa-ref/max Date: Tue, 27 Jun 2023 17:09:23 +0100 Message-Id: <20230627160943.2956928-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Marcin Juszkiewicz Update prebuilt firmware images to have TF-A with FEAT_FGT support enabled. This allowed us to enable test for "max" cpu in sbsa-ref machine. Signed-off-by: Marcin Juszkiewicz Message-Id: <20230530152240.79160-1-marcin.juszkiewicz@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- v3 - re-enable for CI --- tests/avocado/machine_aarch64_sbsaref.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index 0a79fa7ab6..cce6ef9f65 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -29,23 +29,23 @@ def fetch_firmware(self): """ Flash volumes generated using: - - Fedora GNU Toolchain version 12.2.1 20220819 (Red Hat Cross 12.2.1-2) + - Fedora GNU Toolchain version 13.1.1 20230511 (Red Hat 13.1.1-2) - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/5fdb2e54 + https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee38 - Tianocore EDK II - https://github.com/tianocore/edk2/tree/494127613b - https://github.com/tianocore/edk2-non-osi/tree/41876073 - https://github.com/tianocore/edk2-platforms/tree/8efa4f42 + https://github.com/tianocore/edk2/tree/0f9283429dd4 + https://github.com/tianocore/edk2-non-osi/tree/f0bb00937ad6 + https://github.com/tianocore/edk2-platforms/tree/7880b92e2a04 """ # Secure BootRom (TF-A code) fs0_xz_url = ( - "https://fileserver.linaro.org/s/ATnSmq6k8SoXgbH/" + "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash = "a210a09692bcbe0a3743ffd0df44e80e0c7ad8ab" + fs0_xz_hash = "447eff64a90b84ce47703c6ec41fbfc25befaaea" tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash) archive.extract(tar_xz_path, self.workdir) fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd") @@ -93,15 +93,15 @@ def test_sbsaref_edk2_firmware(self): # AP Trusted ROM wait_for_console_pattern(self, "Booting Trusted Firmware") - wait_for_console_pattern(self, "BL1: v2.8(release):v2.8") + wait_for_console_pattern(self, "BL1: v2.9(release):v2.9") wait_for_console_pattern(self, "BL1: Booting BL2") # Trusted Boot Firmware - wait_for_console_pattern(self, "BL2: v2.8(release)") + wait_for_console_pattern(self, "BL2: v2.9(release)") wait_for_console_pattern(self, "Booting BL31") # EL3 Runtime Software - wait_for_console_pattern(self, "BL31: v2.8(release)") + wait_for_console_pattern(self, "BL31: v2.9(release)") # Non-trusted Firmware wait_for_console_pattern(self, "UEFI firmware (version 1.0") @@ -136,21 +136,18 @@ def boot_alpine_linux(self, cpu): self.vm.launch() wait_for_console_pattern(self, "Welcome to Alpine Linux 3.17") - @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout") def test_sbsaref_alpine_linux_cortex_a57(self): """ :avocado: tags=cpu:cortex-a57 """ self.boot_alpine_linux("cortex-a57") - @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout") def test_sbsaref_alpine_linux_neoverse_n1(self): """ :avocado: tags=cpu:max """ self.boot_alpine_linux("neoverse-n1") - @skip("requires TF-A update to handle FEAT_FGT") def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=cpu:max From patchwork Tue Jun 27 16:09: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: 696866 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3865067wrm; Tue, 27 Jun 2023 09:12:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yMfD6XL2BDwz6a1zP8yvMguhVePeC0ph30jM+kDi7HCaO8izDMX/Eovr4gj3XgWt/8jMK X-Received: by 2002:a05:620a:2449:b0:75b:23a1:d85f with SMTP id h9-20020a05620a244900b0075b23a1d85fmr44882705qkn.33.1687882334945; Tue, 27 Jun 2023 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882334; cv=none; d=google.com; s=arc-20160816; b=SaV1r+PP7KKrgnkpASXbkb5OYEUhtU/fx0KlD/Me1pnCKqKT4Z29MAqgpJ3fOUuHNd Rw2ei3hC1aGvlx6Ay0dM0dY8WCyt915iN6c/czRXkTcCd+7lETt2NCP/VrklsPNzEaY4 +EB1xpSBOOMOjONKDJuZp7d3RlnlSwKE1F+FsncekmPEQhASWcwOM1A3R4FyFr0kYe6g UiMGOfd81Ea4etGO4PU0KPEQ8+kERXF7mPtW+O5csTAWgwz2TZYKB5iiw5vvwLZaHkc4 hIhcTj5YBT9YSKzoEHqMPDxBORSLwG95sd0eHH1/89vCZ5Bg7LduwGryklHhCC5kz3cY bXtg== 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=Mu0VzYZ5qJSeNduimPIxEjIPeU7djJlezitZVXx019k=; fh=wfSqoRP2NSDPb/x+y9gbrXxaiq7NXi2nhibnF/9d7ko=; b=mWdUL8pyKoc6AslpS8KNwKLVeCnR8UXz6XQfGbZAwd9QCmlioDblEbeH8NMn3rPR0y BYdc9p/vOzGrHsHi4SSh9If+uBGQKJ3qGw/rtulkSddzRSmhVMO9Zd8dxhLXQETIB3og +Qgq/RdumlEoSXUbF9mZbfT4vwdL08kB983B+Iad0wrXV7pf2TsGtxoBMyXEKldW/UF6 69Sc/6+GCd2em4Vyj/0t4B+Dm8Bi/ACjUqLVtWbu5vQ4/T5hRthGId9UccPPXsEJe8h0 on87dPjaS9LC10v2U9DXH6BP3GnxzeBBkupDUAnY8z7RU1vu7lHgd4XIkoqbLokHtSpG RHcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FrsuvxmJ; 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 h2-20020a05620a21c200b00766fe03ce63si1424022qka.557.2023.06.27.09.12.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FrsuvxmJ; 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 1qEBGc-0000tG-M5; Tue, 27 Jun 2023 12:10:10 -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 1qEBGU-0000Nn-3y for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:02 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGL-0005qh-Os for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:01 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fba5a8af2cso9092755e9.3 for ; Tue, 27 Jun 2023 09:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882192; x=1690474192; 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=Mu0VzYZ5qJSeNduimPIxEjIPeU7djJlezitZVXx019k=; b=FrsuvxmJt0pVI53ZMd/uM4f5oUQpbXhoDdRXePmlrlPlWwnAtKEwBlr+604Ja977Ir J6vN9AFgwiwL5Bmttsvj3T57I2P52ssEpXLOlOOLkcwz0T6uqIkmfZUURQ9toXLKHgJ8 +WSy+pRwI0aoImT6EtZs3CL0mJI+q9Co2DdHRBuHTraRXU7XREtCgfnJcWlGMwRd5J1W j+/P9PCSbO1GaPPXzzLt3H9GbhmCtSOfWMsa1bNCgloGVoQuuQaxCCkk9Bg1uQKUW8d2 w2mfEy14I9DsvOWG2nhiDFupk580J/0ppr+/q8nwyLPKplowGCzIqDfg8nxfPQn+/oCh bTGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882192; x=1690474192; 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=Mu0VzYZ5qJSeNduimPIxEjIPeU7djJlezitZVXx019k=; b=JBoZZ3XSC95iXNIpmqz7JSXZuF25K4obk76eZ7RveQyzJfxBTImWEadTC7IgygDrC1 iWETk3aqF5DTF+pNTJL29y5lxm7DvI695J9g6I3dypDjXgc2CezP5z1WGNgQZi+tUKym e3SPPH83ig3mma7ORcPstszMeQhlR6WV+lG2Y64AlMhtBbVkCwswk0SquPtkYq1RdXxL 0/dgTktQHizJNlvv+IrjNuw/IpR0JGATUpYI6stti9Pi4TFjl/k0RReZQgd9ALwoHaDz KA9xwU5VJRmkdVZgEdHeApimkGEqYXSW+JZQbxtAF3RERQn6+ibn7PZoXJXgwcbD0FRB kr5g== X-Gm-Message-State: AC+VfDx0iwSbsuuJoWj/fz3hd61whlzVNMgHtLAnZ93gkRzc0Ayjx5uv bzKKLBahnUZpKC+XwUS3Be//6g== X-Received: by 2002:a7b:c8c2:0:b0:3f9:5d0:b71d with SMTP id f2-20020a7bc8c2000000b003f905d0b71dmr20323179wml.30.1687882192003; Tue, 27 Jun 2023 09:09:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f8fac0ad4bsm11143759wml.17.2023.06.27.09.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E2FE51FFCA; Tue, 27 Jun 2023 17:09:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Robert Henry , Aaron Lindsay Subject: [PATCH v3 17/36] plugins: force slow path when plugins instrument memory ops Date: Tue, 27 Jun 2023 17:09:24 +0100 Message-Id: <20230627160943.2956928-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The lack of SVE memory instrumentation has been an omission in plugin handling since it was introduced. Fortunately we can utilise the probe_* functions to force all all memory access to follow the slow path. We do this by checking the access type and presence of plugin memory callbacks and if set return the TLB_MMIO flag. We have to jump through a few hoops in user mode to re-use the flag but it was the desired effect: ./qemu-system-aarch64 -display none -serial mon:stdio \ -M virt -cpu max -semihosting-config enable=on \ -kernel ./tests/tcg/aarch64-softmmu/memory-sve \ -plugin ./contrib/plugins/libexeclog.so,ifilter=st1w,afilter=0x40001808 -d plugin gives (disas doesn't currently understand st1w): 0, 0x40001808, 0xe54342a0, ".byte 0xa0, 0x42, 0x43, 0xe5", store, 0x40213010, RAM, store, 0x40213014, RAM, store, 0x40213018, RAM And for user-mode: ./qemu-aarch64 \ -plugin contrib/plugins/libexeclog.so,afilter=0x4007c0 \ -d plugin \ ./tests/tcg/aarch64-linux-user/sha512-sve gives: 1..10 ok 1 - do_test(&tests[i]) 0, 0x4007c0, 0xa4004b80, ".byte 0x80, 0x4b, 0x00, 0xa4", load, 0x5500800370, load, 0x5500800371, load, 0x5500800372, load, 0x5500800373, load, 0x5500800374, load, 0x5500800375, load, 0x5500800376, load, 0x5500800377, load, 0x5500800378, load, 0x5500800379, load, 0x550080037a, load, 0x550080037b, load, 0x550080037c, load, 0x550080037d, load, 0x550080037e, load, 0x550080037f, load, 0x5500800380, load, 0x5500800381, load, 0x5500800382, load, 0x5500800383, load, 0x5500800384, load, 0x5500800385, load, 0x5500800386, lo ad, 0x5500800387, load, 0x5500800388, load, 0x5500800389, load, 0x550080038a, load, 0x550080038b, load, 0x550080038c, load, 0x550080038d, load, 0x550080038e, load, 0x550080038f, load, 0x5500800390, load, 0x5500800391, load, 0x5500800392, load, 0x5500800393, load, 0x5500800394, load, 0x5500800395, load, 0x5500800396, load, 0x5500800397, load, 0x5500800398, load, 0x5500800399, load, 0x550080039a, load, 0x550080039b, load, 0x550080039c, load, 0x550080039d, load, 0x550080039e, load, 0x550080039f, load, 0x55008003a0, load, 0x55008003a1, load, 0x55008003a2, load, 0x55008003a3, load, 0x55008003a4, load, 0x55008003a5, load, 0x55008003a6, load, 0x55008003a7, load, 0x55008003a8, load, 0x55008003a9, load, 0x55008003aa, load, 0x55008003ab, load, 0x55008003ac, load, 0x55008003ad, load, 0x55008003ae, load, 0x55008003af (4007c0 is the ld1b in the sha512-sve) Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Cc: Robert Henry Cc: Aaron Lindsay Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - allow TLB_MMIO to appear in user-mode probe_access v3 - checkpatch cleanups --- include/exec/cpu-all.h | 2 +- include/hw/core/cpu.h | 17 +++++++++++++++++ accel/tcg/cputlb.c | 5 ++++- accel/tcg/user-exec.c | 8 ++++++-- target/arm/tcg/sve_helper.c | 4 ---- tests/tcg/aarch64/Makefile.target | 8 ++++++++ 6 files changed, 36 insertions(+), 8 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 8018ce783e..472fe9ad9c 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -301,7 +301,7 @@ CPUArchState *cpu_copy(CPUArchState *env); * be signaled by probe_access_flags(). */ #define TLB_INVALID_MASK (1 << (TARGET_PAGE_BITS_MIN - 1)) -#define TLB_MMIO 0 +#define TLB_MMIO (1 << (TARGET_PAGE_BITS_MIN - 2)) #define TLB_WATCHPOINT 0 #else diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index eda0230a02..2be7c8f2d9 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -982,6 +982,23 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); #endif +/** + * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled? + * @cs: CPUState pointer + * + * The memory callbacks are installed if a plugin has instrumented an + * instruction for memory. This can be useful to know if you want to + * force a slow path for a series of memory accesses. + */ +static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) +{ +#ifdef CONFIG_PLUGIN + return !!cpu->plugin_mem_cbs; +#else + return false; +#endif +} + /** * cpu_get_address_space: * @cpu: CPU to get address space from diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 5b51eff5a4..b1b9bf4b1d 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1553,7 +1553,10 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, flags |= full->slow_flags[access_type]; /* Fold all "mmio-like" bits into TLB_MMIO. This is not RAM. */ - if (unlikely(flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY))) { + if (unlikely(flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY)) + || + (access_type != MMU_INST_FETCH && + cpu_plugin_mem_cbs_enabled(env_cpu(env)))) { *phost = NULL; return TLB_MMIO; } diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 8fbcbf9771..d95b875a6a 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -745,6 +745,10 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, if (guest_addr_valid_untagged(addr)) { int page_flags = page_get_flags(addr); if (page_flags & acc_flag) { + if ((acc_flag == PAGE_READ || acc_flag == PAGE_WRITE) + && cpu_plugin_mem_cbs_enabled(env_cpu(env))) { + return TLB_MMIO; + } return 0; /* success */ } maperr = !(page_flags & PAGE_VALID); @@ -767,7 +771,7 @@ int probe_access_flags(CPUArchState *env, vaddr addr, int size, g_assert(-(addr | TARGET_PAGE_MASK) >= size); flags = probe_access_internal(env, addr, size, access_type, nonfault, ra); - *phost = flags ? NULL : g2h(env_cpu(env), addr); + *phost = (flags & TLB_INVALID_MASK) ? NULL : g2h(env_cpu(env), addr); return flags; } @@ -778,7 +782,7 @@ void *probe_access(CPUArchState *env, vaddr addr, int size, g_assert(-(addr | TARGET_PAGE_MASK) >= size); flags = probe_access_internal(env, addr, size, access_type, false, ra); - g_assert(flags == 0); + g_assert((flags & ~TLB_MMIO) == 0); return size ? g2h(env_cpu(env), addr) : NULL; } diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 0097522470..7c103fc9f7 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -5688,9 +5688,6 @@ void sve_ldN_r(CPUARMState *env, uint64_t *vg, const target_ulong addr, flags = info.page[0].flags | info.page[1].flags; if (unlikely(flags != 0)) { -#ifdef CONFIG_USER_ONLY - g_assert_not_reached(); -#else /* * At least one page includes MMIO. * Any bus operation can fail with cpu_transaction_failed, @@ -5727,7 +5724,6 @@ void sve_ldN_r(CPUARMState *env, uint64_t *vg, const target_ulong addr, memcpy(&env->vfp.zregs[(rd + i) & 31], &scratch[i], reg_max); } return; -#endif } /* The entire operation is in RAM, on valid pages. */ diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 3430fd3cd8..cec1d4b287 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -91,6 +91,14 @@ sha512-vector: sha512.c TESTS += sha512-vector +ifneq ($(CROSS_CC_HAS_SVE),) +sha512-sve: CFLAGS=-O3 -march=armv8.1-a+sve +sha512-sve: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +TESTS += sha512-sve +endif + ifeq ($(HOST_GDB_SUPPORTS_ARCH),y) GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py From patchwork Tue Jun 27 16:09: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: 696883 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867712wrm; Tue, 27 Jun 2023 09:16:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41NxIP5igdw1UN42ERWIlu+y2VJFobqOspqQw8PWFtywQ9m2eeFX987x0mjuJJwdmvN2lB X-Received: by 2002:a05:622a:142:b0:3fd:df8d:b254 with SMTP id v2-20020a05622a014200b003fddf8db254mr37868166qtw.51.1687882601154; Tue, 27 Jun 2023 09:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882601; cv=none; d=google.com; s=arc-20160816; b=KLYEurg5B4oHkIajkjv946FWgZ/Cbn0zguqA2ZPCnnnzcSRZiWUUki9PuW6Bfja3TC Y3oJOaTxjikPJlhTSz7bq4ZLcGXcOt3Dqpw80nJ96SVRWqJn42DBLnjWh/cxXpya0VMw JLp/a/Q1FGQ/2itjY8i51017IE3h+afeBOkmJGTxt0WoW4Og7ofJsfzk+KsoBOUaRFSM aJqXULLkb7LPMNncj6ukTTGmYpwynnUvjGvK17qicraKqxtrMHiMsw2vax8rhrXac4oL ztpUVxPohDYGR+6/637bEXoeXsJi7tpQC6lSB/rK4hZwPE403Ti09mGaTTU5/hrzhtFG 3DKQ== 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=XTGDyBwpOUnJ81QARU+1/OI2J0gTxsiGK9l42g4HfaQ=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=AF7hMqBYlvY7Glb2HEQm5uO6B1VRQX/DFUJgWaDjNzk4O4C5yXjmU0c1kV7R3ng7OC QdyJx26Qk60ZYTpMhv0u4KXj9KYEdZG28RiH75BewHO91QkBz5MtQeT/NTDB8wkKLCkI aoC4sZas8VVfwANDsCqRbo0Xm+9orYa2WxtNrpZvi+Lnt/wrm9DVugNrUxDU9DlQbX+f JabQ///SGhPtgJ/I0PPhVJj2Hz904MCWaShfVNCWJR8jEMofy1RU28bhcf1Iqd/mUG6S mrKw5G+5SKzaD5hfPKBWWGIejPo5QvtaNrcBjPW+EaxuYqea3dxCs8qkjWHMJwxP/Ipa BaTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pCejVcqP; 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 g21-20020ac87d15000000b00400959b9a49si3184472qtb.588.2023.06.27.09.16.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16: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=pCejVcqP; 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 1qEBMR-0001Ku-Nb; Tue, 27 Jun 2023 12:16:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMK-00017Z-OC for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:04 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMB-00089v-Oa for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:04 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-313e09a5b19so23736f8f.0 for ; Tue, 27 Jun 2023 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882554; x=1690474554; 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=XTGDyBwpOUnJ81QARU+1/OI2J0gTxsiGK9l42g4HfaQ=; b=pCejVcqPGQxvYe8n4oFODd6R3PVt1ZZO2lw77skvQoRyC14sfdGyUjWuy3QGGrZmf7 sVx6kNDl8KpPiE2hfEQSETYRXOieevhsUCDHJERYlqsgXj+OZ39XwVA9cHyD7c1pSUKw 6cYhOu8hbeh56m6Bqgojq8d4NusoOnvC0E07pDbgjOGGt4N7swRppKj3yx/NA1FZtflh KHS2szQhKmSmDZRzzobkz+NaH43CusyC3tJZXos2RDqgkQ+S3uj6VU5qr3Y7bAq0Y8T8 30fgQxKTNxWe2F2n7SR+7KVP7F1qUY0LLPvVRN7fmNTgeBn846orY3Ej0JkdnnaRRqSK dhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882554; x=1690474554; 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=XTGDyBwpOUnJ81QARU+1/OI2J0gTxsiGK9l42g4HfaQ=; b=ikzPtnfT6TXnNyre+JHpT/2x38mwRrDTr73bk2UyofhwgAHea+s+DZ2rDqDdVVFNZ3 AmktsZOgs+VEX5wiG5ymncTdVesAsN4Esp8s/c8+QfUOsNVgTmGlIm+cJKItqCYUmR8B QyWLX9LPxqHKdtZ1deFYu7zOtFcu8a1DRCOMGugwOn/iZUv24yXViRJj3bzo7FYnMV/k 2Ew5Jd2wjMTT+2Y5INug8wSNHhLZZmf1g6WM0VreebNRtA73GZwr75fuFmMJWOPWv60v u4EO7AjQpzjJPF63I3I5WKpIIL9GxEWDV+JdIVUC+NMAXcQVXngnyDpCpRtNNjC5LMTt i/OA== X-Gm-Message-State: AC+VfDx8pzkWvvgLL3BOckuTwEhSxhPFOkFQQecUQEmFHYfjXZ7GIl8G lP4rJC3KpJWo3w0ZuUtkT7/7ug== X-Received: by 2002:a05:6000:1206:b0:313:f977:479f with SMTP id e6-20020a056000120600b00313f977479fmr3352329wrx.20.1687882554217; Tue, 27 Jun 2023 09:15:54 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c1-20020a056000104100b0031402a910edsm1501373wrx.86.2023.06.27.09.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2026A1FFCB; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 18/36] plugins: fix memory leak while parsing options Date: Tue, 27 Jun 2023 17:09:25 +0100 Message-Id: <20230627160943.2956928-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 It was hard to track down this leak as it was an internal allocation by glib and the backtraces did not give much away. The autofree was freeing the allocation with g_free() but not taking care of the individual strings. They should have been freed with g_strfreev() instead. Searching the glib source code for the correct string free function led to: G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL) and indeed if you read to the bottom of the documentation page you will find: typedef gchar** GStrv; A typedef alias for gchar**. This is mostly useful when used together with g_auto(). So fix up all the g_autofree g_strsplit case that smugly thought they had de-allocation covered. Reviewed-by: Richard Henderson Message-Id: <20230623122100.1640995-20-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- contrib/plugins/cache.c | 2 +- contrib/plugins/drcov.c | 2 +- contrib/plugins/execlog.c | 2 +- contrib/plugins/hotblocks.c | 2 +- contrib/plugins/hotpages.c | 2 +- contrib/plugins/howvec.c | 2 +- contrib/plugins/hwprofile.c | 2 +- contrib/plugins/lockstep.c | 2 +- tests/plugin/bb.c | 2 +- tests/plugin/insn.c | 2 +- tests/plugin/mem.c | 2 +- tests/plugin/syscall.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 2e25184a7f..5036213f1b 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -772,7 +772,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, for (i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "iblksize") == 0) { l1_iblksize = STRTOLL(tokens[1]); diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c index b4a855adaf..686ae0a537 100644 --- a/contrib/plugins/drcov.c +++ b/contrib/plugins/drcov.c @@ -148,7 +148,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { for (int i = 0; i < argc; i++) { - g_autofree char **tokens = g_strsplit(argv[i], "=", 2); + g_auto(GStrv) tokens = g_strsplit(argv[i], "=", 2); if (g_strcmp0(tokens[0], "filename") == 0) { file_name = g_strdup(tokens[1]); } diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index e255bd21fd..7129d526f8 100644 --- a/contrib/plugins/execlog.c +++ b/contrib/plugins/execlog.c @@ -227,7 +227,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (int i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "ifilter") == 0) { parse_insn_match(tokens[1]); } else if (g_strcmp0(tokens[0], "afilter") == 0) { diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 062200a7a4..6b74d25fea 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -135,7 +135,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, { for (int i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "inline") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) { fprintf(stderr, "boolean argument parsing failed: %s\n", opt); diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index 0d12910af6..8316ae50c7 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -169,7 +169,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, for (i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", -1); + g_auto(GStrv) tokens = g_strsplit(opt, "=", -1); if (g_strcmp0(tokens[0], "sortby") == 0) { if (g_strcmp0(tokens[1], "reads") == 0) { diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 4a5ec3d936..0ed01ea931 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -333,7 +333,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (i = 0; i < argc; i++) { char *p = argv[i]; - g_autofree char **tokens = g_strsplit(p, "=", -1); + g_auto(GStrv) tokens = g_strsplit(p, "=", -1); if (g_strcmp0(tokens[0], "inline") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) { fprintf(stderr, "boolean argument parsing failed: %s\n", p); diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index 691d4edb0c..739ac0c66b 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -263,7 +263,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, for (i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "track") == 0) { if (g_strcmp0(tokens[1], "read") == 0) { diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index a41ffe83fa..e36f0b9562 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -323,7 +323,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (i = 0; i < argc; i++) { char *p = argv[i]; - g_autofree char **tokens = g_strsplit(p, "=", 2); + g_auto(GStrv) tokens = g_strsplit(p, "=", 2); if (g_strcmp0(tokens[0], "verbose") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &verbose)) { diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index 7d470a1011..df50d1fd3b 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -104,7 +104,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "inline") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) { fprintf(stderr, "boolean argument parsing failed: %s\n", opt); diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 9bd6e44f73..5fd3017c2b 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -189,7 +189,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, { for (int i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "inline") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) { fprintf(stderr, "boolean argument parsing failed: %s\n", opt); diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index 4570f7d815..f3b9f696a0 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@ -83,7 +83,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (int i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "haddr") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_haddr)) { diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c index 96040c578f..72e1a5bf90 100644 --- a/tests/plugin/syscall.c +++ b/tests/plugin/syscall.c @@ -121,7 +121,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (int i = 0; i < argc; i++) { char *opt = argv[i]; - g_autofree char **tokens = g_strsplit(opt, "=", 2); + g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "print") == 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_print)) { From patchwork Tue Jun 27 16:09: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: 696892 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868461wrm; Tue, 27 Jun 2023 09:18:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6U91+SwT+pbK0KTOpuJqqkuNycJATkpy7tGo2s/M1ooEYptbPQHwH/UOhWIEzOHbTfxgYF X-Received: by 2002:a05:6214:e6f:b0:631:f1fa:8c04 with SMTP id jz15-20020a0562140e6f00b00631f1fa8c04mr27833438qvb.38.1687882683076; Tue, 27 Jun 2023 09:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882683; cv=none; d=google.com; s=arc-20160816; b=IqGhVSZkfBfqnVqfF44MtdDeOVADFVUSUYG5aJrwn19L9lENUgn3L+Zl6wxM1ieD7W zcehyz4x+UiVzvBCRCpoCflTOycq2Zq34WvFtkvejdcJ24Xv3okRR3m/IGpWSkhrUuVp LV7XA+LQJkd6HgkRBDvY3ZRiDYmol3PxI4pHXZNA7qG6DXs714qMQ0fmeGOpQu0M3I4M R36KtjHUQy5OnZEYlvRs9ILqsYYReXJYj2XI7MaCLM4CRo4a9PQcYG+wnRPz7/zIrVCR i82cwm5zGLjJAq/fekg8/i/SuDjAd/GvCrhUKomJDRZa9zDtzxtmXj7VjasFc7ft0vsg h0BQ== 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=1/YdtjXXo0e3CzVmNtcCXnVaZZ7ekw+aGjDVemCbNnQ=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=dQuAH4JvTCv0aswVh8aI3YUq9fUVEO+vAboSH0PmSy+HRd9IKtpINxjN7r7qLJ+yhC yUzNZ3hS+RkxJx3dO2Mr2MYq8PX4R97ELbiiLs3yDSOmjIqOLCrYGcJjTWIT2ucBDBM4 07X0OHyZBvQ0YSpV+NOVB1s0YdwlNXaf6kpbMEzJ5GRBN/jJXrPefii8RFtFLwPX3lRD EsGqW+BBEerI5KTQEIxUxsWYRm+M5+7TTKRiswBqoSzSUFq4a0+EA9RNIhHZkhZy9MaG PtaSKYGdnrBerV4/YwsLonkKvdR0ezB7BrBxuWDNsPkvCY1Jgd0L48QBbyQtjAmml77I +RdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NMBk7ziG; 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 jx6-20020a0562142b0600b006262e2d2081si3516171qvb.519.2023.06.27.09.18.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NMBk7ziG; 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 1qEBMG-0000zx-6p; Tue, 27 Jun 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 1qEBME-0000y9-1I for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:58 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBM8-00087M-Tk for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:57 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f973035d60so6282343e87.3 for ; Tue, 27 Jun 2023 09:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882549; x=1690474549; 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=1/YdtjXXo0e3CzVmNtcCXnVaZZ7ekw+aGjDVemCbNnQ=; b=NMBk7ziGTqFekAol9iS/ZfDQgdosHXTAj5emIIWYF6BkCrWy282cAY/StBSGAtNcRI w2TpYbbA66jFvWkMHeI8JcsP4iDy+yi7QKnhILoVcDEdqaoZ4GTOmUHwh4rd06165+PX BwE695mYIq07uU8oP6tTfaeVw9TSGh/OSfRXp1YrIFD2M2sA4FM0T+Sb3D95V9pNeIYv wYUV7AgyaAnW5N94fG+r577zQXGk7ufWd9iMcUspKkFLQV58o2DHXLVacBf7Z5dFfBkd 8Ce8g3+w8LduqDxhRbFWQzMHmGcsRpEOfvFhgh+OH3eNej5azu4/xrMN0+HeUZROxU7f /sKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882549; x=1690474549; 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=1/YdtjXXo0e3CzVmNtcCXnVaZZ7ekw+aGjDVemCbNnQ=; b=J09s2hI3Ao7w3ZjZVywIqehUfLuxTIah/6TdwICSIAdFi1SxBu9W+XCWqN9SbVz9vg U4j6lZqmd6Zf/utY9eoL/kL3fv3lCitJvlE2i0OxONQGKmZM0XKrqYomtKmWpikTWGfX aPGrWW17fb3EYWHOR49p+voKvj8DoZdnk5G2WjbdwtsyU1ZHP6t/HYysUjvbEg30/h6r BOB0nuQuGTURAE9noDRb8+/fOuOh+5B2cwXbrVHuk3HGlQQEgb7CLBn4mledbwwVn+ZB nMYu2nagMhSfoVPUDPsPswtj6z5FI5FLuQhBa82r2IT8yXxCcgkxxxBmtwP9cPcOQrEv hSDQ== X-Gm-Message-State: AC+VfDxMRhqfv+omq+jx5277u7cfdUvmGrcNdTCsgfvDugtHF2HWIK9z OAOvpXprZosXYjPBpFJQZTq2Qg== X-Received: by 2002:a05:6512:3b0b:b0:4fb:81f2:4228 with SMTP id f11-20020a0565123b0b00b004fb81f24228mr2704299lfv.31.1687882549560; Tue, 27 Jun 2023 09:15:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a10-20020a05600c224a00b003faef96ee78sm5067377wmm.33.2023.06.27.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3A7141FFCD; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 19/36] plugins: update lockstep to use g_memdup2 Date: Tue, 27 Jun 2023 17:09:26 +0100 Message-Id: <20230627160943.2956928-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 The old g_memdup is deprecated, use the replacement. Message-Id: <20230623122100.1640995-21-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- contrib/plugins/lockstep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index e36f0b9562..3614c3564c 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -130,7 +130,7 @@ static void report_divergance(ExecState *us, ExecState *them) } } divergence_log = g_slist_prepend(divergence_log, - g_memdup(&divrec, sizeof(divrec))); + g_memdup2(&divrec, sizeof(divrec))); /* Output short log entry of going out of sync... */ if (verbose || divrec.distance == 1 || diverged) { From patchwork Tue Jun 27 16:09: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: 696886 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867870wrm; Tue, 27 Jun 2023 09:17:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7D0MFgks/j69gwcNmvUt7J+h5wa4YN4/of6KVVomhLqw+nzuYOWkqgRYBUqGPQYaCqzmni X-Received: by 2002:a05:620a:290a:b0:765:4c5c:5185 with SMTP id m10-20020a05620a290a00b007654c5c5185mr16745627qkp.78.1687882621729; Tue, 27 Jun 2023 09:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882621; cv=none; d=google.com; s=arc-20160816; b=T1/LyfeVqUXRuBOqEeSh2jxxJYVhSoLY796+57rE8EpIjzlI2ifAUi+XzmX4zSIhKh kCaRRqzS2JyUnT1psRTskDsgk8uqfE7UW+MD0pnQIF6nF+CXANOrBgrd638xflS1WKYe J5LV6GiMQTAhU6ypxcZAolhIl5U/5z0uwS5lC6LmdFnpbf9oJxQFV+YpoNavNIKW7VcS Zku69w6l2Xl55EtaBnYWGlmQYlZmDRcIpHP7AcSHHK9pAgYf4r0CEr6GDl3EoTvsuAV2 JixE9ve89dSqMaLfXAdEqKV0vEBtQgLSeF9/6ohsSTi/rPYm2Hka15oV3WxY0mu0+W9V pGaw== 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=o2j+D2PwWEutlmPyNeR3NDR8AmnsEBx5K3Su+X1Sj40=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=b+St/Ap4NuHFRylwokzSdW/wV6CDYFcapYnZKJQBoSVisVnc7Z2MoCtLfh8lTLU7HF WWtWx/KCwLX4/PngEl8EMJ8JSPfV5UGEmnGP+Y+YEDpxKfM90CKU3n1i5sIjIJJDvImB SMSk2xq54GgMgQjjQ1S4Xf6/5KUD0V4jyKpmRehSf69b0UyiSElc4WOQaOmrDhHVNRfe a9Tdgu5gmOcTytQw6O7xgrVxENsKvwfC6mmpIFKsOlC4Yz6Q05zXNtsuZyXWccKszU4j pAEI/Jg+qOl3iHQNE/Ok7DdoIbdXu24hNVfB5yVpOJZj07asw3v5jn/rcHUSjVB/qxTF YD+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZJ8eRjev; 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 k19-20020a05620a415300b0076704ce8da4si1343184qko.323.2023.06.27.09.17.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZJ8eRjev; 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 1qEBMH-00012A-OH; Tue, 27 Jun 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 1qEBMF-0000zG-LG for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-000875-Gr for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fa99f6a4a1so23990345e9.3 for ; Tue, 27 Jun 2023 09:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882549; x=1690474549; 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=o2j+D2PwWEutlmPyNeR3NDR8AmnsEBx5K3Su+X1Sj40=; b=ZJ8eRjevcYv2JS00nU0r4e6yJLCfvoajGbqg/DIDLDO3mGcm8Hs10nhplmmZOi5424 kYhvdga1lM8nl2IMqjbjoA1EkZP4auTXKvYv64JsFXcL74Of0sS8nKxieQqgVk16fpmV sh9DkYQwSKZBnhwgiPlVsuD2mwttTIUKeXKxacbDELdPUWDCupS02PGQfn/JRmj6DuF/ 09LKyxE6qsE4rXl5h5sdoYi5Xynq4iG9Y7F8vcuJQAUIzzkVpU18HDN0erZKbdIcw80x p3FqEr2C+jzvX+I/hhSu2tomCTx6hiFkSo34BVJ8XvlHz2vk4w+bDe0dszW662BeXgUI 2q4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882549; x=1690474549; 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=o2j+D2PwWEutlmPyNeR3NDR8AmnsEBx5K3Su+X1Sj40=; b=QqXPob8a30e7YYbNePBic9Bu2v9duLpgXDSLMHfP2K7R4BVQYP4jFdPxe3wgPOuwWc B1t/jkmffk0ieS5Zxkf5pT8LmiKlC0ewdfbZAlppAqfTmXvmBmqr3O3QmBKUshBGtlEq 0B/Hz27m+CwNOUWE651vVVyNXSC7hGfK3YUBpDK8701ndh1EE/BmTFK738ywlaDZvWC8 H3JfjNrXabM0UHgHKJzCNkTu/l8+ayaM2LfA5T9o38V6ujFizOBBeqo5IOMAVbjcIYV0 Y20BRVtIwDWvOuwO68fioHEjsdXM5TF9/tGds3fxXTQPhTR3/sy1gfZSfBLHL13+olyG ugjw== X-Gm-Message-State: AC+VfDx5Jy1J4tmdgpB+TduytTpqzezHjPJsaRdlF9wolupsFXtVLG5Z X8d3A16+7Yebv4jBI35RGp2hRQ== X-Received: by 2002:adf:ee51:0:b0:311:13a7:2d87 with SMTP id w17-20020adfee51000000b0031113a72d87mr29879739wro.66.1687882549148; Tue, 27 Jun 2023 09:15:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s4-20020adfea84000000b002ca864b807csm11119526wrm.0.2023.06.27.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5B0DA1FFCE; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 20/36] docs/devel: add some front matter to the devel index Date: Tue, 27 Jun 2023 17:09:27 +0100 Message-Id: <20230627160943.2956928-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Give an overview of the most useful bits of the devel documentation to read depending on what the developer wants to do. Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230623122100.1640995-22-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- v2 - removed excessive start --- docs/devel/index-process.rst | 2 ++ docs/devel/index-tcg.rst | 2 ++ docs/devel/index.rst | 24 ++++++++++++++++++++++-- docs/devel/tcg.rst | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/devel/index-process.rst b/docs/devel/index-process.rst index d50dd74c3e..362f97ee30 100644 --- a/docs/devel/index-process.rst +++ b/docs/devel/index-process.rst @@ -1,3 +1,5 @@ +.. _development_process: + QEMU Community Processes ------------------------ diff --git a/docs/devel/index-tcg.rst b/docs/devel/index-tcg.rst index b44ff8b5a4..a992844e5c 100644 --- a/docs/devel/index-tcg.rst +++ b/docs/devel/index-tcg.rst @@ -1,3 +1,5 @@ +.. _tcg: + TCG Emulation ------------- diff --git a/docs/devel/index.rst b/docs/devel/index.rst index 09cfb322be..abf60457c2 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -2,10 +2,30 @@ Developer Information --------------------- -This section of the manual documents various parts of the internals of QEMU. -You only need to read it if you are interested in reading or +This section of the manual documents various parts of the internals of +QEMU. You only need to read it if you are interested in reading or modifying QEMU's source code. +QEMU is a large and mature project with a number of complex subsystems +that can be overwhelming to understand. The development documentation +is not comprehensive but hopefully presents enough to get you started. +If there are areas that are unclear please reach out either via the +IRC channel or mailing list and hopefully we can improve the +documentation for future developers. + +All developers will want to familiarise themselves with +:ref:`development_process` and how the community interacts. Please pay +particular attention to the :ref:`coding-style` and +:ref:`submitting-a-patch` sections to avoid common pitfalls. + +If you wish to implement a new hardware model you will want to read +through the :ref:`qom` documentation to understand how QEMU's object +model works. + +Those wishing to enhance or add new CPU emulation capabilities will +want to read our :ref:`tcg` documentation, especially the overview of +the :ref:`tcg_internals`. + .. toctree:: :maxdepth: 1 diff --git a/docs/devel/tcg.rst b/docs/devel/tcg.rst index b4096a17df..2786f2f679 100644 --- a/docs/devel/tcg.rst +++ b/docs/devel/tcg.rst @@ -1,3 +1,5 @@ +.. _tcg_internals: + ==================== Translator Internals ==================== From patchwork Tue Jun 27 16:09: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: 696893 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868489wrm; Tue, 27 Jun 2023 09:18:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7A4PEIiKytvUmxdzo5n+78PYJZepYp1kLmB6hHHYCHnPPOIyMon4jv9zBmT39Kx4wZM6/M X-Received: by 2002:ac8:7d91:0:b0:400:8781:78a5 with SMTP id c17-20020ac87d91000000b00400878178a5mr13975633qtd.3.1687882685620; Tue, 27 Jun 2023 09:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882685; cv=none; d=google.com; s=arc-20160816; b=PL1G/BN/r8KuJJpcr6NRhNUGgBA6dVMHQtCzCEi+hYfJY3gMVu6RUzWjetUSCioLEY EZTyvTgSij5IcFfqV/sFraW7E6P4UyeIxvGrfRweuQ84318OdL4TDmSbUcNF6Kn8ui7k nACA6qLxD9rXywa9U0DrhYptjIaMccwgUoojnEv63kGizvmbBwgvw7elYDsTx2L3jB37 dk52a/hg1SAajr4To5gjj5zuIQ30K2uqJ7dfM5f3FV4lYrabwZ3pOqtDJliGpjMbQgrS 8qG3vnS1wFx9pcBfCSQRJFaeGFTTqKJrHphrKuAE5creuhSdNfKJPybTbZdd1+hXvEWf x9YA== 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=SZAOTeGGrKkzwQAvWZdxb45rty8GpJ035mBrUTHulE4=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=X25c9GdnCiwD5CBw5mdktaTKI1gLpjmqn25DkiJQ99ee9ADn3bEv7bEPEOcRI+M2B2 sQnUJwrIi61D5/4QsoFgUK1h8m8ex0RnXRFvRG3VRoYjJNskHzO8B3ckz//BfgvOnnVf zZlKqQSDJVfTXAwPjI/xl/DntgV/LH4cqcVsxk9wr8lxECvky5M0N0ZhaFtkGLwwEc4V qoxV3jaEofLr3NBD4EebjIHlNULbGzl152TEaKftTOuBIiKO8BV6o+cXtA9mbQ3mAlJk 4IDEHxGyIV1Jf2WwZVfZ79yYzRc0mlq6qnrjfoc9XDI2vQzOToZkEoOBvCrWWCnlLZrb DzhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W/lOWDTR"; 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 x2-20020a05622a000200b003e9f7aec3afsi1011622qtw.291.2023.06.27.09.18.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:18:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W/lOWDTR"; 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 1qEBMR-0001Ez-2f; Tue, 27 Jun 2023 12:16:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMM-0001BB-U3 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:06 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMC-0008AL-Rr for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:06 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fa8cd4a113so26733435e9.2 for ; Tue, 27 Jun 2023 09:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882555; x=1690474555; 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=SZAOTeGGrKkzwQAvWZdxb45rty8GpJ035mBrUTHulE4=; b=W/lOWDTR0Dz0qqO6kVc6rJyLGlUlJ4USiuOjkMXtjP8A+I2WoIq7eUgZm34pAkHFIc nza6zBCTf9K6eapcd3ijJ2AGPEIKxJV2E1DHClx5GQ+Gsb7RVM9Z3XIb5J74sWSTIdXO B0W54qk3boxwnFMXy+agcAhAkPLOtkb80jp0XEI5jlyz20tID097S2kzZb3Rwfd8PLK/ 5exjB5+fpZybcLdqHKnKNdISdaSuuIGczypVLks7UaY8ZLSL45kvMKU+HZYdkx4Wfb5g 1Js8D7zRDNvIrEFR5mxHM5Q7H7mHmxjaaqQzHStLPfwy4GSLlGcLZBzwpTXcfixsyaGC CpSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882555; x=1690474555; 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=SZAOTeGGrKkzwQAvWZdxb45rty8GpJ035mBrUTHulE4=; b=aevanKcdRyiP9zBCmZAZqmNDu3VtIi4DmMGTjbyXKT0nF61WDPiamBdYxM5T0TrpEL HsbBkhdg9yobSN1nVIFAVtvbCKw2JCRqcc6sQOTJZse8rCigeBS3BG0kKVU4JHLA9OPz mVz070Jm4IuH5lJJLGZS0RFWqT56pd0zi/KaP7YF/VFmM5M6gGzzJrhzJz2KoIUOnBH9 jxNZUjtAvcbWtOuUsy76ydC0tL/1NQyl+uGlOlFoYyJgFk5dYHCyEh0njoJVS4ioz1vT 9y9Fp+RnIwEICilICvJqTjBbVkn/WKMW4TNddAeuT/zKl17bq48CG0lwlkZr3gmAAXkd Fa9g== X-Gm-Message-State: AC+VfDw3CErr//tJB94mLuDOwzuvp7KWgAutizy7wOPBBSUIqehcAv3F 5hDbmO0aVNbZAbTCp3yIUrVr/w== X-Received: by 2002:a05:600c:230b:b0:3fa:8874:fe69 with SMTP id 11-20020a05600c230b00b003fa8874fe69mr5892547wmo.29.1687882555030; Tue, 27 Jun 2023 09:15:55 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f90a604885sm11275804wma.34.2023.06.27.09.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 732AB1FFC0; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 21/36] include/migration: mark vmstate_register() as a legacy function Date: Tue, 27 Jun 2023 17:09:28 +0100 Message-Id: <20230627160943.2956928-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Mention that QOM-ified devices already have support for registering the description. Reviewed-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Peter Xu Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-3-alex.bennee@linaro.org> --- v3 - checkpatch cleanups --- include/migration/vmstate.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 084f5e784a..d1b8abe08d 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -1209,7 +1209,15 @@ int vmstate_register_with_alias_id(VMStateIf *obj, uint32_t instance_id, int required_for_version, Error **errp); -/* Returns: 0 on success, -1 on failure */ +/** + * vmstate_register() - legacy function to register state + * serialisation description + * + * New code shouldn't be using this function as QOM-ified devices have + * dc->vmsd to store the serialisation description. + * + * Returns: 0 on success, -1 on failure + */ static inline int vmstate_register(VMStateIf *obj, int instance_id, const VMStateDescription *vmsd, void *opaque) From patchwork Tue Jun 27 16:09:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696880 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867379wrm; Tue, 27 Jun 2023 09:16:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Ebwtdinh3Vn0vMD/W82fOWNsphQtrDui0WgbuvugNmugABuvHTWjXJapgeTQKQaioitEE X-Received: by 2002:a05:620a:84c3:b0:763:9e42:6bf7 with SMTP id pq3-20020a05620a84c300b007639e426bf7mr23535284qkn.66.1687882571643; Tue, 27 Jun 2023 09:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882571; cv=none; d=google.com; s=arc-20160816; b=i42C7ZBwKVLiTfn55uLeOGfkQkKFK/uVP+prUVSVgys/nA+oWO0VKCfoI+TQAIBxzC yOYjLlBoQpmji3RefH+QBGOwwgNrHoYNe7Z1jOio3HeCiq7uvFeZb9A2ltxy49eZ92vJ gUy2QPKNGGd7zyWRxSUiA5P9DrpEj++UxD4W3Mw3b0uI3/lBUGPE1oYzpFCVSF9zbOz0 F5JwfHkZ6A+jiIVLEF27EGM0+S/BGDeQhMA23FF1KvCt+mmADtHzdiddM5dqE9S1GNaN UnSExOGnxGs7/Ripu7Nmcg+LagZaiINwX+BQGH+eni9azrpfuWRTswJmHlrsyel1scyy u32w== 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=e4ci5VE+k1gGIJE6LmmjZ/ph4n9gVg3oZR4Aey8XFSs=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=zKIGi1JYR3CPay0/FvYlBTwCiQmqMDHBdITkYY44Zj8gAjoJCmHvxq/sivzuXu5r1d c7wXY02d0WAUy1pRElPkqtO9SbjkdLlaysJFP6T9m7Q3Uqkf5/BsTgJcK6y/2SO9g6ER KfFa379GQ8oPlpiI2HuuuLRHhLO/ds9lOZ2kmdki+sJ7vj2BgXINYTrc7dJbZLPW4Xbn GaOaz9Inc7gp8zvTZuayC/OQULVzvLJ+joA1vrhVG+oLyBDNdKBEzwOmozJrAska09ZO vOfjOWlGTEPa61dIiiixiIB+Q8cqRYqcmeRTDdNB1goa6C6gzoGCv1+WVoWJOgL2LXHZ EpjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XkEzaguo; 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 bl21-20020a05620a1a9500b007653b11f139si3499635qkb.350.2023.06.27.09.16.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:11 -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=XkEzaguo; 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 1qEBMF-0000zC-Ny; Tue, 27 Jun 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 1qEBMD-0000xw-G7 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:57 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBM7-000877-4f for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:57 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fba9daf043so5606675e9.1 for ; Tue, 27 Jun 2023 09:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882549; x=1690474549; 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=e4ci5VE+k1gGIJE6LmmjZ/ph4n9gVg3oZR4Aey8XFSs=; b=XkEzaguorrSddSTVJnXO5+U2kD2x6oBkwBvupyQZScS07eXwG4JTG3kg7HlnjkzqiX QTOz6Es3kaxH/ssrICwtYeQpYZ1+GH/Tz6Xe019qkVysP4MTxvMSAEQezb9OP5oXzqzR iAkz7PpEn2iS+L0QbPKUSdRpoeVSIMWqYLYw9lNBQw7OyqrLo2jKPtwNNlXx03KWUn4i Rbz6yshw2+DBNwmLrqI5RNMqIRxnH3NOUuTzi1T31+L99bvWmkECBZxQeJQ+aCsBY9c+ D+vVZ6QUMB99uJxEKtCXmjNLgIrorDOyGfN0SHvHRDlTluQHxCF3AlC6C1KkHosAuZL1 mYnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882549; x=1690474549; 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=e4ci5VE+k1gGIJE6LmmjZ/ph4n9gVg3oZR4Aey8XFSs=; b=HgWR2CUiQqeVm4N7P5W1zGiUHSRjhUo6FHndCfGXFb8wgjnsjWavqABLzeEY+nZJKd 8Ml0DsBHGjkzJvtWG2tIUqqXXnbC0fQdfuHaY/M2ZzTEWPDdiQMRSRFXa6pHLZdA3mkD F/zZxZqj9YvKYfpyu3AuIp1YT8O0j6vWHee5hkx+RMxiPuXviQO21oU43PUJMAxzRzE2 LoZ2BkegkoxeKwfBITJ1pVWD6HVpB21CaJkKlaTxOOYiXnKtnzeO9WdFcT+iQvzBX6Xi /nfBSbfWcGqT1PBDWUk1L48A3zNrRpnJQd+erluzFpmoEe5a/JOOAGSPaFWpdxooDxn9 QeCA== X-Gm-Message-State: AC+VfDwvVow0OuQEg0c2WNZbrBRqSM9Pz7gyFSMdj1OFGumx3WgzkGCF 7kn6Ri2vq2p7WmJGtsJBjDer5w== X-Received: by 2002:a05:600c:231a:b0:3f9:b430:199b with SMTP id 26-20020a05600c231a00b003f9b430199bmr19322052wmo.15.1687882548949; Tue, 27 Jun 2023 09:15:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i6-20020adffc06000000b00313e421c620sm9996187wrr.54.2023.06.27.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 90F841FFCF; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 22/36] include/hw/qdev-core: fixup kerneldoc annotations Date: Tue, 27 Jun 2023 17:09:29 +0100 Message-Id: <20230627160943.2956928-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Fix up the kerneldoc markup and start documenting the various fields in QDEV related structures. This involved: - moving overall description to a DOC: comment at top - fixing various markup issues for types and structures - adding missing Return: statements - adding some typedefs to hide QLIST macros in headers Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- v3 - checkpatch cleanups --- include/hw/qdev-core.h | 367 ++++++++++++++++++++++++++++------------- 1 file changed, 253 insertions(+), 114 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index f1070d6dc7..102e226d90 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -10,6 +10,65 @@ #include "hw/hotplug.h" #include "hw/resettable.h" +/** + * DOC: The QEMU Device API + * + * All modern devices should represented as a derived QOM class of + * TYPE_DEVICE. The device API introduces the additional methods of + * @realize and @unrealize to represent additional stages in a device + * objects life cycle. + * + * Realization + * ----------- + * + * Devices are constructed in two stages: + * + * 1) object instantiation via object_initialize() and + * 2) device realization via the #DeviceState.realized property + * + * The former may not fail (and must not abort or exit, since it is called + * during device introspection already), and the latter may return error + * information to the caller and must be re-entrant. + * Trivial field initializations should go into #TypeInfo.instance_init. + * Operations depending on @props static properties should go into @realize. + * After successful realization, setting static properties will fail. + * + * As an interim step, the #DeviceState.realized property can also be + * set with qdev_realize(). In the future, devices will propagate this + * state change to their children and along busses they expose. The + * point in time will be deferred to machine creation, so that values + * set in @realize will not be introspectable beforehand. Therefore + * devices must not create children during @realize; they should + * initialize them via object_initialize() in their own + * #TypeInfo.instance_init and forward the realization events + * appropriately. + * + * Any type may override the @realize and/or @unrealize callbacks but needs + * to call the parent type's implementation if keeping their functionality + * is desired. Refer to QOM documentation for further discussion and examples. + * + * .. note:: + * Since TYPE_DEVICE doesn't implement @realize and @unrealize, types + * derived directly from it need not call their parent's @realize and + * @unrealize. For other types consult the documentation and + * implementation of the respective parent types. + * + * Hiding a device + * --------------- + * + * To hide a device, a DeviceListener function hide_device() needs to + * be registered. It can be used to defer adding a device and + * therefore hide it from the guest. The handler registering to this + * DeviceListener can save the QOpts passed to it for re-using it + * later. It must return if it wants the device to be hidden or + * visible. When the handler function decides the device shall be + * visible it will be added with qdev_device_add() and realized as any + * other device. Otherwise qdev_device_add() will return early without + * adding the device. The guest will not see a "hidden" device until + * it was marked visible and qdev_device_add called again. + * + */ + enum { DEV_NVECTORS_UNSPECIFIED = -1, }; @@ -38,7 +97,7 @@ typedef void (*BusRealize)(BusState *bus, Error **errp); typedef void (*BusUnrealize)(BusState *bus); /** - * DeviceClass: + * struct DeviceClass - The base class for all devices. * @props: Properties accessing state fields. * @realize: Callback function invoked when the #DeviceState:realized * property is changed to %true. @@ -47,72 +106,36 @@ typedef void (*BusUnrealize)(BusState *bus); * @hotpluggable: indicates if #DeviceClass is hotpluggable, available * as readonly "hotpluggable" property of #DeviceState instance * - * # Realization # - * Devices are constructed in two stages, - * 1) object instantiation via object_initialize() and - * 2) device realization via #DeviceState:realized property. - * The former may not fail (and must not abort or exit, since it is called - * during device introspection already), and the latter may return error - * information to the caller and must be re-entrant. - * Trivial field initializations should go into #TypeInfo.instance_init. - * Operations depending on @props static properties should go into @realize. - * After successful realization, setting static properties will fail. - * - * As an interim step, the #DeviceState:realized property can also be - * set with qdev_realize(). - * In the future, devices will propagate this state change to their children - * and along busses they expose. - * The point in time will be deferred to machine creation, so that values - * set in @realize will not be introspectable beforehand. Therefore devices - * must not create children during @realize; they should initialize them via - * object_initialize() in their own #TypeInfo.instance_init and forward the - * realization events appropriately. - * - * Any type may override the @realize and/or @unrealize callbacks but needs - * to call the parent type's implementation if keeping their functionality - * is desired. Refer to QOM documentation for further discussion and examples. - * - * - * - * Since TYPE_DEVICE doesn't implement @realize and @unrealize, types - * derived directly from it need not call their parent's @realize and - * @unrealize. - * For other types consult the documentation and implementation of the - * respective parent types. - * - * - * - * # Hiding a device # - * To hide a device, a DeviceListener function hide_device() needs to - * be registered. - * It can be used to defer adding a device and therefore hide it from - * the guest. The handler registering to this DeviceListener can save - * the QOpts passed to it for re-using it later. It must return if it - * wants the device to be hidden or visible. When the handler function - * decides the device shall be visible it will be added with - * qdev_device_add() and realized as any other device. Otherwise - * qdev_device_add() will return early without adding the device. The - * guest will not see a "hidden" device until it was marked visible - * and qdev_device_add called again. - * */ struct DeviceClass { - /*< private >*/ + /* private: */ ObjectClass parent_class; - /*< public >*/ + /* public: */ + /** + * @categories: device categories device belongs to + */ DECLARE_BITMAP(categories, DEVICE_CATEGORY_MAX); + /** + * @fw_name: name used to identify device to firmware interfaces + */ const char *fw_name; + /** + * @desc: human readable description of device + */ const char *desc; - /* - * The underscore at the end ensures a compile-time error if someone - * assigns to dc->props instead of using device_class_set_props. + /** + * @props_: properties associated with device, should only be + * assigned by using device_class_set_props(). The underscore + * ensures a compile-time error if someone attempts to assign + * dc->props directly. */ Property *props_; - /* - * Can this device be instantiated with -device / device_add? + /** + * @user_creatable: Can user instantiate with -device / device_add? + * * All devices should support instantiation with device_add, and * this flag should not exist. But we're not there, yet. Some * devices fail to instantiate with cryptic error messages. @@ -120,25 +143,35 @@ struct DeviceClass { * behavior would be cruel; clearing this flag will protect them. * It should never be cleared without a comment explaining why it * is cleared. + * * TODO remove once we're there */ bool user_creatable; bool hotpluggable; /* callbacks */ - /* - * Reset method here is deprecated and replaced by methods in the - * resettable class interface to implement a multi-phase reset. + /** + * @reset: deprecated device reset method pointer + * + * Modern code should use the ResettableClass interface to + * implement a multi-phase reset. + * * TODO: remove once every reset callback is unused */ DeviceReset reset; DeviceRealize realize; DeviceUnrealize unrealize; - /* device state */ + /** + * @vmsd: device state serialisation description for + * migration/save/restore + */ const VMStateDescription *vmsd; - /* Private to qdev / bus. */ + /** + * @bus_type: bus type + * private: to qdev / bus. + */ const char *bus_type; }; @@ -167,37 +200,96 @@ typedef struct { bool engaged_in_io; } MemReentrancyGuard; + +typedef QLIST_HEAD(, NamedGPIOList) NamedGPIOListHead; +typedef QLIST_HEAD(, NamedClockList) NamedClockListHead; +typedef QLIST_HEAD(, BusState) BusStateHead; + /** - * DeviceState: - * @reset: ResettableState for the device; handled by Resettable interface. + * struct DeviceState - common device state, accessed with qdev helpers * * This structure should not be accessed directly. We declare it here * so that it can be embedded in individual device state structures. */ struct DeviceState { - /*< private >*/ + /* private: */ Object parent_obj; - /*< public >*/ + /* public: */ + /** + * @id: global device id + */ char *id; + /** + * @canonical_path: canonical path of realized device in the QOM tree + */ char *canonical_path; + /** + * @realized: has device been realized? + */ bool realized; + /** + * @pending_deleted_event: track pending deletion events during unplug + */ bool pending_deleted_event; + /** + * @pending_deleted_expires_ms: optional timeout for deletion events + */ int64_t pending_deleted_expires_ms; + /** + * @opts: QDict of options for the device + */ QDict *opts; + /** + * @hotplugged: was device added after PHASE_MACHINE_READY? + */ int hotplugged; + /** + * @allow_unplug_during_migration: can device be unplugged during migration + */ bool allow_unplug_during_migration; + /** + * @parent_bus: bus this device belongs to + */ BusState *parent_bus; - QLIST_HEAD(, NamedGPIOList) gpios; - QLIST_HEAD(, NamedClockList) clocks; - QLIST_HEAD(, BusState) child_bus; + /** + * @gpios: QLIST of named GPIOs the device provides. + */ + NamedGPIOListHead gpios; + /** + * @clocks: QLIST of named clocks the device provides. + */ + NamedClockListHead clocks; + /** + * @child_bus: QLIST of child buses + */ + BusStateHead child_bus; + /** + * @num_child_bus: number of @child_bus entries + */ int num_child_bus; + /** + * @instance_id_alias: device alias for handling legacy migration setups + */ int instance_id_alias; + /** + * @alias_required_for_version: indicates @instance_id_alias is + * needed for migration + */ int alias_required_for_version; + /** + * @reset: ResettableState for the device; handled by Resettable interface. + */ ResettableState reset; + /** + * @unplug_blockers: list of reasons to block unplugging of device + */ GSList *unplug_blockers; - - /* Is the device currently in mmio/pio/dma? Used to prevent re-entrancy */ + /** + * @mem_reentrancy_guard: Is the device currently in mmio/pio/dma? + * + * Used to prevent re-entrancy confusing things. + */ MemReentrancyGuard mem_reentrancy_guard; }; @@ -264,13 +356,24 @@ typedef struct BusChild { #define QDEV_HOTPLUG_HANDLER_PROPERTY "hotplug-handler" +typedef QTAILQ_HEAD(, BusChild) BusChildHead; +typedef QLIST_ENTRY(BusState) BusStateEntry; + /** - * BusState: + * struct BusState: + * @obj: parent object + * @parent: parent Device + * @name: name of bus * @hotplug_handler: link to a hotplug handler associated with bus. - * @reset: ResettableState for the bus; handled by Resettable interface. + * @max_index: max number of child buses + * @realized: is the bus itself realized? + * @full: is the bus full? + * @num_children: current number of child buses */ struct BusState { + /* private: */ Object obj; + /* public: */ DeviceState *parent; char *name; HotplugHandler *hotplug_handler; @@ -279,18 +382,24 @@ struct BusState { bool full; int num_children; - /* - * children is a RCU QTAILQ, thus readers must use RCU to access it, - * and writers must hold the big qemu lock + /** + * @children: an RCU protected QTAILQ, thus readers must use RCU + * to access it, and writers must hold the big qemu lock + */ + BusChildHead children; + /** + * @sibling: next bus + */ + BusStateEntry sibling; + /** + * @reset: ResettableState for the bus; handled by Resettable interface. */ - - QTAILQ_HEAD(, BusChild) children; - QLIST_ENTRY(BusState) sibling; ResettableState reset; }; /** - * GlobalProperty: + * typedef GlobalProperty - a global property type + * * @used: Set to true if property was used when initializing a device. * @optional: If set to true, GlobalProperty will be skipped without errors * if the property doesn't exist. @@ -324,7 +433,8 @@ compat_props_add(GPtrArray *arr, * This only allocates the memory and initializes the device state * structure, ready for the caller to set properties if they wish. * The device still needs to be realized. - * The returned object has a reference count of 1. + * + * Return: a derived DeviceState object with a reference count of 1. */ DeviceState *qdev_new(const char *name); @@ -334,16 +444,18 @@ DeviceState *qdev_new(const char *name); * * This is like qdev_new(), except it returns %NULL when type @name * does not exist, rather than asserting. + * + * Return: a derived DeviceState object with a reference count of 1 or + * NULL if type @name does not exist. */ DeviceState *qdev_try_new(const char *name); /** - * qdev_is_realized: + * qdev_is_realized() - check if device is realized * @dev: The device to check. * - * May be called outside big qemu lock. - * - * Returns: %true% if the device has been fully constructed, %false% otherwise. + * Context: May be called outside big qemu lock. + * Return: true if the device has been fully constructed, false otherwise. */ static inline bool qdev_is_realized(DeviceState *dev) { @@ -361,11 +473,11 @@ static inline bool qdev_is_realized(DeviceState *dev) * @dev must not be plugged into a bus already. * If @bus, plug @dev into @bus. This takes a reference to @dev. * If @dev has no QOM parent, make one up, taking another reference. - * On success, return true. - * On failure, store an error through @errp and return false. * * If you created @dev using qdev_new(), you probably want to use * qdev_realize_and_unref() instead. + * + * Return: true on success, else false setting @errp with error */ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp); @@ -392,6 +504,8 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp); * for the only reference to the child device to be held by the parent * via the child<> property, and so the reference-count-drop done here * would be incorrect. For that use case you want qdev_realize(). + * + * Return: true on success, else false setting @errp with error */ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp); @@ -420,16 +534,16 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev); bool qdev_hotplug_allowed(DeviceState *dev, Error **errp); + /** - * qdev_get_hotplug_handler: Get handler responsible for device wiring - * - * Find HOTPLUG_HANDLER for @dev that provides [pre|un]plug callbacks for it. + * qdev_get_hotplug_handler() - Get handler responsible for device wiring + * @dev: the device we want the HOTPLUG_HANDLER for. * * Note: in case @dev has a parent bus, it will be returned as handler unless * machine handler overrides it. * - * Returns: pointer to object that implements TYPE_HOTPLUG_HANDLER interface - * or NULL if there aren't any. + * Return: pointer to object that implements TYPE_HOTPLUG_HANDLER interface + * or NULL if there aren't any. */ HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev); void qdev_unplug(DeviceState *dev, Error **errp); @@ -459,15 +573,15 @@ void qdev_del_unplug_blocker(DeviceState *dev, Error *reason); * qdev_unplug_blocked: Confirm if a device is blocked from unplug * * @dev: Device to be tested - * @reason: Returns one of the reasons why the device is blocked, - * if any + * @errp: The reasons why the device is blocked, if any * - * Returns: true if device is blocked from unplug, false otherwise + * Returns: true (also setting @errp) if device is blocked from unplug, + * false otherwise */ bool qdev_unplug_blocked(DeviceState *dev, Error **errp); /** - * GpioPolarity: Polarity of a GPIO line + * typedef GpioPolarity - Polarity of a GPIO line * * GPIO lines use either positive (active-high) logic, * or negative (active-low) logic. @@ -499,6 +613,8 @@ typedef enum { * connect another device's output GPIO line to this input. * * For named input GPIO lines, use qdev_get_gpio_in_named(). + * + * Return: qemu_irq corresponding to anonymous input GPIO line */ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n); @@ -516,6 +632,8 @@ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n); * array); this function will assert() if passed an invalid name or index. * * For anonymous input GPIO lines, use qdev_get_gpio_in(). + * + * Return: qemu_irq corresponding to named input GPIO line */ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); @@ -523,7 +641,7 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines * @dev: Device whose GPIO to connect * @n: Number of the anonymous output GPIO line (which must be in range) - * @input_pin: qemu_irq to connect the output line to + * @pin: qemu_irq to connect the output line to * * This function connects an anonymous output GPIO line on a device * up to an arbitrary qemu_irq, so that when the device asserts that @@ -594,6 +712,8 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, * * You probably don't need to use this function -- it is used only * by the platform-bus subsystem. + * + * Return: qemu_irq associated with GPIO or NULL if un-wired. */ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n); @@ -604,14 +724,17 @@ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n); * @name: Name of the output GPIO array * @n: Number of the GPIO line in the array * - * This function is provided only for use by the qtest testing framework - * and is not suitable for use in non-testing parts of QEMU. + * .. note:: + * This function is provided only for use by the qtest testing framework + * and is not suitable for use in non-testing parts of QEMU. * * This function breaks an existing connection of an outbound GPIO * line from @dev, and replaces it with the new qemu_irq @icpt, as if * ``qdev_connect_gpio_out_named(dev, icpt, name, n)`` had been called. * The previously connected qemu_irq is returned, so it can be restored * by a second call to qdev_intercept_gpio_out() if desired. + * + * Return: old disconnected qemu_irq if one existed */ qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt, const char *name, int n); @@ -683,9 +806,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, const char *name, int n); /** - * qdev_init_gpio_in_named_with_opaque: create an array of input GPIO lines - * for the specified device - * + * qdev_init_gpio_in_named_with_opaque() - create an array of input GPIO lines * @dev: Device to create input GPIOs for * @handler: Function to call when GPIO line value is set * @opaque: Opaque data pointer to pass to @handler @@ -698,8 +819,11 @@ void qdev_init_gpio_in_named_with_opaque(DeviceState *dev, const char *name, int n); /** - * qdev_init_gpio_in_named: create an array of input GPIO lines - * for the specified device + * qdev_init_gpio_in_named() - create an array of input GPIO lines + * @dev: device to add array to + * @handler: a &typedef qemu_irq_handler function to call when GPIO is set + * @name: Name of the GPIO input (must be unique for this device) + * @n: Number of GPIO lines in this input set * * Like qdev_init_gpio_in_named_with_opaque(), but the opaque pointer * passed to the handler is @dev (which is the most commonly desired behaviour). @@ -762,14 +886,17 @@ int qdev_walk_children(DeviceState *dev, void *opaque); /** - * device_cold_reset: + * device_cold_reset() - perform a recursive cold reset on a device + * @dev: device to reset. + * * Reset device @dev and perform a recursive processing using the resettable * interface. It triggers a RESET_TYPE_COLD. */ void device_cold_reset(DeviceState *dev); /** - * bus_cold_reset: + * bus_cold_reset() - perform a recursive cold reset on a bus + * @bus: bus to reset * * Reset bus @bus and perform a recursive processing using the resettable * interface. It triggers a RESET_TYPE_COLD. @@ -777,14 +904,18 @@ void device_cold_reset(DeviceState *dev); void bus_cold_reset(BusState *bus); /** - * device_is_in_reset: - * Return true if the device @dev is currently being reset. + * device_is_in_reset() - check device reset state + * @dev: device to check + * + * Return: true if the device @dev is currently being reset. */ bool device_is_in_reset(DeviceState *dev); /** - * bus_is_in_reset: - * Return true if the bus @bus is currently being reset. + * bus_is_in_reset() - check bus reset state + * @bus: bus to check + * + * Return: true if the bus @bus is currently being reset. */ bool bus_is_in_reset(BusState *bus); @@ -797,7 +928,14 @@ char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev); void device_class_set_props(DeviceClass *dc, Property *props); /** - * device_class_set_parent_reset: + * device_class_set_parent_reset() - legacy set device reset handlers + * @dc: device class + * @dev_reset: function pointer to reset handler + * @parent_reset: function pointer to parents reset handler + * + * Modern code should use the ResettableClass interface to + * implement a multi-phase reset instead. + * * TODO: remove the function when DeviceClass's reset method * is not used anymore. */ @@ -871,14 +1009,15 @@ void device_listener_register(DeviceListener *listener); void device_listener_unregister(DeviceListener *listener); /** - * @qdev_should_hide_device: + * qdev_should_hide_device() - check if device should be hidden + * * @opts: options QDict * @from_json: true if @opts entries are typed, false for all strings * @errp: pointer to error object * - * Check if a device should be added. - * When a device is added via qdev_device_add() this will be called, - * and return if the device should be added now or not. + * When a device is added via qdev_device_add() this will be called. + * + * Return: if the device should be added now or not. */ bool qdev_should_hide_device(const QDict *opts, bool from_json, Error **errp); From patchwork Tue Jun 27 16:09:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696879 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867383wrm; Tue, 27 Jun 2023 09:16:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iRIw7MxjTGcaoy58Q/kkDVKitKiiZwoD9UP5aju8aOz/xChENC/kCAHCiX1mdqFbrwwyx X-Received: by 2002:a05:622a:13cc:b0:3f8:58d:713 with SMTP id p12-20020a05622a13cc00b003f8058d0713mr42440247qtk.55.1687882571917; Tue, 27 Jun 2023 09:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882571; cv=none; d=google.com; s=arc-20160816; b=Gj0ooDGBZZMV0uTp+Q8iGVPx1f0U8eVQ2Xn8R4gL54U9kX/7O3twOt2xrPNIAaLeqI Yst+yxK0gA3nN0GG8msogOwvCnpmnC04WeqM/Lg8YzWbtIBZgjI+AzwMCtZg+ZUEMi6L OmRvCGEYtGPNqTLPmVkkPZ7j/DlRo7mQZ8g4bDYiPBgMbFK5WCHI/G3GtG6wAODlz8kf JLX5v68mlrJ25iqArjvuh8u2keraSwLl8lpdPpFTdiJksOky4j6Wto9dHyQJN67xsPwC T+HxNrtkDkP0qHUymT2LwJbYh+AjeOd8WhBF2QOuCkf7CBHAVoosOyrF9nSRnwu15vfA +QLQ== 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=3JC9WCIJtw9nwrfN71qlgt4usYXlUperbuOAmE+qnSw=; fh=WMhh3kaOyRCa0fFxurcMOAC9HykaTC7L5wxz+EPTDYM=; b=bZv67hN5LC+qlcTA9gUwcxXlAgB0PJzTvhJbKmxk/iKrDt6I/je7+Ijj5slSYiBfbW /9CyoygCG2i4NmFR0GUtkQxOw6oU/gWb2zZKqPmlR7Jux1G8QDF2qkbg68x9GfjS38PB S0kiN96OeSOizY3tsRzKITiQUe369crbG/+hLerYzMOXB88QpgqzMjXfdNWio5gxP+1r rsT2sX1rmmWzujWgsACNvysW1Tpl4GPwv7FtDPFmEg9O1u5mtAodxdb7GTZkXCjucVEH 19RsrHLWH3o8QkDR4WAOJs4YoOM5CmnMu9gimJ0Ka3uHaVg4bfgH42whhoJLyfC2Bzz8 cVMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQJnroOa; 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 z10-20020a05622a028a00b003f38c9bd035si3136113qtw.782.2023.06.27.09.16.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:11 -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=cQJnroOa; 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 1qEBMH-000122-Jl; Tue, 27 Jun 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 1qEBME-0000yo-MB for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:58 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-000896-Ga for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:58 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3113dabc549so6452493f8f.1 for ; Tue, 27 Jun 2023 09:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882553; x=1690474553; 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=3JC9WCIJtw9nwrfN71qlgt4usYXlUperbuOAmE+qnSw=; b=cQJnroOavKx8Pi3iD1Ye5zaJPQqpPiCCs9yFwr+io/Tzq1k1aPbKpuG71g7SvrfLjo uE82mjE8RQCXYQA6f3xHuCQCxhvzvKLASsTZx1vN/nOhNHMSP0hK4FzUvDvkkAPChcvk PXoDR4kSYDlUm1HeHkHTT8DeYhRqkOiq5NiIkRg2mvVBcXsTepKg8X+yPUFKbuPaxzJ7 RQmTw3zmErlcG6FTuvpcv9h9GZMuOQkD8+GFHgNkxJENJzdxkpLoPMJ6LFB+2N5Gpqjm kvzV+84L+orzmx2M0AXP9CqSbZrwah7N5aP5WxOMsFXTFcm/VFp+KjcLF/g7h4J6Qpbt HQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882553; x=1690474553; 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=3JC9WCIJtw9nwrfN71qlgt4usYXlUperbuOAmE+qnSw=; b=OYY+jtS1jlsTtCz/XFWQhSUF/Y7NwPUikLea83LixyVbbEN4nTmQ30lXbk4s4OUJSa iQI/uaJiv4aSNPUM89xpdQtGv6iqL9pnCsaTiC7LB6Nb7JNEr0JohW4/3hLB5qJff9VB c8L2z55WIhuKRBmxYFeJvo91YEiunf23FJgXS1AfI/4euttMZil50jV2U6vV5YAtNiYf 8aSzXQg6+A2OdTAlcW4ny9jl84vQz6UjR6AF7onp6plG6Sz095qf5SYmD3Ma90drUGXe QQUuyX1tD1YOSP7pu9PEGjAiuCATzgeflxiik9OcHaYabT30XTYYT4gV/58LubQ4KMBU jkCA== X-Gm-Message-State: AC+VfDwAS1v29LGgkwYQGLkUFc9x99+JqPX8nPCMMFuVBIvfu1ppcZ6x 5zh2G8hKJ9yvtFyk4wa/+4QXGw== X-Received: by 2002:a05:6000:545:b0:313:ef93:9257 with SMTP id b5-20020a056000054500b00313ef939257mr7900702wrf.32.1687882552006; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r11-20020adfce8b000000b00313f3c11512sm5416736wrn.89.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A9AE51FFD0; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , BALATON Zoltan Subject: [PATCH v3 23/36] docs/devel/qom.rst: Correct code style Date: Tue, 27 Jun 2023 17:09:30 +0100 Message-Id: <20230627160943.2956928-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Philippe Mathieu-Daudé Per commit 067109a11c ("docs/devel: mention the spacing requirement for QOM"): For a storage structure the first declaration should always be called “parent_obj” and for a class structure the first member should always be called “parent_class” Adapt the QOM rST document accordingly. Reported-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230622101717.70468-1-philmd@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/qom.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index c9237950d0..2828843058 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -26,7 +26,7 @@ features: typedef DeviceClass MyDeviceClass; typedef struct MyDevice { - DeviceState parent; + DeviceState parent_obj; int reg0, reg1, reg2; } MyDevice; @@ -147,7 +147,7 @@ will also have a wrapper function to call it easily: typedef struct MyDeviceClass { - DeviceClass parent; + DeviceClass parent_class; void (*frobnicate) (MyDevice *obj); } MyDeviceClass; From patchwork Tue Jun 27 16:09:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696891 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868356wrm; Tue, 27 Jun 2023 09:17:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rPgV/sFTD2nFFmCy3EjlrWWnvxJKUc+qLDEWutQaGoYz9nB/9yrcjyYbLDq6TRqgllk3O X-Received: by 2002:a05:6214:528f:b0:62d:ddeb:3789 with SMTP id kj15-20020a056214528f00b0062dddeb3789mr16425218qvb.43.1687882671241; Tue, 27 Jun 2023 09:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882671; cv=none; d=google.com; s=arc-20160816; b=UyYSTYFD/XbF/5qXDja/Id0I1sjrRq8heZDRBb3xR4B58md3E+I8TUJ/zvifQ1D4Ml M9n9cOD/MIz6exPMPDm9bQUuNpyELeyUb4vSnjsjEy3h12K24s0foTnQ8QSMGsbUIJ3x xA/G2l71Ly1atN2V9WOgoL8VA3CcBAqVywhJ69qN5o9D+BP+mj4v9J50EklT99eLBfa8 odsyTn9vgiTbsDkzS7DJ7bs0l0wPshZ6pRllLY8+y7hHa2KCBopnzwBRVRLQpFO/Jzca g0JW2qawUEUxKRAzqkC7QduQaTpBZ/rh6OMCZfslIUp5GFr8YncH1NQr/hOZ+PWkUrvg gsww== 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=MH8q2iOgTUeX14EJZw8vp3pnXPRkiEedRymAvSCpuUo=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=yLQsPfaTU6ba+T7czEU62/+o3JXU8ksXL7Dy2CbTGsd3dyLSdi8efV7inSIQoIVJDn GS4d2WjaHPtxcKOB5ouGSHSf/Q1il0cfMGwig5DVMvR1S7l3fRGOj+GADNwpIJEV6Qye Xi/JA1aksAkbN4fc9KPTAkVXuF3P+Gd0WIRIS7DNWwZ3KKzfk4UVN3EnqF5vixA8/pcv 3iP3N40GrHfWNj2d4ITVtCrDS1N0Fo15WPmCf0aTuLERsUpzzdYL3Jtr0IhgIYfI1mFt +/teWvZMNz01H/+tv877vbER5ag8YYw55s1Pz7W3y9TFSr5JuQNXvLuoej/beGR6/Yfv E1KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DdoZxOLN; 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 z1-20020a056214040100b0062fe9266d13si3458446qvx.439.2023.06.27.09.17.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DdoZxOLN; 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 1qEBMG-00011G-Ug; Tue, 27 Jun 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 1qEBMF-0000z2-Ed for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-000894-Gj for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fa96fd79feso28513345e9.2 for ; Tue, 27 Jun 2023 09:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882553; x=1690474553; 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=MH8q2iOgTUeX14EJZw8vp3pnXPRkiEedRymAvSCpuUo=; b=DdoZxOLN+AvjXoCRjUIs4sxtM6xjeJtnVRAiZaPPV/Af6XT+Ht3QnEGPuV0BPQ3BC3 DCksIEuF/7WM78vkBqJ/lpXOdWc+Gf3xGT84ZjSOP144lEvGDqLuZybzwKgfcfsHgjMs kwe7eTmWGFUAiiZ8Hl6kyRXwBtH6FGSz8yfM9g2MHdmQOtA33Tynkq/7Vsd+U/vlSVK0 cknZz9qFxB4wY8BKaXlAQYD2fgxXKPWP74ygjHKRCx4QvkBDgMZgl/IbsRo83r6jtWGi +f6YCASZhM1lPFuOWMHcoRYzzgvcez1l5duW8Ohraz3lhV3yFLS7mqQmeiFOC+zznouD q9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882553; x=1690474553; 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=MH8q2iOgTUeX14EJZw8vp3pnXPRkiEedRymAvSCpuUo=; b=J5Z/v2BCqPlFb0AKFYos+F5e/9j0rmcwY22WIO98k/7i6yOQS9yYZFNc66a7E3gRPB toCr7Tl3m8RMY+c8zgQLPdIWpxtZkRnd0jGYszd8reXJjdI0uLY/u+98/pCVgBO7zcwS Hy53tCz+rMyFz9FRCUhENsS0Nea39zlmK8vadQCQHOFhH+JnIxeAPl+dNAXATghjD1vS bT/78gAXWZUXpXnHSdrPxsIz6qSkCQyrGbsj/x8+sSAXgtUHvp1f5UMf1H2R26/jWXfm 5VB5wPmepN4h9vJtNC2U3QodPUkZU4zbt7ztShVdvyXyRrYWPdoNovGFMCKX/eu9DvV2 JLZA== X-Gm-Message-State: AC+VfDxKBljCiheBW3wBCIjOoe5HpUVQQUPsMpJYzK/Z51LKBSltji+8 Ku0stsrZQYAjLuqDGZPtSWQmQg== X-Received: by 2002:a1c:791a:0:b0:3fa:76e2:e6d5 with SMTP id l26-20020a1c791a000000b003fa76e2e6d5mr12256709wme.37.1687882552815; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i5-20020a05600c290500b003f9b66a9376sm14234527wmd.42.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C99821FFC1; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 24/36] docs/devel: split qom-api reference into new file Date: Tue, 27 Jun 2023 17:09:31 +0100 Message-Id: <20230627160943.2956928-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Lets try and keep the overview of the sub-system digestible by splitting the core API stuff into a separate file. As QOM and QDEV work together we should also try and enumerate the qdev_ functions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-5-alex.bennee@linaro.org> --- v2 - also include qdev API --- docs/devel/index-api.rst | 2 ++ docs/devel/qdev-api.rst | 7 +++++++ docs/devel/qom-api.rst | 9 +++++++++ docs/devel/qom.rst | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 docs/devel/qdev-api.rst create mode 100644 docs/devel/qom-api.rst diff --git a/docs/devel/index-api.rst b/docs/devel/index-api.rst index 7108821746..539ad29c21 100644 --- a/docs/devel/index-api.rst +++ b/docs/devel/index-api.rst @@ -11,5 +11,7 @@ generated from in-code annotations to function prototypes. loads-stores memory modules + qom-api + qdev-api ui zoned-storage diff --git a/docs/devel/qdev-api.rst b/docs/devel/qdev-api.rst new file mode 100644 index 0000000000..3f35eea025 --- /dev/null +++ b/docs/devel/qdev-api.rst @@ -0,0 +1,7 @@ +.. _qdev-api: + +================================ +QEMU Device (qdev) API Reference +================================ + +.. kernel-doc:: include/hw/qdev-core.h diff --git a/docs/devel/qom-api.rst b/docs/devel/qom-api.rst new file mode 100644 index 0000000000..ed1f17e797 --- /dev/null +++ b/docs/devel/qom-api.rst @@ -0,0 +1,9 @@ +.. _qom-api: + +===================================== +QEMU Object Model (QOM) API Reference +===================================== + +This is the complete API documentation for :ref:`qom`. + +.. kernel-doc:: include/qom/object.h diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 2828843058..c342ce18e3 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -387,4 +387,5 @@ OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: API Reference ------------- -.. kernel-doc:: include/qom/object.h +See the :ref:`QOM API` and :ref:`QDEV API` +documents for the complete API description. From patchwork Tue Jun 27 16:09:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696885 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867769wrm; Tue, 27 Jun 2023 09:16:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+3PMOz69OdvBPZ0JZF0YSsiyjWgf98ioKCGU74ZEggi9CRTY48jq4SxOZ7Sfu4853VX3P X-Received: by 2002:aca:1919:0:b0:3a1:eb15:5ec4 with SMTP id l25-20020aca1919000000b003a1eb155ec4mr4572454oii.42.1687882608072; Tue, 27 Jun 2023 09:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882608; cv=none; d=google.com; s=arc-20160816; b=ME3INXQQQ/XwrKkhDBhKCIv2z37iG7inj+5Em9XkBws7FWQDesGO3c67WOLKIQWrnq SMA15ZuPFwJlvxojEZ+07UW6OuyPlWRLrivExAI+85q7lSXpzW3TPzAyj0yZjZTnl4lQ 0W4Cw4A+T2UYZrHhQ2ZGpCJ3eCw28jSiEwMrJnPkLaOUEwQkpKedHvdHVkLFl24nGrny 8CzzuqqlaQhcrtNuCPvTVNiuLC0D/8ZKLRAtV+3VJwsEjs+K+jIqhv5gncpcSkzx7H6M 4kti7qwQ/MVGIuJmghCQyAATpPsH+895cQc8WHXaZIPBUAS4GlfzbiUUUO0/A3E4+/Eq m1xQ== 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=5iMtZ+QxrIdtSm3RSwhWDx4L6tPX96mwOLg/Wme4Yys=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=RG8NvxqeSZnZP806sYGG9udxQdXBdQtxkr3MGdfSdyZ/FEOfFnHyzyrL6C1j3XKE0f T3z7Xj/Qj/StGq4YI0E8cCATREPj74460+FXxFDCCwGGOY066OCEysiExISJp4oOegga R4G0a2gcLZBV6BUr459M9ethJLvhI6ftsdzKmwr2wm5RNKc1JWcw4wACokNCsLdLYHMG O/mPd/H3iqI/zHdlREs65YOg4q2q260nKkLXe/H+hJQLpExtiujbiYz5wLdH5SfHtdIl 6bMZUXj63ISOmEVVoL4XORF3aYFPJgtJ7NivUJSdVzofY7YiTGLYOqU3NNi9SbxhKWNx I8lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WIwXrl4G; 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 j12-20020ac85f8c000000b003f6b50d68d0si3312478qta.195.2023.06.27.09.16.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WIwXrl4G; 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 1qEBMX-0001Rw-Nh; Tue, 27 Jun 2023 12:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMN-0001Bo-ET for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:07 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMD-0008Ag-2t for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:07 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3113dabc549so6452534f8f.1 for ; Tue, 27 Jun 2023 09:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882555; x=1690474555; 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=5iMtZ+QxrIdtSm3RSwhWDx4L6tPX96mwOLg/Wme4Yys=; b=WIwXrl4Gv7fagv2WaOmuGRYEhm6HA7QHFCHMfzGCh0mFtdxTIXrfMj0XHnfuWGZOlJ zJ4ilcGfqA9guABVs0P5GFfadjybkcpbFTsjQTf360qmX3vuZervAwmkv2oRxr40z1cy YX6cYsC2Djqcwqm2OLPHWJtbSlc8L0ispKCVylVCH/WSW2IanxX07I3G9+8dIu5uPtzx LSd/Xhq6/oq6qmC4VU8U2EvHefqClXTs3r9FHX5DOnnouFhQybYWUILgGSit5JHYX7Xs al2PkEqPwv5owc8veN5RTEgtPtfIjX+uLGq3kgh/6UzzEZfqIfxHdYQYDr+boZXn1ujo BDgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882555; x=1690474555; 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=5iMtZ+QxrIdtSm3RSwhWDx4L6tPX96mwOLg/Wme4Yys=; b=jpoc+1FJ4CumE+xY0ZjFwzcKfCeqT/HlU2TzJK45qeTjxZTJu7bj1DNAq/sWDuTOYn BcKVWHrO48kovUxlojG/B/AQtMP0hVPvL2kzN5XWTDC0U7YIEd67stmMBNwcDAfM25Vq L69vg4YCpmpwp1Ghu6Sy9CHP4cqAzbIb52vrMp5YS1rj27ID6K66dfWVNmPFMmmpSeds QE7ei5sAVzdsHRnk0IjooFr5nh6An+J0jvA+MbPE3mxYux7Ex8kAJCHWZBjV1GmC29fW oHSqgw7bOkOk+AlaI93rYGJomt6h/JaTVqZz/yoD7laZ67bP+qgF9A1i8VOMYkb2U1vX m2KQ== X-Gm-Message-State: AC+VfDy5MkKvjSJy/ABUM+NcUbSgBNXRq7yEH7XBbU2L8r6yDFjEm54v BX/mi1GjC7SNz2LnbELb48kbeg== X-Received: by 2002:a5d:68c5:0:b0:313:eb34:b23e with SMTP id p5-20020a5d68c5000000b00313eb34b23emr9468672wrw.49.1687882555650; Tue, 27 Jun 2023 09:15:55 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i18-20020a5d5232000000b003047ae72b14sm10885501wra.82.2023.06.27.09.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E2BB41FFD1; Tue, 27 Jun 2023 17:09:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 25/36] docs/devel: introduce some key concepts for QOM development Date: Tue, 27 Jun 2023 17:09:32 +0100 Message-Id: <20230627160943.2956928-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Using QOM correctly is increasingly important to maintaining a modern code base. However the current documentation skips some important concepts before launching into a simple example. Lets: - at least mention properties - mention TYPE_OBJECT and TYPE_DEVICE - talk about why we have realize/unrealize - mention the QOM tree - lightly re-arrange the order we mention things Signed-off-by: Alex Bennée Message-Id: <20230619171437.357374-6-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- v3 - moved around as per Paolo's review --- docs/devel/qom.rst | 58 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index c342ce18e3..0b506426d7 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -13,6 +13,24 @@ features: - System for dynamically registering types - Support for single-inheritance of types - Multiple inheritance of stateless interfaces +- Mapping internal members to publicly exposed properties + +The root object class is TYPE_OBJECT which provides for the basic +object methods. + +The QOM tree +============ + +The QOM tree is a composition tree which represents all of the objects +that make up a QEMU "machine". You can view this tree by running +``info qom-tree`` in the :ref:`QEMU monitor`. It will contain both +objects created by the machine itself as well those created due to +user configuration. + +Creating a QOM class +==================== + +A simple minimal device implementation may look something like bellow: .. code-block:: c :caption: Creating a minimal type @@ -48,6 +66,12 @@ In the above example, we create a simple type that is described by #TypeInfo. #TypeInfo describes information about the type including what it inherits from, the instance and class size, and constructor/destructor hooks. +The TYPE_DEVICE class is the parent class for all modern devices +implemented in QEMU and adds some specific methods to handle QEMU +device model. This includes managing the lifetime of devices from +creation through to when they become visible to the guest and +eventually unrealized. + Alternatively several static types could be registered using helper macro DEFINE_TYPES() @@ -98,7 +122,7 @@ when the object is needed. module_obj(TYPE_MY_DEVICE); Class Initialization -==================== +-------------------- Before an object is initialized, the class for the object must be initialized. There is only one class object for all instance objects @@ -168,7 +192,7 @@ will also have a wrapper function to call it easily: } Interfaces -========== +---------- Interfaces allow a limited form of multiple inheritance. Instances are similar to normal types except for the fact that are only defined by @@ -182,7 +206,7 @@ an argument to a method on its corresponding SomethingIfClass, or to dynamically cast it to an object that implements the interface. Methods -======= +------- A *method* is a function within the namespace scope of a class. It usually operates on the object instance by passing it as a @@ -275,8 +299,8 @@ Alternatively, object_class_by_name() can be used to obtain the class and its non-overridden methods for a specific type. This would correspond to ``MyClass::method(...)`` in C++. -The first example of such a QOM method was #CPUClass.reset, -another example is #DeviceClass.realize. +One example of such methods is ``DeviceClass.reset``. More examples +can be found at :ref:`device-life-cycle`. Standard type declaration and definition macros =============================================== @@ -382,10 +406,32 @@ OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) +.. _device-life-cycle: + +Device Life-cycle +================= + +As class initialisation cannot fail devices have an two additional +methods to handle the creation of dynamic devices. The ``realize`` +function is called with ``Error **`` pointer which should be set if +the device cannot complete its setup. Otherwise on successful +completion of the ``realize`` method the device object is added to the +QOM tree and made visible to the guest. + +The reverse function is ``unrealize`` and should be were clean-up +code lives to tidy up after the system is done with the device. + +All devices can be instantiated by C code, however only some can +created dynamically via the command line or monitor. +Likewise only some can be unplugged after creation and need an +explicit ``unrealize`` implementation. This is determined by the +``user_creatable`` variable in the root ``DeviceClass`` structure. +Devices can only be unplugged if their ``parent_bus`` has a registered +``HotplugHandler``. API Reference -------------- +============= See the :ref:`QOM API` and :ref:`QDEV API` documents for the complete API description. From patchwork Tue Jun 27 16:09:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696897 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3872705wrm; Tue, 27 Jun 2023 09:26:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54y02fsziyoAKIP4kmly1o16Azw1Mh46sUq/lvsqAKXEdRYz9fGIjsgaxw8TaqXDhyvWcb X-Received: by 2002:a05:622a:1043:b0:3ff:446f:142f with SMTP id f3-20020a05622a104300b003ff446f142fmr20023558qte.26.1687883211007; Tue, 27 Jun 2023 09:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687883210; cv=none; d=google.com; s=arc-20160816; b=nZpeJ3bRGgWANyIzSmxs53KnZpRvvefrckrqf2zo5ULzRteS2O3T4QP0cDuWm0hDFY rB9XDMPS2fp4W30AMz3QFXcChaDRsXhPP3ihQV27vAgafF8+x74FCDIOvjFCt+/j1n4d O02wPBoqbQE6VZ8VL6QhYZPjMBQ/ch/qTKqIVNAh2ccuMXRh5JFz5K0CE+iBqjPrLjQR tFrz9Pq7TU3oI7++Ehfpksu+pVKGu8dl8eCG9mnyLsX7g0J6PhCLPdATdZiOBCJGmQ6W 8FINA3GqmD9CQmWC33CJClg9jEhZ/c2ji0CRIrNpGYVEOt0nAxrksOOzwkTS+2pSrVIa Nmzg== 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=FGpbXodwi7eOtwTW0EyiBhg0MRqzyOGDQJmw/dX1YZQ=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=EGQ8zYqU/ZPy54cMdRFx+ujIKGXX1slXOHHbGVJ0/CbkKrQtj2DptndLO3VCA/tF7J WoRw9Zb94Kvumc5xfRj9h9oK0dE1cFsPEWprltbdsuG8VgLEliTKDyMAiBuhjg4UVTWJ 4RuMSPVhO//GixWfe947EjpqyZzY53AEc37pbCDJ0czVZK9qrt7Kcz52iGcKlU8zlKvE n9yhItKcNCYXqSU6oASww36YwMpWQgN+5ICPyyac/IugifqzvyQarfOeYmSAgDnOJvLb 3MEJKueiavDK72D1C0eO/OeuDceluWVfEO6lhiWBnHvuVGzzL/Fj9h6ieVjxuLD2ptQL 2/Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ieTW52GI; 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 u22-20020a05622a199600b0040092933638si3396746qtc.369.2023.06.27.09.26.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ieTW52GI; 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 1qEBVv-0000EQ-Ng; Tue, 27 Jun 2023 12:25: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 1qEBVs-0000DR-M4 for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:58 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBVm-0003Fm-Ph for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:54 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fa99b57a38so23469295e9.0 for ; Tue, 27 Jun 2023 09:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687883149; x=1690475149; 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=FGpbXodwi7eOtwTW0EyiBhg0MRqzyOGDQJmw/dX1YZQ=; b=ieTW52GI71BV3KAPofg+uq4vLKo3S4DVx3GgaAW0rs34gp2xa/LYibg+ED7sd91+eS zbG2bG9NYQY67ztUI9veIeNj0u9uy0hXUlM7PsrKX+icuhcEog2OL/IMWvPUERvXn1Mb GWPFBNX+KeXI18tzU6WObzP2smE/gpJCVrC2FF5vSNm/8xie9iJg+IAG+4R+KfGORfpi 8tnV6/Iv2ZoQVz3/sE1sFfKOfUf+/2e/Vu6jHknyFl2XOJ2eRVeXMCZLxWSHpANsce/K ilQR/ps0lGE4+omJPMXBs1j3FL8zmF0Y05QHultEjd1t4ht0ZXH3XzBZaVUNCfX1CN2S DFwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687883149; x=1690475149; 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=FGpbXodwi7eOtwTW0EyiBhg0MRqzyOGDQJmw/dX1YZQ=; b=Mx2poXAGUWDKEqiO2JJmzw3+zsnS4BI2RZVxzuz8dKVMCDHzJXsbvg+MnxpCMLwUdi pj8mX8psiPIG2TBN1Q7BjrLkRNxK09lPvQWQgJBrSSyPNmCZqScUqq0qpAj/evGcvbo+ g3FJqaSRTBFUEXrx1IaQ1JNwn91DvhWBOZ8vS04TnXBA04pVi0l4RkmRLNxSaQJeEdjO 6/QESfmWB1M31gEZpsJpW/8+CRPf0+a3VQT/9pBChMRsmvSzp0RErZ2d+2HId/cgEYC9 30sxFCbp57MYZhp5gdx1GEJ6FGAaoHIaOlFNUDKJCDc45A8LNwa1Mo3sC0c3PjwA8q14 hxbw== X-Gm-Message-State: AC+VfDzgMsjkZx5dPrsQEA12M1gn03A5Y31Y49txFRhhJgJd/aG5TCM6 42Pu/104Ml2fl6CV4q4gQY+LtQ== X-Received: by 2002:a5d:538b:0:b0:30f:c42e:3299 with SMTP id d11-20020a5d538b000000b0030fc42e3299mr22882007wrv.60.1687883149054; Tue, 27 Jun 2023 09:25:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u14-20020adfdb8e000000b003112ab916cdsm10991749wri.73.2023.06.27.09.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:25:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 07BDB1FFD2; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 26/36] gdbstub: lightly refactor connection to avoid snprintf Date: Tue, 27 Jun 2023 17:09:33 +0100 Message-Id: <20230627160943.2956928-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 may be a bit too much to avoid an snprintf and the slightly dodgy assign to a const variable. But hopefully not. Signed-off-by: Alex Bennée --- v2 - fix checkpatch warning --- gdbstub/softmmu.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index 99d994e6bf..f509b7285d 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -332,11 +332,9 @@ static void create_processes(GDBState *s) int gdbserver_start(const char *device) { - trace_gdbstub_op_start(device); - - char gdbstub_device_name[128]; Chardev *chr = NULL; Chardev *mon_chr; + g_autoptr(GString) cs = g_string_new(device); if (!first_cpu) { error_report("gdbstub: meaningless to attach gdb to a " @@ -350,15 +348,16 @@ int gdbserver_start(const char *device) return -1; } - if (!device) { + if (cs->len == 0) { return -1; } - if (strcmp(device, "none") != 0) { - if (strstart(device, "tcp:", NULL)) { + + trace_gdbstub_op_start(cs->str); + + if (g_strcmp0(cs->str, "none") != 0) { + if (g_str_has_prefix(cs->str, "tcp:")) { /* enforce required TCP attributes */ - snprintf(gdbstub_device_name, sizeof(gdbstub_device_name), - "%s,wait=off,nodelay=on,server=on", device); - device = gdbstub_device_name; + g_string_append_printf(cs, ",wait=off,nodelay=on,server=on"); } #ifndef _WIN32 else if (strcmp(device, "stdio") == 0) { @@ -373,7 +372,7 @@ int gdbserver_start(const char *device) * FIXME: it's a bit weird to allow using a mux chardev here * and implicitly setup a monitor. We may want to break this. */ - chr = qemu_chr_new_noreplay("gdb", device, true, NULL); + chr = qemu_chr_new_noreplay("gdb", cs->str, true, NULL); if (!chr) { return -1; } From patchwork Tue Jun 27 16:09:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696896 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3872571wrm; Tue, 27 Jun 2023 09:26:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45NPh0oZvsy4BV77uS54ri2jWfpw8erzISKRgsDVZdgSQhu+Q2ueHTuljKHpCnACG7SgkY X-Received: by 2002:a05:620a:bc1:b0:765:5577:5dac with SMTP id s1-20020a05620a0bc100b0076555775dacmr13327557qki.24.1687883193646; Tue, 27 Jun 2023 09:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687883193; cv=none; d=google.com; s=arc-20160816; b=BOlNNVSJQzspPJsatFuHS7ha5x8QGPqC6qGKQuqXwcqODlG05laMbvwbkUL2A6hLis RR6kpQbsLLsDs+btxgRFFM+F7Pr4dpseAOxD4VM1Ay6HhD+Y/eo4VM+aPyLeCZLwy2Cp q8JBjk7xJeZ7EEeLLTpIg4X/VqO84v0y2HXh8Z/+5IQ7owR1iTYDvdJDTxyDy8dMH5y7 K/xVBWiQ2vxZu63rIkJ3pajihjJRRAKiS2UajQjpZ2bEszpsZFusmGyAwLSwx1GSe7MJ 78e6cufvDlHTksjr+/ixtzEztAZfyeHzWcGbSDFqxhz1QXszm4LrjRQDOIzhq0d1F3zM 2niw== 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=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; fh=hiByEWeFbn21iSqViwRQ6WkRWleUD5OSjDppLdgpuhw=; b=E9t2WrxiwgMgXCE1HTivy3QgHdEZoWM/7LkWHnpEv54DspM2JsXPJP+5UJnMGNR0N1 i2xvf7ERhYrfJpg1+uzIxoppYhkauwk0uYKS7Vka2o7vyNbY+BwwbsENGfBDiFWRDYz6 adcF0hpBeJoLXMW252xCuKkIKibpYordy5wLDkTMTTUh26BqKt0OzEkq2gcTnfSD3E8q 5HG/ee1Qt2a0LHFr/nEeKGMB7RrEO4g6ApIjbKPJnvXXENnHKezVs51eiNq8OBGACWyd ZvnzZZAOKvZrFt7wGw1gy2yWaI3cKMNYWdPKqZL05QoGjK4hwDimqVSSTEGmX+Jp+Hnu /iwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3GTpJy; 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 m17-20020a05622a119100b003fde1911b28si3180869qtk.591.2023.06.27.09.26.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3GTpJy; 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 1qEBVv-0000EG-0Y; Tue, 27 Jun 2023 12:25: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 1qEBVs-0000DT-Lv for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:58 -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 1qEBVm-0003Fl-PZ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fa8cd4a113so26863125e9.2 for ; Tue, 27 Jun 2023 09:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687883149; x=1690475149; 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=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; b=vz3GTpJyIZzejUR5QStkHDhamW2HoF4hq8Iww0exDXSnuVPrzA/BJY1f+8dlk8RQsJ jHNsGEdlDsqptT1Vcl73cwm4BvXr/AiDlv89aPcTHI0JvE1AUZrdqP2vK4J23Sm5l0Fp k0NifdCqaU97G9yZcd3Jvn26dTEJkeW+fLvlJIcjVYM3vfwCOkksFN85ubkXVuAP4im1 PrllyGMs+IgMJXOLYy9ss/mZxNL5FSARc+1NBUSIDFLAaVHd3R4qy8+ve679QQKtxhrr x1Zh+WfsTfMDwdU+ZXLFlVOSjs3WrdBsoyHdSSvrWXrJbWnabr+5pTc2jgFI3U4Zm+8G g6Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687883149; x=1690475149; 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=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; b=UqMiH2GOURYXK5+eXzqLdkdFF6GolHxYMNixg9G2pfAELpM6ctmVuInnoo8yqLPMHK oVZ10yKMHGiL0DA7yBPFtZBDmzsWr4NnENOZJque5tvHmU+OggLGh3Q859yolfLznABg tbRZn2rapEUo8ThymLBc0KAkKiUfPBT1OwN8oHbKtkueuzoXQUtIA81YGUI8WiaA31MG W7Vq9Uo6lmDxc1mq0kOzqE0FDI6rAEG/Lt1Gx6ruCtI0sybdkuaI03Wd3Agw1IQ1fXTv BTqNKBZ414HAS5qKJbEy0vsJozOb0MPsWjs0wV/efd32HegCYLHgHrH9txYiEtxh/0Pf FZWQ== X-Gm-Message-State: AC+VfDwh6YXKk6EanyDaAXR6r1J5l689rVoJDDNLQ4/rTSt8fCgsMSLO 6Iw0wU7g5C+FSQXkAsiJf5fN6A== X-Received: by 2002:a7b:c4cb:0:b0:3fb:ab7d:ad95 with SMTP id g11-20020a7bc4cb000000b003fbab7dad95mr537473wmk.4.1687883148881; Tue, 27 Jun 2023 09:25:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q6-20020a7bce86000000b003fbaa2903f4sm1063394wmj.19.2023.06.27.09.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:25:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 205811FFD3; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , qemu-stable@nongnu.org, Matheus Tavares Bernardino , Taylor Simpson Subject: [PATCH v3 27/36] gdbstub: Permit reverse step/break to provide stop response Date: Tue, 27 Jun 2023 17:09:34 +0100 Message-Id: <20230627160943.2956928-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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: Nicholas Piggin The final part of the reverse step and break handling is to bring the machine back to a debug stop state. gdb expects a response. A gdb 'rsi' command hangs forever because the gdbstub filters out the response (also observable with reverse_debugging.py avocado tests). Fix by setting allow_stop_reply for the gdb backward packets. Fixes: 758370052fb ("gdbstub: only send stop-reply packets when allowed to") Cc: qemu-stable@nongnu.org Cc: Matheus Tavares Bernardino Cc: Alex Bennée Cc: Taylor Simpson Signed-off-by: Nicholas Piggin Acked-by: Matheus Tavares Bernardino Message-Id: <20230623035304.279833-1-npiggin@gmail.com> Signed-off-by: Alex Bennée --- gdbstub/gdbstub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index be18568d0a..9496d7b175 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1814,6 +1814,7 @@ static int gdb_handle_packet(const char *line_buf) .handler = handle_backward, .cmd = "b", .cmd_startswith = 1, + .allow_stop_reply = true, .schema = "o0" }; cmd_parser = &backward_cmd_desc; From patchwork Tue Jun 27 16:09:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696888 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867978wrm; Tue, 27 Jun 2023 09:17:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7eZ+pNyvBztKOD9MkqQM62b/QE5iLBJfqj49KDZlhRlzTUTgO0gbNP30dh2nhRVq+PrWUK X-Received: by 2002:a05:6214:401a:b0:62f:f2fb:6915 with SMTP id kd26-20020a056214401a00b0062ff2fb6915mr33408212qvb.0.1687882634996; Tue, 27 Jun 2023 09:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882634; cv=none; d=google.com; s=arc-20160816; b=vaSrgIeIk8N/40e8HHFUqC72JGuXwwI0FP95qpiLOLnQjLlhWBd6TjOIBi8C286QjM Kuo3mJiNjtTpocGoJPoWuuOx3XihASl4f+K0J7PD8g8M9zAyxD5u882TZJVbqwogzmDu AimHmbBV5RL8gB/hMPuWi/dvP3k0hnZfIVUR6qWe7ipvb3ce3reuDUKrXsicpojqPOMo /xyxNXIuD08INQYja3jBzGY+9XinsX4ubcNXyF32FXWDlo7kIOskhZZixoDs61S1h9c+ MxvAZvr5ZubXMIulaXuD5O+XiBYeTug9cb08LtbZPXUHsZcd2H+zye6vnt6B0ZHNQT5B VfUw== 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=vvgukf2r/kz3Y+kIcG+gDWEsWDEFvjX8X24ODyGYeGY=; fh=ArV5Yx1z9lg+jufSSsiXTUg87d1rJ5PmrQDHLSB2i58=; b=AJ2Qcsj+83a2Fc0VqiNNq1YzNFVhW715NLIiipSQdL6w+D6M1r7w4hH3aIP5chETF5 ONu/WwmdUFO68xG09dtB7R1ZZ8IgXN+ihQf3FUJCVR4VAuzHv9+K4Qa4n/brAKFJRbPy sJOhDtcOJo+dhepr9gQuC6Kw63/BlkP2NNBwYVWxa7jeXCi2EvrxWAC7vWmNZ05fAJ2P V4GBfSQGcByhwue7PgAkKWAv74HCwV/wMPi/+x/yNW0fZraLT0OHQpALWXYQ5qnMSX6V XLh+HnapeNQx3aoveccCfIsWSIkFP52JNsvQDZTfQ3f9dqZQsh7CaCUuE5aj9idfVwMv c/OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErM9F2iw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10-20020ad45c8a000000b00635e04171c4si2203797qvh.419.2023.06.27.09.17.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErM9F2iw; 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 1qEBMN-0001BT-4z; Tue, 27 Jun 2023 12:16:07 -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 1qEBMI-00012z-MP for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:02 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-00088J-Gs for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:02 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f865f0e16cso6543638e87.3 for ; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882551; x=1690474551; 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=vvgukf2r/kz3Y+kIcG+gDWEsWDEFvjX8X24ODyGYeGY=; b=ErM9F2iwYIT4I5Wc99hl/3FeC3hQTqGEZZYKxHbe870Iyn6HivIDKLhWoQZb/XMu7M HsmmJ4I/dtEZtWkVLe/tAMkU6HQ4I42RWB5Se/TZQUXCNGd179pOZiQ9FRSqXKyLKqfW eZpXQnerd9kx88wLIp/SOLQ6F5XdXgCAmoqIVoLhLnopOeLCvmOg9Qmj+JiACikFbReA qPO2i9NMTcFjStxEJC/aveHuJO/yO27BbTDdXctcA9goIH8ZeA7IigeAy5jxIjN+mENh ueYLKtB1helOX5/ksEgRdWDiy7GjBM3pb9igtwDSMLNaMVzy1InDc5+TCIiAtRm35Kfg FsLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882551; x=1690474551; 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=vvgukf2r/kz3Y+kIcG+gDWEsWDEFvjX8X24ODyGYeGY=; b=X6UUw4YrOqmu1zOz17d0ftnysn14yteESrA+qBiFqepjiyRp99Ens8DsooblTn1IlK 8HnoajCbCaAvnXeSN1xbkxdDmBbF7YsfoDJYzdqX37qrZNygAbSC7MlHOHd3/JXhIXAc 7I2QIlXARCmtIiyKiNetrOZhN5x3Fiyt4yA71rhCVOwPkSKx9ZKXwRdejDGek1o2pBNS rmF2gE2fbGxzQLWP3erMYRTZjv6SXrg/z9mLkqY6PtKacA7sEM+oA3aMs6otcdWdHaOd 8szjWoUAcGOCSBwzS4DBEZl7cwf+Pp8u3qyAQ7h184rudZ8saMi9UD5QapfWhMfDZwGT HYQg== X-Gm-Message-State: AC+VfDzfnytzaTYub4+YkqzE0rrp8n4/cxFpUMErY9x8mj31QMI+YUAY jpLpKy/xt/U7DzgVvaj3Y9dk9A== X-Received: by 2002:a19:c206:0:b0:4fa:3a0:2257 with SMTP id l6-20020a19c206000000b004fa03a02257mr5139619lfc.5.1687882551301; Tue, 27 Jun 2023 09:15:51 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y12-20020a05600c364c00b003f7f249e7dfsm14308607wmq.4.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3AAB01FFC6; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 28/36] gdbstub: clean-up vcont handling to avoid goto Date: Tue, 27 Jun 2023 17:09:35 +0100 Message-Id: <20230627160943.2956928-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x133.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We can handle all the error exit cases by using g_autofree() for the one thing that needs cleaning up on the exit. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- gdbstub/gdbstub.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 9496d7b175..49143c7d83 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -573,7 +573,6 @@ static int gdb_handle_vcont(const char *p) { int res, signal = 0; char cur_action; - char *newstates; unsigned long tmp; uint32_t pid, tid; GDBProcess *process; @@ -581,7 +580,7 @@ static int gdb_handle_vcont(const char *p) GDBThreadIdKind kind; unsigned int max_cpus = gdb_get_max_cpus(); /* uninitialised CPUs stay 0 */ - newstates = g_new0(char, max_cpus); + g_autofree char *newstates = g_new0(char, max_cpus); /* mark valid CPUs with 1 */ CPU_FOREACH(cpu) { @@ -597,8 +596,7 @@ static int gdb_handle_vcont(const char *p) res = 0; while (*p) { if (*p++ != ';') { - res = -ENOTSUP; - goto out; + return -ENOTSUP; } cur_action = *p++; @@ -606,13 +604,12 @@ static int gdb_handle_vcont(const char *p) cur_action = qemu_tolower(cur_action); res = qemu_strtoul(p, &p, 16, &tmp); if (res) { - goto out; + return res; } signal = gdb_signal_to_target(tmp); } else if (cur_action != 'c' && cur_action != 's') { /* unknown/invalid/unsupported command */ - res = -ENOTSUP; - goto out; + return -ENOTSUP; } if (*p == '\0' || *p == ';') { @@ -625,14 +622,12 @@ static int gdb_handle_vcont(const char *p) } else if (*p++ == ':') { kind = read_thread_id(p, &p, &pid, &tid); } else { - res = -ENOTSUP; - goto out; + return -ENOTSUP; } switch (kind) { case GDB_READ_THREAD_ERR: - res = -EINVAL; - goto out; + return -EINVAL; case GDB_ALL_PROCESSES: cpu = gdb_first_attached_cpu(); @@ -649,8 +644,7 @@ static int gdb_handle_vcont(const char *p) process = gdb_get_process(pid); if (!process->attached) { - res = -EINVAL; - goto out; + return -EINVAL; } cpu = get_first_cpu_in_process(process); @@ -668,8 +662,7 @@ static int gdb_handle_vcont(const char *p) /* invalid CPU/thread specified */ if (!cpu) { - res = -EINVAL; - goto out; + return -EINVAL; } /* only use if no previous match occourred */ @@ -679,12 +672,9 @@ static int gdb_handle_vcont(const char *p) break; } } + gdbserver_state.signal = signal; gdb_continue_partial(newstates); - -out: - g_free(newstates); - return res; } From patchwork Tue Jun 27 16:09:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696889 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868258wrm; Tue, 27 Jun 2023 09:17:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5th4OINVaiDpQ24WGBnHCExj8VJ5n62A3bB7QGIIAS2F6+gG/Id9uyJK+WjStu/kK91iry X-Received: by 2002:a1f:41cf:0:b0:471:9069:9491 with SMTP id o198-20020a1f41cf000000b0047190699491mr14488989vka.1.1687882659745; Tue, 27 Jun 2023 09:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882659; cv=none; d=google.com; s=arc-20160816; b=I74M9MpIvmls6+DqILHynl2E1aCtjrVooaYhy9f3SO/QCoOBlDx+g6eISJdn63Wruo pJI9m+JM5nv3qAd3ewbFNrNg0UBUde0PZ7z/GNCGi+FqbHhYIE1jvVz8R+nTlaQ0RwU9 BUFSp5r2Q+chDNczNLIogYbSCvZpUD9Lg7DLAGGtPDI4b2b8fk8h1A350wvxL570SaWg BPmOEOvjxMldJ9++A8PySW+OmoQNeUuyLlzTtXiAFY3PC+jeVvWos5Cku7UXINUJAwvT ZpoXq3PxrDItoIu01wgQwyTx/JLV0AuS+ycnOjWOrRfF3VsK2PpbxwaxPuGuHm/+CV+z VzlA== 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=eCS1WP/4CzEo+1xOyZvf30/WwlM8X9DNuki85IAdOWI=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=vQ+bdEr97YJuuL+l7VclYV4oa+IrghvhD0qloFnopjtqqu0357PZmBtAfBNs799vtA i2qZ76SAzP3jXx04/+r/zJjIQ+RqWro4usBrCjPzRGYtFkrZWDXOllcBgn43MSCjt/y7 P8PJqoqHwt5jA0iKjsZkHjgiXxA6zhsStntzSS34FYX1gLVgv2k1CVZPqsXc+03AVBmR 22szCxZFUZDhGT+nT+5HeJ4Xz29UFXqmponAljeMPeDvRnuqP0LwkUfviZip7sQQeKm5 0BJGPPOf74tEzGwSbTIuPrvFjEYRMEEkOTrBIkInz9Nvq0c/jwqbVIvpyObPcqnR/4Lp xU+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMgCZIKA; 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 v4-20020a05620a090400b007653ea7ae1dsi2031792qkv.374.2023.06.27.09.17.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMgCZIKA; 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 1qEBMK-000170-HX; Tue, 27 Jun 2023 12:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMH-00011p-BL for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:01 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-00087D-Gz for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:00 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fa96fd79f0so32712355e9.3 for ; Tue, 27 Jun 2023 09:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882549; x=1690474549; 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=eCS1WP/4CzEo+1xOyZvf30/WwlM8X9DNuki85IAdOWI=; b=kMgCZIKARsYeLXIUoi0iIZ5bHtOUqNrlk7Tu9jd4+JgreQn7ZnStKnqzgMww7WigLI zQzDjjdHrx1WFaXA20vlxih6Gw0RLw6z7WlJc3Hn3AOeUHmsu7RGDall3S8HscBMqILk zqTpCcCnP0HZjyw2VWzds7hSWZcSlas7TFwusMCgmN4Y0vkynfKDN+z5ulNctEpYjtmB dr/fIHtTPZtC3NBtiJHg6ROr020Qu1HZ7mHcv3h4KK3zGZH6lNJiLWpPHUC9UDAldh5H WaYTwAxxzahYBf7NVKnfv3h8vctII1yjFBgcaClsQAdmLRvEyiC5pWAZSWKl3RiydFj8 8YWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882549; x=1690474549; 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=eCS1WP/4CzEo+1xOyZvf30/WwlM8X9DNuki85IAdOWI=; b=S1qQQsXlznNvgTvmKP/2T2Msd4tTec4dAjHEKH6dSPzyGDsX5c1/4261Gqk8S98xpZ mNu60ExfozwlRT9p2Lg5HN23YDlL/P7j24bZr+t3QldoUUF7eaCnUzthwZ5AfXv1qSa9 Bf1e77Ba/t74ZLZyO6RqYSMnTov4SqDK+EmtFl4TWOZnRxFEWK3OMoNMW7a51vQJIhPg MgV+t6wTcmglwY091qUCCez2kDLznsGJ2nfKZyhYelABRcnw9QSRChaGNI9F4pXakVZX FzpkAMCVtsyrbqOYyXCjWiAPk55/4MhF4GFsH1s0MgCPxaErk4zOmILsrwSl71D8sD/i ofIQ== X-Gm-Message-State: AC+VfDxwaH7FR4qK+SJjWNmpUcts5lFO02Ze48BGizubt0PbMlGRK1LG dupYdB7BpwxcCKOelJLkpX6/OQ== X-Received: by 2002:a1c:ed0b:0:b0:3f5:fff8:d4f3 with SMTP id l11-20020a1ced0b000000b003f5fff8d4f3mr36066448wmh.7.1687882549365; Tue, 27 Jun 2023 09:15:49 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c210600b003fafe32c8f6sm5024518wml.10.2023.06.27.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 573621FFD5; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 29/36] linux-user: Expose do_guest_openat() and do_guest_readlink() Date: Tue, 27 Jun 2023 17:09:36 +0100 Message-Id: <20230627160943.2956928-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich These functions will be required by the GDB stub in order to provide the guest view of /proc to GDB. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-2-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- linux-user/qemu.h | 3 +++ linux-user/syscall.c | 54 ++++++++++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 92f9f5af41..a5830ec239 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -165,6 +165,9 @@ typedef struct TaskState { } TaskState; abi_long do_brk(abi_ulong new_brk); +int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, + int flags, mode_t mode); +ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz); /* user access */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f2cb101d83..fa83737192 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8448,7 +8448,8 @@ static int open_hardware(CPUArchState *cpu_env, int fd) } #endif -static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode) +int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, + int flags, mode_t mode) { struct fake_open { const char *filename; @@ -8520,6 +8521,36 @@ static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int return safe_openat(dirfd, path(pathname), flags, mode); } +ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz) +{ + ssize_t ret; + + if (!pathname || !buf) { + errno = EFAULT; + return -1; + } + + if (!bufsiz) { + /* Short circuit this for the magic exe check. */ + errno = EINVAL; + return -1; + } + + if (is_proc_myself((const char *)pathname, "exe")) { + /* + * Don't worry about sign mismatch as earlier mapping + * logic would have thrown a bad address error. + */ + ret = MIN(strlen(exec_path), bufsiz); + /* We cannot NUL terminate the string. */ + memcpy(buf, exec_path, ret); + } else { + ret = readlink(path(pathname), buf, bufsiz); + } + + return ret; +} + static int do_execveat(CPUArchState *cpu_env, int dirfd, abi_long pathname, abi_long guest_argp, abi_long guest_envp, int flags) @@ -8994,7 +9025,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, case TARGET_NR_open: if (!(p = lock_user_string(arg1))) return -TARGET_EFAULT; - ret = get_errno(do_openat(cpu_env, AT_FDCWD, p, + ret = get_errno(do_guest_openat(cpu_env, AT_FDCWD, p, target_to_host_bitmask(arg2, fcntl_flags_tbl), arg3)); fd_trans_unregister(ret); @@ -9004,7 +9035,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, case TARGET_NR_openat: if (!(p = lock_user_string(arg2))) return -TARGET_EFAULT; - ret = get_errno(do_openat(cpu_env, arg1, p, + ret = get_errno(do_guest_openat(cpu_env, arg1, p, target_to_host_bitmask(arg3, fcntl_flags_tbl), arg4)); fd_trans_unregister(ret); @@ -10229,22 +10260,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, void *p2; p = lock_user_string(arg1); p2 = lock_user(VERIFY_WRITE, arg2, arg3, 0); - if (!p || !p2) { - ret = -TARGET_EFAULT; - } else if (!arg3) { - /* Short circuit this for the magic exe check. */ - ret = -TARGET_EINVAL; - } else if (is_proc_myself((const char *)p, "exe")) { - /* - * Don't worry about sign mismatch as earlier mapping - * logic would have thrown a bad address error. - */ - ret = MIN(strlen(exec_path), arg3); - /* We cannot NUL terminate the string. */ - memcpy(p2, exec_path, ret); - } else { - ret = get_errno(readlink(path(p), p2, arg3)); - } + ret = get_errno(do_guest_readlink(p, p2, arg3)); unlock_user(p2, arg2, ret); unlock_user(p, arg1, 0); } From patchwork Tue Jun 27 16:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696872 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3866249wrm; Tue, 27 Jun 2023 09:14:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Wxzky3YpQY8428bMUsfnIvkmHyI4U1FAF3uen1wpsb4lLiHxLarndnONJwMaUmzoWgDvD X-Received: by 2002:a05:6214:252f:b0:631:f9ad:1d43 with SMTP id gg15-20020a056214252f00b00631f9ad1d43mr28531572qvb.14.1687882461688; Tue, 27 Jun 2023 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882461; cv=none; d=google.com; s=arc-20160816; b=a8+wPvasXYok6Qg9Cc9lJCHmdXOGXyRIseKtP9WMm3TLN4K4qrmrFH69hyi0ycwiVH oHhu3PWTGOgw1tWOs0bQukDxMQnmrVSG7vTyU8qPNm6BUIXsoS/7lqprxEXyNlDmu9JA nj0WNjUDKVoaVy559njOZFHgP8cH9ZAoHj5fQW3rQaMY1kk52mQGwdBgN2XkW1W29dcC FmnMn/sbEObZkmfzYkLV4aiUJYDgJFE1kt7/JYyKx+E3H1Co1DKTusoba5w9beAuodPR iIzqSxTv6K6kK8vZNV9k46/p2HkOx1ir9u/y3GmtfBS3qfKR54hs7Y2taZFqB4e6Yekj WA/Q== 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=u8VqszCYj9oqwHFxWVNQZUykN/PvSJ3ab7nReTpSKM8=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=BFcfy8zIuza4r7Y3HJk7z/rca9FGjc8UGKvQYvLJuYJ9v9WWBiHmDxZ6YxuUSZ0nJR 6FbxCi9m8ht1FnHB2bBFRfF69LDUQyfwI/QNZtoMnmG6fWfhf5iYMGbihwQNKuTCaJxT pHPmeI9tLDiFmJxGs82yALWW4O+UGobwOYlFA0l0XT0QM01I0ffwwX75jTGQETTvPUh/ 1zhhsgeyPa8E4bk25bDLUOxOcMQdN49DYCRnfp+vlVRq3NYRIRYmOC+iqqXyjHA4N/20 vWSqboB2PNyVvPX9Krrk6eCQ2eHHXlbkOfK8auOrLaqCIgErl2FM1/pOWqKSLHOrnr6W hO2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XMhm8FgS; 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 13-20020a056214202d00b00630173ee631si3431024qvf.321.2023.06.27.09.14.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XMhm8FgS; 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 1qEBGa-0000ng-NB; Tue, 27 Jun 2023 12:10:08 -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 1qEBGV-0000UJ-Nr for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:03 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGM-0005r6-RW for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:10:03 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f96d680399so6563407e87.0 for ; Tue, 27 Jun 2023 09:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882192; x=1690474192; 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=u8VqszCYj9oqwHFxWVNQZUykN/PvSJ3ab7nReTpSKM8=; b=XMhm8FgS8giBNBK5ETfbrA6xJ5oNX8WRTHa90LgBxgSEuqHi2XjhMOfLVrr1l7RHo5 PTXSUv25u2pr8jgcyjPDsZKBgJsJMOP3zu7w6i2Q2wK5JcBbjHkVhDlIembD+DegUXFU hlAgNXXcngS2UPAQ+oSxM1THsn83DyeRPd6uKxS3S5yjiKWwN7EPEeQ8DUQbqI58iQ9m ePz6e2He2NflCCs9KurPBCU+17ADYY/WiVpxC257huHPqNPtnorDpVxRvk+RygqzCein p2TcLFUx/FblveNqwW4dAhe7jaA1LeyUXqA8tNQVMhcVsa9dw+lUtEHbrR3iPtFO6A/0 ol+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882192; x=1690474192; 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=u8VqszCYj9oqwHFxWVNQZUykN/PvSJ3ab7nReTpSKM8=; b=mFo4s5ToUTc7G+BGmFu+R0lfpZ7P74DTwFB3l5W62tYMGIcxg1/X4Fn/G5jBWdy7g4 LN9FFK2LFHADClWVFAeuzYmf5UBqDM5/yRb2lj046NMAdHAMAmUR8x6rAOv6htSJp+Hi 6BpU9zdRfcCOPwerIkMZkNCMAf8ZAvxEH1cPFV/3DApfBGpB+FFvl+hOqathXvFIY0SB PsK7fI26l9MXtr8nlgec/PoUzd0U/m2Mv8xeFDdiBY9TCvu5GMcJenGRdnkXj2rV/Oew jd+9UGES09sgDgIvh0WUCUQcvJ7KVc4zbdynFFS7zKRACDLXOZ82zjmIa08ZnkshlHj5 jDWQ== X-Gm-Message-State: AC+VfDwl95tJ3k7tKFY+C65QwuQHKuU7dW2y4KAZLOd0gMoTVIp3aLUF npz63rTQaik3Dwkgdc3bzsB46A== X-Received: by 2002:a05:6512:118d:b0:4f9:596d:c803 with SMTP id g13-20020a056512118d00b004f9596dc803mr17906428lfr.53.1687882192454; Tue, 27 Jun 2023 09:09:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c020e00b003f8d6647661sm14109513wmi.15.2023.06.27.09.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:51 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 71F201FFD6; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 30/36] linux-user: Add "safe" parameter to do_guest_openat() Date: Tue, 27 Jun 2023 17:09:37 +0100 Message-Id: <20230627160943.2956928-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12e.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich gdbstub cannot meaningfully handle QEMU_ERESTARTSYS, and it doesn't need to. Add a parameter to do_guest_openat() that makes it use openat() instead of safe_openat(), so that it becomes usable from gdbstub. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-3-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- linux-user/qemu.h | 2 +- linux-user/syscall.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index a5830ec239..9b8e0860d7 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -166,7 +166,7 @@ typedef struct TaskState { abi_long do_brk(abi_ulong new_brk); int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, - int flags, mode_t mode); + int flags, mode_t mode, bool safe); ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz); /* user access */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fa83737192..ecd9f5e23d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8449,7 +8449,7 @@ static int open_hardware(CPUArchState *cpu_env, int fd) #endif int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, - int flags, mode_t mode) + int flags, mode_t mode, bool safe) { struct fake_open { const char *filename; @@ -8476,7 +8476,11 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, }; if (is_proc_myself(pathname, "exe")) { - return safe_openat(dirfd, exec_path, flags, mode); + if (safe) { + return safe_openat(dirfd, exec_path, flags, mode); + } else { + return openat(dirfd, exec_path, flags, mode); + } } for (fake_open = fakes; fake_open->filename; fake_open++) { @@ -8518,7 +8522,11 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, return fd; } - return safe_openat(dirfd, path(pathname), flags, mode); + if (safe) { + return safe_openat(dirfd, path(pathname), flags, mode); + } else { + return openat(dirfd, path(pathname), flags, mode); + } } ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz) @@ -9027,7 +9035,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, return -TARGET_EFAULT; ret = get_errno(do_guest_openat(cpu_env, AT_FDCWD, p, target_to_host_bitmask(arg2, fcntl_flags_tbl), - arg3)); + arg3, true)); fd_trans_unregister(ret); unlock_user(p, arg1, 0); return ret; @@ -9037,7 +9045,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, return -TARGET_EFAULT; ret = get_errno(do_guest_openat(cpu_env, arg1, p, target_to_host_bitmask(arg3, fcntl_flags_tbl), - arg4)); + arg4, true)); fd_trans_unregister(ret); unlock_user(p, arg2, 0); return ret; From patchwork Tue Jun 27 16:09:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696881 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867531wrm; Tue, 27 Jun 2023 09:16:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Z+8h2R8ZhXaFLpe/TL09s3exa5qfS7tTFIcWXubkYxtGQNu/+4RexeGiazcFlVE1ndk+5 X-Received: by 2002:a05:620a:1728:b0:765:42ca:3ca5 with SMTP id az40-20020a05620a172800b0076542ca3ca5mr15254931qkb.66.1687882585710; Tue, 27 Jun 2023 09:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882585; cv=none; d=google.com; s=arc-20160816; b=yN/gDCMpj5268QCVc3BXGr2ju8LRm2nV1zZI9blHvgN7ONiGGLiegPbrhjDZOwbSVv x1Rz7+QABNpFkDS3vfbw0Q0DynWT/lL51wQGknUaQXD/s0Ch8QolT5VktRD5m81vDTgq k4ajnsWHfRnmaS+2Jiql7sKz6d4ba8vEc7kparqIWrFUf8A73WpLv7lrmxlkYYhcMYVV Z6jkhPRS852PtlDyhYVz8ascxbtUBld3+lnMfXiZrFY2ieP96lQ6BGC/dqgg3AkTXBH4 5ubL+WpeVyAWRCD+tOQKyo0JZTRqchRCTBZ0Vh1h8mPFsS+mWjKareTpceJUQfMLCG/0 To+Q== 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=FlozXpssbNBwOzj56lVjhGsxc7X6CRXAuo5Pr/qBStk=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=Yz1DMuJuUS3yzLFtL/3IuhqQAJZ0RGbHlmgflJcZrgVoS2D9IoQVQQGioAgymi5i8g 1xn4uF9HrPC2Sc1MFTvhGXHZCDd0o5ZJjO6R8v3n6IXTKkPa6KOL8fx1GCFCK851nZd7 yDQpLuH6Z355fCvimVuXdDdk16tc9vziOpK1/yykEtaGOe460UT1rAMaqXimkSexl8+C swa1UPWJ7hWkej/7eN8Ymxx+tKm/Q3XXMCUdPhxV/tAfbiga06Ud0HOsjul/nCYpGIjY nJyr4s/mjzCRNTAT+LI3EUBj6/2U5BCxaJ2wBAy62Yg0BSK6UCSjZUJ8ze8tjk7voqQp ApeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fxlzYjf9; 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 i4-20020a05620a248400b00763e13b62desi1341475qkn.400.2023.06.27.09.16.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fxlzYjf9; 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 1qEBMO-0001CK-AW; Tue, 27 Jun 2023 12:16:08 -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 1qEBMM-0001AU-9i for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:06 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMC-0008A8-OJ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:05 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fa48b5dc2eso4795630e87.1 for ; Tue, 27 Jun 2023 09:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882554; x=1690474554; 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=FlozXpssbNBwOzj56lVjhGsxc7X6CRXAuo5Pr/qBStk=; b=fxlzYjf9WaKOCmve8bGBNYL/bEMhrdhlgYxNvwKkRuWBJ1T3ZBhczH9MLYivi0IL2D FmrTlOewL6qZY1AOUUFckHkXuyLryZVJxvO37TdeK3Oi5ubh6REiZUXm0h9EIep2uQAj rt1Fhp9fj72oPbQRhXgoPHiky9WwyO1EX0m7p5TNTT2LS84J5g5rH2yh739ODzXivHOt DzhJ0K3YeEl+KuMkwQATlRLIYdT/Zl5lFxUmn38EtNqO1FROgEgpO6WT03gpfEuhb13J B0jEOe3ca1opvJW+VxvwDOq1A/Sf+91iT3BG2MAFTtvjN0MKE5t5mY9Zqfi5/uhbNLJk 2GRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882554; x=1690474554; 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=FlozXpssbNBwOzj56lVjhGsxc7X6CRXAuo5Pr/qBStk=; b=Xh9InrzmmDzz9NJB38oYAJvD8jD+Hj5kdRZqlpeURJVD3JWM3wuKCNGDufZH62FWf0 3fRXkfEcEMo70YeJ270bdZJQh5JUpDxn9BPhGKOTS7GnF+7JCbEVZQzNy/vIsRQBdL1q qLBufi/3/R/ioxibJcq/4SYUfFXbTwO/u+n7nA3RxQAudTMVWKatGmo3Vw370WUSbaIt fSNW2i6h2d6f9Gsr5tPJOG2l2UuwnoNdF6xwv5HUR/ypsyGlMpx/zbslx0iZx9ihpcKu bpUrnFYBxG9Di+igFKgY0Q0F5sodSHiRceyoDvmvkP6bEISapIq1RuAem45cRIyFqn26 ndcQ== X-Gm-Message-State: AC+VfDxavjOvy5BovFVhKRAk9AI5xG2YWoq3uXjqzbqu646yDKP81sf6 vtGtsmyxmKGykmHOlcO2ZEAzoQ== X-Received: by 2002:a05:6512:15aa:b0:4fb:74d6:6154 with SMTP id bp42-20020a05651215aa00b004fb74d66154mr4784538lfb.37.1687882554623; Tue, 27 Jun 2023 09:15:54 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e3-20020a05600c218300b003f9a6f3f240sm14112956wme.14.2023.06.27.09.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8A3201FFD7; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 31/36] linux-user: Emulate /proc/self/smaps Date: Tue, 27 Jun 2023 17:09:38 +0100 Message-Id: <20230627160943.2956928-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12b.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich /proc/self/smaps is an extension of /proc/self/maps: it provides the same lines, plus additional information about each range. GDB uses /proc/self/smaps when available, which means that generate-core-file tries it first before falling back to /proc/self/maps. This, in turn, causes it to dump the host mappings, since /proc/self/smaps is not emulated and is just passed through. Fix by emulating /proc/self/smaps. Provide true values only for Size, KernelPageSize, MMUPageSize and VmFlags. Leave all other values at 0, which is a valid conservative estimate. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-4-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- linux-user/syscall.c | 58 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ecd9f5e23d..08162cc966 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8042,7 +8042,36 @@ static int open_self_cmdline(CPUArchState *cpu_env, int fd) return 0; } -static int open_self_maps(CPUArchState *cpu_env, int fd) +static void show_smaps(int fd, unsigned long size) +{ + unsigned long page_size_kb = TARGET_PAGE_SIZE >> 10; + unsigned long size_kb = size >> 10; + + dprintf(fd, "Size: %lu kB\n" + "KernelPageSize: %lu kB\n" + "MMUPageSize: %lu kB\n" + "Rss: 0 kB\n" + "Pss: 0 kB\n" + "Pss_Dirty: 0 kB\n" + "Shared_Clean: 0 kB\n" + "Shared_Dirty: 0 kB\n" + "Private_Clean: 0 kB\n" + "Private_Dirty: 0 kB\n" + "Referenced: 0 kB\n" + "Anonymous: 0 kB\n" + "LazyFree: 0 kB\n" + "AnonHugePages: 0 kB\n" + "ShmemPmdMapped: 0 kB\n" + "FilePmdMapped: 0 kB\n" + "Shared_Hugetlb: 0 kB\n" + "Private_Hugetlb: 0 kB\n" + "Swap: 0 kB\n" + "SwapPss: 0 kB\n" + "Locked: 0 kB\n" + "THPeligible: 0\n", size_kb, page_size_kb, page_size_kb); +} + +static int open_self_maps_1(CPUArchState *cpu_env, int fd, bool smaps) { CPUState *cpu = env_cpu(cpu_env); TaskState *ts = cpu->opaque; @@ -8089,6 +8118,18 @@ static int open_self_maps(CPUArchState *cpu_env, int fd) } else { dprintf(fd, "\n"); } + if (smaps) { + show_smaps(fd, max - min); + dprintf(fd, "VmFlags:%s%s%s%s%s%s%s%s\n", + (flags & PAGE_READ) ? " rd" : "", + (flags & PAGE_WRITE_ORG) ? " wr" : "", + (flags & PAGE_EXEC) ? " ex" : "", + e->is_priv ? "" : " sh", + (flags & PAGE_READ) ? " mr" : "", + (flags & PAGE_WRITE_ORG) ? " mw" : "", + (flags & PAGE_EXEC) ? " me" : "", + e->is_priv ? "" : " ms"); + } } } @@ -8103,11 +8144,25 @@ static int open_self_maps(CPUArchState *cpu_env, int fd) " --xp 00000000 00:00 0", TARGET_VSYSCALL_PAGE, TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE); dprintf(fd, "%*s%s\n", 73 - count, "", "[vsyscall]"); + if (smaps) { + show_smaps(fd, TARGET_PAGE_SIZE); + dprintf(fd, "VmFlags: ex\n"); + } #endif return 0; } +static int open_self_maps(CPUArchState *cpu_env, int fd) +{ + return open_self_maps_1(cpu_env, fd, false); +} + +static int open_self_smaps(CPUArchState *cpu_env, int fd) +{ + return open_self_maps_1(cpu_env, fd, true); +} + static int open_self_stat(CPUArchState *cpu_env, int fd) { CPUState *cpu = env_cpu(cpu_env); @@ -8459,6 +8514,7 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, const struct fake_open *fake_open; static const struct fake_open fakes[] = { { "maps", open_self_maps, is_proc_myself }, + { "smaps", open_self_smaps, is_proc_myself }, { "stat", open_self_stat, is_proc_myself }, { "auxv", open_self_auxv, is_proc_myself }, { "cmdline", open_self_cmdline, is_proc_myself }, From patchwork Tue Jun 27 16:09:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696884 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867773wrm; Tue, 27 Jun 2023 09:16:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dOZC4LLQ/EDO92AvexUD0tncykkK9Aldwc6L3V5AfZq/AoGv7VENjGdxgj529JnHlm5Y2 X-Received: by 2002:a05:6808:130c:b0:3a0:3773:f294 with SMTP id y12-20020a056808130c00b003a03773f294mr31847544oiv.8.1687882608372; Tue, 27 Jun 2023 09:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882608; cv=none; d=google.com; s=arc-20160816; b=L0J8snKuIrzcqahZ7KJq555lEW1mw8SFUpJUYl6ky/WHq82VWKuv35a/6rn/0MnFUp vbuO6h9pnMcoqbBdMbJDI8xnV3EJER2gsaNI9nPnR1vAStVfz2K5A+4R0nDuRapZWGLC qdClyv40GoDf/XnGo2MlS6uZZUASbczv3dVTPgkIkbnYhXw+buX09iB3sVmwaAuhJYNf SiY2zYbHd8og93uTF3zBVCC3hUgxibBF12zAkijwg643Z9kcpZneyMsKcdsSQp+Sxdvz becm2P7l8mL6u8IDM2mO2oPhNVRcDPMANkux3k9eCz92/knmGCXao47V2YX2xhotQiTb aAiA== 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=81Ksm8uVTMPnt2+cnp4q2zmd0NQ6258gRF87FUOPn3E=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=eSpYF1g6//r8rAW0PlYte+je24CSyVGdm1pMYkZP+7b7UJTM0ZNuLHHrbYmJmIQ7s5 aSwjkOuMU6nhTuDaeMpZjr9lQt4ztl9+S+5FjVdYzJ0uoFJRDOWpEmsG2SB3xRj2K3g+ OpTaKSCBkDbuglMM4j0CCFBtHhSQYH9ttW66yYMcCjh9X4g48klyXRuXmBQ0GB1Ys00p Wv45Ky7Srscjn0FVMzupjtme1X0r+CkPoDjn8g8aWSpLcVt8Ut9byP5TClmdnIZOC4+y 5jr3XvSCiJqFzrhjrH0UsltFYvzXABVWLz/rWZQ1GFoJM5TPp6mi1bsdta6hOk9O907y 4JKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e08SsTOg; 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 jl10-20020ad45e8a000000b0062deb8c3a1fsi3388487qvb.319.2023.06.27.09.16.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e08SsTOg; 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 1qEBMK-00016A-8K; Tue, 27 Jun 2023 12:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBMH-00011M-2x for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:01 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-00088u-Gp for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:00 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fba64d9296so9233325e9.3 for ; Tue, 27 Jun 2023 09:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882552; x=1690474552; 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=81Ksm8uVTMPnt2+cnp4q2zmd0NQ6258gRF87FUOPn3E=; b=e08SsTOg9xG2QdllDTmBh4BxNQ34xDnN0WEvIFDik4Q7Sb+otfh8AvdGlmDM8VbHNe 6U+RgzKtR9LLnI/QKhmLSGLFok6CiCzjWVfnW6TQyPUG4CXBgAmknPzD6NS8c7YB2Xd0 JaQUSBW7A5mGSUC8k2HGpnBJMNVyHM5QdrVcbNNO2d5P53aLflnDBAkGEvzXz7/UBwnk gXssVnwHV7OhGIgVYyBSYY61yDlMJRhdHPGsoEJtqZx5ALSxSktjBtxARKjoCgFbP3X5 9H6aG40AjAoRyiiB+JKSqHpIQfbjwAPh44ThRvVCqMkR6AqSQlb9qRpMcBQ3c1XlWnFE VZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882552; x=1690474552; 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=81Ksm8uVTMPnt2+cnp4q2zmd0NQ6258gRF87FUOPn3E=; b=UU8HTAhtzQwDJjr7p58BCqxW9NE8bFZLZFhD1GpWXqFfYEL5lFNXjQSm7lV3MX6Fuv pNHZKTBkjQc8kxkzvfviMaefV7UN5iGp27OWKbpR8SlA2qnPjkvGdWr5fl05AIqhML/B mB364CBNJJelxtuQ9HqFvwsqSgHrCSc4lFs0V7BX/N32c+n7O0l7YoTs1wWgcVefE3Kx E34JRdc+bMVyG/iKQz1FqkiL5MEW5xM2jRAmbGkZG0ZfaaAjQx4Kab6S1jqdTZ9IgA79 8C3s9V0eVqLPbz7VU57u584Mz+4sPTgbCQ8cSyAcSq8rnLYs2Yqrp3eJhsNqoOkuaheU PJ7g== X-Gm-Message-State: AC+VfDyww3LUCxVrTh9T8n0voCnZgVkaWSA+JMK+x+N7J5RNupHgokcL xjq1p2SMkCuRq4cbTrUP0aC3gw== X-Received: by 2002:a05:600c:219a:b0:3fa:993f:acc1 with SMTP id e26-20020a05600c219a00b003fa993facc1mr4264819wme.2.1687882552620; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a16-20020adfdd10000000b00313ef2150dcsm7136675wrm.45.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A75691FFD9; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 32/36] gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process() Date: Tue, 27 Jun 2023 17:09:39 +0100 Message-Id: <20230627160943.2956928-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich These functions will be needed by user-target.c in order to retrieve the name of the executable. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-5-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/internals.h | 2 ++ gdbstub/gdbstub.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 33d21d6488..25e4d5eeaa 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -129,6 +129,8 @@ void gdb_read_byte(uint8_t ch); */ bool gdb_got_immediate_ack(void); /* utility helpers */ +GDBProcess *gdb_get_process(uint32_t pid); +CPUState *gdb_get_first_cpu_in_process(GDBProcess *process); CPUState *gdb_first_attached_cpu(void); void gdb_append_thread_id(CPUState *cpu, GString *buf); int gdb_get_cpu_index(CPUState *cpu); diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 49143c7d83..ce3e4a2671 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -211,7 +211,7 @@ static uint32_t gdb_get_cpu_pid(CPUState *cpu) return cpu->cluster_index + 1; } -static GDBProcess *gdb_get_process(uint32_t pid) +GDBProcess *gdb_get_process(uint32_t pid) { int i; @@ -247,7 +247,7 @@ static CPUState *find_cpu(uint32_t thread_id) return NULL; } -static CPUState *get_first_cpu_in_process(GDBProcess *process) +CPUState *gdb_get_first_cpu_in_process(GDBProcess *process) { CPUState *cpu; @@ -325,7 +325,7 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) return NULL; } - return get_first_cpu_in_process(process); + return gdb_get_first_cpu_in_process(process); } else { /* a specific thread */ cpu = find_cpu(tid); @@ -354,7 +354,7 @@ static const char *get_feature_xml(const char *p, const char **newp, size_t len; int i; const char *name; - CPUState *cpu = get_first_cpu_in_process(process); + CPUState *cpu = gdb_get_first_cpu_in_process(process); CPUClass *cc = CPU_GET_CLASS(cpu); len = 0; @@ -490,7 +490,7 @@ void gdb_register_coprocessor(CPUState *cpu, static void gdb_process_breakpoint_remove_all(GDBProcess *p) { - CPUState *cpu = get_first_cpu_in_process(p); + CPUState *cpu = gdb_get_first_cpu_in_process(p); while (cpu) { gdb_breakpoint_remove_all(cpu); @@ -647,7 +647,7 @@ static int gdb_handle_vcont(const char *p) return -EINVAL; } - cpu = get_first_cpu_in_process(process); + cpu = gdb_get_first_cpu_in_process(process); while (cpu) { if (newstates[cpu->cpu_index] == 1) { newstates[cpu->cpu_index] = cur_action; @@ -1270,7 +1270,7 @@ static void handle_v_attach(GArray *params, void *user_ctx) goto cleanup; } - cpu = get_first_cpu_in_process(process); + cpu = gdb_get_first_cpu_in_process(process); if (!cpu) { goto cleanup; } @@ -1393,7 +1393,7 @@ static void handle_query_curr_tid(GArray *params, void *user_ctx) * first thread). */ process = gdb_get_cpu_process(gdbserver_state.g_cpu); - cpu = get_first_cpu_in_process(process); + cpu = gdb_get_first_cpu_in_process(process); g_string_assign(gdbserver_state.str_buf, "QC"); gdb_append_thread_id(cpu, gdbserver_state.str_buf); gdb_put_strbuf(); From patchwork Tue Jun 27 16:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696887 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867944wrm; Tue, 27 Jun 2023 09:17:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vpAeb/imdqO+RiMVGPRbyaRncnacqs6jz52vGDDjuGBrgav+GRsU6ouJWdgKNF5ATEKxD X-Received: by 2002:a05:620a:25c8:b0:763:b475:90ef with SMTP id y8-20020a05620a25c800b00763b47590efmr23668801qko.69.1687882630129; Tue, 27 Jun 2023 09:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882630; cv=none; d=google.com; s=arc-20160816; b=NsCKZ0byGscsuVVwN8exMyBI6g8x/KgyPeKGVO2ng/gwWfpbXn8YMh9UxZssJSIqVD CEgVIMj08jMvyz/T0RKzMfNESiQBJ8Wrxm2d7JEc9YrCM945IaFUlxV/26n3RqEAW8A4 7ku0GoZknUkJLtn7o6S+VgwJg2vJtr2ZnhDOhdwETXSQTDmqzJZ6LuX32rBv5b7ayb1N 7kgcvhL1Il8IlaQgb9AXMzKVIBW47dUmFsOazdh1PbE/EBnLcAWPz65vi8JGJyXJDyaP DROnsLmntm0XsREka7zKOekx3QcO1ALEaRwrGsZ37i3zurq7SOoOarJFZ8liOeqGz8Ap Lp9A== 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=oenQvTjQMNLdspNzkaNvCWQ+SG7wcPXLwQUq75k2j/o=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=Em4etnfoz1+lLPcCoOmBeNMwQzcv3HsaqUs4mSAxoVzpE7i3B61dLnbcbpWdqxr8Av JR3On0BYnVC/aSKFYShWQ072x+11tTtjsCOKJT7rbjdU+BP9OJ9ZEP33kgek7YUeOYhk mAIZ8P3yI/FpYFLeiqs4WT4Cb1Jho4SYLw/jlCMQoHtwNLHxmyy1ZsJRt4/Z+OeBP5v+ XDxNIRUzRSl+F1qpNAZCXbYj11+8wgbtn4lg6GkqJM/U9gmVbIWQgFgZr4CXiBYhS2Ty R5Fl+CKfOYagbQWpMAIVVp4tQmKlfyBpppywJ/IMfDNQXHbXPJLF7ychWTWxFPQsjEP7 OJPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ih2wexnc; 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 ra15-20020a05620a8c8f00b0076554a836e6si3139344qkn.580.2023.06.27.09.17.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ih2wexnc; 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 1qEBMH-00011q-Cj; Tue, 27 Jun 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 1qEBME-0000ya-Du for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:58 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBMA-00088p-Fd for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:58 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-313e34ab99fso3936693f8f.1 for ; Tue, 27 Jun 2023 09:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882552; x=1690474552; 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=oenQvTjQMNLdspNzkaNvCWQ+SG7wcPXLwQUq75k2j/o=; b=Ih2wexncfGfDwD/HAFokzszaawhjM6uXNHK7B6jp2MzfjbW9DldwHEyzIji3TXQl1E 5WBYFZznMG5OEMZd4XnACFVvna6jclk2uDjNJtmIpIY8FjrRYYZmZYTGCTcMXhl3fCg4 /sFik4pCIs4FgGanbatBlgfpTiVunY9tKbi76zC5qKzSNUAA+QPUI99LZhRqYC9IBLRY SBEXA/6agLb/T5ikQl8nzgqpCZk0r6DK8rLhLPoShxLeTpMhxm2yljngOhK/MVF+6xWT y0IZa9AgBBkVv/Gh7sWhxDa0rGhLTgC7/Wr22A8XsJzGIWC0Iohqxgr89xYZgc1Br3oF qrPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882552; x=1690474552; 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=oenQvTjQMNLdspNzkaNvCWQ+SG7wcPXLwQUq75k2j/o=; b=DzzxDOt70iN2MBjyls0ZFPO4qQ5Dz9tT75jKAMnDvE5X2xgLLWO69LbmlSpPyKsjMG KsJQy10vKzR2TBoOpK8UOoocdEMUKTJUhsVad5eGllHcXfTa1tJ7vmDTnQ8tN1es5OSO HEAngZkepNoIhFbAJJ3dRiZpyg2seZuW1rjkpqn7+GNJRUKpOWirQuo0UaOhXv2PT9Xx KAnanQqep6v568UjFTME7ZbaP05/GQ9vOPVy4YoEfDIc4jmzK7icX/s3MPl+w3YeX33K Md1TpKt2RyOHl/uG7mBZ/+r17UhSh1ybBuVl4x0SDQF/9VEbfK78iIev1EWoVbAsdnkn rMYQ== X-Gm-Message-State: AC+VfDw9UqPe98fso0KzmppbxR40n/rx9QFurn28IybbNU4QiNEBHnGv TIAlaw4Tji/vJxPjVIhsnyLicA== X-Received: by 2002:a5d:4a0e:0:b0:30a:e6d2:3ce3 with SMTP id m14-20020a5d4a0e000000b0030ae6d23ce3mr23425908wrq.16.1687882552435; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n2-20020a5d67c2000000b003127741d7desm10713516wrw.58.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C2A7D1FFDB; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 33/36] gdbstub: Report the actual qemu-user pid Date: Tue, 27 Jun 2023 17:09:40 +0100 Message-Id: <20230627160943.2956928-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProcess. Add an assertion to make sure that future changes don't break it. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-6-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- gdbstub/gdbstub.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index ce3e4a2671..697dd4bbad 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -202,13 +202,16 @@ void gdb_memtox(GString *buf, const char *mem, int len) static uint32_t gdb_get_cpu_pid(CPUState *cpu) { - /* TODO: In user mode, we should use the task state PID */ +#ifdef CONFIG_USER_ONLY + return getpid(); +#else if (cpu->cluster_index == UNASSIGNED_CLUSTER_INDEX) { /* Return the default process' PID */ int index = gdbserver_state.process_num - 1; return gdbserver_state.processes[index].pid; } return cpu->cluster_index + 1; +#endif } GDBProcess *gdb_get_process(uint32_t pid) @@ -2137,19 +2140,25 @@ void gdb_read_byte(uint8_t ch) void gdb_create_default_process(GDBState *s) { GDBProcess *process; - int max_pid = 0; + int pid; +#ifdef CONFIG_USER_ONLY + assert(gdbserver_state.process_num == 0); + pid = getpid(); +#else if (gdbserver_state.process_num) { - max_pid = s->processes[s->process_num - 1].pid; + pid = s->processes[s->process_num - 1].pid; + } else { + pid = 0; } + /* We need an available PID slot for this process */ + assert(pid < UINT32_MAX); + pid++; +#endif s->processes = g_renew(GDBProcess, s->processes, ++s->process_num); process = &s->processes[s->process_num - 1]; - - /* We need an available PID slot for this process */ - assert(max_pid < UINT32_MAX); - - process->pid = max_pid + 1; + process->pid = pid; process->attached = false; process->target_xml[0] = '\0'; } From patchwork Tue Jun 27 16:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696882 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3867639wrm; Tue, 27 Jun 2023 09:16:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gYI7Joq4bs9Pe2ic00cRsFybr6Vlpppknb41zpWgpkDRMAy6kJKPk7GeqlePKelbSjnuw X-Received: by 2002:a05:6808:120a:b0:39e:b985:b47e with SMTP id a10-20020a056808120a00b0039eb985b47emr37797046oil.36.1687882595617; Tue, 27 Jun 2023 09:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882595; cv=none; d=google.com; s=arc-20160816; b=fBXFYoUqabrrbfpe0ysl77ruwYzRGZBbJKrA2AqBDrNY6b9ee6NK0Fnxn8LXWLBmp+ TybDolyOi2q2+P/xzYUt1JCY5NdZREuYqdMtyoi+OVxgf3ez1hi1v0gE4gB8TpcRnck3 ++/1VZ6m6fzphLfv0fU3tlmQ4iU0MzVAl3ShouK6a5X+nYvRUMSlv24x8f4WCqILZzFd ltJhK0UmoYaVHfNIsdovOWOmZG3wWWDMauANPym0p0PpzM2g4yMz2iy5dDFgvQLwHoMG SEnWz+3rXa5frCNyy1Uyk26ol+jN7kZ+d9l1RBhnHwgcdm3kheBViVFk+svxX1ocpF4Z 59IQ== 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=E+S/2xF0HXkyXAmhdbBZi2PQMRaPK50oTftei6f5iso=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=AE3dSGYIC1LaGwMaTm5bgaJYxEGw2hforjSo1pQVmgca58dgtLczNOSroHw4rEgmBN yoNCwi2hhix1+6XjSA+mIDof6la5rrDYxuVoYZPzrOavG+vTu4AOgXxK8FHSfp1rVlCG Mim+RFDtmRFdWzyN9MgzO/gb4mAvdbQI3UJjN82c7qxVY+H6Z/gVzfTybG5Oj8I1q4v2 3M7tjTWTSFJVCl2ToKpd/VHummuqc381wrmaQGWTpgRAwrhN6Vv2eFguVVVT3vfxtMvR IMIL5XNCovFvm4qQFXYuv7/H1NHeKPZ0Lk7mSNB3mFzWUqpNXuOhK6OkpSBLJVjG75VE Xb4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BV7BhM8O; 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 o3-20020ac85a43000000b003f2b900c2adsi3315478qta.179.2023.06.27.09.16.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BV7BhM8O; 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 1qEBMJ-00014g-O2; Tue, 27 Jun 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 1qEBMG-00011F-Tb for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:00 -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 1qEBMA-000887-Gx for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:16:00 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-307d20548adso4306759f8f.0 for ; Tue, 27 Jun 2023 09:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882551; x=1690474551; 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=E+S/2xF0HXkyXAmhdbBZi2PQMRaPK50oTftei6f5iso=; b=BV7BhM8Ovfh2OFs128IggTGFRSjkSCL0R1igGCXlxO4X0Lownl8Pm+ZzUOI0/FOXp/ vwNsLsoxEZmQM3zgf7K821zL0E+I96IRnwMsXDXk8zWD+WsfRFoIu+5w4+j+4oiBjZOc KhjbS6tbtdOVJETWApXJqWyrsiJJowKvO9h0jsDsgA0izHIdoVuU2fh4WNUDm7XDo2Dw jsk8zHPM/tmFgFcZ7mvWejaFQFgLg6HobxOOeOU4WSVte3lQBhqn1VoIJ4ltsTGEGeMs OsXDJBsFbInS+liPfgdAFejUcssEUci7o5vQbQqg8V4Q832WnsweFHJX+KBfv+Ew3nDL 9UFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882551; x=1690474551; 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=E+S/2xF0HXkyXAmhdbBZi2PQMRaPK50oTftei6f5iso=; b=isvjdch04FX5vTK+fs/CgJEnqTOM2Ol3/8MlVGzaY792LDUQivj1gmmqRXQrAGu80n cXql7Jg5R2PUzKIe+nBPcF6OGESFHnTLCb8fnWfsVPvvZot4qMFS1jClsiz3o1K0p/Qb eBkrEzsNrJR9ub4SbyzwvCqhc5iW1cNxNtJFK+ddNiVARdKA6e1GadA/A0STy2vcjtoa Q2w58tCxNpGaNQjtRSy0VVJJBPiDoXgVlzhe0dIw5rIEivqkG0up9/Wnr/78iubU49EI wVZFygrXH6C2znQsRVQEQ7DvL5t28v/ywWWLxXuvrI0BFPVkTv4TnLca6GHoeKu72bMw sfJw== X-Gm-Message-State: AC+VfDx8YEhfi2FvgvqNXvnPF0FUCwM3uBOOvRKId5dbsi/gv+TSVhKT 26hce58Q+gq/9OLIN/WXkAxQyQ== X-Received: by 2002:adf:f24c:0:b0:313:f152:d7f2 with SMTP id b12-20020adff24c000000b00313f152d7f2mr4395926wrp.36.1687882550883; Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f13-20020a5d50cd000000b0030647d1f34bsm10970498wrt.1.2023.06.27.09.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1058E1FFE1; Tue, 27 Jun 2023 17:09:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 35/36] docs: Document security implications of debugging Date: Tue, 27 Jun 2023 17:09:42 +0100 Message-Id: <20230627160943.2956928-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich Now that the GDB stub explicitly implements reading host files (note that it was already possible by changing the emulated code to open and read those files), concerns may arise that it undermines security. Document the status quo, which is that the users are already responsible for securing the GDB connection themselves. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-8-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- docs/system/gdb.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst index 7d3718deef..9906991b84 100644 --- a/docs/system/gdb.rst +++ b/docs/system/gdb.rst @@ -214,3 +214,18 @@ The memory mode can be checked by sending the following command: ``maintenance packet Qqemu.PhyMemMode:0`` This will change it back to normal memory mode. + +Security considerations +======================= + +Connecting to the GDB socket allows running arbitrary code inside the guest; +in case of the TCG emulation, which is not considered a security boundary, this +also means running arbitrary code on the host. Additionally, when debugging +qemu-user, it allows directly downloading any file readable by QEMU from the +host. + +The GDB socket is not protected by authentication, authorization or encryption. +It is therefore a responsibility of the user to make sure that only authorized +clients can connect to it, e.g., by using a unix socket with proper +permissions, or by opening a TCP socket only on interfaces that are not +reachable by potential attackers. From patchwork Tue Jun 27 16:09:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696895 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3868911wrm; Tue, 27 Jun 2023 09:18:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73A2E3f/+YC/bZ0MHlGwZLlS8zzYOL/1zJtuSqao5XHjQhwjbOWJSnCyddHncuI7W9Qvm7 X-Received: by 2002:ac8:5795:0:b0:401:e023:5e9f with SMTP id v21-20020ac85795000000b00401e0235e9fmr4413696qta.68.1687882734392; Tue, 27 Jun 2023 09:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687882734; cv=none; d=google.com; s=arc-20160816; b=k7qTQUwDBB1W+6uLWRcgxybiPo+dIGCSdOLBKDpDYpT4c/K/fEJYQ0nV1f+Ih299mW pnldIt1JOUpW90C7Z3BTg9rPYIqpNjlRRZaWXQffSpD3D/ZnoAUB8o8Zqe17HnTEs1qg rUAzblWGQbyO0Vw4zyRru72z1lQpqx+fXyGO7laiH6zK912kER0bk+bhqEFTuoaIFKH1 DSj4TDIsLYF/YXkc5cwXhuUxbPwSZ0aB9YBHTl47FLF62QXXZ7akf0PoBgnNdPRAUsNy gR/f3auwWkDUPUEDpC89Y/Egji4yG44/MznrwH55Zwh7EhR1uJIaLJh5KkjtTNED8wF1 JXhg== 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=YSkcoehiqyKjiOIAuNJ9AUja3GDxG2+fTHEXVRu0R8c=; fh=B6/adVaiTRj/g/M/QPigvyXZO+x+u/FNsaNX2Qo1+tw=; b=SYPXX6qv2Px07bfeQ5DnPnHj3dryiJTnVN7rCR2v1YfCx8fZR2qr0qaToUPiKRf6K+ 1k3J0yhoE93lMnHx6yvhgofor/M3D7wvWaB60/re8CD2Ra9LjWRHpYkWVd26HQYLQRhY g22Yyg0TaEV0Ts9ohycnJw5/eoqdC+P5WHVo+WkOsQ+O+Xi/8v6+o7OtuNlr9Q/zVPmt bEZOtl1KETyyPe/oBAwjAK20b8bcX6VRWnd7gaMy+fC/lXEAKAgBXplbffipJ3dG7nfX m90d5kMNLaEaW9HRbJNyNpD6Zoqt2tCUh8tE2+5TNS5+jqihw2ezRkGlq/iw7YRFfo8U WZjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l04FELmG; 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 t21-20020a05622a149500b004007a693058si3293901qtx.662.2023.06.27.09.18.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:18:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l04FELmG; 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 1qEBMI-00012l-HS; Tue, 27 Jun 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 1qEBMF-0000zX-QY for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -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 1qEBMA-00087o-Gd for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:15:59 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-312824aa384so4221212f8f.1 for ; Tue, 27 Jun 2023 09:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882550; x=1690474550; 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=YSkcoehiqyKjiOIAuNJ9AUja3GDxG2+fTHEXVRu0R8c=; b=l04FELmGhRVd9r5eJ9OS1CF/Sz4hNNsVM36lsWwEstCQKdKbWLYyPtGOdDS9CUJrtW gCY4zfxV+bvK0i54jcHrYqr/B6jOxcCPLXREbWcf3H7oy5R1q8Bhl5zoTgHTeQR/r2Jr ZhvEVxnpI297rzCfsW0ZpJs0Ko1oTeE526SXChfgoCZmyHA4fwFVoUvutFWGEC9+dJc5 UJZU9FT1m92pbDNuVMi8olDo9/DMuMo9kja4qpBV5pUGhOxGLwE1r+ISu/GsdWehSoKQ P7oVfLqzqbRHpodVCyFXG3S+cgsMlAZTDU0+S9ydDL+dsQhbtCMQYNuti6kof+JBU9Wz MxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882550; x=1690474550; 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=YSkcoehiqyKjiOIAuNJ9AUja3GDxG2+fTHEXVRu0R8c=; b=aF+eeM8pR0HDTSN9EpZdQJ5C0md65ZhHRr7Rg9KKQEzrQiw/anWF1vdG1tTmrt35H6 d/V5ZfnDVtZLKFOcUR7xtdjnYzGIISvIas4TBf3x2jamNSD/mZzVnx00B4JMa+qsjzQ6 6d+g3Wsf6Pk8EclgdlbXAg1LRsa/QX17XC/t5Vzohf2VB3naWJq+X1ZOYDomRU1SQwUr li98R0IQxz+k0tvA+7NtzTWreCh7ei2Ljur69Qje9lR7HpIVbvbgpZj4yNWyGz3mnwoi u82VVq1FYsDM8O638JmUpDlGBbN1rJaewdd7wdZ9BlyAScEyNcO+LPpsZ/Ozt01ZSiYP hPEw== X-Gm-Message-State: AC+VfDxH/Rrefez7RXfKwNSB1xTOipLrk3nIjv8Ss9wAHA88IE3z+AwP u29uMiCn+6Fw6u2QLvlJI/qZEQ== X-Received: by 2002:adf:e8c1:0:b0:30f:bcf3:9a30 with SMTP id k1-20020adfe8c1000000b0030fbcf39a30mr12190379wrn.17.1687882550523; Tue, 27 Jun 2023 09:15:50 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z2-20020a5d6542000000b00313eee8c080sm7285706wrv.98.2023.06.27.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:15:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3968E1FFBC; Tue, 27 Jun 2023 17:09:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH v3 36/36] tests/tcg: Add a test for info proc mappings Date: Tue, 27 Jun 2023 17:09:43 +0100 Message-Id: <20230627160943.2956928-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-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, T_SCC_BODY_TEXT_LINE=-0.01 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: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-9-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- tests/tcg/multiarch/Makefile.target | 9 ++- .../multiarch/gdbstub/test-proc-mappings.py | 65 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/multiarch/gdbstub/test-proc-mappings.py diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index 373db69648..43bddeaf21 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -81,6 +81,13 @@ run-gdbstub-qxfer-auxv-read: sha1 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \ basic gdbstub qXfer:auxv:read support) +run-gdbstub-proc-mappings: sha1 + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(HAVE_GDB_BIN) \ + --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-proc-mappings.py, \ + proc mappings support) + run-gdbstub-thread-breakpoint: testthread $(call run-test, $@, $(GDB_SCRIPT) \ --gdb $(HAVE_GDB_BIN) \ @@ -97,7 +104,7 @@ run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb") endif EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ - run-gdbstub-thread-breakpoint + run-gdbstub-proc-mappings run-gdbstub-thread-breakpoint # ARM Compatible Semi Hosting Tests # diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py new file mode 100644 index 0000000000..7b596ac21b --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py @@ -0,0 +1,65 @@ +"""Test that gdbstub has access to proc mappings. + +This runs as a sourced script (via -x, via run-test.py).""" +from __future__ import print_function +import gdb +import sys + + +n_failures = 0 + + +def report(cond, msg): + """Report success/fail of a test""" + if cond: + print("PASS: {}".format(msg)) + else: + print("FAIL: {}".format(msg)) + global n_failures + n_failures += 1 + + +def run_test(): + """Run through the tests one by one""" + try: + mappings = gdb.execute("info proc mappings", False, True) + except gdb.error as exc: + exc_str = str(exc) + if "Not supported on this target." in exc_str: + # Detect failures due to an outstanding issue with how GDB handles + # the x86_64 QEMU's target.xml, which does not contain the + # definition of orig_rax. Skip the test in this case. + print("SKIP: {}".format(exc_str)) + return + raise + report(isinstance(mappings, str), "Fetched the mappings from the inferior") + report("/sha1" in mappings, "Found the test binary name in the mappings") + + +def main(): + """Prepare the environment and run through the tests""" + try: + inferior = gdb.selected_inferior() + print("ATTACHED: {}".format(inferior.architecture().name())) + except (gdb.error, AttributeError): + print("SKIPPING (not connected)") + exit(0) + + if gdb.parse_and_eval('$pc') == 0: + print("SKIP: PC not set") + 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: + report(False, "GDB Exception: {}".format(sys.exc_info()[0])) + print("All tests complete: %d failures" % n_failures) + exit(n_failures) + + +main()