From patchwork Fri Jun 30 18:03:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697954 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp592860wrs; Fri, 30 Jun 2023 11:06:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlF6rNGSnH0/xuVPZhuxQlvQ8YpUiz+VWm+f2695jQPOr6/SmuwuiNNmd6t+jRW/BSYh3rLM X-Received: by 2002:a05:620a:4256:b0:767:2e70:a511 with SMTP id w22-20020a05620a425600b007672e70a511mr3250875qko.72.1688148370235; Fri, 30 Jun 2023 11:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148370; cv=none; d=google.com; s=arc-20160816; b=QRtEfKeFcODsXGGlh/W2smdzb8+1K0owQMcRuwXyi1GNluaN0vaHeP5Nyk/jO+/q7a A8tmfvWZSO8cTBP5g3+rJjWLFfmyte4aeyhBfSatGPazmXjccj60mDQq+Euino9AtFwQ 5n0mTFdQVC8VmHiIMkk+H1MurQehhFHL8WbstOvWCQs5LDAJkqG/3dtxItP9iZu0l/kB oyYMh0hwQKBrggMuXmgpR3gj1gCHXzTNvyHxEXe6oc18KjiEET/Ew3lX7+79h6PZqYl4 BhQsbfs94CYm5KdOYw+XHCSeI1HpAQPbilUVKLi2kqSsmgr7uazIroIWeI+vKlmxMtiU EGAg== 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=TRLND/FsJP/7sFVhRXujI3BG1g81af0/qiaTT1E8hck=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=HofDbIeSSwfqE48MMoiR0YYNCM4z/7iMmtpMX9QupOezKFjQbL1Wyi8k3HnvhTFpi5 yc9JSRENmRYtGbUPFVJKqmHYSyzOWLaB/p64tME6qpLNuoqeNaFwh2CffJZSuFhtZp0g pO/vjf+67T2G05dxnU+xzwIMxMvd89e3k2buuHUM+O5p+o8SLjD6nNR3vSAG2pshIHT1 80n0bPvnKIcNnWttm/PfCTmp2lnA2QaP8k6PrEEuPgLRnBl4k8Qnw7fKfPFz+4NMNqtT TBCaj9lu9ksDdvS5849STNwrfqHQoCjLT9Sd3n49HZH6cGWyfPvk5r1KtwMraHVUW+8X dl9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oyBMZlpD; 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 v19-20020a05620a091300b007654177397bsi6039670qkv.345.2023.06.30.11.06.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:06: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=oyBMZlpD; 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 1qFITz-0008IE-MX; Fri, 30 Jun 2023 14:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITu-0008Gz-Ki for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:30 -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 1qFITr-0006y8-N0 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:30 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbc244d386so17432945e9.2 for ; Fri, 30 Jun 2023 11:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148266; x=1690740266; 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=TRLND/FsJP/7sFVhRXujI3BG1g81af0/qiaTT1E8hck=; b=oyBMZlpDSBxckYDa7f5eSaZ6VDlXW0xk6+XnXPl9sUWEJalNR0LgK3MwdRWZ9QiZ4P 7klpbwwESHVP7g9Bl6oEvJZyUkH8I8vdCdE54+dit/8fb9tgmFAXKo23G+GQpnMhkCkM DUNBa8B7VC00GPTjK/jUsBXqfwZdD5LDFhWp/ekx4OKxA6cEhcRAAeEOexnqPnhpcfJ9 S5FbGypbjKKr5oRPQWPGFXDRHMxyzyXE0uECckMps3KPer/Frrzsiz9zGzWqdCM5fJwb 2+is+7c/izXRaVNXI2m2/wvjwiG2lcRp3LYGU3pgUu8OBVyAjjFhcIwJUEUF3qrb4XxK AwYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148266; x=1690740266; 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=TRLND/FsJP/7sFVhRXujI3BG1g81af0/qiaTT1E8hck=; b=MVBBw0ijKKi3aOPGABe/sN8eU3VP7jYOx7aU05GBo12k8SuD9zil2aEKp4ba8mjgRs otlWhNWg2mF5ReApES4j65KAdoqQNpsXR+nmyhpHbeVflhb0yFUq1fv9kf6o7qoeN5TS +S6ak7b9wDiKzJjrK+eDi6FUvlKw6ZsuRyt4KjBN2Vw6fn/Hhvu7dQjyXSvKKI+MjB4U rHCLxXqJQ0QOG+7KajEMmwanapxYnGiKLvP1qzJWK5UFOevIpq+QFB9Es0vXBhFl4kMm pze0/CyTmW1ld/gEdcFrV9VhOvhB4iANRGz+ckOUpWdfNZ2w9DpXMRjLGm2dNeHoz0+C ad3Q== X-Gm-Message-State: ABy/qLaTgrXn64dXDih9+U03VqnW4YKNrLOXh116Ma0Et+T2jLCwjOvJ UbpogsRCJAdVEZql2P6mFjiPAA== X-Received: by 2002:adf:e6cc:0:b0:30a:e9cb:1a2e with SMTP id y12-20020adfe6cc000000b0030ae9cb1a2emr2538200wrm.65.1688148266147; Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i6-20020adff306000000b00311339f5b06sm18754525wro.57.2023.06.30.11.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0F3B41FFBC; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 01/38] gitlab: explicit set artifacts publishing criteria Date: Fri, 30 Jun 2023 19:03:46 +0100 Message-Id: <20230630180423.558337-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé 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 b6ec99ecd1..84ff2f6d2b 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 Fri Jun 30 18:03:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697952 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp592721wrs; Fri, 30 Jun 2023 11:05:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIySf0T62A4ePPKKHGdPG4ciKJryuRjmJygH07bBIdSHJV8OoYEwAqazXY84Yx7QIwA3C/ X-Received: by 2002:a05:6359:613:b0:134:ec26:b53 with SMTP id eh19-20020a056359061300b00134ec260b53mr3570158rwb.16.1688148353905; Fri, 30 Jun 2023 11:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148353; cv=none; d=google.com; s=arc-20160816; b=0HmcfGmyjrfwTwGpFu5f5Feh0KAYViFdaSxJaVMfUAv2tZME9htbbG84J+Xe41Hzxi kUk9JRYpIMO74Kmbbcv+m8hpLRK1L9CqgdYNFwME6l631BXoTNGk17uYVn6qUnN4r79X vFQI8Lid5dywuwRSpyQTjCqdq3Zq26IsFXAXhIZ3id+l1O198EfvcMfd65AFPHHAsAGV JWEcD+/ANlY3RuuhroiiXyZylKUEV4xNMImt5VCfnxsQBk/hJDrzzf8GUUxIy3r7Nhay Fr7muQYOFkZEjw1C8sxkeqigr2sQzeg8fxOV2GPcVAFR4cn5EuiQ79ccTyVJW+XDlPnr N0xg== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=X7eoBfvwcremVGMEL97o1OUxqwmceU8Z0kdaZSAJru7z53OPgnppSKhgDumH/x45hU Bxng6+cK9QcIIrXqlM6N6YtcNhuz0aEAzQUV7VaHhzJTA2kgXc4dYektrKkwYtl3lwHo R9CAtcMdHjw0agOK1XINwpkLHfQDR1irvNfYhMxIton/c1QYUIgRI/VCWz271aMRoTCk WKF2VY75NodNnIblaG6XcNEyPRYUhj89uT2tFESJ/GEGJkH2oT9c5PqdKpXrXtmfKzb8 Kk28EALkhvMlChMExf2XlWMkFlwA6P8qucfUHYCj+9cF0ENzRGuVIjbwyqO2erRCxM0O tA1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HpHO/oaZ"; 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 kc1-20020a056214410100b0063020a21b9csi8181114qvb.271.2023.06.30.11.05.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HpHO/oaZ"; 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 1qFITz-0008Hs-LS; Fri, 30 Jun 2023 14:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITu-0008GP-4Z for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:30 -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 1qFITq-0006xo-Vv for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:29 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3128fcd58f3so2431419f8f.1 for ; Fri, 30 Jun 2023 11:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148265; x=1690740265; 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=HpHO/oaZAMnX54bvBiaPuNPoh3OlybvY8OLK1LOw6pK+G/67+dU6tG7Z7JZaXvF5Q+ KvndDQ981KEDQHr5UMFM02eqpChl2qTBVmyAxYgkGrsZ1qGFyRZj0LaHFXlBgFwFfXTR PHR5ZUg91Kitcyv87ZnWXLQd64oWAIkyQzXR90ttc4e6r3xr2z7NI4RNVVG2T0EFnJ2S W7f2EXFmN9TrQbhFzMay/x151LsGaImjmtMlFXR00IKuWitEZYe9YeH8ikTAfPIZc0+b ug7fmxWOC0q99A8hzSj5piCJV9ZUZ/82SSQEVQymq/zx10HlZ/Uj/wwJhr7wZJsBCmdy dwJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148265; x=1690740265; 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=CYyO43SPCwXXp0zWs8tdRaP75AL2CZ7UMPBE680HtEvOoADbeJIhxUW04xD9cM/zPa BjD8RijGI6W5hX4QzmreiMLcsaoZfZmUEkqwP9SKjE4NOwi2GOelJh7Qy8+GRvZaFZSe 9nwyII2j92p3RAOFceqEdpRqgH/OeTe677KNApLezoenybFOOeiYL+Epypiw7Hm99A9z On0ggwVyUL0VfH0q/nAGHGo+L6xvktOaz6UzRnCq2o761KjOcsoSX2EcExXNnBiUlDi2 NCBgnwfTclsBdE7aOevv9YGjw6FEd9dA82sP7jWt+f/3qRe91hNjgJW8JafMkGfdr1Oc nk6g== X-Gm-Message-State: ABy/qLZ5iJw1XPjsMk6xcSJh19WTGUDR9Jd+Dn9lbs6sNhLrlyPBKnzh qLFUc+Jbsu3z6sfJsKUxLI1YTw== X-Received: by 2002:adf:fe44:0:b0:313:f5fd:62af with SMTP id m4-20020adffe44000000b00313f5fd62afmr2567954wrs.18.1688148264959; Fri, 30 Jun 2023 11:04:24 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id da16-20020a056000197000b0031274a184d5sm18994575wrb.109.2023.06.30.11.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 28FC71FFBD; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 02/38] gitlab: ensure coverage job also publishes meson log Date: Fri, 30 Jun 2023 19:03:47 +0100 Message-Id: <20230630180423.558337-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 Fri Jun 30 18:03:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697963 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593994wrs; Fri, 30 Jun 2023 11:08:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5r8fV1cbRU5TCs21t82yhO3NLTpG7t0zNMeXWJw41nN3rezzkQMIi4X0s3sGx2FUmp6F3b X-Received: by 2002:a37:9302:0:b0:75e:d11d:51ab with SMTP id v2-20020a379302000000b0075ed11d51abmr3202477qkd.9.1688148509048; Fri, 30 Jun 2023 11:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148509; cv=none; d=google.com; s=arc-20160816; b=wNGcfPI5D//fPema5X865KL10cRexyEzJH1VH5PE3gImiNd3mRC3QMMnMfuKRPDano m4P3Zf03TXw/9sI0DVgALmmgkRICcxdSpL1WzWJh8gEcnw7sREbQ5nJfCjftBjwIUGy9 VwnXayp67tmyo7u6EIDkvm6uEVWCJP9+Tcr21JytAwf0gO44Zs8bkKWqiKMAYQBR+njO 9gA7aqSPv7XQu8pKpBxkyAYGren9Yj8IPnkDMPzH+Cykc0301uClLrrhpxsNWMAdNV+l cAAfQcoZowf26pOYX8WtGaWrZXaQRAvTMj2B+VSqbmLRhz9opW1aUOfVoA94A4z7Ewzc PGLw== 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=fqhI0bkTQitTyq9xrsayX2zpGaZY5TkEhiP+M9bVqrM=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=rSIXsoeuCHV6kFhrW/bUtLuYazIfYJt6s+sSUt0uSB7XhATNdv/AZifJ6H/PMgCt2U mW6YCgC7Gn8QqrGiR3saCwb4XBz2xz25XlhKF29IE6cerJZp5yumHx5f4UioAFoct35c 442CwvnjN8DcvIpdOdyaHL/6jbnFM5JP4qn5ol+62cNj47w1z0Lkp8odSxcJ1iBlRaj+ 4fIJVuNfdppiBG5aRpWXBnbJICPA4EVN9PrZjcNIvUaC0nzzZdomDVxeNyvsSSGFBcz3 OkIGGihoDs0vlkzz3/cKCNTpf9GC72Cs929EKkEa++9QiUZwOwRiBeSjyiIscsOeKgWM lbCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c08bKGxq; 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 qk12-20020a05620a888c00b00765a6fa70desi6570009qkn.329.2023.06.30.11.08.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c08bKGxq; 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 1qFIU5-0008ML-GN; Fri, 30 Jun 2023 14:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITv-0008Hf-DX for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITr-0006xv-Md for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f9fdb0ef35so3617114e87.0 for ; Fri, 30 Jun 2023 11:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148265; x=1690740265; 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=fqhI0bkTQitTyq9xrsayX2zpGaZY5TkEhiP+M9bVqrM=; b=c08bKGxq0P+kwW4pJ0jqOdEMvS1ioDlM5/DzZcsqwJRTb6dG+Bjr8nNOvEqb07krRp UVuDAp42zIGgpTOjH2mWifzhWdzZ2mZgn3zGu58cvr5aJQ8RSAEnAR9MVFZulYV1JoMh KB++kVan/jQJbcoK5qnU6m6ykcL4uaAHSOvFY4ytTN16SbsTXxRtZ5PF6NzfPzMlph6k m3eo0qx8Zjy6bZQ81LAefKcVQN3yJ5H8cw8wtsDV6f2sX+UzoCl9XVt0ECSlmIKYBFZG s/xV4pp52ny7e8xrPyWZidKX3nRetzGyeSsZogfueZMDLsMwzpDFPtDW7RWyZ0S7bLQM 6RSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148265; x=1690740265; 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=fqhI0bkTQitTyq9xrsayX2zpGaZY5TkEhiP+M9bVqrM=; b=hkLD8oF3PX8dAaJUusOvCeWUeS4viaWTtyaAVHSl9+MwSgyy8zCLXtRGqlLDMR/Lrj bu7Dj0tUDalqp0ZBOCMgLtbc7izKWJpB6pD+aHZ5nFj4rLLs8/VQ18KV1NLvGnKCo8nh CacI/mYT43cTqTjHdnAtbmKPsMUQOQB/99ip8AhDRnKLxLzjEFh00YW7fKKIRMX/Bifu gQ9/7oabfN3PZLmlIORmxT/QEGgIPLK26dDPh2LquceBrZJF+w7JgsJs1g1lwPmhfRHz eBtTgaxhRYIbt91goXtfBr9VkF+CqjNGWa7Aps23pHwg86JIMlsYWew4HexHnDAXrIPB LyxQ== X-Gm-Message-State: ABy/qLaUTjHGMEyXBjJl953r/bbqbLdhIiA9bxUwTK4zQzh6kHNhSWqT TRw4BVfxsX6+79WeVNKhKim1QA== X-Received: by 2002:a05:6512:3131:b0:4f8:7897:55e6 with SMTP id p17-20020a056512313100b004f8789755e6mr2595659lfd.45.1688148265171; Fri, 30 Jun 2023 11:04:25 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h2-20020a1ccc02000000b003fa74bff02asm19430550wmb.26.2023.06.30.11.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4138B1FFBE; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 03/38] gitlab: reduce testing scope of check-gcov Date: Fri, 30 Jun 2023 19:03:48 +0100 Message-Id: <20230630180423.558337-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12c.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. Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230623122100.1640995-4-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- .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 Fri Jun 30 18:03:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697966 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp594115wrs; Fri, 30 Jun 2023 11:08:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47hg7hKAWCsvQBGSAzxMgv/bT3cCEUOjHAjUJllMDn9IaTFkMBv7bVpUA2UrAsfdUIjRxa X-Received: by 2002:ac8:5e4a:0:b0:3fd:da36:3e97 with SMTP id i10-20020ac85e4a000000b003fdda363e97mr3389132qtx.34.1688148522114; Fri, 30 Jun 2023 11:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148522; cv=none; d=google.com; s=arc-20160816; b=eIsGta6/18/3fihdkASZFeRPB2rM8S+8T3/Xsz79RnADS8XXkR8xb3QNmXRLPWZRy8 CUbzXjfsbZzPYcxmEvMsd4su1B6XVW+zp23MiBCpW1Z4cHciIvt/z1v8Ca7NTLgEU9Yg JqjdJy8tIcmH/v+UEjdLMywAkvB+KPpXGxRAPNYCGey1SxlYhBoTA5ElEH79MX11duPC T0X+1LORi6+ztO/G4t3yVa1UfX2f76yEDrYMG1tGDWPv+yuFLilQ4h7t8hpLiK1SO7xk dmOnwA5+Yb6oegeXapkYFy/7Zfskdp6V7uIwwVJ/RY0X4XfAUmKI/AWrsL1CSYbz9bWn Ro4g== 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=d/TY0KkPssJi6NIaD4x7Wem9brAqFmX1qoF7RdIDR9w=; fh=jrfTN7FxfmWtRbtBcTtAPhkvEjWPfSjdBL4h00Mm+Ww=; b=sQTnQx766zGorBhJ3HXYII+vNd7xW82QJdOdkhxvlwptz6gqoXzxFtlAOqBMfclqME bNk2y6S93+CJ70BvYLZO2mlsB2wU7sSZf/alz4hXRjh9NPHL1O5KJNJP/Ca31kUlRAc+ pXcma+iQMF/8n72g6tRC4g0BLXViEHPp41mbnRzpnSv0Cv+T+4Xm+g+3CAVrvSlMJSLE 16FP/Fpt+b6Cw5KmZzPL0axRqycijXDnHHxPv4/xcXH7tidnewNanj/u3FOY3UqxbCB7 d6E7zgRrMZ/cDRYepjTS4BqA9Z1AXcpnajGe0xO+hND8FlHf+xlLYFKjRVw1TGhoYWh4 A0DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eOfxqV+Z; 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 x10-20020a05622a000a00b004028b201f13si5813628qtw.693.2023.06.30.11.08.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eOfxqV+Z; 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 1qFIU5-0008M7-36; Fri, 30 Jun 2023 14:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITv-0008Hg-LI for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITr-0006yJ-PG for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbc0981755so20866275e9.1 for ; Fri, 30 Jun 2023 11:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148266; x=1690740266; 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=d/TY0KkPssJi6NIaD4x7Wem9brAqFmX1qoF7RdIDR9w=; b=eOfxqV+Zr0Z6pF13yplbNqFx1RF/BlJhSEb/uHWNvi0B9ZV+FhBmuhVaJp7Ox1F3No PW54VszFhlLGN4b6Q/4wxwD1cbwBNzxof7d9UXmVp3aVdI0jXLMndgA1ER224SjBWWy1 QBd9UpYRiXjPlWITdSmQtk+CjqvsLzijRKl+nWQzWLVVelZ/wbAnUqbJZgrSwaplI/Er 27vZx3A8rghsr4wgwP0JxY+qlDAwkG+l5FSnSRq/qY+NFlUkIJdOoGSpQwqZ/A8VoUtP BE83wxsPF7oeOjtPraFwrAUhTWZ4ZoSrawb0BFLHTAKtc4cyqz8PxBS/4+UHzT56zVE5 R59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148266; x=1690740266; 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=d/TY0KkPssJi6NIaD4x7Wem9brAqFmX1qoF7RdIDR9w=; b=W0AhO0qwuoVBA9kKWYYvZyFyqt/7eVHGkj1Sx3Q2ygk9lYLMhBVg5suwdVhxoJhRJ5 oMXeHrws2dUIHGN2SxUrYV5IbUlotv4qSH2a6HfMVpFStr4dKT/Vf2KwEgeLJZwSDlzB 2JkyW4uVIRAV7hqciUrQBFg9qWDTVGgUd0j1v2Xxe0gb3urIWZ3Sx4xowVsrf4L89aJx Pqzyt52rzjzcTs1u0b3UqaJ15L3Mx+LNi5HRX96BrKA0Xk1v6KUkvP7AhE7maSxHtDrx xlKromyORX8s7Cj2NIlZR3yLgkfk/OMsg+gbUNyYWGsZzfsT+ed6ucxDC1J1b1Z+Xla3 STnQ== X-Gm-Message-State: AC+VfDyXM22cDPdFn422YxDXxXg3qGseT4AJ4doy7PJJh2dxaoSFf1u5 c+ZXEfnvaVydutMmNWLJKpfXsQ== X-Received: by 2002:a05:600c:290:b0:3fb:c225:a75e with SMTP id 16-20020a05600c029000b003fbc225a75emr2618980wmk.24.1688148266376; Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f90a604885sm19691989wma.34.2023.06.30.11.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5AC8F1FFBF; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ani Sinha Subject: [PATCH v4 04/38] docs/devel: remind developers to run CI container pipeline when updating images Date: Fri, 30 Jun 2023 19:03:49 +0100 Message-Id: <20230630180423.558337-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 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 e85e26c4ca..fb651eae11 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 Fri Jun 30 18:03:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697955 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp592875wrs; Fri, 30 Jun 2023 11:06:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbtnm1BB+qBqM2g+OPosSbDwGMJ9JJJuH1b7Wno4XWCb70XQWrx3sZf0SaZjf1Dy0nHHFA X-Received: by 2002:a05:6214:27c4:b0:635:df49:719c with SMTP id ge4-20020a05621427c400b00635df49719cmr4674965qvb.22.1688148371249; Fri, 30 Jun 2023 11:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148371; cv=none; d=google.com; s=arc-20160816; b=jpnOoVYzAjOS4SL8TmmZ3m85T0GBq2USpdQfBYLFDw/Obb2tBzRHda8JFV5W1DBRlY A7ouG5BFbVOelD1in+FqMXyStO5sUCvgjnUjCSlr3jIyF82T+sOqc3Rlnbtt5ovl3Mr1 klcWm0I4z6BglSwtior7GBeV9W/spMwgMi8CWEfrt1OsMXV+vpdgQJLhE+phvI9sn/hA 90D+a6dj1DTXOMWI2XT2g73DnRkR3ZuV4ZLew77Mo6MQx2Vo1HcMWG2h8aAGuEOmJTvL ZM20lGIX9jyCJsHxMAeSQe7H5/zS1n915R82sxiZd+QdqOOjWHpt+nkTYe2F82uA0QHs RRcA== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=A91AFubtZH2g05lLcmeF7V+lnwqozfLlJ/5ykb4kYBzW5Gt79d6Cy0SX/YgxcxsnkQ SMLnJocs2v664dRC0/0C9073YqAkLU+Yd/jAacYsQqllDiO34XgtnObrFZKs/2yNUT+T ubw9AbmaQREtazMTtkmAEjTbbU4aepq+QWxT0sIb9Yfa4ZJganSAFp2HQ4Ce+fz9gkNs voxPJ8LiDWOPxywTrs4U+gJzjmBQ4XQHq6um7M0ztT8pulnZKAX7kRaHHMvX/swj+4Df yj5sKme2DyyQDSIIUbAOflMfDqFPnkun1bx8l3sYVxYaie/wUE06xNkvijgoveXbBJvK cYJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lqbvm6pq; 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 kd25-20020a056214401900b00635e2f1ec88si6576827qvb.476.2023.06.30.11.06.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:06: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=lqbvm6pq; 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 1qFIU2-0008LX-3x; Fri, 30 Jun 2023 14:04:38 -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 1qFITv-0008Hh-ND for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITs-0006yb-AD for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:31 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbc59de009so13910035e9.3 for ; Fri, 30 Jun 2023 11:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148267; x=1690740267; 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=lqbvm6pqNewUj6RaKfZVi7dE9g8W3q0ZBjF95DMcrcjTNDFusfskvIHAZLOvVzetEw dKryrBXBWXPB5kHTZeo/D8UtNTR/yhRFHw20GiEapa3TeDKxxSWfPkWphjuVsU2EBuX+ LwTOBmhYa3FRqRbsuECPn3H5VxN1DeCLEhTt1NlrkiUFW6x4kJB04DX9NEwA4FknAovm uhsSUF4gBoYM/sh7DpPQltOBDnoVWZopWMJyYEqw5fZJl1r0Go9z9wmOsdWsaauUbDI5 LXJ2xJqQDtgBuAKAzVPWabmUsuGKBnsRF7sHa/dmhZuM8Nabvem72ZAQToQWOmecIjJ5 vARw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148267; x=1690740267; 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=XoGufJtdV6WS0+pehRuZW0fJkUnD5hE7aNFS1sjYAfTAk3Qalu8QiYVgIfwJ6g9lHZ uuRsruOHfN+dgEGt1RFKY+11+F5KiqEuQA82Vxz3DnBt84v6AzI4FYhpNrPhwAM6pa/V k5orxHotPOyElHrCda7zOY5I8J9vs9ZQUj6Jkncu6TFtTDu8JaMbeKoWIMVSXYZX9Oin MdcNx221OGXPdtzgrgylsispU/ad2MBOs+0HZ6dvXmpuShLp8sq13MIMGSKsYgravjRm jzNRI/7QDCCO7oUlxJCUUbaXIZ62x0QB5Pg7QwIZEuR7t9LvYJBx3z+vTGcJ830k+MRV Awww== X-Gm-Message-State: AC+VfDynxmX7Ios09OXR4R7P7qDzg+u4cc6NnDGCpO8rmzIFkGbimK4X XXEVK0eRg3FAnQe+dEhoN3g9Ow== X-Received: by 2002:a05:600c:218f:b0:3fb:5dad:1392 with SMTP id e15-20020a05600c218f00b003fb5dad1392mr2327208wme.17.1688148266903; Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c1-20020a05600c0ac100b003fba6a0c881sm10400961wmr.43.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 748461FFC0; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 05/38] tests/tcg: add mechanism to handle plugin arguments Date: Fri, 30 Jun 2023 19:03:50 +0100 Message-Id: <20230630180423.558337-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 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 Fri Jun 30 18:03:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697957 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593094wrs; Fri, 30 Jun 2023 11:06:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlHu4hqcuji1QboC3fxPDZUBltM91GocQZ+8lyYAmyxDSTnbyJCxAcaDPXFqwflA7w+W/2+7 X-Received: by 2002:a05:6358:cc2f:b0:134:e5ec:6ab6 with SMTP id gx47-20020a056358cc2f00b00134e5ec6ab6mr3363667rwb.25.1688148396134; Fri, 30 Jun 2023 11:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148396; cv=none; d=google.com; s=arc-20160816; b=MfCfdaHhBgumJOGyZSSrv10NHt2S07SGtiNP2+EMKVRYCL61QlKmIxljIf44wluF4u CySSjAgb0etY4GCgKAdKh5i8pV0sqzRiyT6dPoel5w0TlFF0KzTzJ/3t8TY7J/C+fBuS XRwA3FBS4fmb+4Rmo3MVfTU2bEEEgZ525XDcyKqbM8O1/Jhc+RX+QHxm/Guu1VPq9Z0d +NAmAWd9B8/Zg8UXAT6oh5OhgfDoN75ZzfUQedu6IarngbAPWScll+rXpftt0eaRP85D Ew2w1j6KzpwzvrAeO8hXMOjy0wgArRGzT6u3sgpW65umU4wPeLUg6RKnUePtP/RbDXjT 5UDQ== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=My4fEsM1veEyZVvAHQzeBZVb06VSUA7Eyyt3uQMES6H3cUKfGRAzPO1NqnRnHvydyE yoAZrUe3iO3P+u9veJ3fgYtt+J2lKjq5hUswrAOj6Cd8Zc/Ac0oiDGBLFD8n1VxsPotG go3sCcJRkUSbKp7SSyfEd/U8HFBUOOjmD/RN+b2tnv2hdOFwO2wKZGthEvbXwEteATGb 814PvWYvUE/5+XxUhAoBo4bT1RBuf1wQTaZ4fX/D64/TWyMJlky0MarE9SdAomKJg0V0 stL75zpPO1HSslxYxfVRqMnkHH5lqnOToEtm3F9mM5hlzH7hScZbL7XDESWWVAleSESS 1ATg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MpO2MOS4; 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 m20-20020ac85b14000000b004033ec2f5e4si1401790qtw.464.2023.06.30.11.06.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:06:36 -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=MpO2MOS4; 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 1qFIUB-0008Q2-PO; Fri, 30 Jun 2023 14:04:47 -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 1qFITx-0008IJ-Rc for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -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 1qFITt-0006yt-Pq for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:32 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc12181b6so19815185e9.2 for ; Fri, 30 Jun 2023 11:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148267; x=1690740267; 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=MpO2MOS4a98PEtb2uWvjbuhddvjIe20YxqcF3E3H8bVlwK2tLZ+90AxPHqHk9qJqzY 2gPtLSIJj3hFE7C7usNN64fgOBoeoS1cfO+DgM9sqo+7CDm0hKlcQMZRRpypk6QfckWf bvc+EDldvonBgUdZaLLFTNZiWzwcVPW9s5V7wyfWRmeJ5H0kcOfvuctgcK8FZfP+ubtP crRYg39gl7y1/tj3at73i2yv333nzywosh2ljppkTeyHCmb/nipiGbdYcOLzut/ZVBlH GfDxrp7inwXlasLtPzcSdO6mtjMIDfi2tNoauXOuNsX0wBMdcysR9puTXZ5G3OsskeL4 DCbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148267; x=1690740267; 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=XIEKQjqB3mtCd64lJhemvdt2cH4vvwb5ZCWyBf22MhBqY6eApOJ/7+1HkR82An4eHX EpoW8l844Y+UKS26I+MUU+pumBY/axgt1oXiUqkSyH1WGO6EZ7ZWqvd7UHOvnrpZnO0T 3ReIDR/NnaGY4lc3izbdwuUSLMlsY/+hzRzF8YOOwcpR+7FrDO8qVifmczphUcO9/Nsr Czwb48vLBJ2Muvb/RdTUGD31m7Jce5CmhDlqsx1Q6fIhMyL8uhxRq6p5XHJ7jVKFWofW GB6EmrNgC8o7QbfYPtX/hjxQcz8aAQ5BqVwj4BwC316t7d5SLbP8X5xV25rbx26L5Idi 3K/g== X-Gm-Message-State: AC+VfDya2dUWhhDihmaRAGeRIeovqphnf0fNfFASfrRXVDuqnHQwdcq2 S2DzCNLvd5ipwtgJ8bZPHFCWOw== X-Received: by 2002:a05:600c:2299:b0:3fb:b2a5:aeac with SMTP id 25-20020a05600c229900b003fbb2a5aeacmr2508315wmf.20.1688148267615; Fri, 30 Jun 2023 11:04:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y5-20020a05600c364500b003fbc9d178a8sm1192326wmq.4.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8BF481FFC1; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 06/38] qemu-keymap: properly check return from xkb_keymap_mod_get_index Date: Fri, 30 Jun 2023 19:03:51 +0100 Message-Id: <20230630180423.558337-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 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 Fri Jun 30 18:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697953 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp592727wrs; Fri, 30 Jun 2023 11:05:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6q6eTnLqylIpb22lVaZJqUEKcCwagcQqnlonV9BwO1FEhMrtBczCwP7NnYXt39ZIR0AMIa X-Received: by 2002:a05:622a:1747:b0:400:79c0:cb69 with SMTP id l7-20020a05622a174700b0040079c0cb69mr3222687qtk.58.1688148354232; Fri, 30 Jun 2023 11:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148354; cv=none; d=google.com; s=arc-20160816; b=z7GOsedQyD5dJnw2Ifu5iYJMxoq+pJOLkNxVLlvCJlaUQB6fa1FI06kJJVYfeu8cgC fgScJgPzabxGfU14I9yCdOEjtEHcBkwdWJWGRDPOL1tc9fns8PCWEStqZwvkW7N6hOu0 lpCQ+s6IAr/JYSNVRn+4rjUe07+75dCWZzNOAdGpVkAF9+Ie2OipMLXxa0a1JSd1LORj QEMT6ieFClIimBbm9dtgner/JkfEaQ9saGVUjpdihFRLdsFURks+Ak5a4IcNK02fN+wK SoRkxobykpfzBa6tAMbrTv6spPEro/9KBah6ys3W6fskSIRXb0yJ1e0rnlMOXUYbYA/X nHKA== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=H45CE411nQrAZUPcy+8WfxlV+ejlw6nErykKRlKTfyxSDaGnA7lERRjjMi/uJdFUQq b4GByc2UQYl40bRxoRLrsF/h9Sg6xeyUzE5jFOiqCO+Sb0EiWflgbqyq3PsebVUO6o4H XsBJDd4+aoHXHZ908Ve9gynqXjX/dz/wgz8v3sQ4VtK/70waSeSG1ZatDSnxZxF3Z+MT iNMugs+Dev8JzyeM/SKlciVtHM+TcDCA82p3FDa+LuwAbJ+TNcWnGcIaeZq5WvQd5Qoi MMoFLKIkoMl2V7Gd9TW4x6ZcDk6kUGif1hKt+50uv3flaOHyXIfFu9zxXqAzgFjxfteO gE1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mwwqeu/2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e8-20020ac84e48000000b00401fb769401si6321785qtw.368.2023.06.30.11.05.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:05: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="Mwwqeu/2"; 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 1qFIU9-0008NF-AN; Fri, 30 Jun 2023 14:04:45 -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 1qFITy-0008IP-4H for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -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 1qFITu-0006zP-A5 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:33 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-313f1085ac2so2386461f8f.1 for ; Fri, 30 Jun 2023 11:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148268; x=1690740268; 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=Mwwqeu/2LjEp/DTk1EdT6TDICGuAO3g6x+jAlFMYhvDYd+P2Pa1h3Kgb7xDdNeKyQ/ Pqnku4PekyaO9Rfb5xBbu8+az2lTV54jTMNxjh/avbMfFx7tjGp4AoZ96UjxleYjFS5K VX+OPHA5Ky7FtyrlhPqwKUeeX123499PjY3SejlICDWw4eRx8m1lrVjw3ktVKTUvhljP /E7d6WNr5WFAdto4Wc99g+Kzg8qQO6Yw/P7IBQpwUwmNu4kCTpNqutzvWsXO2EyTpQxC jkghYwH5TTeIep9iHM3coTUygMIFufTcSeaf23IlkWIkBTJIrnqoUjiWvovMHQEmN0Vw Ig8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148268; x=1690740268; 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=TFbjEtj44bYElb2ZetZTTJWLkMrp8wRX6lfSRPI0ru7m7lpqEd1UMgxlbaheuNlNxM Z85tQ9Ug6tUoa9imNecBlJuBU8m4W4otGWH3kovkr927HlZFGno6JiKSAnaz1XVQhZUE YW3sY2hBnaaXPwiRL+A2CjxVY+Qe/71B6lbk8Jz8xalW3u3zrk06gb0fMEN9RHAXGg7h scv5b6XikXa+hOB9LcdzQUmNjqf/8sNmRxKegfvMpGRWGepc0zKy3/mRajInuBhNSqvi 5KZeICdOGweyzBOmmkUHnnNj4VzfdRUJkfIahO1FMC/PqZlVdV+mINw/SRfE8OH1Pfmh QlHQ== X-Gm-Message-State: ABy/qLYkga09A0I99vhJU+R1eqknh5HTOjWCLVYrHptXpn2tVCgUaLo0 TegbPp5BV123WLBFCLgHQdg0SYBzDtptBtf5bxU= X-Received: by 2002:adf:ee0e:0:b0:313:e953:65cf with SMTP id y14-20020adfee0e000000b00313e95365cfmr3148541wrn.17.1688148268660; Fri, 30 Jun 2023 11:04:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f10-20020a7bcd0a000000b003fa99969e61sm13990081wmj.45.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A49A71FFC2; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 07/38] scripts/oss-fuzz: add a suppression for keymap Date: Fri, 30 Jun 2023 19:03:52 +0100 Message-Id: <20230630180423.558337-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 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 Fri Jun 30 18:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697961 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593889wrs; Fri, 30 Jun 2023 11:08:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cHKnvYynjVn8lIDz2JJaHTVmzTAYOHn5Tz07DstoHqpNdg/Qzbizc68bwE3sH8eGe42dM X-Received: by 2002:a05:6808:aaa:b0:3a3:6331:fd69 with SMTP id r10-20020a0568080aaa00b003a36331fd69mr3376156oij.8.1688148495367; Fri, 30 Jun 2023 11:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148495; cv=none; d=google.com; s=arc-20160816; b=BpNL7F6MMCAFuMjN+9dqIIS5RHu7aSyyXbcWtjs2S/pnxISJ93dRTI4Y9F2Hf1zDGH zvjb9KNnn0+Di92Hs1fLDiqZnfYPGrQMwhkHp0xBlTZ+HwhhHoc8oU82NCqr29b3tKoM yAahHXplIEwhkoPLYBY8pw1DCq/toufSP1MfhkX3u+ct2Yoa5F9nBaAjlNQxOsNyb2kX 05FjhI2Tz+BUojSDFgnBE92mZY1iunDG1jn5pSGmPrmB0byFp81JolrAvfsekzq93BxB o/n4mK8uBAcyvr93R14lI990nV7oeWlYoT64e++rPaBHunSXzbUyHorEIBcnXHXuFPVj mnOQ== 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=SSu5pHfoFzXcN2jMDhRn3eR0vnuKsKx/O0/7tf0yFTM=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=hsjz23LGWLnII+jgAaPBi+HImOQ+7dsSYUbchUMBdnqle3O5iia96kRFWgft+t1U1r q5WwKOfgn+Fqe+Zjgu7hL3dgFHyKPRnKi2c+8/1qys4CjsGbjjGUFIBin6r7JrdDCSOQ 27IQEw5rVwS9exK1e/neRaEoUMIjIECFyLJPVzhhP9z+7+H+1lCfjFfvGQOg7fE3RuLz bFRcJS/3DQgrVoGC9vbWo6ZIkUnWjDbKS9TE5/L0m+AfLUAuYAdn7/Pv0hVjQYnxKUC5 3+y1EHQf520PYbj0ZzyGUWaSyGZLlUcyYjuNdfZxQ22ftyBHpGuC7iWHccMQiMtnOYzq aNDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gmI1tCM/"; 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 tc1-20020a05620a2cc100b007671ac49befsi4718259qkn.682.2023.06.30.11.08.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gmI1tCM/"; 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 1qFIU3-0008Lu-0e; Fri, 30 Jun 2023 14:04:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITx-0008IL-RZ for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITt-0006yz-Py for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:32 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-314172bb818so2391820f8f.1 for ; Fri, 30 Jun 2023 11:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148268; x=1690740268; 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=SSu5pHfoFzXcN2jMDhRn3eR0vnuKsKx/O0/7tf0yFTM=; b=gmI1tCM/SzFKZXXDBrrViPmwB5IpkzBVuzKvF58c4h2JL+/MLQgDzcg6aOke7RgKBp d3uq1KhwOEQOqI7POh0IkwWoMgYE3/B6W6d8aeR24Te3Cv27dZInOiYLRv6gEvs4ebHP K5dYahrofUra5LlAuxQnVRwUKu5kXvfAm1l6ESW5kZkg67vedbnOl8wx4ne3sF7jvjma LsITkM1Zu4R3kU5NtaTYtn0L/6b3pNGvCBucGs/BPTztscdwkVOjyl5zV2BcGOt5ZChq DwPEQxndmKBxSj+9UWfybCEwGa/A/Kgs/plQpoj0vIp0A9D6IbPGdnP97fB1eELVE+F0 /keQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148268; x=1690740268; 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=SSu5pHfoFzXcN2jMDhRn3eR0vnuKsKx/O0/7tf0yFTM=; b=gepRnD6GR0ZTJh+NFTPlJesS5WHfSTVtJz4sdJoghzr1Zk3w7cZcEMX3R2U9QPJCx0 u/wemRrCtHuGecOmvIwbLfdhbY5/NMtttJyKTRQvN8fsZTa9djALb6fWWTTB7yCo/Cza H4gGNWCkVCO6YpS82cFNSlGqXSIaG/U3xXQKLbFdvSUdUbSAuVSoH6x6PxVkijyNSiK4 LngxHd0BAZ1TkrVyMkwUFcAIobTpVyL3xBqtROjTFigfJMfx5RMxkiP88/QGZ+iQDPbh ZS9KCL2Ic7ZvFt6swUBariXiwRm/CsXJU+JFn6ONES3VyXugybzIBJzEtJfcR8QktJmA Fz0A== X-Gm-Message-State: ABy/qLZGW96PqPrgGn1OeGobOBOcIjNJDbXT+a9e6kNUT/q1ov5Pp4Om bqJtCMUcinaKjRBnOvjvwN9t8Q== X-Received: by 2002:a5d:61d2:0:b0:313:e8bf:a6e with SMTP id q18-20020a5d61d2000000b00313e8bf0a6emr2851150wrv.21.1688148267856; Fri, 30 Jun 2023 11:04:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b7-20020a5d45c7000000b003141a3c4353sm4227394wrs.30.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BD5481FFBB; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 08/38] tests/qtests: clean-up and fix leak in generic_fuzz Date: Fri, 30 Jun 2023 19:03:53 +0100 Message-Id: <20230630180423.558337-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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: Richard Henderson --- v3 - use g_strconcat instead --- tests/qtest/fuzz/generic_fuzz.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c index c525d22951..11256abf6c 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++) { - config = predefined_configs + i; - name = g_string_new("generic-fuzz"); - g_string_append_printf(name, "-%s", config->name); + for (int i = 0; i < ARRAY_SIZE(predefined_configs); i++) { + const generic_fuzz_config *config = predefined_configs + i; 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 Fri Jun 30 18:03:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697964 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp594007wrs; Fri, 30 Jun 2023 11:08:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2ghnI9f44WuPQh9WRLT0ViV2TN4ztKZM6+Z5EFMXUGxYXTIxUTmyuJvaC4f+Y5z4AfvSL X-Received: by 2002:a05:6359:6a5:b0:134:ece4:1e81 with SMTP id ei37-20020a05635906a500b00134ece41e81mr1492661rwb.7.1688148509921; Fri, 30 Jun 2023 11:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148509; cv=none; d=google.com; s=arc-20160816; b=KeRMN954WmTAcJLThg5jAlRaQ692+7KKJWqnFMDYc2yZbiaJ2xY+QS/xqHzTr6VYwW bCWlUm7B9PK9ZBAo5VE72+Nc9CceodOSAFb3Wh9Yxz6iU+U+qpAUO6nFcoPH7N6OstTH YkzcjUDeYjK8pC41IQ1rkzls+QTTQcwqlpH2lkzVsFtwhh0xcGneTO19KaidEpbt1KIV juTZIqwNZ+mPwE20bMZhoF6aIpqb7RUtwoH/BKV3Zcq67HN1e8pSfyp11sDm0X7kJrBA FjS68KnJZ7hz1DwEjwhOpYwfdtvFwD880Iskumow7a3gOYI2laaur3/XyZSYzaElmlPm uYcQ== 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=Lz5lxf2E/M/Con0bds2DlcTKe4KZQ3/27M1SQX+Iwww=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=DeVO/1uI+IxLTKcaaQmKVBAyQJZowvB3Y1J3FeNiZ3RfCPL0f/jRdJ8ZNBjj+gUJmf DdtYkdM81RHGU6qjdvLjiWw0om08dmR7muNphZ64V6nQdhMJK2+T17BfV3sz0+zz60za xiTPnr9/2ltXBx1cOQX+D1grO99jbPIRTATZIqIc93wk8hyuQdocvRThqFnRcL/mRQMj 3W56vM5L2EnRNG+XzqSi5O8x53QqHzAlu9PD02aWCkO8nR4yjWG9uMogBBctLWRhaHtz 29dHYW6YDqbLdsbahbv7I+IriT7u+vzw/eoM/UhW40Zx+Z5FP+O+OFFq+kyB/c7rkJau 4hIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lFHAHR36; 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 d7-20020a05621421c700b005f97bebca20si9097981qvh.59.2023.06.30.11.08.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lFHAHR36; 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 1qFIU5-0008MG-F2; Fri, 30 Jun 2023 14:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFITy-0008IT-J4 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -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 1qFITv-0006zx-CL for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:34 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3141c8a6f30so2111473f8f.1 for ; Fri, 30 Jun 2023 11:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148270; x=1690740270; 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=Lz5lxf2E/M/Con0bds2DlcTKe4KZQ3/27M1SQX+Iwww=; b=lFHAHR36qCUu5wDEbG6J2QygRFQ2dD6A2GOtDeYxbbedkkOgJiAAatzJHDROvNA9Mz D3yDxkwcuMd87xCib4gslxnYZMP+m4Xx+uESdIqbzyLtSAoYRM1ukKpjjNNMbbvejMW3 c5Ixz7R+EBFoFWiIX7R0xQkoIm6MYmg73irj/wL9avvujI7WIl+ZImvvcoo4+tLpMwJg 27B7qFQqtbeEghKIjRyulpI2mrjGMpLO423EsQ7kJ2NBKLTJN+D8YXaxNxp7TmXrw8ku DrZdWMiQepXxr6t5atiD8tlhKaLj2zHBwkOT+GQuT1ZIcxAg6mksMVS950op+gNwdKOm SihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148270; x=1690740270; 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=Lz5lxf2E/M/Con0bds2DlcTKe4KZQ3/27M1SQX+Iwww=; b=ZazQ0t1wa9bdBSiDjGxLhbO89fTgKrvYS3v8e7gKc+12T8r4PcoOZNj+0Wy8Pk3/rE eGSBaLFeLHQ62pZPIntTy7sMLD/xAUhswxnVTBVVHepP4yqjq/i5lY/BK0K7tplVntVv V3YJcVn6DwZFBUYYttM0llK+SQgSQQReydLnq4wUlbLyAYwdn7nqBGzA8F4RRiGrf8n8 vcZ4Y27hpwH+xxbrnxUarWp8GxlIDi1eXfvssVwEmXV0ezIKBI9NVDpIJ+qjFEfmv8i7 yt/rRMaN5wLF0T7R+mR2u5I0d8eO1+CoMZOUREkFbzFzNVAf8B0zJtheC94MW1nZsSBg qqoQ== X-Gm-Message-State: ABy/qLY6dxBPjnEX4i4Bwi2UhP3Hq28jMl/C+mSWm9zxh+DJjjnmjlYW C6YmxF5CDVysxFFgLEJTPnz2NA== X-Received: by 2002:adf:d4c3:0:b0:314:117e:d332 with SMTP id w3-20020adfd4c3000000b00314117ed332mr2803305wrk.49.1688148269794; Fri, 30 Jun 2023 11:04:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t25-20020a7bc3d9000000b003fbb8c7c799sm4838941wmj.30.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D870D1FFC3; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 09/38] tests/docker: add test-fuzz Date: Fri, 30 Jun 2023 19:03:54 +0100 Message-Id: <20230630180423.558337-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 4feea49a6e..7164cf55a1 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 Fri Jun 30 18:03:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697959 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593194wrs; Fri, 30 Jun 2023 11:06:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMJw9PZpwQ3ceRIDOxb9DJJCEd7LwZnfAhqsVAfDpUG/HHq7Ncab//30a0b8Q6oVWtnT/R X-Received: by 2002:a05:620a:24c:b0:767:464e:c52a with SMTP id q12-20020a05620a024c00b00767464ec52amr2337882qkn.35.1688148408286; Fri, 30 Jun 2023 11:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148408; cv=none; d=google.com; s=arc-20160816; b=fjxtnZmJ/HSRQlu4v7ZyWrEIV5xABYegV7r41CwmeXUIwAxh/yrKRkoHD+opOjugk4 QuiCQMwbqUQjIwctFzzbFe2RYK0MYJk28eQXSxqt+twGYWUI/+3Sx1hbG3FQDErBVDC7 3gQefgL0paLY6tVve6MwMmXETKe89ZuUK8kopoWGIluNs7XpZjX9RzMpftMxwlrbyJT/ G2xB5NHWV8B3PNXxG0PVLmYxfw/NzFqsOBdE08QhTtHAnbKImHlEgZg1+1LYQ1Dyg+k1 Mnq+J3nO1JWIqBOhwxUAdBnXwMTY+ZUIobXXL00+ljcKUhUcq4SvS5L+KT98V5dPPBmb bsFA== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=AQhPALxwflsrImXcyLFAzs0cVE6EKQw+yDCylSFlX6SM8yd2ZERwgxXHl5u7/iePGi yTQaQsN+AvB3kWe2wtffSzdLoq79/uC5G7Ih2HUvgCJ6ToklV3bS0TMqe8ZidA79aRck wnKwk+XdggY8g6HjFmEXtIav7eMEs5paklIZruDPEqri/YagxwnqCHzDtWXbRMxX65vA gZlqvfHXpSj6fowPkufbDmp4Vck3bvG5+zDRBbUjESDqAAhlfNiMO078mwnejRcnqkdw oE6V6c9rQ6vA8F3p4JIeB14ni8QiRrfbAnic4w9jqYq0QIcE7OcdtsZCfecEZkiNpCwO 4hwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A9B0umKu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e11-20020a37ac0b000000b00767179b3a48si5147933qkm.289.2023.06.30.11.06.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:06: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=A9B0umKu; 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 1qFIUB-0008Q1-OR; Fri, 30 Jun 2023 14:04:47 -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 1qFITy-0008IQ-58 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -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 1qFITu-0006zW-Bx for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:33 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fba8e2aa52so24001285e9.1 for ; Fri, 30 Jun 2023 11:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148269; x=1690740269; 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=A9B0umKu17kCfIRcTjlCXjvN428jQJ9E2iSAYiiWybN21JmxjpQIpW71X4jnvbHuNR YYVv41/Tz7Qo037SU98diqxZfVf05EFtLDyNEBolr61Eac/MzmHBYr06vb8df4Pj50AS qjU4vgGMY+eVB2MID1X56eNsoltOoJGUAKZ2p13wUP3vZ2+g5JG1LAwt/F78fn7ZkQ0h 7g/L2xeGmNNiJqD9r84OEsys5dEm8V1o7lYJjZ/xEjq5MI8IDSlUPRNfw/MU2jL0WPK2 nu1Ip9vVRpNgOJjuoINU3co4cnCLlVYTwEWmzHdPObe9Apfhqet3jfiFHw+QufBBDzVK O7FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148269; x=1690740269; 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=ZTu63LQfXSOVT0GeJ/vRRll50NUVFLbOmZtWPJhZZWellAzUmwCoV3H3+aOmfUacac E/djXOG8NrPjkeOX+wExxN4nUSYzfYJmHR1ZbMIB98Sub6bu+/CffcpNs8yvU+LQtxOJ a363Erm7k8atpqOsnDBjXODt0fa5cmF4EedLwJw+Yeq+iERm1PM4TPgxkPeWDJfwyo+e n22ubK4vi5QN2wb8RLc8lhDk9mVsttQnZ2bIi7QGAENiNtHEyEnkxZhx1SQqtMYzfNX3 NI92fvDUIvHe0X8tOJ53UAMpSDObsiXXQRO/DsYydAntv6r60ucsbOWhzWDuWyQ/DKCq HVKQ== X-Gm-Message-State: ABy/qLYUYQRPuyLmjn2OtKuAWzjKfhz/slbJGaVQU8umoA740p0TPsuT XpHSOJwIc09UZ9WWyxkRJBr2wA== X-Received: by 2002:adf:fe02:0:b0:314:1ebc:6e19 with SMTP id n2-20020adffe02000000b003141ebc6e19mr2320847wrr.64.1688148268923; Fri, 30 Jun 2023 11:04:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z3-20020a5d4c83000000b0030497b3224bsm18740547wrs.64.2023.06.30.11.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F0F111FFC4; Fri, 30 Jun 2023 19:04:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 10/38] Makefile: add lcitool-refresh to UNCHECKED_GOALS Date: Fri, 30 Jun 2023 19:03:55 +0100 Message-Id: <20230630180423.558337-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This 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 Fri Jun 30 18:03:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697967 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp594173wrs; Fri, 30 Jun 2023 11:08:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTODOEuER8dt11SRbYGDy890yD6oNKtZUsj8FTUAS3fr8XIDjzkgA3Je1v2UyR7rFYS3AS X-Received: by 2002:ad4:4353:0:b0:635:dcef:b5be with SMTP id q19-20020ad44353000000b00635dcefb5bemr3501637qvs.53.1688148530928; Fri, 30 Jun 2023 11:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148530; cv=none; d=google.com; s=arc-20160816; b=GaEid5O/ZfjNNnxS3/HHC/QRKTfFkbOcybUl5H12O4u+K/IlSl3I13DqICw4JEwr4Y YiT3qkM8hJnYwcAuiUr5ml43D2pUuBCpIgERqCvXdYbvcDiUmA5eytD3fEQPKeUKezFN CPKOcWxuUBV6UwjfHUx89S7m1SZ3FZKklNcxxrpy3SN5BKxQugllEzJRsO7kz2IW1XqM KD8JjtgmSJR1ArX6BcE0KLtZ9S2SY71dq9ZBqN8AD4R6VxF4AGtBjS3Bct369j0rzOZE /4vMDWxRBEo4WT96OJ50kkuW5lgeRJBgCL5c9TPie/gRxH1gcVr7uGFStmBt2rukE1Oz wq6w== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=c/ku+34BOyPUF3886gKLaDVKm3KHFBwlRs/S/C8U11tYxT3PRtEhY2/Z2lRjC3kmtO +85wyIHUzBsigkUHdf+m17NbVIXFAOZr7lWjgssxxYu2V6K05dlK82kBGyVT8rdEq/+K VrIMxWnsLEUads+qK3t/ZC3byNLIYNcgQmPGRjV+rLCldr18OfmgfHJLJuPz3FO8YrCt xTekqMKo9aHlkgtgj4V3hqVwMLaICFivn+hiQs0wlOSkk74HJPm4rH3ioK8Z+E3dNqgN KOUZBcLR2vPoVH3gbuzDHzf4/XQLr8o0pLxPP2zeom8V8wCcROpgHcQlA0uXVWOAo+17 6S3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KxWrfwih; 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 rj2-20020a05620a8fc200b007609a3a1034si4300766qkn.514.2023.06.30.11.08.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08: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=KxWrfwih; 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 1qFIV5-0000mn-Qr; Fri, 30 Jun 2023 14:05:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIU1-0008KX-M9 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITx-00070T-Of for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so11305525e9.1 for ; Fri, 30 Jun 2023 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148271; x=1690740271; 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=KxWrfwih2gOUnIm9hOzlaO/OFblK+rIztGkgbsLqLZudJMtbwRuyWBWNJMcSXOL5S8 1H/ubj92Rei3l41cQdllDNQz9MOIlV5SmVsTCB7QICOcjgQxwOyauX+/Tq+eDEGfPa3B alPrEabh83txeRiGRRJ8xFB3aBmEKmoficjcDQL9Ee6DdwRi2dDB5V4dFBJeGEoMoRgF Do4ADw23ZQ/pISGpyca7E35E5GRMRIk0uExbVnpb5Qj9O+ypV0i2Ml5U8ERaufvyj3KT Pob2PHN49WmBwJAV14ufrPCjEDh6LYirYKqlOHp6/z8/HNITxIh9zn6FrOIaiBTpRthc KP0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148271; x=1690740271; 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=acegtIJM4yX5VhNirHOVB2M7VIKPbEZNA1DvfZsYsa0pH4simH8PNyNfBqw8B8OInk GPmRUX8QWeCwtoHfI5aDaVtGpQHaHXW0RLHcn8vB4rzcdgKoXCiTvOk++mHSO9zcbIW5 y7X+84C412MPNJDnVlrgMoQsBby2D1+xOzfOXRBpPo3UqV2o70jMNFfTKRk/v6ojkEzC zZ474N7w8fIV4ma3xnCg8C3cfmCsy0k5ow9uwVY7mSU8v3FVLQLcQqNOisqz3fBDJjXy D02rHBeLahAhOq5yEx7I/EmiNEhV8eAZhI9wZD8SkyKFsk9UHR21ORoYaVa6NTUvc3T4 oHig== X-Gm-Message-State: AC+VfDwrkgGgznUT+Riq7WRHCBRd3VQToBHS94ONH6x1sFxl4Yqkek6O +nhyaeq4Tfj9pjs1x98bx9RAgQ== X-Received: by 2002:a05:600c:286:b0:3fb:b6f3:e528 with SMTP id 6-20020a05600c028600b003fbb6f3e528mr2728005wmk.25.1688148270805; Fri, 30 Jun 2023 11:04:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 7-20020a05600c230700b003fa968e9c27sm14844832wmo.9.2023.06.30.11.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1AC9D1FFBD; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 11/38] tests/lcitool: update to latest version Date: Fri, 30 Jun 2023 19:03:56 +0100 Message-Id: <20230630180423.558337-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Fri Jun 30 18:03:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697965 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp594005wrs; Fri, 30 Jun 2023 11:08:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xys5Gvi44Bql+jU7IpjRdUApdz3eAhvndJDShZfJBo146nxFukRD9t7OyYQ6tOySvLSxM X-Received: by 2002:a05:620a:394a:b0:75b:23a1:d8d4 with SMTP id qs10-20020a05620a394a00b0075b23a1d8d4mr4330363qkn.24.1688148509880; Fri, 30 Jun 2023 11:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148509; cv=none; d=google.com; s=arc-20160816; b=lRZpvfBTqB3Q/kyIKgxUsG9kju05DWzBnQ3yt1iZIGCFs1XMafb3EnkrObxZdALHCb 9MB6UV5/g66ckkxXIHjq0ZmGTXfpvkg99qcIku8dZj+RP5l2KqtLvOLn3fwTxHS5ZzoO 1rePqcc2h6Jo5EeuBTGyqBGCwJhedfqU31q3JP0xIi5brEw9fqX9/qO164aVgr74dJxT Z4rG7rPmrxSt3MV+3LKKj7DUgEb1T6p2pFcjCNpiyFeUp5HaIDVTJySZ0x3wpZTCSTTZ uzyAC5D2BdbK5pMDBpEaWc1pBxzI28q0k664yMjaZy6GVltze2N23dbd3EI6kkts3T6h ++Lg== 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=GIa1KpNqbnJWJS3Yc6n24yDdoCuhYLNVAgac4pBlV9w=; fh=h75E+a8A9Eo5hUfr91gV6HgMrq5eoaZJZby1DFSTHu8=; b=XO8WxkM5sPdBn+1IFm56cYusQxZ34uwnsorZXGC4UoomxF6Z+DJVTujR9pfe5+1+cF pLVhcgCoTLUcKykGcoD15sPIgXSlYMPlQZHc0V1kcPDC8HAgSsiipz2C8mKIbARJkwHe PmFogFIAfhIbii4+jxWt6I4a1Tiv/nkRU0+ghq/kYW3cmHaiVz9Dblamxpo7R7NTjCIL Qd50NnaQFFYG/++B90zF2AEF9qDPaJJn2pLFiN+gTCilTlmol3Q/3Z3EBxknfyPGEvEn QGCtRqSsmPzuhso3x+HhcCD8wQtn6Ll8c46Gm/SfRRu4mt4CxIqCOhELaqxkZnpx+9KT RRUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2nQK32g; 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 i2-20020a05620a248200b00765a36443f9si7696581qkn.394.2023.06.30.11.08.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2nQK32g; 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 1qFIUD-0008RI-Mq; Fri, 30 Jun 2023 14:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIU1-0008Ka-Lw for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -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 1qFITx-000717-HJ for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-307d58b3efbso2430366f8f.0 for ; Fri, 30 Jun 2023 11:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148272; x=1690740272; 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=GIa1KpNqbnJWJS3Yc6n24yDdoCuhYLNVAgac4pBlV9w=; b=F2nQK32gdPiibMChTtnDAMxjLT8qp+/hPmVTchkSSDflS696rKg6U8mvUCQt7jFn+H J5UJp+fJ+T4+Xc4a2ro1dQSDcyHt4B2MUw4CoNOYqCB5Zk3TH9sa3MK8GkVbcj6BrhuZ 7jV0FGzv24dsCvnIAPaSSIzMXfcRIj2OBFHAGvBFxKfQNXND9jQZwvXtlRRlfubQB2Wn 4qvKV5wRqGGcpV8bdCQixfSeGrHC9598Qakb9SkcOWDS7tzgpvfUdoCt2YdKYCosiDEl sKjUAAdCtvmhoKC+3JrweAxnw42/03lxdBZAcCO/IFv0DKol4ayr69GsL0+RvmRZfw3f g9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148272; x=1690740272; 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=GIa1KpNqbnJWJS3Yc6n24yDdoCuhYLNVAgac4pBlV9w=; b=grxZCoDF2col5n1T9JhSamcpjX6ssmwGxFMOfkjsBxHw1otoLVNhJJsE2dj0S7vJsO C6KURAYWqUI/tq6LDzK4JqaFI6CVFunJ852KXPzLJGfsATUdyw/bi+miqUJBjYKIifbE bmDgOsBXi6K5qfnwXC495E10qeQiP46HDQ9B3FdpEl6I8ds1Deh+cMwA7hZ27YsjXJWX l+4JWl8/JKGihUcjQcJkJ7rXZ9TxhqNBK4Aitc5PnZQ6900C1dmvq+NAKugX/36Tk9bC PmzVR2P+8FktMb54i1Q4PG9n441jRKKF6gGuzAbYhChi1X5ow6dBJAsGESAY5TQc+CRx Z1tg== X-Gm-Message-State: ABy/qLZa3R4b01qTTwihh17eH7K2jxkcUejx3Q1haSd6cS2z57ZHY4+A +iNBmhdQzRDA5QGJKXBAtc3PhA== X-Received: by 2002:a5d:550d:0:b0:313:ed1d:39d5 with SMTP id b13-20020a5d550d000000b00313ed1d39d5mr2549104wrv.35.1688148272113; Fri, 30 Jun 2023 11:04:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p8-20020a7bcc88000000b003fb225d414fsm13226166wma.21.2023.06.30.11.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3B04E1FFC5; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Erik Skultety Subject: [PATCH v4 12/38] tests/lcitool: Bump fedora container versions Date: Fri, 30 Jun 2023 19:03:57 +0100 Message-Id: <20230630180423.558337-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-13-alex.bennee@linaro.org> Message-Id: [AJB: Dropped alpine (in prev commit), reflow commit msg] Signed-off-by: Alex Bennée --- 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 Fri Jun 30 18:03:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697962 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593964wrs; Fri, 30 Jun 2023 11:08:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhNb7y/v3WnDUzo+ntV3Bl18ZzrZcVV5rZxTq6dpEw8SB6pO5cF5h4T8752Nu85Nr6ModA X-Received: by 2002:a05:6102:1341:b0:444:c644:c231 with SMTP id j1-20020a056102134100b00444c644c231mr2491855vsl.12.1688148505675; Fri, 30 Jun 2023 11:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148505; cv=none; d=google.com; s=arc-20160816; b=K1foB/5yRNOE3gEbzQOWxuKRLro1PA9/bK1GvXzPKOD2Axj/BqoVuPm3ErUq8+mKfg 739st4PEtPr7mEF3TnfPQGEaiF6HN4IpN2sSFHRDSAJr8uRmaxaFfFNdfGSqIUnu3U88 WPuTw1u0HM/yqiEtmwylrTjZKsKgKZ7ybZ2XClx9ZvAXs5CKCEsgvcOOR5R2vmzM/jUX SjfMvvqWxHPkbRyCGwlMlaPtRG4xGgA4yYu8ezi98JMx00QXa2hbDLOM6XDjWEbPQytw L/hiWMO6D/vLfxz2bQEsgp3yf6F9lkEczKpfAk/evG4oXgjrTLf7TgpipQ5C4lXEsPwo neOg== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=1D4IJqJxIRCcDWE1XlYYAZaSM4e7jPdcNsVVci/50niahA9HZtprmM/7ABvxiNsD2t 8SdjeXlRjH9mOqsUjTSokuBiy6OT7vLzVMG+9L8s8dgH5p48mQoNF/TsYylhcIvNhnkP 2tIrEu+pMv+MnyRZ4ssq3YEzOFtvdy288lMUbfIln5LN3C1ftq4FNWm57WbKh1CRyNtT 3Z45lLOWzjjAM1nkjj6hMSejUjTZelLzhxEwAW6ZulCpAqOs4MUSNnS4EbxJYPCAJQ70 VpFG+R9VvLcpiTgvZr9cGIkcgbY0EEhfl4emtaXc88SISxuznQv/MpszRbog6vjmRgLy Jy8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zXMQrRq7; 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 t9-20020a67d909000000b0042e537c0c06si1020641vsj.695.2023.06.30.11.08.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08: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=zXMQrRq7; 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 1qFIUD-0008RR-Ru; Fri, 30 Jun 2023 14:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIU0-0008Jz-2v for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITx-00070G-Go for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-313e12db357so2596376f8f.0 for ; Fri, 30 Jun 2023 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148270; x=1690740270; 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=zXMQrRq7GPvl1oka/2W6cRb8Zw4woVRoGVFaMhcsQE4JwuUfyHGUl2f1VG5bPwDR54 GQdiuZQ0m84V5HduHqs+HdwsQNAr2gMRLWZZ9kYbr5qDrbao836PGIqao+zePYkPBAN/ r7pd4diQmRQbubIX3oRkWs3MPNLfaw7aH9SjQgfEVkbBATDwmMNjVItp3hMK7O2QGap1 GUGSva5Fx06bZgcNCn3guIO4PIX50pcavyDP/R1LUiZ2TFLL7TXYVQ0QbVTo4Qha+G79 QY3/PUrvbhdsPoowg2A+8t/tS206yYnrZaQDrscNnoRceCsE1io1A1cnP+MthFXASGu2 YK+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148270; x=1690740270; 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=J7pFJQgBAAAT6iudLiT4VIl/ZgxdoW28SVm0Vxca9DHBpfJH366MHSZ5hdvkxW5Ln/ brjw8z/HAWNoJkUcJthx3qlLksxS8eLTmt3uPbL2juXVz+UZfWebvHeHAbVH+Wy9IMx7 E8RIvurInoIEVatIhmaKGfSnFEVMfu5roNyoEl75Yc0f2S0Sy31n+444HnrHicxlp62J UEfLjJlzPTyjYutZqQeKRLWi+ud/YX9NXK+tjYv+2kvmFVBxfWzHR/rqIyUcC6A01IDi HFT8TTJE+I20aSpBjHM2Bi6+82HALv+YzY0IRKk5jn1tkg6wt9DU8O/U6bK7nJf4dZxP QE+w== X-Gm-Message-State: ABy/qLbSH8ToKQB2ZOU6NAY3dYZz+HxULhwhigCdrKdMO0VGanjFzWTw bh9gSS1Ml6yTPXFOtHzF5mD/vg== X-Received: by 2002:a05:6000:85:b0:313:e8f9:dbfa with SMTP id m5-20020a056000008500b00313e8f9dbfamr3166556wrx.35.1688148270263; Fri, 30 Jun 2023 11:04:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o23-20020a05600c379700b003fae92e7a8dsm13436586wmr.27.2023.06.30.11.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6E25D1FFBE; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 13/38] tests/lcitool: add an explicit gcc-native package Date: Fri, 30 Jun 2023 19:03:58 +0100 Message-Id: <20230630180423.558337-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Fri Jun 30 18:03:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697960 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593887wrs; Fri, 30 Jun 2023 11:08:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7K5xqvAzSMdniGliGVGmDvJdZEB+ZmNK9Rzlug+J3owfsMv3buaZE68pd7UDW5JaEbqoQY X-Received: by 2002:ac8:5ad5:0:b0:400:a9a4:8514 with SMTP id d21-20020ac85ad5000000b00400a9a48514mr4382132qtd.22.1688148494981; Fri, 30 Jun 2023 11:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148494; cv=none; d=google.com; s=arc-20160816; b=Gf9SzvvPOUDaIQba8QD/AFe4mnz8kLHNAgybhz0Zir6oM15TczddvgXHLb9ScVJ/hK 2Xje0DXSrMvOnx+UVenxL7cwg6pChVA+xmAV9/zQNjoDVReNEbrUhWWWwc1zTgdO9IHw Hk+/0iLdj2xrx+pt4/rEHkjQ154eyMTCAO7Xoe9ckq/3hBqKVh+FBlq821161sFWgXqg Ij0XCgS2JH108WDAaDQ/0cOzGDvI1UphPlDM1lfVImnCuN/xB+Kwm5qwTKkVYuuWsFj9 8h1i2B3ateEIxIKjma5j7L+DBtfVW7yoQz/dTGxW3umA1ONG9Zd45lgZFCBj0pMpdFd9 BAHg== 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=wZ9lkOLlvuBeUlhuh2idWbjS3HxjyDfhOtWa7DeS7no=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=B225D0KAFAb7gYXVuH3fRtT61/gwW7OqFwYOcYteaAtd2wSBH2BD1qAYUfbiAiu5Yi kJyUiRdD/CYyK9etJwUPw1IcsqYBWxZMoCyoIR+3oRqpTB2w+vuo4cAR68o2UKbxUx+K omj8FtTfW68Bgpg/68abPtYC6IOSNAqDpDWi6qhgtBvM6boPhb+wQh8tq4VxVSMkM2ps pGJbwwGKbu2y4kTnESLfnliK73w5qJISCP0GQxdksCIi77qAiZ7AxQiqQLBwGHgCuAZc +81yVSq7yhGLnIEeCyz29yn7poxbrh9ZqCeM4Q7mjshzHr+2RAGrE7ACKks/P7gPE/da pbbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNeFLore; 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 a22-20020ac85b96000000b003f53bb4c34fsi7966863qta.805.2023.06.30.11.08.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:08: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=XNeFLore; 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 1qFIUZ-00005Y-AU; Fri, 30 Jun 2023 14:05: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 1qFIU0-0008K0-3I for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:37 -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 1qFITx-000710-HX for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:35 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbc77e769cso10204265e9.0 for ; Fri, 30 Jun 2023 11:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148272; x=1690740272; 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=wZ9lkOLlvuBeUlhuh2idWbjS3HxjyDfhOtWa7DeS7no=; b=XNeFLoreL5p3VIAvZV3PaQGB+77F1iocZxLvT0+r0jXTXQAADJN8CbvrRzd44lbtGS 5+7Eb//ryZPNOwNsvaaF6r/LEZLPkqLpmZMY8giXGODe5h2NPsksAi8MXjsqH29QqKxh CNUG+MUpF/wo3BMreePsyJ9IQe6461W1NVLbqXrvcauZRN+OAViIAtUogdI8ipTejaG1 KlZW+0L3kDESMlXu7rFzEARzAXSwnwKjQW0DL0EFe5WpumlpgwBAH6E9c+RMxKHKbvJT OghsqYtOCjOqqZpadF8j1MlFzj+OWznNJFUonbQagfFNtS8KFVLsv//anzZx5K8MC06r cwOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148272; x=1690740272; 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=wZ9lkOLlvuBeUlhuh2idWbjS3HxjyDfhOtWa7DeS7no=; b=VKpEKNDWrEo8m18GJnJ2Db6kYkzCe0rcTHDmfduFlw/al0EQWib5KVJemFkx5GeHcX f2Z4zzY2psKuAWsktqRSjk6KRarPuZD79hXLAz9/e2+YIRVp4rekVC4L4ggLzYBAmYby Oyxq6bvIYAHQzzA0l5ZWzUqjiF57aHS9RbBZW5R7Ij9CNx3qa/APWh63TA7wV3UXQr0Z LOvBxGklW3tqIKnSPVC1jHwbrRwloPPIcLRRTVOYqlb9rUHG1If1R2qJyg0QKpDq5qtv 3JfzZd0CLM1cezu3dVKE4G2kVQR18xEz9WhVUhBRl211TMOT554Vh4Pbit1QPL83mhT9 R9cw== X-Gm-Message-State: AC+VfDzpciY0wECekqfjPTDDxfuWysGjXu4mS3EWHIW2FWvXlsXHgCpB tg6J5hJF6z9J0bM2iReie30rgQ== X-Received: by 2002:a7b:cb4b:0:b0:3f9:b30f:a013 with SMTP id v11-20020a7bcb4b000000b003f9b30fa013mr2745520wmj.6.1688148271871; Fri, 30 Jun 2023 11:04:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y23-20020a7bcd97000000b003fbb2c0fce5sm7107025wmj.25.2023.06.30.11.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 873461FFC6; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 14/38] tests/lcitool: introduce qemu-minimal Date: Fri, 30 Jun 2023 19:03:59 +0100 Message-Id: <20230630180423.558337-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 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 Reviewed-by: Richard Henderson --- v2 - minor rewording v3 - shift extra packages from next commit --- tests/lcitool/projects/qemu-minimal.yml | 27 +++++++++++++++++++++++++ 1 file changed, 27 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..d44737dc1d --- /dev/null +++ b/tests/lcitool/projects/qemu-minimal.yml @@ -0,0 +1,27 @@ +# Very minimal set of qemu packages, used for minimal cross-compile sanity checks +--- +packages: + - bash + - bc + - bison + - ccache + - findutils + - flex + - g++ + - gcc + - gcc-native + - glib2 + - glib2-native + - glib2-static + - libc-static + - libfdt + - libffi + - make + - meson + - ninja + - pixman + - pkg-config + - python3 + - python3-venv + - sed + - tar From patchwork Fri Jun 30 18:04:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697988 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp601040wrs; Fri, 30 Jun 2023 11:24:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4heqIeStx8FMrvg4iqF8jCkXw6Cjvr5n8LEYZPVvOm0PVfQJjjFktXbOJH1OdUNThE0+o8 X-Received: by 2002:a05:622a:594:b0:400:7965:d01 with SMTP id c20-20020a05622a059400b0040079650d01mr3494677qtb.6.1688149443736; Fri, 30 Jun 2023 11:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149443; cv=none; d=google.com; s=arc-20160816; b=G3A2mYmMF2n7khxQdFK2/NrhKYprbJaLkwDNzzHfX+uqkMm9L/QmaF8FkKCEfN5Rit V7S6F8AXxYwp8QZ+d45OqpYKxByMB6SJdwvXYISNsP/j5SFoQJ5Vtq4a/4B8+tfm1JER ZH6UBb2Yk86nUA8fXRjApL7dbEJ88KiU5Z29oJfTUCB7ik6winUsmPqgRa3stbHBg8EE 6XGkoMu7nZo0egW+ksvPFt0jabait3W2RE7ciMMKuFYot3Fhiqz1pNNW6rhwl9jCBtQU sUGWy/vWyXvQfxjr8+WYzwAzbC5vUFU+f00nMFaL+zRa1/2XdCip9ENvBdH/BJzjIe2Y kx/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=EYONftyZEy/mDoKyYXPlJOEpSTTJ0oXWSrdquW0QcdQ=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=FewcyVym2khyvnlQM9vhnsui3p3L6Gxiv3YI0vrP2qzNAVwOPR5FuFt2hgQS9eSZVQ +5SoMA7t5spkHWFLi9djSjB0wPR9Ng33WfIp+zk917eugXT2a/aVhr3GX1UDWNI3k4xX bGDdjpF3RLxOiwl9QYMcC+k5ako2443PRjDOmF3Imxep44tYJTnE5/FsodaF9rLm2tO+ IFV4MlPqT8MAmt5X6ZGscATcCVPpwgMenG5H2rbW9anOcoUkKFMCw+1cAO7pvTRv9Pyq LmaqmSeEzbvKDYlkG1mddzoCA/f2bplroSgLjCBy9DeOtCL+WLIkJMGJipQ8P5ztq3Sz Q4dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LLFK0WGd; 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 j3-20020ac85c43000000b0040095b1248bsi7833945qtj.631.2023.06.30.11.24.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:24: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=LLFK0WGd; 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 1qFImR-0004eA-7N; Fri, 30 Jun 2023 14:23:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFImP-0004cy-MJ for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:37 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFImH-0001fu-PM for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fbc54caad5so13708585e9.2 for ; Fri, 30 Jun 2023 11:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688149408; x=1690741408; 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=EYONftyZEy/mDoKyYXPlJOEpSTTJ0oXWSrdquW0QcdQ=; b=LLFK0WGd1DDW+D3QyF57wT+EkNcUlUbXslQftYe8FwW7qsr6zjXSX43Ghi8WcEVxv+ bQc17vMwh/+HXgoafUUK/oxQ/Tvtupvl6T+nYREsXtThhCEyrqO/iuHoqKTu2UiR2ePv NxHtYVb2zZBJTPKxXviaFkA+bdlNKixvCuHQfaZZ9HE8qDlNaHxbzuD1v3XE5f2VhVmR Xm+5ru//YwrmJdOKFBUH6xHxBTRB8o38ha2Q0E6Jvfz0HNI/Y3FD9tYKha5mkxvCUTJ+ JkWxp99GI6Lg8t0dAxBK0y0OGk12gVUFBnQ4AWPQ5LqODH0cW3s/8DRi66mWm92S2NKC stcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688149408; x=1690741408; 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=EYONftyZEy/mDoKyYXPlJOEpSTTJ0oXWSrdquW0QcdQ=; b=UQ3YxpGL9DYlDBB+qSU1n8DQGAYRFnnUeL8CtI/+FvpGa4wNbVwbHX40X4PBSJvoXr ZZalyHeKbAuxjPILai1e9R1aUR4Q8P1AseBpaCxuSNF5xQXiIjsYyU/BeHSBQEvqcuD0 HNBsXtmSph2EJ6CzqoYqaYt3Vn72fmdKa/ZcDCHjNm4nqJKLow624F2qCVGph17uPsSV hWujJXV8KhyctzxZWmI+PDQKl+ZyMhglUjN6yEd5ookn+hMNwRh3qMngPVx3Hjg7Z/Xk g974xhFwIe+38PRcQ779z0LoBEWrq1CwUesRHEo872yVsv2cqedSk/+Xkl6xbf9WZxSr W/SA== X-Gm-Message-State: AC+VfDzaqrAWLt/obygyAIOfYzbAsUkYRqUXCPVASHYCQ3z/Fba6BTea P4AnJVtOLir8KzhzgIKFvIEhaw== X-Received: by 2002:a1c:4c12:0:b0:3fb:b1af:a455 with SMTP id z18-20020a1c4c12000000b003fbb1afa455mr2712307wmf.5.1688149408151; Fri, 30 Jun 2023 11:23:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z26-20020a1c4c1a000000b003f91e32b1ebsm10231195wmf.17.2023.06.30.11.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:23:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A2C991FFC7; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 15/38] tests/docker: convert riscv64-cross to lcitool Date: Fri, 30 Jun 2023 19:04:00 +0100 Message-Id: <20230630180423.558337-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Reviewed-by: Richard Henderson --- v4 - moved qemu-minimal changes to previous commit --- .../dockerfiles/debian-riscv64-cross.docker | 119 +++++++++++------- tests/lcitool/refresh | 10 +- 2 files changed, 83 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/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 Fri Jun 30 18:04:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697978 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597589wrs; Fri, 30 Jun 2023 11:15:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7qrygG1lGzYNMdhVnnmfsBDQ3YwJgEOnQ85hR4I1c/OYYWs4/OHmmsENzT3fITWA9dpFr X-Received: by 2002:a05:6358:f1a:b0:127:f810:a78a with SMTP id b26-20020a0563580f1a00b00127f810a78amr3037898rwj.20.1688148954669; Fri, 30 Jun 2023 11:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148954; cv=none; d=google.com; s=arc-20160816; b=egru5WOYwf4QMqeUdmWJTo6TXpfxXJl04/NJT/6pwMyXIXCui0tkk1p2geKJZFkCiv GSbHZZBVBOK+ICfmTh7wV3T+Sr5XPiCcHUu7Z+702XgXhkCGBcNE85SMpnsWsE5/6dIr DRUvqKif+4Zf7AZtPvkigYjBbZRh8eCgUjR3K+JW++XUvKOTFTqJIxFaXbJJ5YQ6mWmY tTefpmBi5kZJBXYdxYgACOcl83WPa1Rd8Si4nppJAivStLQDCMQpRvpG/xTMRzYhIBeh QhjMMRcozac8FZKpTOiuw46uH4LCaVerBvPXCNWLMlo3ZcPpBdj+pZitI68fwBLnLfn2 ALXg== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=K2irCLzvloenaTJ6Qa+wnvyiMhR7ibzDBSLJAtQ1IQubbKVxD/P9r9f7YRABKJGljI hZWx9AvX0USI2iIT6Yni8MYDxsYzBNMgTYsIXRMpqr1dXSseNA3fr5JXCihKV1fZL/uP 7iWaSAjbXIb7fKln9XyADBubmHFbMFCIOpVreQDIq/CLEhBaC7vlJLzo/STv3GB+CNte yLJvN4PiwsOWDL5F0FCGLIY0gmBdSd0/D9e4b7TciX+fJcmxqsXUJQRjDK8aeuozAS8U 3NZ3/OThFNk6gb3RxDyRzRD9YF3yF1irzigu6+SUJkI//XihFOYLS2P9JkdZFfiC1rxN Auqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=StMOqtM0; 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 r19-20020ac85c93000000b003f94afc0694si8277655qta.188.2023.06.30.11.15.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:15: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=StMOqtM0; 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 1qFIdB-0005r7-80; Fri, 30 Jun 2023 14:14: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 1qFIcp-0005bF-8H for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:47 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIcj-0003ZR-ET for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:42 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fba545d743so24805935e9.0 for ; Fri, 30 Jun 2023 11:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148816; x=1690740816; 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=StMOqtM0mw6tRLQ4Zr89gPd/skzqqmyl4AEx1umhVntwoUchrXQeace8LMFC5emKdI FnX8OHYQiHi8V35uB8tECmq5iF8+G2oiJ5/f3X/YmRVSvbsUcJsmz4qn+JshEOvPrJ1c Oj8nqtJD0Oo0k2LvzEAYCuPWeGZ1bIdDl5TSe99uaFZEHDBYA2sNQ2EhpvS/lk/eFtXx ycvbcZcTdJzLoW546Q1jTF+3Y8quzV17PR3h+TabtUmqTgBaM6EoQFqhGrd1ggrpUvsz 1F2yfSg3JaPeqoZDo9qJkwyUjSj95cU1i6ZCWCSLO74jCMweO/EpLaWsc0sZdV854VP9 uM6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148816; x=1690740816; 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=LFJIcanFRlByEbaouUqUczjIllZ1vohWkKFVmvFY+zZ4GHiSEFytdlrKCWDFD+Bylh F/z0m0d21Bd+rzsJRkmv3fciQEYr9ODlw1wGuILX0JYNmzvUv4JEWsz8C9HNX8XlrzFO lfE4QvmiR50TN56gFvcze5Cr7H1cbDxynzSwarPmQBY+Jc9Z4Gimz9jQVKrxEgLxW4Uc EibYIHhGW1ELVxVLf9CcQi0s7Pl1Dx577ko0U7BblYQC1xZs5aYb9Lf0jph/YSW3KTGt O26YCPYY7QkyaMdPOx6L+yCgmjLcM5LB0EJFChfcYws20/g8yS5iWkdvhbgfy9lYDyxi igBQ== X-Gm-Message-State: AC+VfDxa/M5lLT09bsjNVmqogxcUGhAaT/8lyenFiEK1R2CHKXg/ONCv W7vGDYuG4NwEp9aQQQgbdUl6Q1+sIoL6Cz5z4Xc= X-Received: by 2002:a7b:c353:0:b0:3fb:b56b:470f with SMTP id l19-20020a7bc353000000b003fbb56b470fmr2757519wmj.14.1688148816025; Fri, 30 Jun 2023 11:13:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f10-20020a7bc8ca000000b003fbad1b4904sm8379012wml.0.2023.06.30.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BA7B41FFC8; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 16/38] tests/avocado: update firmware to enable sbsa-ref/max Date: Fri, 30 Jun 2023 19:04:01 +0100 Message-Id: <20230630180423.558337-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 --- 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 Fri Jun 30 18:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697984 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp598545wrs; Fri, 30 Jun 2023 11:17:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TUVTho1U9eVgyNCJStr0tpzG2pJBZn8PsbhiLyqye6UpRAgPg/bk8kzO2lIEyfvkZXhxs X-Received: by 2002:a05:620a:408b:b0:767:1f7a:26e4 with SMTP id f11-20020a05620a408b00b007671f7a26e4mr5246148qko.43.1688149074676; Fri, 30 Jun 2023 11:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149074; cv=none; d=google.com; s=arc-20160816; b=cJGArBTxh6OV+w2fA64qOhfuGAYIwE27aBLGclwcdho7IYGCU18O7ppyB5gIUY96ff KYMrBD9Q9ynERIgxo/DKwUHlxa0zU3XzPdYXdvA2Bu7Bc1LJqVH47I0IpcBIUlAvj8v3 AXuJ0dZ8xWOcIra9bq4RXP2tl9uk1VBmB2ppEt1kHwKRkB4BSp2wGoREu6/KV4/ZS8s+ cgIvebBmOZu6zAl7Ak7rbfs+g92NWJTapwN1z3WSffKrMR2QvA1WaprgJVoVYJ16vfc9 WHlFA+z4h8liIM58w6TApKmZJGpnxudGWgfG4+K541IQBxwV5w7eZCsn7BwvK42vtAhK c8UA== 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=3vRjuiilHj41vuYTU55vTlTL6iGYeqfANvYZbGxWyZk=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=vk6hqRTOm/xTk4AA9ZuuIGNhJoXNAug5DWW49SQBt40Uuak++/AH1Lc3VOKVvgvihv KM226EpPDOa6J+UEU/dhrKZ5yxOtPQew7H6GuZX6NGARkfWLLh95gzCl0+csiEKciVeI cMgf6N6VV+8brPkSvDjGo7oJL1yKm1MPh6bKG1vU6gZyfiUgiMKhSuhC8lG3sknYTj6g SXjxRND6m9l3e819CLrxAf5xCVfdg8m6NA0lilCnoVZRSbsgcDgJzZVOo3re8okNekBP g2I/6fQEZdIK3tuzwddzKiqqBKSDvGzzY2LBoEGHZF4eRJgLTc29lvCgeybpO/4hZDfg RO/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twd++pV8; 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 v7-20020a05620a090700b00763a119b58fsi6880349qkv.492.2023.06.30.11.17.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:17: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=twd++pV8; 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 1qFId6-0005lF-A1; Fri, 30 Jun 2023 14:14: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 1qFIcl-0005T2-4I for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:39 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIch-0003Xx-2Y for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3113da5260dso2419094f8f.2 for ; Fri, 30 Jun 2023 11:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148813; x=1690740813; 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=3vRjuiilHj41vuYTU55vTlTL6iGYeqfANvYZbGxWyZk=; b=twd++pV818VZ5cb8kSXntM/xDeg7w7p5+ZJuoSidY242qZRqz+AO56Bi2nB7L3A4Pf 2h/uvC2yKBLHkmT4kVZ0xARt7F1I7JqXdErTX+8dSLRtb7xLrggkaioA4pcATmlA0dnp 8K31QxmK8cjLcUkyC+F+519KBTZ7ZfX6cuX5R6d+b/Ceb09gOGSjvhh5iYWegvGjoRZu PqYMomJ+hYIYX81/zoMDMKMSIHheJwk5NKgjDwRKA1i9pxOhfHwfbEtIl8YlLNcoEZhn Di/+2NC8e8yBIsknhIz+J2cBSR84Q11BcZrMCJtZgPQWMzOgKadE9YYrGIbnet+8SWk7 CNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148813; x=1690740813; 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=3vRjuiilHj41vuYTU55vTlTL6iGYeqfANvYZbGxWyZk=; b=OnIuyGBAyQp92FMl7yAQXOZLHMIkJ/2cXOoErAL/NoPGnTgfYibrAmniI9mNrhCX+I ExSg3Lk3PAFUz7EqsMy7RVAF6mYeeS6z+DMMDGN+LkY9PWGIR1nSUTlcs6Po+eCtOgmM 6mvL1SxNtJlggeO8hayTXEvRnbXMVmDinWxq14vwoLqkqcVBzymaTPzABN5nC7SZNFko imPwXExf6TDjaJcA073CD9uoGIBq8cQ+OXYJpJ9lq4kY8tmD3yafbzjhWnLH/jBuhzzZ ZspN8XbolK6ru8YbJEuua8pc7znViHq3kNZDRFKdHi7kKsYDHLBT6m12j6mzYklzZm9G PGtA== X-Gm-Message-State: ABy/qLap5o7RPMq5ZV9ZmlkYCgN4nGqPhgDvV8Zyk6vZq7pBZFlChLYS WL8DoRUAQ/2U5V8bJC3rVmJtFg== X-Received: by 2002:a5d:525c:0:b0:314:99e:af3a with SMTP id k28-20020a5d525c000000b00314099eaf3amr2873262wrc.48.1688148813718; Fri, 30 Jun 2023 11:13:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l6-20020adff486000000b00313fd294d6csm10797951wro.7.2023.06.30.11.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D350A1FFC9; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 17/38] tests/avocado: Make the test_arm_bpim2u_gmac test more reliable Date: Fri, 30 Jun 2023 19:04:02 +0100 Message-Id: <20230630180423.558337-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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: Thomas Huth The test_arm_bpim2u_gmac test sometimes fails (ca. 1 out of 20 runs here) since the disk shows up as /dev/mmcblk1 instead of /dev/mmcblk0 in some runs. No matter of the name in /dev, the major:minor encoding seems always to be the same, so we can fix this issue by using the correct major:minor hex number in the "root=" parameter instead. Signed-off-by: Thomas Huth Message-Id: <20230630161604.446394-1-thuth@redhat.com> Tested-by: Alex Bennée Signed-off-by: Alex Bennée --- tests/avocado/boot_linux_console.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 6ed660611f..6eab515718 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -869,7 +869,7 @@ def test_arm_bpim2u_gmac(self): self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0,115200 ' - 'root=/dev/mmcblk0 rootwait rw ' + 'root=b300 rootwait rw ' 'panic=-1 noreboot') self.vm.add_args('-kernel', kernel_path, '-dtb', dtb_path, @@ -885,7 +885,7 @@ def test_arm_bpim2u_gmac(self): exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', 'Allwinner sun8i Family') exec_command_and_wait_for_pattern(self, 'cat /proc/partitions', - 'mmcblk0') + 'mmcblk') exec_command_and_wait_for_pattern(self, 'ifconfig eth0 up', 'eth0: Link is Up') exec_command_and_wait_for_pattern(self, 'udhcpc eth0', From patchwork Fri Jun 30 18:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697986 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp601003wrs; Fri, 30 Jun 2023 11:23:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZLO0T6GuoYUYLJRx3Upz9b02l+eKgFcviRjs5DzayJ6aQwbBRM8ZKI3e2OEgeOWcje0KO X-Received: by 2002:ad4:5de6:0:b0:62f:f1ca:ee55 with SMTP id jn6-20020ad45de6000000b0062ff1caee55mr4290038qvb.41.1688149437791; Fri, 30 Jun 2023 11:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149437; cv=none; d=google.com; s=arc-20160816; b=zo3IlRcIDfTwmRS4mxgGFHWsLzB9Tr7UwCoOGnpbekOWonMBynXs9cxOkgwxvMXtvf /CedxWxkOuMOzn8I54vHPnJQTxbBUogIG5lrxvKqRQnHv8ZOSvQbgL2XWeZHioYOIvKa fothaEbihCasapGG1sa0TlE8eXvtz7HRWLxlhKLk+2VD2auFzeW+PKG7eknP5HDyH2fr 0K4t6JaHooebLUkHpsRym8Sfn0F+1GmW2rVDX+sxd99Y+ChIomuf5QQYGH8zKaysynGr czVWGVRW15sQu1sLsuFgLDYtGGhheTc5sVmj4btluqTtK+Zo32mz36B9NMETXHRHxLRC wp0Q== 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=Ay2STL3w3t73igsB7L/HM+7h1jtUCGIXFOIRbzQEacg=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=Tq4p9KExOkpNRm0Kho+TNvvd+fMFznSYTqZ9fDpHFHk4d9KNKdHh+3qfwgUw1rZC5E 3EjTGpsLBo8c8Gq3rNokqJtF21pP9U0hAug3gdRwAjab1j5cRMu06jUsQxWOQIGmfAWk 49Y5h5VFewhTO9WYWGRqWZfImRrfH3oAfpKqQB0B10x/f60g3A25z+nQ5O/RC0iRqADV /LEawprgcFIh8u6ECAUe+urz8aldu+8UTGXUeJH72bSz0TRt1VxJo9QWi0rg+DDnriZT xSIUhb9N2EX7h6qC2txbB3x63dHxxS8Se/VKtCHLSW0Qz6sE+2BDITa9Mt2KzxV8Kw1N RFYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jxYXEAWM; 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 fv10-20020a056214240a00b0062febed2bafsi7255613qvb.356.2023.06.30.11.23.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jxYXEAWM; 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 1qFImR-0004eW-HX; Fri, 30 Jun 2023 14:23:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFImQ-0004dY-Aj for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:38 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFImN-0001fx-D3 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:38 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3113dabc549so2599213f8f.1 for ; Fri, 30 Jun 2023 11:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688149408; x=1690741408; 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=Ay2STL3w3t73igsB7L/HM+7h1jtUCGIXFOIRbzQEacg=; b=jxYXEAWM5fsjiwKZfee8MetTUA9eXz6nKU1Ol41fy6BqsmPOsg4u1fS7cvBG+CqfDi UFSeLAlYxjjd1lukeLo/oVf2Bo4ayxc6qq2LL1yMnTzOJDKbyEpGdHpd2Vs9LGDN9nFo YZtXylLYvo1u7OQqbltk772UI0lBF2CA2mY42nkGEcUzXIkK1SKSA1ugAkoFNJo97Bm4 YabmDgN1DjNaMNUsKqJirm8U0hve6az432WjtNwF8/tnALYvOx+2TJRcxWhVkO9cqVEA A8tGENOnyqZOp9Ib8VSOU9qyvxmFLA+6vTlDH7SKDiIbxACJDlfsexrT0khMfj/9Q5/O etYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688149408; x=1690741408; 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=Ay2STL3w3t73igsB7L/HM+7h1jtUCGIXFOIRbzQEacg=; b=XeDifliTX5PL/auv0sghLqY+LS7QMGNAxjVJYQYEGglIvTAHkXelt7vpjxRD0MHjvx nfr3h01GnKBZlRYFKu3/8kQ941GiTf+9U+f6EW/3YFKIRFpztMnI2ccTFrD/g64FQd/8 PsdMMcHlPqJNWBcUr0D8KOk/6qjHYlINOCcmcGV9SoRnoaT2oiXCQzdKorX5eg7Xt3a4 oV8kPhnC/44s0zw9lDo9S9d3nfZzuvTg1XbjbHx+6+VAaj7aXohMzMWEUX7i5ZkQQx+w uhYxuvbQ2iaZEqofalTiEv29zutIxz5Nt7DmEQyzFbr39ZUtfb54S5ujTfSn+2JD3L2l wPbA== X-Gm-Message-State: ABy/qLYH+B2hwE9omQ2k5RbZkQj8AjjLgbGTRn7min76LRwo2jBBWVJf YcVlYQUzXiV9ku9t32M6C/K0PQ== X-Received: by 2002:adf:f992:0:b0:314:1e87:f5d3 with SMTP id f18-20020adff992000000b003141e87f5d3mr4250739wrr.29.1688149408331; Fri, 30 Jun 2023 11:23:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m9-20020adff389000000b00313f551b032sm13070406wro.53.2023.06.30.11.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:23:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EB88E1FFCA; Fri, 30 Jun 2023 19:04:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 18/38] target/arm: make arm_casq_ptw CONFIG_TCG only Date: Fri, 30 Jun 2023 19:04:03 +0100 Message-Id: <20230630180423.558337-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 ptw code is accessed by non-TCG code (specifically arm_pamax and arm_cpu_get_phys_page_attrs_debug) but most of it is really only for TCG emulation. Seeing as we already assert for a non TARGET_AARCH64 build lets extend the test rather than further messing with the ifdef ladder. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - tweak comment to rth's suggestion --- target/arm/ptw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 6015121b99..42355caa9b 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -628,7 +628,7 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, uint64_t new_val, S1Translate *ptw, ARMMMUFaultInfo *fi) { -#ifdef TARGET_AARCH64 +#if defined(TARGET_AARCH64) && defined(CONFIG_TCG) uint64_t cur_val; void *host = ptw->out_host; @@ -709,7 +709,7 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, return cur_val; #else - /* AArch32 does not have FEAT_HADFS. */ + /* AArch32 does not have FEAT_HADFS; non-TCG guests only use debug-mode. */ g_assert_not_reached(); #endif } From patchwork Fri Jun 30 18:04:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697990 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp601485wrs; Fri, 30 Jun 2023 11:25:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+N7NS5w/Izh2LXSlc4alFXA3AnIE4KsaJRwb/Nb9U0ERoMjvyGd1Lz+frJb43scWSoN1Y X-Received: by 2002:a05:6214:d4a:b0:630:1faa:a404 with SMTP id 10-20020a0562140d4a00b006301faaa404mr5136467qvr.39.1688149519971; Fri, 30 Jun 2023 11:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149519; cv=none; d=google.com; s=arc-20160816; b=WJ6kLQd20MYmwix457zjUCPv5W0o106AyyTBuikvNoJdscsOq74mh9j3nLS5tOiHwc 18hTDOYZopVQNm+/BzDzLEKklxR9SPJ9IAuY1ue/+hSrLllr23s2poBjexCJDjsEwG/z T8xynba9J4qy4DoJfFd+5lRr4v9JIIbPR6AuKcUSVS9lV7ge4Tl7/X8FLC/TtA9MD9cz tQWFQGG5zAznAGv06xEE+OpFw/N8Hh7b9OLa2pVzDL4PRkDuFMMSA/HGWsZnc5rsnkAg KwdY+Hx8VSSuN+z4yplpiRR6RHaVZsSvqR7z3BJGXJiIZk8lf8iNw/RxrVqX4ialVoXJ y+qg== 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=0NG8jmDhQgwq34YGmLxK+sBPC3RdhxFrpgNzmFHQ9KI=; fh=kKo+2DKLIzSuUMXWxrgRrsYL8jwwPTUVd8au6T1R73U=; b=H8kUqItZ4kjLMkA2GDp94C058Kgp2v3bvmNDd/rmqGdQVCovio32diZKINTi6NeHIu E9CBAmJqjM8fn/ZEs10vaNlluibWr5CxmsFaG9uLk398ZIvY6YPDgSkoSomOsMbFymvN kCGUK8ooYGW9PtQ0xnU9BKWmfRddYdKV65+ciPJ9rRWAHCxngO1+fhdcEfjjEjwMIqTG WgJaWO8PZfP8rpq59wkeTi6XJ1RHsiY8VMJURZgD/k41x0YQNBvf6EZlaSNmQi6a6ru4 FrwNlPisGuPqQ3fhPpgmagSHryib3Av6CySkOrv5wajergyIzaQD76EgoerOnT5/S4LV 8YfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RL6D1kSG; 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-20020a056214040100b006261a39302bsi8498449qvx.309.2023.06.30.11.25.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RL6D1kSG; 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 1qFIma-0004jh-4d; Fri, 30 Jun 2023 14:23:48 -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 1qFImS-0004g9-SQ for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:40 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFImN-0001gJ-E6 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:40 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fbc0981733so20039585e9.3 for ; Fri, 30 Jun 2023 11:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688149409; x=1690741409; 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=0NG8jmDhQgwq34YGmLxK+sBPC3RdhxFrpgNzmFHQ9KI=; b=RL6D1kSGTl7ppyHyB9wpInDt2Q8BFj5yxe54YSud6/CjSsAs72LB4ZjOLYCN9oJLFJ NA2p30nKNxfq/btf+KUq5KBnBvWa+sK6vUB20+ltlj7gxJp2dSL/lSCSTnd8Cf3ycRtC 74xsLxtZ7qWmnh6KvgmroO1zcMRp7yitWFR7yjMuc3b/IcvEarSZYnvdLvoPi9yYezMm bu2/sLjgUD3qfuxUwtmX56I9NqEhLo9YS16ig4QGj7UFX/i6n9C7qi2SjEzJqkCN6TPt 98IG4n1RyVtWNykOnkz0S8Q3UxS7MTYPOwfrt9PcWGwJDoghWIlJ3OSrwQoa5oQY+J9b OQTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688149409; x=1690741409; 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=0NG8jmDhQgwq34YGmLxK+sBPC3RdhxFrpgNzmFHQ9KI=; b=F8CX3zdXMxDBpx1UurgTC5d6w42vlGvdC2A7m/NXol+C3/LOamWar/voZx3Ro1gARG 6iB4CUj4/SOlRoeyRTZxc0YNIJMg2H1ngYYvrHhGZJuOX2Hsyp4+rvFQvHoT2AYsINgU fvWpKzIGoYirMtg3tZysYfA6PZJvBVHArfnKSh5d+0cKcZ9EVgSLrKcy4eSfj9kHs4uP 0opA+VdJbOH5oKQTo9bWTz0/xqRAjG7u6vSVP4bbCr0nGAdpc2KlOByp1dNtKM0qWTAG 1sHVL7SBxoDddESgpgAviyGes65anbG3TIVIBi6C+fbH5wxhmf9nLs7vaDFWfiJGmzOX zVcA== X-Gm-Message-State: AC+VfDxDvlH09rbXehFZZt1Io08VgQr+VugG0d/wBTsuuPCoLiWOX9rN SFldtF9YCfg64uyWDosUdcgrWA== X-Received: by 2002:a1c:f418:0:b0:3fa:934c:8350 with SMTP id z24-20020a1cf418000000b003fa934c8350mr2843628wma.27.1688149409630; Fri, 30 Jun 2023 11:23:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k16-20020a05600c0b5000b003fba6709c68sm10472838wmr.47.2023.06.30.11.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:23:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 21F921FFCB; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Robert Henry , Aaron Lindsay Subject: [PATCH v4 19/38] plugins: force slow path when plugins instrument memory ops Date: Fri, 30 Jun 2023 19:04:04 +0100 Message-Id: <20230630180423.558337-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 --- v2 - allow TLB_MMIO to appear in user-mode probe_access v3 - checkpatch cleanups v4 - add new probe helper for mmu's, add check_mem_cbs to probe_internal --- include/exec/cpu-all.h | 2 +- include/exec/exec-all.h | 23 +++++++++++++++++ include/hw/core/cpu.h | 17 +++++++++++++ accel/tcg/cputlb.c | 41 +++++++++++++++++++++++++------ accel/tcg/user-exec.c | 8 ++++-- target/arm/ptw.c | 14 +++++------ target/arm/tcg/sve_helper.c | 4 --- tests/tcg/aarch64/Makefile.target | 8 ++++++ 8 files changed, 96 insertions(+), 21 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/exec/exec-all.h b/include/exec/exec-all.h index 200c27eadf..5fa0687cd2 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -464,6 +464,29 @@ int probe_access_full(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, CPUTLBEntryFull **pfull, uintptr_t retaddr); + +/** + * probe_access_mmu() - Like probe_access_full except cannot fault and + * doesn't trigger instrumentation. + * + * @env: CPUArchState + * @vaddr: virtual address to probe + * @size: size of the probe + * @access_type: read, write or execute permission + * @mmu_idx: softmmu index + * @phost: ptr to return value host address or NULL + * @pfull: ptr to return value CPUTLBEntryFull structure or NULL + * + * The CPUTLBEntryFull structure returned via @pfull is transient + * and must be consumed or copied immediately, before any further + * access or changes to TLB @mmu_idx. + * + * Returns: TLB flags as per probe_access_flags() + */ +int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, + MMUAccessType access_type, int mmu_idx, + void **phost, CPUTLBEntryFull **pfull); + #endif /* Hide the qatomic_read to make code a little easier on the eyes */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b08f8b7079..fdcbe87352 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -976,6 +976,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..c2b81ec569 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1513,13 +1513,14 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, int fault_size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, CPUTLBEntryFull **pfull, - uintptr_t retaddr) + uintptr_t retaddr, bool check_mem_cbs) { uintptr_t index = tlb_index(env, mmu_idx, addr); CPUTLBEntry *entry = tlb_entry(env, mmu_idx, addr); uint64_t tlb_addr = tlb_read_idx(entry, access_type); vaddr page_addr = addr & TARGET_PAGE_MASK; int flags = TLB_FLAGS_MASK & ~TLB_FORCE_SLOW; + bool force_mmio = check_mem_cbs && cpu_plugin_mem_cbs_enabled(env_cpu(env)); CPUTLBEntryFull *full; if (!tlb_hit_page(tlb_addr, page_addr)) { @@ -1553,7 +1554,9 @@ 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 && force_mmio)) { *phost = NULL; return TLB_MMIO; } @@ -1569,7 +1572,7 @@ int probe_access_full(CPUArchState *env, vaddr addr, int size, uintptr_t retaddr) { int flags = probe_access_internal(env, addr, size, access_type, mmu_idx, - nonfault, phost, pfull, retaddr); + nonfault, phost, pfull, retaddr, true); /* Handle clean RAM pages. */ if (unlikely(flags & TLB_NOTDIRTY)) { @@ -1580,6 +1583,29 @@ int probe_access_full(CPUArchState *env, vaddr addr, int size, return flags; } +int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, + MMUAccessType access_type, int mmu_idx, + void **phost, CPUTLBEntryFull **pfull) +{ + void *discard_phost; + CPUTLBEntryFull *discard_tlb; + + /* privately handle users that don't need full results */ + phost = phost ? phost : &discard_phost; + pfull = pfull ? pfull : &discard_tlb; + + int flags = probe_access_internal(env, addr, size, access_type, mmu_idx, + true, phost, pfull, 0, false); + + /* Handle clean RAM pages. */ + if (unlikely(flags & TLB_NOTDIRTY)) { + notdirty_write(env_cpu(env), addr, 1, *pfull, 0); + flags &= ~TLB_NOTDIRTY; + } + + return flags; +} + int probe_access_flags(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, uintptr_t retaddr) @@ -1590,7 +1616,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, mmu_idx, - nonfault, phost, &full, retaddr); + nonfault, phost, &full, retaddr, true); /* Handle clean RAM pages. */ if (unlikely(flags & TLB_NOTDIRTY)) { @@ -1611,7 +1637,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, mmu_idx, - false, &host, &full, retaddr); + false, &host, &full, retaddr, true); /* Per the interface, size == 0 merely faults the access. */ if (size == 0) { @@ -1644,7 +1670,7 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, int flags; flags = probe_access_internal(env, addr, 0, access_type, - mmu_idx, true, &host, &full, 0); + mmu_idx, true, &host, &full, 0, false); /* No combination of flags are expected by the caller. */ return flags ? NULL : host; @@ -1667,7 +1693,8 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, vaddr addr, void *p; (void)probe_access_internal(env, addr, 1, MMU_INST_FETCH, - cpu_mmu_index(env, true), false, &p, &full, 0); + cpu_mmu_index(env, true), false, + &p, &full, 0, false); if (p == NULL) { return -1; } 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/ptw.c b/target/arm/ptw.c index 42355caa9b..9aaff1546a 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -489,9 +489,9 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw, int flags; env->tlb_fi = fi; - flags = probe_access_full(env, addr, 0, MMU_DATA_LOAD, - arm_to_core_mmu_idx(s2_mmu_idx), - true, &ptw->out_host, &full, 0); + flags = probe_access_full_mmu(env, addr, 0, MMU_DATA_LOAD, + arm_to_core_mmu_idx(s2_mmu_idx), + &ptw->out_host, &full); env->tlb_fi = NULL; if (unlikely(flags & TLB_INVALID_MASK)) { @@ -644,12 +644,12 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, */ if (unlikely(!ptw->out_rw)) { int flags; - void *discard; env->tlb_fi = fi; - flags = probe_access_flags(env, ptw->out_virt, 0, MMU_DATA_STORE, - arm_to_core_mmu_idx(ptw->in_ptw_idx), - true, &discard, 0); + flags = probe_access_full_mmu(env, ptw->out_virt, 0, + MMU_DATA_STORE, + arm_to_core_mmu_idx(ptw->in_ptw_idx), + NULL, NULL); env->tlb_fi = NULL; if (unlikely(flags & TLB_INVALID_MASK)) { 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 Fri Jun 30 18:04:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697971 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596720wrs; Fri, 30 Jun 2023 11:14:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlHyQP2qqENFjiSkxcAO9NRUAit1tnxp7m/RT36rLAUNOywzoQFwu/4hERz3AtnR/mfro0Rp X-Received: by 2002:a67:ef52:0:b0:443:69fd:3626 with SMTP id k18-20020a67ef52000000b0044369fd3626mr2795875vsr.11.1688148856295; Fri, 30 Jun 2023 11:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148856; cv=none; d=google.com; s=arc-20160816; b=jNb1TNU2kMawFM21hoqRgJMfIoxNr8JTdvgVX/HKh++WR4w87+D/oM5+L1fik2K/Km gr0XgXZKgr85CtVMqEvVr5xAY7oS6qQKsgnu6dxrC48iH4NLdLg7Q6MN5ZwDxr/yMYdF fBSHBLfIt17RXxgDcVkgot5ChcCgyu28p2iWBXx/ZxoRgBVnbgkMEs5PVhVb2b0TfIO9 QiRQZ/m3Ynjo8BynCxX4gQvS+x7azrfnB31424R3AVzl9YoU5YL6bB00xxbfZFnB8GGR 4CHsC+IqJKhw4eNvbtfdL4WHlMhqz9AexmNEF448xFmRJtTAxFzIY50+yWY09j5Af/3l p0bA== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=Lipb1KqzupY5kptyUU2eaDxKURq5O2JnxKan928U2BosCYGfj+/PC7W9Ybm5fCsyLc ZzizMfKtz4s376ANP4kUrJ2uVI3gn5LsUBsakfzhla0dMuVXbhVB+HJC/N+/q+GvcMRu lhLtD7tJeJLOoEd39Jx6sGNmQn/9PfN25wTKTD33qs6SvAYyX8cNFgDIHwTQXeTK+4EE YQzFD1JzTfpeNlgGyMBQgNI+EaYDvMAxvbHgh2t0O4Ef+q/BQCgb18wNVTEJlVB/JmFi xRzqZYPrYoY7kcE9JWTkBe/hN31mXe35bB7UbVWx7u3zlic3MvMJfGWvmA4XYiJ3APUO k2fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UihyaEYn; 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 p7-20020a05621421e700b0061b762515fdsi8013499qvj.262.2023.06.30.11.14.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UihyaEYn; 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 1qFIcf-0005N4-Hs; Fri, 30 Jun 2023 14:13:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIcd-0005M2-Sv for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:31 -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 1qFIcb-0003VT-QN for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:31 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-313fb7f0f80so2454606f8f.2 for ; Fri, 30 Jun 2023 11:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148808; x=1690740808; 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=UihyaEYnewtQ0bDAEensUOq2OUGrHOS7o2OwNtP4RWN+Ul+aWdKqeY9UG9ZJAMs4cQ fisyY9x1OgtipVxCTBIOhg+0iX6QCdkf8N8tPXHVsPt020B8h/HUlyBI1CHE/yzmtZbV vt9ygnAgUYwiwUwmYD6D93kqcCtr+YOqPLUVihOmuYV8kg+XG/4ynuNy1NGaXP2WdqU1 9Mpd7X3dJ+bDRlrNxfX6uZGNbpdHJW2dgz+N+POo+rH2j7A3OMDDsugytppktuFc1pNn Uibm39PCQitoRSFXyAvvii2ns2N8tflW+AXUYw/v8NPiE+Skjr0KE1gdIilIQGNXwjs2 7GGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148808; x=1690740808; 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=ArPlvf+Aqm3twjIeaLQbIO1a1acNvdzRZsaGmTigC8d02YbqDX1jTFo3T/S9Y6O1Zm snkcjBCokGPgyMaeJ8O0jQIG8WUJCOkOiZaRbuGM19NAuCYOpNz1uIxj3j1CPz4sKs/E Yy9TdjM6cWHg/lcVuibVrQtdbh9apMA3k2AAYqqSfQk5OzWR0VZ2GD3l2xYBPix++ps/ KDV7BeeiQ3pMGsNoqHTZvgCn8pEHn0kQtcg/iiPuKc8Tymrrfm7ZNPxA9qSmzPrPhpxH BBQ8/AlBNgW/oeYhgzgKd12PCUTEon/+XgajMQ+VacR5Bqq8gH/XWnFkESmyW7LG8lOX D8IA== X-Gm-Message-State: ABy/qLYhR43yLIxDl6GqJlkpcy3jDYuRnBOrGMuL8iqKxt/85uKbx+f/ X59X2KDOkST0sy/M2BVrNmxaNg== X-Received: by 2002:adf:fecb:0:b0:314:1031:aa96 with SMTP id q11-20020adffecb000000b003141031aa96mr2705622wrs.50.1688148808368; Fri, 30 Jun 2023 11:13:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b00301a351a8d6sm19019624wrb.84.2023.06.30.11.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 54E291FFBC; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 20/38] plugins: fix memory leak while parsing options Date: Fri, 30 Jun 2023 19:04:05 +0100 Message-Id: <20230630180423.558337-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 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 Fri Jun 30 18:04:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697977 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597540wrs; Fri, 30 Jun 2023 11:15:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4T3tqrMih1ILSM3iZrWs+HL3MJ6VwxyBKI0njw/mHFQU2RbORmADMZOUykViZF7NhblUKI X-Received: by 2002:a05:620a:2a0b:b0:765:a23b:cc27 with SMTP id o11-20020a05620a2a0b00b00765a23bcc27mr4751313qkp.14.1688148948366; Fri, 30 Jun 2023 11:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148948; cv=none; d=google.com; s=arc-20160816; b=mdPusK5EhfcaVy38RRDrrfwQtHUKpEk1V3JJykuvvmaZYpqA12GuZpvE6OcBO8fYju OJhxsut/mzFic4FOTBkaSiByoTc5YVt8n1qJoALYsPC5UVfLm7qhnrImMuJNtGxqcRbz 6EtBhclNUlYL3vWeNiI417l/qtfm0+Iz27U5PyhKUzwg0rRR4ZvATYe4HgAuFKPcmnhb 29AI8rB/2HhQWO5vbiJr3Wm/iHTZD0VOX8bjY+8Pg7io48a5ucYfP6nzItk+PtArBLJk KP6oZyHlY0nVpyz0F1loJdUoigPIvcE9llFJ4DVUZAu6VuRfmCX/lQkVTxmS1TzZ/0qc AdBw== 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=xR5/t5x9pG5u9j5MsPviyFWbyRXcbAYZ+kVu5BRUcF8=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=0p1fhp7X8ssB2JQjtEUT6eXTHIV+LBFAmC1qGPIojuOZ65tt2sEA0w6dsRUlZJofR9 TM9VNFEzCQzidy5V6eSZCtVpyELwn8KPvXatLqirgnEf5VZv1Z6R3HJjRcWL53B5n+U4 7fMy0fa4MAodXtCoumyXaTPflZRJc9Eh190D8Bw+e3mBDJLmN6vAvCwQs//Rpawmj4sk Zz6qsbkXbkPXeBQSoWhunb42gAHt1WpThkklklxA0vuBvIsFWBGMALCSwczKiyU903Gh ppQNQUtnoZReqCCGLucQQuAFxSQtNO0gdCiW/iD7B+VKZc7jp/vKm9go0XjhseGVDfSE iYRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWYCfDjo; 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 ro24-20020a05620a399800b00766fd5908e1si6205305qkn.363.2023.06.30.11.15.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:15: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=CWYCfDjo; 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 1qFIci-0005Pb-9h; Fri, 30 Jun 2023 14:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIcg-0005Nb-Hd for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:34 -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 1qFIcc-0003Vp-VE for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3113da5260dso2418991f8f.2 for ; Fri, 30 Jun 2023 11:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148809; x=1690740809; 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=xR5/t5x9pG5u9j5MsPviyFWbyRXcbAYZ+kVu5BRUcF8=; b=CWYCfDjoWFn5LOXEL4IUnzJeVYCxoZiFOY76PNqN2I2UXkVzC4FHqmb0fqXGa6lIC8 Ne/5/J6CWo+qZ3yLDneHii1wTtzRnohO8othGeND2rpzUc4l+AW7VbdZUY0wweXMCfT/ xwZDrftVNiB/hBgkByh05i4mHX8W0K3z3NQl75haDXECyOFJkvoOb89AFAdYBfB8KDmG ntNMsni79X+P0SYk1/7F4lX8yJycGL/6H+M/2m+lVxD82vBVuxk158e2qEcfUimDH+L/ qyirYwXKmcryN8SO4bttAphRD9yPihu5YSa73Mkyy/xNA8bi5hrQTv8AbSTGJOuVmqA2 6M7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148809; x=1690740809; 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=xR5/t5x9pG5u9j5MsPviyFWbyRXcbAYZ+kVu5BRUcF8=; b=VUy1BZFhfvNUCc/dLynBjTh501iPXfgE5/LLyV9QSGGCh+CND0Ms6mbhi1nvWfN/6S nomfkwXSAg/LoahHmuJa+iAdyaBNp5p3oWBuLPyXRcaOZdx5C/ePc2DGZL3fZQOz5N1E qsRBzT86btGM+zLnA+GgRQZf516EpkgoUrKGdgr+oq+nkIXx73oP7F88EO8U5ztqUgkD so6GAK+PJC+bmb7ZT7rR9H3NV0Qxka6GhHafzKUne/iAkno5nS9VBT2ty88vKK3GP6mY 0ZbqOt+KcKm/yrZ/dMBRT7PL+hNas/izQ5wWzfQacUBUT9wb86yoCKGKtWhg+Agkoo2y kq6A== X-Gm-Message-State: ABy/qLYkztwq6m06nyiD25045Wy6K+0vMt55jKdG52aDfmaggrDuHp1Q DDyjD1QUKFxWeFs5Yp3/sLY6ag== X-Received: by 2002:a5d:6a49:0:b0:314:7c0:c406 with SMTP id t9-20020a5d6a49000000b0031407c0c406mr2771790wrw.40.1688148809452; Fri, 30 Jun 2023 11:13:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a16-20020adfdd10000000b00313ef2150dcsm15111904wrm.45.2023.06.30.11.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6C88B1FFCC; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 21/38] plugins: update lockstep to use g_memdup2 Date: Fri, 30 Jun 2023 19:04:06 +0100 Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 The old g_memdup is deprecated, use the replacement. Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-20-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- 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 Fri Jun 30 18:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 697989 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp601099wrs; Fri, 30 Jun 2023 11:24:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Tuyg7cXaGWQukdN4unka/YMpc/NHacAj2e9iszmuERCnkqeuL0YrS+0mzXhDhz02hF/dB X-Received: by 2002:a05:620a:1929:b0:767:100e:4cbd with SMTP id bj41-20020a05620a192900b00767100e4cbdmr3575881qkb.0.1688149453525; Fri, 30 Jun 2023 11:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149453; cv=none; d=google.com; s=arc-20160816; b=wwJGStgN3+IBgVejIV1sNMw87jWHNfL1fVta4fq/JSTAi7/dZG7mKnnaAN3Ao0wOcV N+FUUXOcfEiB2TrUoCr7hpr6xrcaXqr/2iDY0HbMgKDGjlfXXi3DVDKWx4Snl0qSyZSW hUyPsliVxWpOtadKf3lUXVOjYh35ViwibuCMUxXv2HEkqzc1bAHEzSQSo/GVK+LVnPMr jyTKLen0CFyJdAwYd0S9UyqwH2ZV+GPTlSApA4fl6K1+zhPQpF0hSvE4cw+fULXL41ah YWIzErkdW7PoCDprimrPBoWmrnbs1ZRIzOL/74nWdbNDF9xGbTBNQLOgY8CUZIEsS4u1 ZsNQ== 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=c3k4gxlWKUhqIL3YZ385nyvBDR7JSxVw9q07tm06Blc=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=h1ApxilZrpy6hsYkXIwLedoM7NNUBe1k/CQVIk4dYXURNsPNFAC2xa2UmNMI3ZzNmh nPsZUrQ2YY8atsMt9U+hAKTwPRKA0vPicJvCWt/URzTVWoIxRhcRG8zAjkeXKOdhAeoK zxmvT87BX2Se2KO2it8clp3cmxGwYSd5sxjO1em+414oy8vIJyoZKwUYOp/VknamvIuI 9NAn2Pms83YpSoazuv1tCrZ3ttzQ47km+OtEI7aCrMIMvPsrIqJfXDhZBptE/UC+VlZY bDhE0Ds6dnk6tuDT2qvtbH3Kur4ULjqfdcADK0p3u+bdw3gPIM+NAscycQs3eeFOWxfH oC6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PaRW8AyW; 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 sk1-20020a05620a3a4100b00763a23c1f2esi3005901qkn.186.2023.06.30.11.24.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PaRW8AyW; 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 1qFImT-0004h4-P4; Fri, 30 Jun 2023 14:23:45 -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 1qFImR-0004eq-QS for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:39 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFImN-0001gC-Ds for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:39 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbc244d307so17328195e9.1 for ; Fri, 30 Jun 2023 11:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688149409; x=1690741409; 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=c3k4gxlWKUhqIL3YZ385nyvBDR7JSxVw9q07tm06Blc=; b=PaRW8AyWR4FDOzV1Pxtl17VBw0FaKrG/s1g6whWr0m+GD7rYUEFrO7Yt/ZIJmTkvca 4PRwwZCODPaz5LLVye2iBtM0G4fc5NBfmMH2kCgEaY3xxKF4KH1AawZluXMIfSKNcNsY ZyV2JYyaa8SJ/V07WnbKQ4tG0Jdkr0T3md+btxN2Ol8oo+PmdKsqbJ4202X4wv1JBk7u XOAPvQI4mrfZqbXAs9NJLIhYJ8uTpEzrUx5G0IVkux/DKUMza11m1G895wTdvfiXmkBa zmOdL6oiO4/S6C7Tr2Y/uffLE3m8j09vLroM6UOOX0ZTsqUbH8JOn3efIwYGevh4e7m2 ScLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688149409; x=1690741409; 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=c3k4gxlWKUhqIL3YZ385nyvBDR7JSxVw9q07tm06Blc=; b=TXmAVADcFEyBUjiLqEH2aHQXw3GKvXUxwGw+w4CoRjzAH3WI1XTGWJTegdOhvFj0fk mngvqA0owo0H8jub7RUsmvSmmWppctXfrKcG/MVdhzrWJizamSJKJyC1nPmheNiLiN8F 0XLaucwFqJ/zXCrr7UA624szJtEUi6o5S6Gk7RUiO10A+PpS2Ng0SKdHcWazUy+oQDzS phTVsQ8LJi9Q1ZveGcoGbMl0sA5RKZJ9yvfQsuBvCRU7yDHeaVgoGNl8KqzqRtCMS5Rm NhPKUu1WmObFg8DDTbGGwlXnVoDHi79bR+tUxnv5DN+fn+gqbFh2RzTP0XI58+WM/5ga S3uA== X-Gm-Message-State: AC+VfDzkpOyfy4IKEXW4ayoZrCqZ1AdsAFPHpZ/97rhKTLhWX9nQioc5 uvHaNRzl1LKwxh9Hfw6PUbySjg== X-Received: by 2002:a7b:cd9a:0:b0:3fa:8d25:fde3 with SMTP id y26-20020a7bcd9a000000b003fa8d25fde3mr2770062wmj.11.1688149409349; Fri, 30 Jun 2023 11:23:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h2-20020a1ccc02000000b003fa74bff02asm19469314wmb.26.2023.06.30.11.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:23:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8B0AF1FFBF; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 22/38] docs/devel: add some front matter to the devel index Date: Fri, 30 Jun 2023 19:04:07 +0100 Message-Id: <20230630180423.558337-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230623122100.1640995-22-alex.bennee@linaro.org> --- 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 Fri Jun 30 18:04: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: 697987 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp601025wrs; Fri, 30 Jun 2023 11:24:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlF/TIltagwYpmg2Xeg7/xxeBO4YK9KVIomXy1PghsECNN5HEmxt0/AaLYPL4m0oxaLBbAxF X-Received: by 2002:a05:6214:27c4:b0:632:649:587b with SMTP id ge4-20020a05621427c400b006320649587bmr3373837qvb.45.1688149440800; Fri, 30 Jun 2023 11:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149440; cv=none; d=google.com; s=arc-20160816; b=jINREwmil5Vf6ZrrMBZzF3UtRRZGEmTFpxJPSNaJ7eju8NFE7uLc4AP60AEBjeFxyD /5LcF92x7Gnq3jEiW0tNuYIjIYShDZgqmogo2Tlo3SnsMdorZU5n/NPF54Vgr8ne6KpF 7NaFJrTeU7oHqI5vuWVPzLGZRxFvdczqTMrpIsPig9WuEtTf//XGtMIX4BOJrkoHTehh 9olSy4m5rn5hEeW+BEs7LSsgb4jBsqcYEFl1DPwzoftlkeTHMnyJD3u8ZHlNk8fsk30b Gvl/ePXj1sNFIIFqEzrPartpSZhVYJCu9TRKf5ZTbhRXwBVo32RL4xjnRrMznIXp/uTH jcdg== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=Rg9msladFwUKtEtoi+XhIq+YwGVvH7/Tfo25pw3x8OTFr4IJMCO7+UXySF7a0YEex+ be1UgxyCpFG/htXQaVDj6nqJG3HffBKbZmbjXp0302oBd1d8YL+xAkMXt8FnhpHCH6aC wWoPfb6I8xTJSiZgOiAXBL+szxB2PHCaojAABgjwGgBW3Nmo+ddAGhSKDBw/CGqo+RwU IiBygQHFSurYbSAhJ/++zH+UcqEDbDlN4X/UWkUYOJwPGItQkcCcOqa+9LZhP7atMjDd eMOR0nVUN0OLwC4bZgGyjA6tn+y+LAB2eWtu49qc2T08tUOCAuRxFHS8XE8FI0gmrSlQ hysg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/N7erLs"; 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 f2-20020a05622a1a0200b004031c028d2esi5268430qtb.619.2023.06.30.11.24.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/N7erLs"; 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 1qFImT-0004gD-1C; Fri, 30 Jun 2023 14:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFImQ-0004dZ-Be for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:38 -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 1qFImN-0001ft-DI for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:23:38 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc244d39dso18035265e9.3 for ; Fri, 30 Jun 2023 11:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688149408; x=1690741408; 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=g/N7erLsp1h7BmSUo12Nbnbnfc8lW9elx9iRyhyZtgN0qhjESHti9E49CuYoISNP/1 ZvbXdbSz3QOxnE3Cii5WTanfgLplB/VC3dQbYxggx6m16wXmFPFMDr6wHkuDm+ImcdsY +0xsx2sSNlvHBc4YeWo6078vsrVddhw/SuXRL+MllKyJQxK1uHSV2eGDoEKP+EE708/u 7Z/n1qmOwQNrFuXz8NbQWCiPSRNZAjBJYlZw2AlvJaTAd2Fpp1W20ZSKbNXDk4F89ToZ D5EEGYweUyl+hg2vS5D5nZ5fqFKXhxTVVFhOkXDa/OXz1hqPOfb/dUimXQcxcpwhl9ZU pAzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688149408; x=1690741408; 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=NJd0jilpcLae5pcjLocLqlJnrktpVX/D9o6HxDonYrOT0olRmz+qXsZbgVLRw+N8Du FlWTLo+gCcsEydem0j16rCcpTiMvotmkziLMMXHsNLme+CpixLXS8ewYDINmGvKPuKLT 3LOCfJhIbvWH1L60DVYyt8rxXOrS5H28x/Dcp8T2Dl8SB/8luW4AecKGY46Ziom7f0C2 GnDe2ABfTrkmhPQS+0tklYqqZKHj/5j9195cK0tZk2hSwSdIjm3KA9Rj9QXduDvf1ZVt +2VQ5XwGQFcHrAZRVGFEKAvQbGMRrIgYR+hZGKFDudSWL9dDLeTZN0UKZvaz3MTmfq5P n/Iw== X-Gm-Message-State: AC+VfDwtlwbkyvLc+T6CQzvSPNqR4d6jGirO46Kxvje42uZrDdJ4+9/k 9TOcKESat1P9h9SGUl96PtmhyQ== X-Received: by 2002:a1c:e909:0:b0:3fb:b05d:f274 with SMTP id q9-20020a1ce909000000b003fbb05df274mr3323849wmc.4.1688149407977; Fri, 30 Jun 2023 11:23:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c5-20020a5d4145000000b00314145e6d61sm4976168wrq.6.2023.06.30.11.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:23:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A35E51FFCD; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 23/38] include/migration: mark vmstate_register() as a legacy function Date: Fri, 30 Jun 2023 19:04:08 +0100 Message-Id: <20230630180423.558337-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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 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 Fri Jun 30 18:04: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: 697983 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp598257wrs; Fri, 30 Jun 2023 11:17:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9R/poXF9FG5SIRE7PE2fugeQROx4VIbUpPz+yG9p4JuCwM21I4EOsMhtJXnjk7Y5Y3HkM X-Received: by 2002:a05:6214:c3:b0:635:de52:8385 with SMTP id f3-20020a05621400c300b00635de528385mr2891418qvs.65.1688149038180; Fri, 30 Jun 2023 11:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149038; cv=none; d=google.com; s=arc-20160816; b=gwcOCdHczW27/Lluwwn41IBJek4KTKB4lEyDtoasQNcA38EZ3sCFTQ77GavFrjEBEA RaNJkATzTZQbu6ilKEQXtGJZdxm5JMHGJVFrZHxZQ61WrZ1TutAwoO5kNKMXxYQWsAFf CdXYf7m9lvTn4v/hYJDbiRhnbo08Rxm3lrz5Bp4F/UzwHluuTGuziz7V8YeX4dbnV2cq kT4YiSJ+DzwPjdyhbmfPWDLwJ2DvO8N4QO2g8ctiuH/TiYsxleurlrhJjb5j8dkKcBjJ YSk1TYCsemQ76rt3+0qRA3zTl13y/mqZuXG3CmPe/CY9QbOPNQG6qMgZTAGR5HaYtjA6 WwwQ== 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=XQBnJI7l7f68Qb9jZBCgf1nBCIzt5cpENQcUJ3iuXHI=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=SmQLrmfdtOjusJ2C33xKKPpZhPev5Z2bmc512JvIBUWNkPWNtWwvXHiIeSu/SbwyT/ HyQiOLN83ccVd+3lslyleSv/Tmqlk9Hkkmgb8vyejRbFlB2cQt+vu0ti9t82NCdN6UJ7 nC9gK8V9b8NjTEaNpN8YcA409F1OS6WE+mms7mqi/weKjT0ge//9bYWRhbiw/BXNJB8f i8SzVJrnnI2hxvslG/tI3vTEbYpqzKN0qs7Lw08APjGBfp2/LbYqdbFWdNB2tEkYbb2j WHGC8nZ7nG0a85xcqTe6VLXOH9bsrLX7bLre7AEzWE5DOM0QSDLu3EMyUeU+DMEl18GF ltmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jfSpEUHO; 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 eo2-20020ad45942000000b0062ffc3762f3si8266066qvb.189.2023.06.30.11.17.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:17:18 -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=jfSpEUHO; 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 1qFIdC-0005sM-66; Fri, 30 Jun 2023 14:14:06 -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 1qFIcp-0005bD-1y for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:47 -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 1qFIci-0003Ye-JZ for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:42 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31409e8c145so2424431f8f.2 for ; Fri, 30 Jun 2023 11:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148814; x=1690740814; 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=XQBnJI7l7f68Qb9jZBCgf1nBCIzt5cpENQcUJ3iuXHI=; b=jfSpEUHO30z+/We66v0R/IjHQtoLuNufSvlGyCymqtwN18zYDX+O/uUe4K/C2vse4Z 2lK0601Mxg+iigNJXTYPq5TWgwnGTOcdBbO1gB8PhpvY0OaoHoc/as7NEYbLTfsKVol/ RUKXCIZ9hCNnYpzvBBZ3ICrVZ6i7XoAs1aOKPWXS7umiAfWKPZhQ89s+Y1ZiXzGUS5bO c1ijGzKde/EbITjLNPmm4MQ1wz5jTq6pcCLISj1o8/JwQdX9ljyIgZBcq46mJMoX5d3O TdxSKsL/FYkXV2SrsuaeYtJGqeliLSVnBcoK3pIbTqXwH/JULENWyJ8oTgncWWzljIoL ajFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148814; x=1690740814; 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=XQBnJI7l7f68Qb9jZBCgf1nBCIzt5cpENQcUJ3iuXHI=; b=iuBnMNsgAq2gTAuKBXDwU0CVmxKeNHqKYcaE2G7FHGN3uZ8H7976ornjuyx6ZIuttj +Cah51SMMVXihMl9++AvibS7XH2r6LnjNzzRmhh2b/fyVYXYLHK1R10k8dFvBahmpNJ5 LPWOS1bxvkKqslDyTZYf6eawmkSQoSdaj9waCaNMjkIMJHTvmH8CTgfD1t1BbAl6fy10 JzwT3RVjY7LOAreAWwbedVB86vN4LR4jIcaJQTAAIq2/UZkwaNETnHp0/scrbZ9Es6KE eiv3C6hwqRJbHZfPaEt2GVTK3O0TNnZ8QKPq8rPjXho27X+MH8umA/lbC8XKLv1bioGU edIw== X-Gm-Message-State: ABy/qLYygPZ6ypLBvH9bWwQD0Sn8Uov2Kt0kZR55yrS2NJZfYXvPS8al bkDuN65A76wPn5OEGKFW1BucOw== X-Received: by 2002:a5d:6a47:0:b0:314:377:5e43 with SMTP id t7-20020a5d6a47000000b0031403775e43mr2501247wrw.48.1688148814528; Fri, 30 Jun 2023 11:13:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cw8-20020a056000090800b00311d8c2561bsm18775531wrb.60.2023.06.30.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C02FC1FFCE; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 24/38] include/hw/qdev-core: fixup kerneldoc annotations Date: Fri, 30 Jun 2023 19:04:09 +0100 Message-Id: <20230630180423.558337-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-23-alex.bennee@linaro.org> --- v3 - checkpatch cleanups v4 - add newline for spacing to DeviceClass --- include/hw/qdev-core.h | 368 ++++++++++++++++++++++++++++------------- 1 file changed, 254 insertions(+), 114 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index f1070d6dc7..06cadfc492 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,37 @@ 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 +144,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 +201,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 +357,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 +383,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 +434,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 +445,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 +474,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 +505,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 +535,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 +574,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 +614,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 +633,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 +642,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 +713,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 +725,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 +807,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 +820,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 +887,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 +905,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 +929,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 +1010,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 Fri Jun 30 18:04: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: 697981 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp598003wrs; Fri, 30 Jun 2023 11:16:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFzKvEJxMKoT6z3Cos0N8LVRyJQ3LrbZZq1Tng0t8TBksV3G2roFcSls0AF1/vRerxwmZTg X-Received: by 2002:ad4:444c:0:b0:626:3a98:95a with SMTP id l12-20020ad4444c000000b006263a98095amr3456718qvt.22.1688149000352; Fri, 30 Jun 2023 11:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149000; cv=none; d=google.com; s=arc-20160816; b=kAyD1kOjXN5E6ow79yWl2cdqyzMmWjWPvLGMIDypMKTATkBD7vcs7K09lqn7FZtRPk uvjVoz0z6tnxAf6tRXjGsaXeIM5x20w+SDniLlGFMo/O5/Ct0LJcJdiwu43SrqnGmjUc XPtjx4tr7iH0o3ncVscIl59QGpPWh4kuEVEB7mwb06mv863O0YYzOkdJlPI6MZ14yxne dd568jmBGovAkoIFOTMbRb0PDfQBqhkL7ECVLMW26FUIzunNA/UyllEv7b77FYiD3Ycz fnsTbWlZnSH93l6Q+y/f509IloyABXqARmKD7guL623L5JcqTpNcuoFSo81ttoiqG3zi h30w== 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=GEoTyHpQo3GLIR/onzo+RyhnQxgL/H3zC8sm06HYlis=; b=IXxGWB9EN6qhMK3t0vDmiw++z2zMvgfh7Ff1XaVzSs2zAIjsNLb1RybVzJXHr4OdXz gBA1NO0w2P/Wo5ARTuZsaRw7UDrUf0v3yatZIDGZOUYz3SSLLwGKFKcjvUqIDQFy/yA9 ErRMs81U3/FkMGTpyMeH55mBmjWngoV9ZOh2/yj72IFbu+awA0Ku82EwJcxEJIdmgkW2 Eajfcsra/U2Ky0tapzt9UreUrQdD2Sw57uj2lJorHLGuIRSUml+AsN5iS34RPIMe3jC5 Hm1XYotS6uF+NWBNHpXGiKwpS7KfcVaAbIhYfETLWpxwbGtRD6ppg/1HuRcMKcyjDHVX Gfhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dIC0Zv9/"; 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 ge6-20020a05621427c600b00631f44eb2fasi8187377qvb.489.2023.06.30.11.16.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:16: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="dIC0Zv9/"; 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 1qFIcl-0005T3-PR; Fri, 30 Jun 2023 14:13:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIck-0005Rm-36 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:38 -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 1qFIcg-0003XK-9f for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:37 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-313f58d6652so2428904f8f.2 for ; Fri, 30 Jun 2023 11:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148812; x=1690740812; 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=dIC0Zv9/w87dJC0fdYzyuSo2cKcLhYfbBjAqYq5V1Q6ZpAVnZ9mVuaZFlJy/ACH5f3 Syw8wQujtkt/V5CBMYUEnBWMoVcgM/BHrg7BwRFUBY7mbZieu2jhVImCGxEXwz8wKCmN Zx14PbBVFzqOsAZNQNYZ1XqfgHBluD67GrpFli5ABqtIvHw2f+omWdhWMgDwG+4fHT9z 4huZ9YQko3HRwTRMqYK6P5KapzJerLuBi94VFJ4OooVQChWQnjSCajxXViDE9PWuGUGS C8ED7K5YxTNilCGUHtgdIOwWBxkgQHvflkTthDsBauWD/8OjhBcFPHThM0fgQlSxB76O agqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148812; x=1690740812; 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=kLhFwLllLBcABf0FLHFOWJ1JpdPmSLhyETzCroUnu/O3rS3sRt5mN6t6TXWNrmHUGh g7tXrXnvgsQ35HpQ4oNkFRjbFdWR61d/MDE6Wd9GBIZnogpLSqIZ9HAEGLgzvVfOtd76 2iNnMD2uKuQ4tGbEnE4oFDpTpAYyywOy2japdrYcpXHWl8bwv7AmD+LOT3Sf0jd2ATnd xLFfO8hKOOVqoWmoayNjhUEocc/BkLzqx8AfiVfnqLdkJr1awtD51GY2hofuYeYtwHw+ 1mqXXJt/8ANpeK+uTiUVgyvVaAUQR8lDXgH89Z9Mhk4AHIL0qpOKSboZQCPF+PXeozgP dMBw== X-Gm-Message-State: ABy/qLZ2wfkzYUURfoyLDoBRswhKgyXn3LX3u08TEPvUia0MDlkOGB5n sL5Aqr5RlBOZCkBSt/hsZ8LRqw== X-Received: by 2002:adf:df8f:0:b0:314:c99:cd2d with SMTP id z15-20020adfdf8f000000b003140c99cd2dmr3099118wrl.10.1688148812799; Fri, 30 Jun 2023 11:13:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e1-20020a5d5941000000b00313e59cb371sm17576229wri.12.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D8BBD1FFCF; Fri, 30 Jun 2023 19:04:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , BALATON Zoltan Subject: [PATCH v4 25/38] docs/devel/qom.rst: Correct code style Date: Fri, 30 Jun 2023 19:04:10 +0100 Message-Id: <20230630180423.558337-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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: 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 Fri Jun 30 18:04: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: 697969 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596714wrs; Fri, 30 Jun 2023 11:14:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSMxbaI8SXFafN3T99/3OeS6ZBQLhLwCUTResn5QkJnT/IDiiRPMcGEP+g6XwAHF2mu4t7 X-Received: by 2002:a05:6102:3166:b0:440:ad55:a589 with SMTP id l6-20020a056102316600b00440ad55a589mr2654133vsm.12.1688148855668; Fri, 30 Jun 2023 11:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148855; cv=none; d=google.com; s=arc-20160816; b=pEf0U5Ye5DqpxGNOBkRlEnFacjZkybYzFuCFxFfR3zNXhqODBAafuXI6ojRN6YKxSG ikRyQbH+HP73vNUMV8nxObUitX5s6m/7GTO6x1bDDpcD7xwrFnYMxtQdzpnbxmWSlk/V tQaxIREX3W/Af3WW1dz6BlHzhFzjIXfDaf1sFS5H4IHSxklTJQLU2CGDCK8JpjuJYZiK B9A4wZju6z+6YwZMvLuBJxLIPVY178xXEiOIA0wBmqSo98YVWSDNUGD/weamRcYc0tDP AX6XrROv1OtAsteky70J7fYqW0inqdjP5CfizVzZQ7cWP5DinNctmIPcEbpG0zBnuAju I0kA== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=eYzoWixyYm0ytFFK91s1lFYHPmlTK+h/B16+NVurWiffyv6lSfPROlNjuHghmAejEh v/zKZuvEVPC1VmqdCke21r7XGSK7hDErQnFys8+1zQ9fqKz9mPGs8IOY6Els0Dpjq80o HFTbjOy6ZNEM9XSz9fIDeznpKmjNdlOWLxc3ZwRxQUI0XDqQigukec2AmlBDZ+tCqrWe kfsZhg+yvpAEsEPLDg9N/b5xjD2cmlnqibifEPGAQCZdz1wpRMoN0VLi4bGNSU13oCaX fgBJFCPlbUL1ph58XyETRhaXud/YO9ui/cj+5MigNPiGT2eqHS8O8xPUAMMUCyPpjcA5 8iWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDvdq5F7; 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-20020a0562140dcd00b0062dddf078cdsi8370280qvt.48.2023.06.30.11.14.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDvdq5F7; 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 1qFIck-0005S2-HY; Fri, 30 Jun 2023 14:13:38 -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 1qFIci-0005QL-EL for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:36 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIcf-0003Wg-9q for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:36 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31297125334so1972432f8f.0 for ; Fri, 30 Jun 2023 11:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148811; x=1690740811; 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=oDvdq5F78Cxq+csDREUhlgsG/N37ST6wZcwezMzL84GD3V+fNjHlK+mysKyRUjxoBw TBbP218GWVvap1XSpClLPj596Nma3gfwoJVvP0nb7Ee2I/71shJM/R15ebPEq8szoXOJ q2so1rdXzWlpflsgiuMNucQS0uOanIKqyTVhSksPXrqmwgGryhTFoM2GMQDIoolmggQ+ I7GeEc0/VAt5CoOqmQss/DkFlY2lvUQUiYo6zeAPzhg9LuvqCjw5JxS/7Hm8kUDEGGKJ pJYV2a7YHDuOd4P4Q5jKQqIj4OHgqAOlRCoSoU2haRGqgea/+MjtJUnTYXzB7lK1uzQY kLcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148811; x=1690740811; 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=L7CRELyjwJcGmT1bhE0VjEmiORya/i1vdozARFITgJIdutQMZi29bn0MqheCoMEkSx 9wlTMYsNVBUiwvUwUARIBz2LLXhtm5YXF8tiwEyhvKO3zc5/+yV9UfU1yEaFx+Kezxse UPkfy8mPGvaRQhC88IlstFPjUVIWdhEXUE4NrVmpPFaC84nRFDgvC7r/KsBGRTNFgWR1 P3Wcmzl0OKgViOndryPEdbSSx10HvkJGso8FHGwMpzpEmMUyGbkcCzNrucZT2Nv/kB1g 9CNBxfHrnMvuFS/gktxlqQUwwNG2YFH4p2nEeJ7sdp1HIXA/GbHU4N+qVtReEcplJ4I1 gniw== X-Gm-Message-State: AC+VfDwoqMIrdb1XB2/MSctfxLX+sFB6yb/UTWOQHFvD8VbSUWDVTr3n Mc5xJU66t/CegHJhtTwv8TtOHg== X-Received: by 2002:a5d:518b:0:b0:313:ee4b:b584 with SMTP id k11-20020a5d518b000000b00313ee4bb584mr8038327wrv.1.1688148811676; Fri, 30 Jun 2023 11:13:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t1-20020adfe441000000b00313f45f74a8sm13308744wrm.103.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 044331FFD0; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 26/38] docs/devel: split qom-api reference into new file Date: Fri, 30 Jun 2023 19:04:11 +0100 Message-Id: <20230630180423.558337-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Fri Jun 30 18:04: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: 697975 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597256wrs; Fri, 30 Jun 2023 11:15:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gx30AU7r712XH8WOB4VCBxxkFg7m3khFap8+gsgwaXsTDh8GlepeDm00hW/Hff5fFbR3C X-Received: by 2002:a05:620a:4009:b0:767:1802:60d1 with SMTP id h9-20020a05620a400900b00767180260d1mr4060625qko.18.1688148913176; Fri, 30 Jun 2023 11:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148913; cv=none; d=google.com; s=arc-20160816; b=1HcSAVNnfhS7lr2YPxprPf9gojemIwoV7NHIv3lmWbGcYJH79dAiUm+omKQtRFZ75S stZMMCauv76ArG9i4b3Pswzj6BfVTfK+jq7ee4GlBpR+MMIV7bSTEAj32Z2IZr5lGVUX 8D2KbUp7PhxjadYnP+yeuSriWolGSVBSTWoSHrtycFMMQhxK0CPIHgMqAeJ6lIsCiAUS 4pkMcbP9Mfc4Eg3aOFQidqiks1n1eRV4Maynlro3hp335vhdNaHj63u9YkAE6vo4rIp7 I8RX/iwLSwO/hyN+9tCFGgtkS2dW09OKe5x9SVSoLcb6mqXCml8bhQm5H7KaG2w6l0rL wo/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7Dv1TJKAgvOjRuScSXc6KvO/+t9ISNh+7I3S8hdzvEw=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=jyW3uYkjZH3mK5QxvV5NFmqXf6nnvom3MCa0sOkZJ41V1SRgVhXYXOn/yHoypsxDEw 0jmyvZa7a1pfKgGP/UcQJN4cY3hRR0yhsMCCm2C4Wa5YF9qUgSx7KMyqK3wOicIoD25z aRYt4XpogCe4LmoGp1SQXJPK137NYiz7v1veEwesfpD3L/nHM/yVFWiJOsS/ZSWagpro y1KaSkoF1UTlxi4VM0C37Ra1A2IO4lkW1sKIp319/mzsnW2nwdQWLqJpEoRyP2T1BlXd Ctr5XnQ7VfeOlOrYi3J96iIsJpchs2CNfPmRK45uaXUKmQkr2FB7useGPxC6qvUma44K SiWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IjRTo8+6; 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-20020a05620a21c200b00766fe03ce63si6228502qka.557.2023.06.30.11.15.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IjRTo8+6; 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 1qFId5-0005jA-Rl; Fri, 30 Jun 2023 14:13: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 1qFIci-0005PW-7J for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:36 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIce-0003W8-1G for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:35 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-314172bb818so2401013f8f.1 for ; Fri, 30 Jun 2023 11:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148810; x=1690740810; 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=7Dv1TJKAgvOjRuScSXc6KvO/+t9ISNh+7I3S8hdzvEw=; b=IjRTo8+6BQ3Ebxy1aldztooiW/vlRCsJvKFDdNiAaKHoPuEpkotRC5wX5qwJ1HeUpF ke2Ue2eePkapN4YHzuv5Z32e/o/GfH5nWC5DnAeOrap2wuIzaj9UOTrqLoF2UNPYj+YK ttw0GRWpY5rWX2I2ZVa7w0A9rnfiNkN5+i4yuhiYvSw8mwxRiZFZOYtVNe9kPImyyEAP HN644H6ZoB+YMIZkoEgKH7jkxAnJGZwqQrY2w/kikxEKIRZX+XRDfrJps6D5yUJZIAbK 2M0xeTK3UiZkxwmw3XtlM8ZUp0p/WqjtcYFpbcJqkBJTgW64q5ItoL3TOceQpOu6hQWL 6LPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148810; x=1690740810; 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=7Dv1TJKAgvOjRuScSXc6KvO/+t9ISNh+7I3S8hdzvEw=; b=OzlDyF+0UqdTVVC304hUTEqGKgl1bPqAvyCBRxPB2NHhPMXhv6bYWoiAqB3OvESwNy iB04YVdZYQPc6aIpoKiOCzSz51yGfIe+uCbN6Vvc5qyOLC1jumpUMQhLITkkifDQ63rh L3SffRT9lBht2y0boECRfj0jxFF2xQWEWIosKcB3i/r9p1cNo5/Hr6TvlgIjFCVlXQoV /EBPelWVkbTd4lrdmlS/Ysz1x2eQeYv1kUZ9fitKHscTP04RdCW0bXppIwiusivmrDaX IOSzbbu6FSwDVcaZDoKfTscsj6adMvSsfbqzKHeQCp1aE3y1i2rCuerA+29TN50mPxNb pAGA== X-Gm-Message-State: ABy/qLarR5zY884KZt2I09+lNNZt/Pf5IV2aMnXC/ENHYxks2Z41H6wU yf2hieUcE646bYdtLYoNn2BjJQ== X-Received: by 2002:adf:ea87:0:b0:311:1f3e:e79 with SMTP id s7-20020adfea87000000b003111f3e0e79mr3260550wrm.13.1688148810551; Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v1-20020adfe281000000b00311299df211sm18857193wri.77.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1D09D1FFC0; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 27/38] docs/devel: introduce some key concepts for QOM development Date: Fri, 30 Jun 2023 19:04:12 +0100 Message-Id: <20230630180423.558337-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230619171437.357374-6-alex.bennee@linaro.org> --- 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 Fri Jun 30 18:04: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: 697973 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596898wrs; Fri, 30 Jun 2023 11:14:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Aqk0sM9dqQEX3Yz6Qu6qwtIRCN9ZJ++swucOOeewno3GZ5h6MatimwtI6az1BP38QTqbo X-Received: by 2002:a05:620a:460a:b0:765:5c3a:26d6 with SMTP id br10-20020a05620a460a00b007655c3a26d6mr11823659qkb.12.1688148875480; Fri, 30 Jun 2023 11:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148875; cv=none; d=google.com; s=arc-20160816; b=ounmsLAnqL6Ubgn9GqT3wgKZqImpiAbQJYUcC4bPqL7n/L5cpVm18PSoamU62gnKva 0wJsk2nrKkUps8Rs1jql5ELSJqnf7MTBO67grNF7PJ5b4KZCBQirMrnO0CKSE8sZEq2a TGrBJ+t2GLLPM6FIjZmdAYqDOe+T4tWEne3CIPP3NxFX10g2M62m8VjUBkzWj/9OwmXt cLwD9yTznwZtUrj+dju1ExvFcLCgKCRFgCHhPf6PbQLfqdbhgiVq60CjRm/ELS82aHJl XSLo6Upsz/zJA4pGpvGVDFDj2yndFiSJTLyAymis4QrqFmTiEzn8lNkHkfnXtKd/BFlM f0hg== 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=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=1DqfJHyKgo1eEWSj7gUXG7ho0JHbHLajahhbU0viSC8544RAhNdTUXCpYdhzVmISV1 dY8SDNdHVWYqIC0fw1MYIAF0wpwudzxup5riSlvLiUVtbmA7ZTb15/Z2PidTlq126djo AfYK6WHdAd9RdDTatFOLsBY0wiePskajY5c8m1OfDAPBc5QFGWvNAs/nWgQH32Gm9CSM dQGD/i00rv24/cLytOLByOB3WqWD7HI7TdzjVwSa51+BDh05fLkC8xCG4hEd7xdGZcBe NvHHuoTqg4b5fkEcQo1NpE0/s8zwdFXoE7oRZqTLMp8Wf8Bx/ENW9uJl/s192Ns16L6Q swIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qbpC3mhD; 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 jl7-20020ad45e87000000b00625c59cf054si7654140qvb.329.2023.06.30.11.14.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14: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=qbpC3mhD; 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 1qFIcx-0005UD-Mh; Fri, 30 Jun 2023 14:13: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 1qFIcg-0005Nu-WA for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:35 -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 1qFIcd-0003Vy-P5 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:34 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbc244d3a8so16979615e9.2 for ; Fri, 30 Jun 2023 11:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148810; x=1690740810; 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=qbpC3mhDVEt4vOC/cNCfXQ7ApVvxwz2j4QDN9+L08kRZB1MAVF36ZMa2vz+RgFQOmc jQr1F9ew6n8s1hpS/1IvW14Lq6A50crqjZ8J9fZ/HQbk7zAI6zDHHewvo0KGqrOcbf7M U+rMtmSBT9pvCedeXNXwwZBhC9G9tQFg5de/PuaniMCXNDV4qyX1auqVbZVN4J0pyS80 FZZGPcp/5tRZVpR6u8bajJ+w+MzRaXU96n2onSkusGFACAt+aOsFysxlvP7sMj+MB6Xs rkqVhhhjiQfuRn55ZdVmNs61mg6+0mqVoQwSikptmJLvPjAjAPlfQbn3YIeRYkvmokD6 BB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148810; x=1690740810; 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=BeiIdNd6pycDSET/fLWf6t/QLXlFUrd4Vs/PdRnDIY0P79f3RH4DbE9g7mcYJRS5Wg NbHCpKdYwph856kMoGyh0sIXCJQ8wD9PkkpRamKyO4ptvCJHo0Ti2GsUoqBBfz2q5ylK JeLiUZaBad6BmWtyCUxJ4nSzizhOryFtyt661temtRiY4413WgS52q042bCcn+ncoNfq jdtTwn4C27btrNSBnKSEW/neTKVwKSkzXwvzX4yNmdjzToxSQdVGo+T2v+v1P6P0fmxa BVwEddMxpCAtLMNTSc8jSAJJcgm1+C0+IHHdVTUtTeLvM8wLRzaLw8FlJR2cjDln9uF9 s25w== X-Gm-Message-State: AC+VfDy/QhiT1uLo5arpqsWH1yP3BS4KOHc1ofIhFwKC9aEQ+OwNDYR8 eCtCty+PqhAPLcN1rgB11lArAQ== X-Received: by 2002:a05:600c:286:b0:3fb:b6f3:e528 with SMTP id 6-20020a05600c028600b003fbb6f3e528mr2747867wmk.25.1688148810147; Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s25-20020a7bc399000000b003fa96fe2bebsm14598535wmj.41.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3742A1FFD1; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 28/38] gdbstub: lightly refactor connection to avoid snprintf Date: Fri, 30 Jun 2023 19:04:13 +0100 Message-Id: <20230630180423.558337-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This 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 Reviewed-by: Richard Henderson --- 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 Fri Jun 30 18:04: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: 697976 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597277wrs; Fri, 30 Jun 2023 11:15:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlGwy5WcfbhpxeeSxtPrCMB8pobojQ+lHMFFJuDU+WgqgxOtk+IvKQ8S/sfMNtZjmJxLJl1u X-Received: by 2002:a05:6359:207:b0:133:595:1c with SMTP id ej7-20020a056359020700b001330595001cmr2454734rwb.31.1688148915537; Fri, 30 Jun 2023 11:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148915; cv=none; d=google.com; s=arc-20160816; b=BRpxGh2Ss5yfmqGoDOhKAEhyR2KU1V47iX5Z1rG16UZXGewDXtFhIqxyMETQRE2rh5 UDE9mqK5i6gZ7p+YkqIvQgvhB5+xb2hCHyNyLoiwIGVADDsTiX2/6RrunT2G+x6rGx2x RRtduuT0dBkibCwQpnGkeKSdnZSBrp90rCti6BMa+NXJq8SM/XChF9I5DkYf3lzFuWQN QYmMAVK7xi+IB6K85xSMCXj/Jfn+CEDREs10HHTIW/YHYmpzthgAvBtaBMzB16f5b5In KERlr+B+3P0U783szKV0IcrE/4FDt0YIC7pjKnn8DDSgC9qdsn+91y5QB9Cm4XJ5ZLSE vdFg== 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=ALxGmzvga6tIU6vn0TbLsO8BGacIzfZzO03C4YGEoho=; b=lGnsPC1VIAVlS2+rzQeGAybAQ4l1KFnUQleDmjlY7mOh/n6GO+u/pMYCE7nRU54J1i Ff4BNyQI64U4FAbTdv2jhrR9iewPsmynEp55CvNMiELvtUJRLoYzKe/sKRt4MrH5yX3D x61j8UEuLUoJ9VKLFBtSwnimZ1iDaWDlkvvvUFYDxUgxcIGqE56R8qTEArix6gOQggIE SpjsXFQbuOFL7Fiq19B4rHuPSfQwxeJcpsXs+oVKVwi0rcT+kYoh6nfF1vNrUl4V/Uc4 55GxRBphiuq4J/tM0GG0tEsvXfBNFGQl607zteblJmKTlZ2FhHn8hzUJtyKKi0hR8Pix 3Itw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoJv59s6; 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 z13-20020ac87f8d000000b003e4e9ddc6f9si8307028qtj.118.2023.06.30.11.15.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoJv59s6; 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 1qFId6-0005ki-78; Fri, 30 Jun 2023 14:14: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 1qFIcl-0005T1-4f for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:39 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIcg-0003XY-LP for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:38 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fb4146e8ceso24686915e9.0 for ; Fri, 30 Jun 2023 11:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148813; x=1690740813; 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=OoJv59s6DKWXwTqzOtPlJEpShOSxoQvzfmw/Q7NevrMIOxHOBPj5glmCOJaetH9Fml TAjkFFeaz6J4xW94nYXWNFN3YtlQPtIiBZOzZunzagKMmO4T9JjhumgvtNivnJr4bdoz 6pA96NB4/uc30H1ff2QVp5p6DGYjxO8Xgh3XhbWUj7UFzuIynyR7+R1NdJqobn1fyK1O PKUMiC4nR8f4lhDRGRK4epEosjIASKDcS9gUmSSc2j6ISNkUF08gfpIzTqoWnShQqbLH 4RP4Gir1WeR36WZJs3JjS6VWA+vy2ddNHUU3aoNL0QPYsyJw2j6RdcCUrgO9H5fXKZXc Z6oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148813; x=1690740813; 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=gtCkyGuD1z5fDzgtcPqICD9k+CXSgqa/A23XM6rVwgm2TQ4k+0adL7lPGRXd8zClWL i26xyNsvpZrSFJLafuSJjbmhj6JpdspF5VkkbV8YXRAyb+U1NicSCti0QIbNrJL3TRpi RaFnfa8G7LHXT1QrBxevSAyF31Ml/7wmUdfwS4cX/Ignokkz2xoKIhgFQYs5DxH45EGd FxuGINgys2E6sDdgY7lIhZiTi+d2L56vJMdZtaq01XM0Kakf/5M6CfSUb6zrElUcj+cf AijrxlnbDsIKvdaWwO6F6uyMCguRyyUOVCix8Qv9EtYtOxTRTzoZ+OZPrq/x8oXb+pMF uXpw== X-Gm-Message-State: AC+VfDzx0vfvOCNnk7VlariqOY3qtOBxThKAsrMJ/XN0O3Cju7x0bReF KRC1wISFMkEFLKb8EWQIE++AQw== X-Received: by 2002:a05:600c:22d4:b0:3fa:9850:8b12 with SMTP id 20-20020a05600c22d400b003fa98508b12mr2554049wmg.21.1688148813030; Fri, 30 Jun 2023 11:13:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 25-20020a05600c029900b003f42158288dsm22573094wmk.20.2023.06.30.11.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4FF8A1FFD3; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Nicholas Piggin , qemu-stable@nongnu.org, Matheus Tavares Bernardino , Taylor Simpson Subject: [PATCH v4 29/38] gdbstub: Permit reverse step/break to provide stop response Date: Fri, 30 Jun 2023 19:04:14 +0100 Message-Id: <20230630180423.558337-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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: 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 Fri Jun 30 18:04: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: 697970 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596718wrs; Fri, 30 Jun 2023 11:14:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+4okuwR01XOlx8GeY89IQdqxoKAdDzA3uvCnuXqF32Ge8gbO1YRMFGfY2ThqQIgEgRW4o X-Received: by 2002:ac8:5acf:0:b0:400:83a6:6e7 with SMTP id d15-20020ac85acf000000b0040083a606e7mr3982033qtd.67.1688148856284; Fri, 30 Jun 2023 11:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148856; cv=none; d=google.com; s=arc-20160816; b=Rbpfqm8Kj+DYghBK4fFLV82cH5n2BRnM3X74UWVWvvq4u2V+NVLn/lOs+vDG4auU2R CNUhfEBLy+WCaTthRatMLR/kMp98b0NYi5G9R7mP82yRKEvtxDuvGHGvWm3WK1fvwWqq cYpH9vG+t6mbLXJvUE63zoHB84TfkduZMOc/uolEsTRTuW0Kolr9kBhaCRK2gmXIXasq hsebcXURaI1NGZ6j5AKP72QZ4HTg+A7ylgrXIcvgYgDAVbrZanWW59+gRAe40AMIIax5 LeqT6RHnuhAMg6xe8+a4zmnJE0ZpMrlut/C2s6ziPZ4199XTr7CTSWKT4Jd6yB7jmGTj jSbA== 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=noOnfZ3FZdhjlEdVG7JVDMqP/nuQCMSustvyazImnlo=; fh=OltHerz+Vf7zZkebZbScoRT4WgVwJDskRS7DoEjx2Hw=; b=E1gaFxt5ce1jhLTXoqimFIt1bzCbNvo79Z7xoeLMfY6UW3dmp/PpOa/e7WdvR4F3yF ebwjZtIm4sQRKncAlpDr+jcfj0kVksS2PMSwCOmoeaL5k6iRKaZKu6jOFhIC/SU5PIGt KEi9DBSUUiiw1jOwg61i10lJmc7h5GwHDW3ds5YKgS9nXjzt18ca8zsevW74b7gj+eoF uwcBy+nX9XbCipUCmFusobmhaf3G/WERB15iEqVsFd3QUJSt3QiytZNJaBdnuxVYszRZ TITjHIkvHOyPmQtUcWM4qeUFtvGDFh69PObJ3VWXeKs0gmRCuo3nkvBi8OhW2Y4a9aCY rBeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VI98akRw; 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 18-20020ac85912000000b003eaaed801a1si8336315qty.59.2023.06.30.11.14.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VI98akRw; 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 1qFIcg-0005Na-Ry; Fri, 30 Jun 2023 14:13:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIcf-0005MZ-5C for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:33 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIcb-0003VM-Rh for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:32 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so11409535e9.1 for ; Fri, 30 Jun 2023 11:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148808; x=1690740808; 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=noOnfZ3FZdhjlEdVG7JVDMqP/nuQCMSustvyazImnlo=; b=VI98akRwt+XRNJczc8Rm7Mri7D3wdEaxHfy4i2FpSwkGWFOT8c9z4uJY0nCScc+yTL 8nt47fOni/djJJkt9WHOTT38BjH1v7A+MSafLkL3bX2Z4ZGdT43Z4muuu8D8jKRH6zSF +Mx8TUE8OIw7JhgUASMh4ni3Iwr/i+b6B5pxL6YV6BjOAW9NzWCKHnzRXN+TBIiEa9eg NzgeMCiAhVetkSluWlUv4mVJfL2m4SWloAtFylnE+EKQnyt5/mptFgj+KJYbvKdrjrTv 6ElS6LNDloaGwnd1h86THJvP5+25SrlDQBRpuzndP8YHXtd9dkzdIO0fZ7XB+P0dpcYO 1/mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148808; x=1690740808; 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=noOnfZ3FZdhjlEdVG7JVDMqP/nuQCMSustvyazImnlo=; b=cjni8wDgvSjUyHXVZQrrDBvxfoMoDwuoRr3kULq90a53rUxKf5pSr7sepTc2Wj0Utc XkXiAQbbmtvOLgsGNnW0yn/MTBf9bb2+HIHEAF2ZtZsH12AFuhjr64tSl0h/RIKwok6B hmw0yTfLZKCk8tsbDS8oImS7rzE2euZauRtxwSPX3Bn5Rh6jbPldosm+IjoR9qYFluVp dTsDl1+Szuaw1YqsDKWOOWyBJoWeAapBTJ4e15YP5ivcARJ+dLMwkZaWGPProSPBXJpv Z8+2PKNbPNYQggK9WpSJtzzD3bNR/0/l4X5GxAw+v8t8oUgFH0AvTsaO27MbUgB5lbxs x/sg== X-Gm-Message-State: AC+VfDwws34sHCaiW8lToibj8qjZ2k5xzskWP60RgVAdQGZTKQdnDXpe bZuNQk92Dv+3+ARlZos2CSMhzg== X-Received: by 2002:a05:600c:b52:b0:3fb:afc0:56c5 with SMTP id k18-20020a05600c0b5200b003fbafc056c5mr2699745wmr.12.1688148807936; Fri, 30 Jun 2023 11:13:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l21-20020a7bc455000000b003fa95c466a1sm15232380wmi.5.2023.06.30.11.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 696FD1FFD5; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov Subject: [PATCH v4 30/38] gdbstub: clean-up vcont handling to avoid goto Date: Fri, 30 Jun 2023 19:04:15 +0100 Message-Id: <20230630180423.558337-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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. Message-Id: <20230627160943.2956928-29-alex.bennee@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- 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 Fri Jun 30 18:04: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: 697980 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597756wrs; Fri, 30 Jun 2023 11:16:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5YvmF3PtTcds/4frGBRgVmdaQZQivLcIYBgqdutXgvolgmUPwFce4faKIzCF0XZbrfai6G X-Received: by 2002:a05:620a:4711:b0:767:400b:bbca with SMTP id bs17-20020a05620a471100b00767400bbbcamr3463552qkb.48.1688148973227; Fri, 30 Jun 2023 11:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148973; cv=none; d=google.com; s=arc-20160816; b=bkbvF3Bl5RCi6OT85XXo6g+PKMAvGcJAfrq4/4iiT+iv7+CFGCVZn9lqim/9DDBRJh GUMg9gr6JC3P+ME+I9sqtyr8jmZM41OloEyJGAam5DV11bn8AfNdbAblVgSpQ/Kup44M OSqW9/rA6g1RJQ66Ll6QesQDvF6/flpU8gCb2+/9ghAQ8Fj8PFpw26NTGNUDWT3R7B0P S6sLR+czecIyPOwBHc3JSUW11AQLdtNqT6oKo3i1dJP4GZ1Xf8+Bogp8oa0WfdHiZC1Z hHciTjdGM1kGHTM04w1kKza9sePRGkXPYG9hL5LYh5wsEgvwzukM/ODouWzyqIKSKwGm FCIw== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=A9TIEhH9BiVA3BuIBFhgYY8yT14+aXCAn7zu4jaDbQDOMgDqJi0h5K3qz6N408ZMnw EKnwq71Y+kHR9Nv7/AkKpwNU7mVJRl+R2jF3h1fDO1LyQylhmCbJXdy/8LcIDZlngi5m q6RnkoKt7jeG0bWTT5Ow+A1HSlHc7gMzM6lrLbVgBOWmfpxDTyGUU/AdzDFI6KbOa+Yh eR2SjARdYBy6swsEWYrmQy9hoYq+fR/Yfa4im0FlVoWPs30FUQ4Z0Ztz4AFY5Ag5epo7 LxPuVWKhgCA4WLP2XUrr6hycU2SFDA0te3YWLULcLoq29/AQNlXOf35qn/YimnVAgfP3 nb3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xy6k6gp6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c10-20020a37e10a000000b0076707e30100si5858187qkm.7.2023.06.30.11.16.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:16:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xy6k6gp6; 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 1qFIdD-0005uS-92; Fri, 30 Jun 2023 14:14: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 1qFIco-0005b5-K9 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:47 -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 1qFIci-0003Yu-Sm for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:41 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fbc244d3a8so16980445e9.2 for ; Fri, 30 Jun 2023 11:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148815; x=1690740815; 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=Xy6k6gp6X142Qw/n69wK7eYUqHoFX1HR8YZmYN/71bNAjKsJ/4QHSR9j63Fm2eeGl7 3JPZy+avHNgPqFAWwCUqjcfH731JIxleq5duRSlPtoAyi+hK0g6EsMFIGbQd5/0vS3/7 98D/A/1uD5qAfStaAdTh28BtTqb0yBaI0qKyeVBGJAJ7OrN7bCQkhqnNOCmjlrmdAvfQ vTMHtkW/OhtPjhtvCRqzja6K2TmDhLrj0+fR9W+3F7IyFcBBZcuNLTXRYU0DzUBqf5zd nSBds3gSTkyU1coi145RQe4CM8TlVSmERk5sNAMWoM3FdI8VbiaJkjctsJuvRumtThpk 5GdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148815; x=1690740815; 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=ZoV8wg3gcU17SXOXe/90OJwewvz0/kzWbcAsAf/zj9xVkJbNxAOrKscrs9ypDg7ZU6 s/370xlyq6jl9HImS4j4TbwhpmzS5H5h+2cPrXUb50NdPZEIr0MtOnGuJkJ+9LCFxyre X1O6cUv9uvEDCNjzCW7p5zs34Vzdbbpdb2I5OwEtrKHaatOdo52rMO75HPglFSlI7LlR 9RY/DzKlyWg1zrvS3L0lLco9psldUTDlta7p5+odYexMsYG4PxAAKG7Y0S9eTsQcotI3 uB5Fcu9dl9oOGvtsWNFFyOYUDuswWIJIrmm2oAoRIXYcVk8p2zOKyENam6jC8nzT8F/k tJqQ== X-Gm-Message-State: AC+VfDwqq68eXLreEiPujd8v8HDEmCvi9OBa8KbmoExV8BEXN7qmL6nI guDYXefe9U0pfdjbhhO0Zre1lw== X-Received: by 2002:a7b:c409:0:b0:3fb:41b5:52eb with SMTP id k9-20020a7bc409000000b003fb41b552ebmr2561476wmi.26.1688148815185; Fri, 30 Jun 2023 11:13:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c5-20020a5d4145000000b00314145e6d61sm4959242wrq.6.2023.06.30.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 849EF1FFD6; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 31/38] linux-user: Expose do_guest_openat() and do_guest_readlink() Date: Fri, 30 Jun 2023 19:04:16 +0100 Message-Id: <20230630180423.558337-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 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 Fri Jun 30 18:04: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: 697968 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596710wrs; Fri, 30 Jun 2023 11:14:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zXIdpfCFCOr4OApYg56YEZK4JBcBCziwMdr2VCYpi5zR/8VDjLngh0UkYO7feyEXF588G X-Received: by 2002:ac8:5b42:0:b0:400:8e42:8dd9 with SMTP id n2-20020ac85b42000000b004008e428dd9mr4668982qtw.30.1688148855534; Fri, 30 Jun 2023 11:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148855; cv=none; d=google.com; s=arc-20160816; b=ZlMlSm+oH1p8hn7OAx7CSjY/LE8plYOHgaWG6fWRirqzzwVuh/ZxNn8VnWtYKPEI+T kJIp6BHUhcNyhhSwCwiy8hKYrbAR+M6ndURDjBWBmpQ0dCZEd4p3SOYZQRx+WPUjmMga QXYf44iSvO2wouGX8Gq0C7hunyP9ub89GwFUVzBs3xH8MkpFojO3CmKeyuU3Q1CD91RG kWpxeT47G99++jPutpLDeGe+y4wmzyfoVkkk+7VYSY9pDBW9DbFmvdQ3mb1S1hKpGrOh gPTZc4SVkk5/51YrfPmMPC9oh1f11uaEYSkMVR4l1DtXZmNTS2TgZsSmQSRv1a+gTAda uaYQ== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=GMu6jXR7KlW79r3QHP4ispe3JltTr94JYZXbRAMW6ZOVNA77maiqaeIyKAD35DA7tP oI/pCdw6dOo3/YBTHXnxwJaie0dihWyiWundxG+OPenr9UF3OVha/xXbfy1Oua2L8zvi 0MHoF539Mvv9ZPU0ORzqLwv0tc4N2Me7ll4//G3NwajArt70TD4qWCEQKGvTMGWIv5ua OT46w/4MCqJatlwL0Dud8v979dEmMN9lvs2hCox9+OvGaYhzSu1t8PwdrnFEOVi2vXYo 7q4GDSeyZkw8AQNaQztXGwKX8HelpjRUQq38q4oiy+JL5iWAHEOnGHlw9EZHAwozdmqq Sr0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vavoppwc; 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 u13-20020a05622a14cd00b003e4e85115casi2478460qtx.679.2023.06.30.11.14.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vavoppwc; 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 1qFIcg-0005NX-CY; Fri, 30 Jun 2023 14:13:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIcf-0005MN-4O for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:33 -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 1qFIcb-0003VP-ME for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:32 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbc244d384so16348515e9.0 for ; Fri, 30 Jun 2023 11:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148808; x=1690740808; 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=VavoppwcK7F8QbOXizPkeLrt8cOBceNhpfRKa4jwnasgfzOthsTM2SDmLZ6XG5xQzC oKNnfK2GUqRPSx61xRtddY2mhMXdlj9OfJtEYLMGnt59Q5jB5WCCt9yP+sU3drHv9PJI mUZ3yin+xzi4gS1Ik0Iah8h5TDa98t4WkFWycL1/HADbcPaIg/+u9m3ea1y/TC+aB6fk 8yqppZndxIrbNv9TFwanENbpbfPFauHyK/BBGT39b9MZrR+/0GUW+wg+Gd40Mx2RabVm v1uEHIit4gekd5njgE8Ac0jd2pE3cCETQovUTQZXyFATZi7thXMoTZZ0zNvJeDh8wY06 BQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148808; x=1690740808; 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=NdiiOIEE9ro/kgcJBMCm44Cpfdf1tyzHYi2Gj0FIeBt2J4cnLvcIVzF3+aKWR1PXyK 43ZGlZ4Fix+W1s5nKwsMluiacc1y+7IeJfa+StY9kiIYiPpT1Ts5s+ZF5nut/TJb6S8Y vXg3bG0frQQO5LAokY9PRnKEiWRSJ3KHBUjiaFHCCriaHtOmmpdkKGlRrv86jsdwnobA 3KgNaEc25Ve5vOiFdIph3pZCLP5r2Yk15576qpJ6TI3/IITTtJw6revbkde6/Tt2WKs+ 71OeVPtRHp8k430bInidT2npNd/8FYECiBu8UyN28m/meekyxcg9IPKwzuhlaVAKyZ3t xMTw== X-Gm-Message-State: AC+VfDwKEbG5W1WYyA/CMEZsbf3Nyn9nT/lQeyBOCOVACj4NWPurPl64 apeoFOY2cZt8eX/wa1V7dO+79g== X-Received: by 2002:a05:600c:215:b0:3fa:97ad:2ba5 with SMTP id 21-20020a05600c021500b003fa97ad2ba5mr2626436wmi.31.1688148808167; Fri, 30 Jun 2023 11:13:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q9-20020a1ce909000000b003fbc90e030csm1682204wmc.37.2023.06.30.11.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9EDD21FFD7; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 32/38] linux-user: Add "safe" parameter to do_guest_openat() Date: Fri, 30 Jun 2023 19:04:17 +0100 Message-Id: <20230630180423.558337-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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: 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 Fri Jun 30 18:04: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: 697982 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp598254wrs; Fri, 30 Jun 2023 11:17:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFuppwrmwK3ro0dEmAC5q+mpIBwEH+CDC8NvAnBM23WRD9XEaWDzaSVrHIDPwXHRW8YDjd X-Received: by 2002:a1f:4585:0:b0:453:b080:632d with SMTP id s127-20020a1f4585000000b00453b080632dmr2827528vka.0.1688149037538; Fri, 30 Jun 2023 11:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149037; cv=none; d=google.com; s=arc-20160816; b=GosH5+g845yXtIEpodMd7yvesrTbon7TwO2J1kPYcCjLILWxoaIYJl5lDUfpEKA/6R 08NUizpWD9e/3WPsbr6Iec2ZLAWJpYSoth0lsVCc7VzHUXuIq0QjFs4wkov84WaIQvp8 SxXnDW4IN81EgDmE1Kan2/icWF7OjLl9I24vCfSrfDm7fL/RSHz1YCv1NiWoZiMSCxKd 4WkhHCaP4kLv1DnnArtNWGDGFR53MWSUDlxMyHOqIu38GW0fok/ofQYI9dA9HCKv7xHM uwVbtEy2o3WsaQq2yeK15aJa8RQrrgo7AkXCEkSZ0PHO0Sl0op+ELdeJJVrgnCIes0iI D5OQ== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=I9QCA/+hq+jpMvSZ7Qi8RF4QtWDOpfxlN1DOj/SfOVjIrG0R4qh0JW2qJML+G6ails P6piwOyQ2kb1OWQymJkFX73FMf2SnY8pCYZb5cF6RTcc0fpV/NeqlDhlmHmPK0crh0bq /2Ryxm4EA4Lx/xQln4NSsSBkRdTrSto+W8/+ooUZtSldOZlZ7H8rCfK+kykXVEsvwsF1 3u5nWCOxLfPf6XoTbVVw6MvSEVkrUep9IFmHAEsC1BmhEJabBodKlNJsVP8kzuHbur+t sCogye2Gzg9P0Oe23Ilgo14BteLa9p3BUydkYYbjOIfZA/La6iRyrmEToFjgbz87lIJO JVHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F1D3YyQI; 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 a9-20020ad45c49000000b006260ed5aba7si7924471qva.91.2023.06.30.11.17.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:17: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=F1D3YyQI; 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 1qFIdC-0005sl-BW; Fri, 30 Jun 2023 14:14:06 -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 1qFIcm-0005ar-J0 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:41 -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 1qFIch-0003YD-FL for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:40 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso12929645e9.2 for ; Fri, 30 Jun 2023 11:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148814; x=1690740814; 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=F1D3YyQIsUqLIAaICEEKjm6d0cCSBgHPHoZidptjuqHj4OspPP8SlKAXUAAWzQW8CA o4TVMouZMZ2JYSVtZaIRT2McNJ1Epwb/d35ieSmgFd7kyuwV+OgpKECvHGuzy8DP7mMx ExSmVElVtD9AOFgVxYAf4ayuEIuVqPsjZnNovNoxAORSmjhmkQwOaWfnOfGdRG8eafpO 2kmq+AJu0IgEzdzZb6mnfS9OgKAvyTmSu3l+9PcxLdJabqosHmelSPhnm9mEqFo0O7Vy whue4U50aW079Yq8tx8E675UkqpM2ZpxAQ1XpU63v7m7/GxsWYZuml0GgUaEbJSbc2yP NdlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148814; x=1690740814; 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=TWZoiIsZRmya7AKcYBsI1a6QlbYX25DadRQgjgx3IMJEAovM5nR2lQ1Hw16cXEIbY0 FHe5QP8XJfhXdQJ6boKUnDf/ksGYDeg/I1Sgx1FDM91vyOIEJRZQnYea/FV+xOslJVOE 9WKo6B+8QFXB2PHupJKGzabWMVnHX9ns/Z6yIhlexkvy2azhbc59Fe8z5oF7RD8sNgQX pXc+CpE75UMSnFxerHD+DUrJbjxOnvY1DW4c0LNB3RdjHYMW3jOzLAbt0oMN5eccHFtx 452I3vKD+/GyMpMUxq/CnyIE3j6P/bjYkrVN1BVp6bsGzBXoUL4UengCPfgGgmad0Z7O hJPA== X-Gm-Message-State: ABy/qLbDDJuX4M/SOgkj60BrTgWA8YiJHp91PYObfCR9O1Uk3o1QVolS wgfQD3KP2160FzHdwGKqzi1Law== X-Received: by 2002:a5d:4c83:0:b0:314:1ce8:80b2 with SMTP id z3-20020a5d4c83000000b003141ce880b2mr2828534wrs.24.1688148814162; Fri, 30 Jun 2023 11:13:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w11-20020a5d608b000000b00313f7fc35e9sm11940282wrt.63.2023.06.30.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B8FB61FFDA; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 33/38] linux-user: Emulate /proc/self/smaps Date: Fri, 30 Jun 2023 19:04:18 +0100 Message-Id: <20230630180423.558337-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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: 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 Fri Jun 30 18:04: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: 697979 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597741wrs; Fri, 30 Jun 2023 11:16:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgQL5eSgbLfQo70in5vjcoAMaRiE4dNEaERGV2/+z1XLue4cODD7Uy3Q/9DoW5QuKWSmyb X-Received: by 2002:ad4:4509:0:b0:635:ea31:521a with SMTP id k9-20020ad44509000000b00635ea31521amr3988346qvu.7.1688148972112; Fri, 30 Jun 2023 11:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148972; cv=none; d=google.com; s=arc-20160816; b=IeQKED/PhHh9fktsuGlo0VIkeLZMtkueloVCwNvYus25H6HPoK4izVGqqMxl1Q5qRg U7WMIBSkljKxC0w96hq0/D1eVV3bPewMCw3z/i6k8YSShnOuehX6ufoBu92r4hF8ErBc R8KBJwsWZLlWFeHYkVqQ/yNKPn7sDniwIeIhXKsvPtP9S/s1aamdEJjuNHn+20m8SjXq f7I7hcu0+F+0Zl9Z/CdSTKQSXMEUJVr/TUj79FZZemEFvrHKZXkVVvQHBKtySfJJ5sdh F2GT5dH6yqE/WFs3EjnHocgtiHu+2kvN5FTQlJ2u8DG7NDSEUpwfQ3nwxY23V4kCJffJ WHqw== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=v/fz1iPCfDDPlVXo+T1Eu24AsCu/R+EnrikTgSclrPhfy+7uu2KcsSZhlUspXcOs1Y lBiS3bo9bFW8LrSt+LIN2R5zIkEJTVpA6kIOc8muRGWxTTXWZMcCzZP0SH2LhRVEWYY7 VhyJY0zpw0/5tYutmvYk/+KpqFQggPccnWOy8ZavzQLGR/svnWsiRG7ESkyk3AR6Ioyr YCTUj/3q4wzN09Yz/3eIT+Iu9xIrcZpiwiJLBvIX/lm9JwWHG/KzuwRkdE3YxTGetNZf S1O9lXwNgB6SPM4RLGSPQMumGK5XFQhjSKvuyjysL2V1xlm83Et3NdflfCgQ524xQh3z cpfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YoKrb6Re; 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 e20-20020a37ac14000000b00765a7b69a74si7076153qkm.673.2023.06.30.11.16.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:16:12 -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=YoKrb6Re; 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 1qFId8-0005mW-7E; Fri, 30 Jun 2023 14:14: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 1qFIcj-0005RP-Kz for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:37 -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 1qFIcf-0003Wo-ET for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:37 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fa8ce2307dso26654115e9.2 for ; Fri, 30 Jun 2023 11:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148812; x=1690740812; 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=YoKrb6ReTPU3uKlLaE4D/+AEw+OCcqZU/Ytw1OGISiy++SXKvKwuSymf0j4I7GC6Lo gMD26yHcO3iyTlICvfBHWpfwLmAIOw+PHEZ0IbMOarYlHoMzDrTDSyPbCYdtRW79hc0a yOn9jQjX6E8KpQYlAMa6rijYiCVgaOIW6KQsTU+Zaax2Me4AGYbnNAHSFGzBVruRQatv XYRgYfAwAZ6PYMfau2d+G+cmgrucB/5K2Lu6amH9nEJ9t1TJq8IV12Qw0YNaO5WBnxUL KK0izKNBqR19YGyo67ju1MMW8rOb9b3zyxAv30IdyDtdzNq2ubNEEa0Ggj+1TSiSvvYr l3+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148812; x=1690740812; 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=Jir/sSzjJ9M0UQ0vTD+4/Ko/LaLGJ4RdnPiY2EYi8K4GJdFnu13pH4tGIyNruOMuDz lGxgfZbl3byv5C3jleYD2A2+V3ZM3NNcbFToah0WOggHvyKDYFqAWmCUrBUq332tJqrE 2Nza2P5LsMtMS102sIXg1nh2WPlg7fCyNq2NALkrg3+fPoE+rd8iTqg4mZqXhkuU1xgW 3FfU1CG4k1ZDXUCCYH32R92eep1twNrHjZoyU4LIa48hZ9tSkKbDG7gnQS0QffeTBXSG 88UhgCY5dvUKQ/hWvZ61V6Ts+f8ZvUKv1wK9DqyR8Qum6YBQgpSuO9vZU0qq4Jdy7sn0 SUMA== X-Gm-Message-State: AC+VfDwOzDexEVaEBXV3TJZ0PLDED56esFf2bi3geqddncEy6d4xvUK8 uaviryFFOKqgm/k8Nk6FbxIRNA== X-Received: by 2002:a05:600c:204d:b0:3fb:9ef1:34ef with SMTP id p13-20020a05600c204d00b003fb9ef134efmr3269586wmg.37.1688148811899; Fri, 30 Jun 2023 11:13:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l1-20020adff481000000b003113ed02080sm18720230wro.95.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D5D191FFDB; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 34/38] gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process() Date: Fri, 30 Jun 2023 19:04:19 +0100 Message-Id: <20230630180423.558337-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 --- 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 Fri Jun 30 18:04: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: 697974 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp597090wrs; Fri, 30 Jun 2023 11:14:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPTxlDGMOuUR+zMKlL/e2g0KOmNTo4QVW72CFnHgqt1aIQbaEzfRtyx5Cm8lUH+IExMZIX X-Received: by 2002:a05:6359:67a3:b0:134:e301:2c21 with SMTP id sq35-20020a05635967a300b00134e3012c21mr3747068rwb.15.1688148895863; Fri, 30 Jun 2023 11:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148895; cv=none; d=google.com; s=arc-20160816; b=amranCgFeMqocq6JZBu2h036dUz1fxjv0iiPhW/o5yi36lDbHyu24rDMiMykWsNysR ZGkW06aA5OVmkk3ABSsDT3p1KZhu4gyv3jb3b0FXo5CKgZtDWNpPyya/5MkG+VIqeLMz QksTWVmWdiNZfgTYzhlslRnrliz2Pt634Yg+PvVV0dE9rxY0nDt4L/sDPBGrOKRbXsrO GID09X0GRx/fDtLYXsOvpk3YSSTHIJzRE915bjjgYg0chj5wXTNDkIVCe5UXq1v+z1C3 lofKVH5SS9xLkc5D9w7eyCQzOKspf5jICDC4j+4vvGKCP35TZWuw64t79D+tcKso1VGP 8tVA== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=GcnTHlaIRGEqQQwAB9asaMwjzCRrh43OKQKwAs66i1s2oj0f0zVdxzNHDzafmP897B 34QjekjSR/j3NtpC+7eTAPRzaSAkJa0oUQv/O/+5Ig4Cud3FkSqRSLHNREOBwPD7ouOU vEYZvInXlbj9c7zheI+ZaJDEb/mV7pR3nKJ9EQ9KJGFjOoqIdF9fIXjD8OO3gTNkVA+/ NwEgbiyPKWuUIupUP0rAe/WinJ6QGGgcEtZNM8i8PzPXGijgCQ0NLVB87AVMHa855waH Y0O5lmYxd61pL9vR+ezAhgLokRBjXGfPaI7sXZfd2UZ6X3ErgtK6m6m8Bamt5fuJ3M9P c1Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qddmp1xb; 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 qz10-20020a05620a8c0a00b00765b3212b78si6483010qkn.564.2023.06.30.11.14.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14: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=qddmp1xb; 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 1qFId9-0005oV-In; Fri, 30 Jun 2023 14:14: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 1qFIcm-0005at-Pd for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:43 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIci-0003Yk-H3 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:40 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbca8935bfso4388015e9.3 for ; Fri, 30 Jun 2023 11:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148815; x=1690740815; 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=qddmp1xbc6xCFtXNg6HPx+/yEITPjZ7FmfWXcpyu8GOdwqfQNX1wWjNHkzEYyjP/0Y CjRzjpMRFhVYkpjQC4AGC1BC6m1HV3L0DJ203NqRhb99xEjFXuK8RfYwU/dYGFuK5IST KkS6uKM4Mc3LmTXfYojoVozWN7qV1wQXRzWN2K5ABJ42Q6XRtirMKIvA1tE9ktvo7wZF o0z5QbC95CYpGFnbj3+CJ4q6bViIsbNeepfWv6929CaajyhXij0uOIHrkhCwZaAwsReu 72EVM5leGW/32wFikyQcf4mE+hPX6bNL2oAnzzKbFc9JS/V8YWL+eZ5b4Tqg5WedhS0B Zk8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148815; x=1690740815; 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=Bvfuyp/doTdC/E1sPmtKF6duEPa6T6dP8XY5b909+kUAyVhwD63+JAKvmVOR9ypApu /q4nF6jJ4DcD1EJ5L7igLjblo8qvnKG9QTT61wdVc8P3i+LQW9QJkwvDt5kJgr5JFAaq W/fKLk3Kuex3+o69gQdq8nSzn8MBqFsaDDnWbiW8Epl7BhYvVKS3hLn+MlhoaM4PA+4J 0H70u2IgooE8a/IhTdwWsTS7NydvrewyGYQRcc9KoxY61ajVxb6J/x5euKdst86SA22R xyrf8hu1h4Y2aPN2HFreBRNz7PXwShtSEKP3ZmwqZMWdFugTWDaHu7lxIRNEBHLTLP2m hwnA== X-Gm-Message-State: AC+VfDw7CMm49vBXQXcmiJrGOQqk7AD/vkJP56Hu6JVTAG8AJAFIijJM SvUnjVfdQ78sf1nF0NtMrfhiug== X-Received: by 2002:a05:600c:2253:b0:3fb:a5b3:4f02 with SMTP id a19-20020a05600c225300b003fba5b34f02mr2623714wmm.36.1688148814971; Fri, 30 Jun 2023 11:13:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c13-20020a7bc00d000000b003f735ba7736sm19916239wmb.46.2023.06.30.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EE3751FFDC; Fri, 30 Jun 2023 19:04:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 35/38] gdbstub: Report the actual qemu-user pid Date: Fri, 30 Jun 2023 19:04:20 +0100 Message-Id: <20230630180423.558337-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 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 Fri Jun 30 18:04: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: 697972 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp596741wrs; Fri, 30 Jun 2023 11:14:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ571KLs4bkJFc95e/OFhZ+AVYGsN+ZLFiJFPOhiZePmry+P8h3u/Tr8GkGw0L5cBoIoCN4a X-Received: by 2002:ac8:5a16:0:b0:400:97c6:b40b with SMTP id n22-20020ac85a16000000b0040097c6b40bmr4198958qta.48.1688148859331; Fri, 30 Jun 2023 11:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148859; cv=none; d=google.com; s=arc-20160816; b=mXW4/VaYsfYkOevKhGOe4wite91LAwpsHgMI755l0u1Ch+ODB/5+RYvEch/dkShH3x V+HZ227AbIQ7L6vBsy+CVBqmt670v+5h8cpFk/qRTfMdTsG1BHxiK7GnSsIG9BSpTVwO VLsGNeNkaJzNqdM2I0Za9g5oceLY/0pN6POtFkK6MKJ6FmJXJjXTkye6zk/VP0L80cW9 UkK905CCQ3Cno54gDqvLL/bximDKxcQYPV3A3RThIMYYTeod/iqIrNXF3FTobP3n5hJj fo5V41GCX4reQhSR5kfH0TR+jQZO3ebQJajYq5ei5VWNhB+VF4auwGOf/ftIsHi0gT7b MjIA== 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=SoVkw0L+f6XIdwSZ6FAqdyofp7PL2+Kglo7DXQJdr40=; fh=50pozNI8HB4RcDZEClBwyW8OIG6bkbErzLEM/wCHAyU=; b=IGa6hMTPn7urjzP/gOl0BJfkH9GTrl+Qls6rFItyUDrMyViCMlkg41/6au9F3NnhWX 2sEBXmMrd4/Of2gl3zIMundJEsF/AInOvRLCF8awTFToglXiybKWfNgKcP8X4b/85DVU X77abvbYb18Iq6dtytiqw7kculDTwu6LJcPWtwlPdQcyFpufBIaGUSotveQdx1sCFW1P sX5aMKso6BtNtIUDmA7dPV9LdLLy2sjWTivnW+ndoIVcDL2Zwi4q2urbEmA1YtjPU/KC sFCTM2NgD4Ny7fuk1FdNx4pOKNdjQ1ka6tgFpJhveFJgJJi03IeKENXogv1+RSWgSTRa xTaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AP/Rlf6e"; 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 w5-20020a05622a134500b003ef5a23a3a4si8604932qtk.418.2023.06.30.11.14.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AP/Rlf6e"; 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 1qFId9-0005oS-JC; Fri, 30 Jun 2023 14:14: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 1qFIcj-0005RB-3d for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:37 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFIcf-0003We-3o for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:36 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-313e12db357so2606714f8f.0 for ; Fri, 30 Jun 2023 11:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148811; x=1690740811; 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=SoVkw0L+f6XIdwSZ6FAqdyofp7PL2+Kglo7DXQJdr40=; b=AP/Rlf6e99gv9BooQEC/vc572Klz3nz+Bny+hh3EX9qq0l9DFDq0HQm16l/UNFORvY qJyH2ibQ+/DhXEpdh1XxAW97Tl1eOtB7NrSpi4TKtKoOdWgguTXtB1hT7fNfdb3zWiWZ mCrz/e8KZQrjmmPlC+nolasAZG88UZiWWSDIXsxlj+jxpW6t9Ap568npycZZ5kD3Wbxu TZqLmHFoP+89k8xsbhi249P4wPHkZ+HIxGI6/vouSfN5fWemIgVIdtX71up6CvGPs8i9 pFlyTDpwhYvv6GQEXISs0K5gzlYRReXphcu4VZLSbB9ryBusCJJ2VliqlNXFCnV9j0iq Ag4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148811; x=1690740811; 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=SoVkw0L+f6XIdwSZ6FAqdyofp7PL2+Kglo7DXQJdr40=; b=a0MNl9Uq1nfGkKyPrLHo+5w5h/3Fzwp0JKB2j438ylljhL/SOzjsVdkyq1bNLj98eA XmOlT4OlldBD+0MfHmLs9WxY0HOTAPkzh1l3IqTBpVy5+V+sqSStUIvsZCWBR8EjcNsB 76OydRybsiQ6ccIuUmzH5jQ6CR0o6ZThFvYv8k3agcY8I8tM9uPUu2YEC4iveH80lxyb RKR7kp3OwP5Mj0DZAVl4HYh2B5+f9hrJwdK+xJu77odX9HwT3pUuMZlKjTH6zUEltMBo Nb6YWh0oZXcsHmVbGbIEE/gYd8O3WGx6S8i1DQMP19ZXZbh8Rbd2Y8ZLB+bXzpPm1p+X gklw== X-Gm-Message-State: ABy/qLZoY1oGCtyWtujBh6tIvbAlTexf+dOgRlHb4OksLP87/Uo4PHBB bBewE2w2fZdSVviU67Mjiapd/A== X-Received: by 2002:adf:dfcf:0:b0:313:f783:262a with SMTP id q15-20020adfdfcf000000b00313f783262amr3122266wrn.21.1688148811385; Fri, 30 Jun 2023 11:13:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c13-20020adfe74d000000b0030ae499da59sm3805869wrn.111.2023.06.30.11.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A9831FFE1; Fri, 30 Jun 2023 19:04:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich , Dominik 'Disconnect3d' Czarnota Subject: [PATCH v4 36/38] gdbstub: Add support for info proc mappings Date: Fri, 30 Jun 2023 19:04:21 +0100 Message-Id: <20230630180423.558337-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 the GDB's generate-core-file command doesn't work well with qemu-user: the resulting dumps are huge [1] and at the same time incomplete (argv and envp are missing). The reason is that GDB has no access to proc mappings and therefore has to fall back to using heuristics for discovering them. This is, in turn, because qemu-user does not implement the Host I/O feature of the GDB Remote Serial Protocol. Implement vFile:{open,close,pread,readlink} and also qXfer:exec-file:read+. With that, generate-core-file begins to work on aarch64 and s390x. [1] https://sourceware.org/pipermail/gdb-patches/2023-May/199432.html Co-developed-by: Dominik 'Disconnect3d' Czarnota Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-7-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- v3 - remove #define BUFSIZ (both linux and BSD define it but BSD complains if you redefine it) --- gdbstub/internals.h | 5 ++ gdbstub/gdbstub.c | 45 +++++++++++++- gdbstub/user-target.c | 137 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+), 2 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 25e4d5eeaa..f2b46cce41 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -189,6 +189,11 @@ typedef union GdbCmdVariant { void gdb_handle_query_rcmd(GArray *params, void *user_ctx); /* softmmu */ void gdb_handle_query_offsets(GArray *params, void *user_ctx); /* user */ void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx); /*user */ +void gdb_handle_v_file_open(GArray *params, void *user_ctx); /* user */ +void gdb_handle_v_file_close(GArray *params, void *user_ctx); /* user */ +void gdb_handle_v_file_pread(GArray *params, void *user_ctx); /* user */ +void gdb_handle_v_file_readlink(GArray *params, void *user_ctx); /* user */ +void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx); /* user */ void gdb_handle_query_attached(GArray *params, void *user_ctx); /* both */ diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 697dd4bbad..6911b73c07 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1327,6 +1327,36 @@ static const GdbCmdParseEntry gdb_v_commands_table[] = { .cmd = "Kill;", .cmd_startswith = 1 }, +#ifdef CONFIG_USER_ONLY + /* + * Host I/O Packets. See [1] for details. + * [1] https://sourceware.org/gdb/onlinedocs/gdb/Host-I_002fO-Packets.html + */ + { + .handler = gdb_handle_v_file_open, + .cmd = "File:open:", + .cmd_startswith = 1, + .schema = "s,L,L0" + }, + { + .handler = gdb_handle_v_file_close, + .cmd = "File:close:", + .cmd_startswith = 1, + .schema = "l0" + }, + { + .handler = gdb_handle_v_file_pread, + .cmd = "File:pread:", + .cmd_startswith = 1, + .schema = "l,L,L0" + }, + { + .handler = gdb_handle_v_file_readlink, + .cmd = "File:readlink:", + .cmd_startswith = 1, + .schema = "s0" + }, +#endif }; static void handle_v_commands(GArray *params, void *user_ctx) @@ -1472,11 +1502,14 @@ static void handle_query_supported(GArray *params, void *user_ctx) ";ReverseStep+;ReverseContinue+"); } -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX) +#if defined(CONFIG_USER_ONLY) +#if defined(CONFIG_LINUX) if (gdbserver_state.c_cpu->opaque) { g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+"); } #endif + g_string_append(gdbserver_state.str_buf, ";qXfer:exec-file:read+"); +#endif if (params->len && strstr(get_param(params, 0)->data, "multiprocess+")) { @@ -1615,13 +1648,21 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = { .cmd_startswith = 1, .schema = "s:l,l0" }, -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX) +#if defined(CONFIG_USER_ONLY) +#if defined(CONFIG_LINUX) { .handler = gdb_handle_query_xfer_auxv, .cmd = "Xfer:auxv:read::", .cmd_startswith = 1, .schema = "l,l0" }, +#endif + { + .handler = gdb_handle_query_xfer_exec_file, + .cmd = "Xfer:exec-file:read:", + .cmd_startswith = 1, + .schema = "l:l,l0" + }, #endif { .handler = gdb_handle_query_attached, diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index fa0e59ec9a..6e21c3161c 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -11,6 +11,10 @@ #include "exec/gdbstub.h" #include "qemu.h" #include "internals.h" +#ifdef CONFIG_LINUX +#include "linux-user/loader.h" +#include "linux-user/qemu.h" +#endif /* * Map target signal numbers to GDB protocol signal numbers and vice @@ -281,3 +285,136 @@ void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx) gdbserver_state.str_buf->len, true); } #endif + +static const char *get_filename_param(GArray *params, int i) +{ + const char *hex_filename = get_param(params, i)->data; + gdb_hextomem(gdbserver_state.mem_buf, hex_filename, + strlen(hex_filename) / 2); + g_byte_array_append(gdbserver_state.mem_buf, (const guint8 *)"", 1); + return (const char *)gdbserver_state.mem_buf->data; +} + +static void hostio_reply_with_data(const void *buf, size_t n) +{ + g_string_printf(gdbserver_state.str_buf, "F%zx;", n); + gdb_memtox(gdbserver_state.str_buf, buf, n); + gdb_put_packet_binary(gdbserver_state.str_buf->str, + gdbserver_state.str_buf->len, true); +} + +void gdb_handle_v_file_open(GArray *params, void *user_ctx) +{ + const char *filename = get_filename_param(params, 0); + uint64_t flags = get_param(params, 1)->val_ull; + uint64_t mode = get_param(params, 2)->val_ull; + +#ifdef CONFIG_LINUX + int fd = do_guest_openat(gdbserver_state.g_cpu->env_ptr, 0, filename, + flags, mode, false); +#else + int fd = open(filename, flags, mode); +#endif + if (fd < 0) { + g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno); + } else { + g_string_printf(gdbserver_state.str_buf, "F%d", fd); + } + gdb_put_strbuf(); +} + +void gdb_handle_v_file_close(GArray *params, void *user_ctx) +{ + int fd = get_param(params, 0)->val_ul; + + if (close(fd) == -1) { + g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno); + gdb_put_strbuf(); + return; + } + + gdb_put_packet("F00"); +} + +void gdb_handle_v_file_pread(GArray *params, void *user_ctx) +{ + int fd = get_param(params, 0)->val_ul; + size_t count = get_param(params, 1)->val_ull; + off_t offset = get_param(params, 2)->val_ull; + + size_t bufsiz = MIN(count, BUFSIZ); + g_autofree char *buf = g_try_malloc(bufsiz); + if (buf == NULL) { + gdb_put_packet("E12"); + return; + } + + ssize_t n = pread(fd, buf, bufsiz, offset); + if (n < 0) { + g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno); + gdb_put_strbuf(); + return; + } + hostio_reply_with_data(buf, n); +} + +void gdb_handle_v_file_readlink(GArray *params, void *user_ctx) +{ + const char *filename = get_filename_param(params, 0); + + g_autofree char *buf = g_try_malloc(BUFSIZ); + if (buf == NULL) { + gdb_put_packet("E12"); + return; + } + +#ifdef CONFIG_LINUX + ssize_t n = do_guest_readlink(filename, buf, BUFSIZ); +#else + ssize_t n = readlink(filename, buf, BUFSIZ); +#endif + if (n < 0) { + g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno); + gdb_put_strbuf(); + return; + } + hostio_reply_with_data(buf, n); +} + +void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx) +{ + uint32_t pid = get_param(params, 0)->val_ul; + uint32_t offset = get_param(params, 1)->val_ul; + uint32_t length = get_param(params, 2)->val_ul; + + GDBProcess *process = gdb_get_process(pid); + if (!process) { + gdb_put_packet("E00"); + return; + } + + CPUState *cpu = gdb_get_first_cpu_in_process(process); + if (!cpu) { + gdb_put_packet("E00"); + return; + } + + TaskState *ts = cpu->opaque; + if (!ts || !ts->bprm || !ts->bprm->filename) { + gdb_put_packet("E00"); + return; + } + + size_t total_length = strlen(ts->bprm->filename); + if (offset > total_length) { + gdb_put_packet("E00"); + return; + } + if (offset + length > total_length) { + length = total_length - offset; + } + + g_string_printf(gdbserver_state.str_buf, "l%.*s", length, + ts->bprm->filename + offset); + gdb_put_strbuf(); +} From patchwork Fri Jun 30 18:04: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: 697985 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp598561wrs; Fri, 30 Jun 2023 11:17:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlFPuDEoqFU90FalQsyu4Zph0vl6uSsOshbaj3wrbFhI9DFkIJs5qZRGihYSpbW5s3+mtBxw X-Received: by 2002:ad4:574a:0:b0:632:1da6:986a with SMTP id q10-20020ad4574a000000b006321da6986amr5194828qvx.17.1688149077584; Fri, 30 Jun 2023 11:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149077; cv=none; d=google.com; s=arc-20160816; b=N3cI8t7BswC3gUJRinYMUXQDYBiINcF9WZtxzqlexII9I7Moe4t4KzEPRelFCTX6FT UooQsRgqKKlzicTDstFCjl77xo3EddV4WSqg0pmdc81o5uqs/M9WioFci/VcfYx8hEvQ 1/c2Vmixm+anNVwWKZpfjs70GH8zcYwhWJpgmwNrWFoFQ7tQSnDg4OwtPmMkAdwHnxso NO531URaMaK37Selhp1er83xiXRZVA0wpavtpHmuB3dRFsgeRE8UzaqaPK0ranUTipe6 wDyQ0YjYqBy4xoVfbr6ktcaVr9P97XuGyQN2qrLiQP32ou6I0lu6Tqj2kWBXE5iq/bR4 ZPXw== 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=7t6FYLyWy431w3wryjlf0ss7bOMa2KXvVFdEtFrGEiI=; fh=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=X9XJ7dQ5ryyarz1AnUb82nT975Jb2qbHw8kOvy31krs7ZsTlW1Ocp3/VLO7PxQ37+/ vOP0vRwpnqsrxeqXCeZmEtFFhRttlv5OOj6PAjg9vLdCMPM138RSyjNw8qCfE66YZaRR W7f12PbsWeDs8nm7v2zmx8Ha/5g/DyceThml8K8fiicpV/H+X2DLFi6WJhOkYe4EuDT1 02E6rkI74vrfeVxkd95my9Q8yVHZTG85EkU7xkB1Zit3zqU38R9JqujmUgMgxrXFP+n0 URJTRLcTkZk9OTQwcDVxoOJwoYqgTdQR8hyESiq1fC7O4KYrtQhWK4+1CyAKr0voZMLf x1Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s3JFjpZw; 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 im13-20020a056214246d00b0062b6a5ee017si8442587qvb.157.2023.06.30.11.17.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s3JFjpZw; 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 1qFIch-0005Om-K2; Fri, 30 Jun 2023 14:13:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFIcf-0005Mz-EX for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:33 -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 1qFIcc-0003Vm-Gj for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:13:33 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbc656873eso12230555e9.1 for ; Fri, 30 Jun 2023 11:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148809; x=1690740809; 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=7t6FYLyWy431w3wryjlf0ss7bOMa2KXvVFdEtFrGEiI=; b=s3JFjpZw+RNiazG9hTe3HKM9400YXzQw9NPtXnhtUmCb1jBU7AXQrUOVrvefsI+6/g SmpF5cwZZQ+Y/lbOIo6/mfDbRhiVw/tkn9mWedjuES95xENVvLpIs8qufu0OjjEyWNvY irguLNjBtt35MFgRw3n/TvSgcdFgf9Y9wt1u9sz5iWhIo/2ekxZBAszUrBQeoehE7Cdm AmB3t4U4mqYZvoieChrFih25YNKuaT2jLitwlRyr+Bpr7X9jodjMfslYC0N9PJc/GMAy gqZjyB0rSeznq93bbZTJkFKEubNDlS31IgE6yWGEKKijT/6ur8zwlkDr9YetUtrufZWJ eZig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148809; x=1690740809; 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=7t6FYLyWy431w3wryjlf0ss7bOMa2KXvVFdEtFrGEiI=; b=IskMdat2snc0bN6fC8z6w9AaZCLGjd4jHTnYZ6IXjKO5okLweWgVc8YHcMest5PDUS 67Z3KR3X6tXOMB1o8Qe0qGHR2YNSbzXQZc0689CALlZrn0noI6pHwhjo96Y9TpJB77Y1 HS/4ryavFtao++gr0V8YURBcs4An4Wg+DLPIfom+4jWiiMTFS3/ON3AimBuw6Y9RKWiT dwMfQMM8OggoPs7JXgnKLgLJhL599Vzsf94QNq2+zmMw8MTJ1G6cj9mhOnXKHijHLFf0 /OGaYy6ukdJWlkSNpAY+X+L765CQbnP2KT6PaubT+gfZPAr5qbla7hHpyqyteRZbTKKM u1Pg== X-Gm-Message-State: ABy/qLaptT/L+T2lv3e2aAmw/943bSGINi6fOhyWK7wD1DItUx8wI3wI DVQPyOW6fII8Nk/lx6MAQi4SAw== X-Received: by 2002:adf:ee51:0:b0:313:e520:936f with SMTP id w17-20020adfee51000000b00313e520936fmr3790842wro.17.1688148809192; Fri, 30 Jun 2023 11:13:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n5-20020adfe345000000b0030e5bd253aasm18865146wrj.39.2023.06.30.11.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:13:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 355CA1FFE4; Fri, 30 Jun 2023 19:04:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 37/38] docs: Document security implications of debugging Date: Fri, 30 Jun 2023 19:04:22 +0100 Message-Id: <20230630180423.558337-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-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=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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230627160943.2956928-36-alex.bennee@linaro.org> Message-Id: <20230621203627.1808446-8-iii@linux.ibm.com> Signed-off-by: Alex Bennée --- 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 Fri Jun 30 18:04: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: 697958 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp593162wrs; Fri, 30 Jun 2023 11:06:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QWh/rj6tNhTwUtpvBuXSLtU61AJJVHtStCSL2mhXi/aJGpF/jjLn0DwcLnMrwC4xAcbnN X-Received: by 2002:ac8:57c5:0:b0:403:38a4:4cb8 with SMTP id w5-20020ac857c5000000b0040338a44cb8mr3530846qta.39.1688148403716; Fri, 30 Jun 2023 11:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688148403; cv=none; d=google.com; s=arc-20160816; b=IeI7/NGkIlmPzcWutYDH67Ofc9WluSskCHyUAZ0Lt+RoC11aB6qw/GScpWYpvszhAY e3TZpJadjQyJHwmLK31mQ6ARvSjpeLExwN7MWJozA5CgvuB6JyanzptmLGPZy2GkOxCE z7rbPEpZyKl6ivlr4hY2VaJIid0eQvE4H/BUs6HX6kiKDU9ROABOQATFW1Di7+uFwUy7 LkRiLI5NwfhWD2qzOYza2KjYJyLDzRNzZtl4DBciqau7PpG9CgoldEhgzyU7MEPb8Efz 508bAkvN6/BGi8j8uvHR6CrHatI9Gqn40EWtXTne0t144L44Dg/Il6huImOISBkoTnWT 7H0Q== 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=WuTBZDcfojtFbKfkJjfEwZ/JCpHxFhyq5cXQ7fdJG7M=; b=CmVjyGRVQFL2jWQLnlcpJcvIdiF4OcPtsjLGf/D29dUiF8cZ7qAwz3115WErPn0Amd SqmXcr93aidZFQYhpetQ01CpnAy+IBhSNJhULbE6/RiQN62fPTUJ/+D6YO2jDVgNPIdI LuyAIsQRsqXIyra5yhQieETglMp2c+iojD9EgwjBpBYSQiEXjV8SM3xQJ/LaPh7mxZ7/ HjD12Q6BliIbJuxGpjaZNrEYgkGwu6qncry1kRY5V3HHPK0QG1XTvvh720mkrIkXqJUV OCPwkC27SvKaIK+lWDpfFuva2Yp7fFPXPS1A3ntqnbWACEFPCj6gekNLJ/N9rOFmaMXO igNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WrZuiQHc; 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 z20-20020ac87f94000000b003f9c568b2c8si8459919qtj.210.2023.06.30.11.06.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 11:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WrZuiQHc; 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 1qFIV8-000144-1e; Fri, 30 Jun 2023 14:05:46 -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 1qFIU2-0008Lv-Tz for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:38 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFITy-00071L-D1 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 14:04:38 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so11306155e9.1 for ; Fri, 30 Jun 2023 11:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688148273; x=1690740273; 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=WrZuiQHc5Xg4FMqV4ZTJVVpH+e/kzrFtF+XGvrjXU7RxB7iRfmWF+h7Q51XPWKAjcZ j+/D47YeDqv5dDBflkIZQHzcCC0AcD/DejnB6PmhOrSA7gHPzmsn5DRjIBHvQGBJmlix RZHXMAGZX2ri8P/Rbm+flKYHodn68xjhh7RVUzFrfOsjZVLWPW7IF6W25h5uLmZKdh2E 6rOLFyf7Zium9wMlHIE5OTpMfzQWUMGT4FGptAHJ6gw1DLyPvkofxYrrXfWpFgEDHNqB Wbwp5UwdRzzUTQNSZmpDiqQzcmAz36p63G9HwTreOW0429tQ6QED0S9UeDrT7JngJZ0/ KHFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688148273; x=1690740273; 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=BUip+/sgsbQuYRSivQKeBXlSzzhokOqxKXzCqStcUlpOLWQ9RiUqp2PCoAT0ozLvfi xrMsct6EYPpZQJ85h1LHW6RdvtP5KF7Bw3ryUj0sJG2FnfHJQC1SE+MF7U7cAgGAdq7A WmiiFpLfKl80ybwLlWGcNfwXIbEKESCNFmeZOT/daB7NgOtN+DHuf3oo/JNdZfrGd8Gn THbvqPL14MCZO/AbMgupsboigvRPlrdMSKUsXidD7PzMHlSU18B+AR8e532H55BXcBaC 9df+uNpFh7yJffDGnfHAGPPB2o9WN9hH9dnXnzD0S/yMaa8xTmfl038xjCpFqw4+Rz6r 3rTA== X-Gm-Message-State: AC+VfDxBJOqLiSNMQEQr2hEBpwYJj9DmuGIxfqEr4Fs7r2xvqK1Ef5QW 0U0+OnyJ+3Y85ROqOv8EpSw8TQ== X-Received: by 2002:a05:600c:2905:b0:3fb:ba04:6d57 with SMTP id i5-20020a05600c290500b003fbba046d57mr2666632wmd.5.1688148272915; Fri, 30 Jun 2023 11:04:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a10-20020a1cf00a000000b003f8fb02c413sm19696334wmb.8.2023.06.30.11.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 11:04:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 569241FFE9; Fri, 30 Jun 2023 19:04:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Stefan Hajnoczi , Leonardo Bras , Laurent Vivier , Peter Xu , Juan Quintela , Beraldo Leal , Radoslaw Biernacki , Qiuhao Li , Peter Maydell , Yanan Wang , Riku Voipio , Wainer dos Santos Moschetta , Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Eduardo Habkost , Thomas Huth , Laurent Vivier , Bin Meng , Marcel Apfelbaum , Bandan Das , Cleber Rosa , Richard Henderson , Leif Lindholm , Marcin Juszkiewicz , qemu-arm@nongnu.org, Darren Kenny , Alexander Bulekov , Ilya Leoshkevich Subject: [PATCH v4 38/38] tests/tcg: Add a test for info proc mappings Date: Fri, 30 Jun 2023 19:04:23 +0100 Message-Id: <20230630180423.558337-39-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230630180423.558337-1-alex.bennee@linaro.org> References: <20230630180423.558337-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 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()