From patchwork Mon Jul 3 13:43: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: 698692 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761165wrs; Mon, 3 Jul 2023 06:51:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6PjM1OIKXFJ3Eq4Vs+u50QyzFHwJKXTVle1iAj3WuvH13GTrVTvZemBlXElA7XK0BSopoI X-Received: by 2002:a05:620a:4096:b0:765:381a:3485 with SMTP id f22-20020a05620a409600b00765381a3485mr13704570qko.50.1688392263832; Mon, 03 Jul 2023 06:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392263; cv=none; d=google.com; s=arc-20160816; b=MXphWHUHj9rECPHGIttNq0TL582zk0SzmCyJ5/vK5Xk7JD+cSRyaCfkcPWQSyfsALp SMy+Ac3LFGvOrXFtteoirHOl21y0XkiveeimDziqZRIZvu/RTjaAbYv399Ef4snBdi3M 54aUvqBwVy0mcyLQyAo/xWSz+a/lF84ucRC7d7kVRd+BDGZxg+T9jNyvWhDlEUQ4G3El FDy1ig+kgXxDynKwGV70EUjBYTw8WZyBsIRpjat4iHgWK2jFTwH4jlS+c94MbL6sT2cl j9FlnS8ILF4bk4/KzUnp3OgrziLGP5LGkHywRAF0BU8DsQ75bPtD85Th56pVLrlgukxK D3jg== 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=mBABYgdiyToLjyHowniWhIyVXJ273GgxeMYZV8p8dqk=; fh=QaImBOnMuQCEh3b9T8UfhDTXiCiGzD7Dedem6RLxSzI=; b=ZfLdhVe7Khuo69nrh2pXtfVDd7dfXYWXTE5JC//GGHKZiF9RA/ugnD01S/DNz2PCk9 /dS7pfr49Uj0Y/7tUVcAFfaymd+QCPwzvwJQyGdrDFHBvU9gOzbgqAidg0YQJF0yTf5t AQYub5VoI3ffP5VlMRidd4bhuOzRQk1sajtProT2lAyS/bLDS2WZJTgB8pAmdV14G9/w uDk3yadUrD1iRhgSM17Q+r7H+SewIioB7DUVKyOQ1o50NIgIpKxtBOIPtdljl1Lp9UWR L114Sn0F49FMhV9KZmnehK2uRvI96CuhrTULT3WJf01tVEfnsFneq6nih4WcDAmiGrXL gsSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MiOYZnwL; 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 b12-20020a05620a04ec00b007621b47d0a7si10081964qkh.392.2023.07.03.06.51.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51: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=MiOYZnwL; 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 1qGJr6-0007RF-K1; Mon, 03 Jul 2023 09:44:40 -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 1qGJqy-0007NK-Te for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:33 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJqw-0005fQ-Lw for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:32 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3141140f51bso5996050f8f.1 for ; Mon, 03 Jul 2023 06:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391868; x=1690983868; 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=mBABYgdiyToLjyHowniWhIyVXJ273GgxeMYZV8p8dqk=; b=MiOYZnwLRGvy6qN11Asf+2HZQxJxfTYjxsn7Kb+4kqT4fLepYWqyV0E8phtu9/a/Oy zCP53wRT/q2kCQ5kiNR9qZycLTGljf7iOpHjbC3uvb4UEGOo+cK4gXcLuntnAojJO5By R9DGvgs5S/SbMD6udFTrgOtkI5sebjNq6trArJ+nHLKZyyBaFt/figMQVpGEtgszkHqd zbPGFY5dcEku6XoeZtKfpRb1wtQy42B0qgMz0ywMSTvtcZsrbPRJplU5s5pUT4KDANco ViD5k/CqnqXSP6sBdm+NRR47Z/1pleSUdo/F9VAPjATi/xGP2stFu+/xs+/noTm9OksF RpIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391868; x=1690983868; 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=mBABYgdiyToLjyHowniWhIyVXJ273GgxeMYZV8p8dqk=; b=hM9mLYolrdseQL/XdfL+Ffn+vxW19labjfRgpl+gDZSoV+tfJTHBZCxBeoCxiarGE7 ecU2fTUMfap/aIiz9Vy8bX9O9ZMe032IEZM1JgPQwaF6n+hHSqbNxX+2jw06eNr5eM+P BjhQjippsE9JLfaxrYJzwtZ2RC4ZAy+MUc4mLiogIs7l6rM8G3jp0lPBkKRq9Aq2dYXo RW46TG5bLkV4viDwXwtgwFhamdIOx9HxAw48bSmH97SzbIuYJ9mNJ1grrJCJ4yHuaxsH ixuZtIh/8cQqT4NRKL/u8bXFe0+6Zu26FwnJ0wQVgm4LuWUG/LUyxWAtYz3RMleDZgnh CHHg== X-Gm-Message-State: ABy/qLYJSNVhzDHP2pXdqPiKgBQOsHVjrgmtd29wcavKJHZWznH4BDC2 CJo4qTKkEjlU/X3NMDeHtyawpw== X-Received: by 2002:a5d:408d:0:b0:313:eb35:570e with SMTP id o13-20020a5d408d000000b00313eb35570emr8531157wrp.68.1688391868759; Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l6-20020adff486000000b00313fd294d6csm17607720wro.7.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 01FCC1FFBC; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Bin Meng Subject: [PULL 01/38] gitlab: explicit set artifacts publishing criteria Date: Mon, 3 Jul 2023 14:43:50 +0100 Message-Id: <20230703134427.1389440-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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: <20230503145535.91325-2-berrange@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-2-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698683 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1758628wrs; Mon, 3 Jul 2023 06:45:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlHTAihuCMC3xJxJ2hjYu0eBoUkYPnHonzbbXLJSOGTRlakWK5U3W77mUWUoPA8pd+7FOhTj X-Received: by 2002:a05:622a:1707:b0:403:532b:659f with SMTP id h7-20020a05622a170700b00403532b659fmr6753217qtk.66.1688391942712; Mon, 03 Jul 2023 06:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688391942; cv=none; d=google.com; s=arc-20160816; b=QYvgzL09NzwMpKOi0GcOc6kOOBx+rGqWXVzsH5731dyUbkhZJYQ46Oz0PQGWsPgLwt 8Kw4uCymlaPL/ChqY/TPKSPCx5CfTzJVFjwoWIqgD9hzqSz/LxoOP91dCYmvX8MqAPno GR9SYSIwe9YGsGK9SALWFaRxPOWQC+mhFKVsy57gsOJEycjDGbom4CyMdAzsgcnaEKEl fhgI/teMtQgI18Egof4OrIoOAW9mmQsUxAMhFaLyP5bjrg6PVG+VLIVc7OXwnda/NDxP nIPhUZo6rBHUy9Nhp6KlsJE6D7hrPsCXbmooMPnrvdd0EG/GKdtGtUbsBnDexJrplZnc YJcg== 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=GeRzCQ4EwzWGsNcRrOpl+FoUKZGHEnv7AIluzaFf2u8=; fh=sJLj9P3ijb3SMCdhGmd22Id9uivviXUbVH4b9hNqO2A=; b=K83JNHAQ+fm0+5rOIuABntMBJfWAagvpVv1Th+Jr52baEPNs/vJY/npSgTjGf0cuGu Dl2gxYz/1jHxpflcer34DVmlKgxEgfHooJiV2VuCryZOFJmMeI4Q5xpn5VuQFdqlIi9h 99NqI/g3n0BZ8z+LeQ/+CsBv99qqDDfiZTRNuB5K9bIIKgzOlKgbIZMQsN/W+arfB7N4 0UEjeVTaiIn1GPa1QsXQkW2i24Ci3lReD1wWkVjXAoBxA/pMvL+snMhuDWGQOqHYpJI4 WOPdBSBFweW0kd53lgdgtRSRun6a2w01P+vrVdyHS3zjhmTKS1OBsd+0eTqW25fbe4mI 2Caw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ja6l46h4; 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 o20-20020a05622a139400b004032845a061si7500204qtk.0.2023.07.03.06.45.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:45: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=ja6l46h4; 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 1qGJrB-0007cj-AC; Mon, 03 Jul 2023 09:44: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 1qGJr2-0007TF-T0 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44: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 1qGJqx-0005fY-Cf for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:34 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc244d384so41328885e9.0 for ; Mon, 03 Jul 2023 06:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391869; x=1690983869; 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=GeRzCQ4EwzWGsNcRrOpl+FoUKZGHEnv7AIluzaFf2u8=; b=ja6l46h4I0BtyGmPnCZI0Pj04UYb1Nxlcc+ZF7EcYM5e3UVcyC9xjaVe4FTmIxSnEB PDBe3lNANAJB88Mi3pYSuAThDZRo0/dcqZlUM6zs1nOAX7X144jPL0B8jFK/wo7uHf9l VYZNaCCqyPT7vmm264vZqOf1nOQEEusYMqOW8T2Xrae0vfeZ6vsbII2Hoi33R1tQXKro 0sJIOI8q3YIWErH/b6TDP0U3U9uFWlbXpymTJs7hM73+SPgTQaB5OjeuY2FGmZ79e+mm t15DOaNIli+w468l9l/5Z5kNwjimkgHPBQEAdWe+r+VIgzcj2vD8ASX3vPAGYZXtTcVh bP4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391869; x=1690983869; 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=GeRzCQ4EwzWGsNcRrOpl+FoUKZGHEnv7AIluzaFf2u8=; b=GBv84tndcQYhM3Wof+EpAkprZkfMaI6cnEevbTxXBbEkJRHeRC/AHSgghwR8SBaJda nkfNux1cRzXQsNVsM8trcAmiEPFt9N2llBD8mTbwBvfWjGN2E41iHQp4xWDlMJesg6Kk 5xTh1mnj55AZTWa7CqdNn+oSjzHYbg27dsn1O1EFg0nPcoEWqYyrmcRHH5q/SqnqmrJo qKi90wmC0yIWzYXrwztyOvLJ8NcXC06ibcCocCS0S6MkfM7DYS2SUrh5LmakqkeFk6aC cAFoVaIObKXRASnsCgmC/4dOLPK62FCYBRD0NcehINwkjdTSUL8cTyjulOXLSPH0Fg+t 0+Rg== X-Gm-Message-State: AC+VfDzkYw9UObo/5KhWwcKGANHG6FnDOwI9vN6P06qOLWzwY3LLNgLm o4LOctAz9a6E0beSoA7ywhQ6dfX0+jxjl1oDhaU= X-Received: by 2002:a7b:cb9a:0:b0:3fa:9590:a365 with SMTP id m26-20020a7bcb9a000000b003fa9590a365mr7488184wmi.17.1688391868917; Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f4-20020a1c6a04000000b003fba2734f1esm18185573wmc.1.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A24A1FFBD; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 02/38] gitlab: ensure coverage job also publishes meson log Date: Mon, 3 Jul 2023 14:43:51 +0100 Message-Id: <20230703134427.1389440-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé The 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: <20230503145535.91325-3-berrange@redhat.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-3-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698686 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1760441wrs; Mon, 3 Jul 2023 06:49:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4or8H2Rue37L3povHC4OIUn7YzXpdu1cyCFQjP4JEOHWTTWRCefqBQB3dAl76GHE3aRFxc X-Received: by 2002:a05:620a:2547:b0:766:39e5:1f2d with SMTP id s7-20020a05620a254700b0076639e51f2dmr10602484qko.16.1688392168921; Mon, 03 Jul 2023 06:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392168; cv=none; d=google.com; s=arc-20160816; b=pzlJXzC4wvqqsQmGVE+3rJWfmoDUtbMhVNpZWWU1TgH5l8EP0LSvd+uzo+pyCI3nVp d7Kyeip9C0nTo0jzlsRgek6lwPDs2IZNkAEUXtEELCkgt/hsPZirypMKxC+nHcubJI6f xj8NzFc0bvoZqhBTp3zeAchMcROTSGb4AkwK7b/3WtsS/lkEbc4VrsAf2atPy/sVBkYV nVfOVrcraIkK00qCESBMYtX7SukSfcfYEimL1U0+7ryvh9RENVhEVTHU/CtUoNE40whZ LObEY4vjbNgz/W9KdH+ov0655csZiVVUD/y6a/GRg0xYig0xm8tEvhbLpvAoyUgNJJ1L S+3Q== 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=lQVppiiyqsC0HGXhv0zk8KKZESG+1QKz8Jmvmi/GdQw=; fh=TmZzSOFkvpO30PdZ4stjErulhTxe52hDZl3OxPfO9hs=; b=HLLU5N9BSWmbNJC0DxXZUe9PM3CASa9tXd9NzDDH2qsxVSSPuBXlQqnyD2J/CuKm0f q6QV+n7yOnsMEkfOl3+LCQajNKmgE9fUz6SKl73aBRrgJD3YJJYtnrc5Q9Pq7Kr3NUfV 6hPyxlAQPYaU5Fshh1NgmLjJXAZFVd9x8ZoX2l3zVJHYIs3AEI0oW/vC8F/fAAxi87xY PlNco5bSccKFLRQ23m+Ugx611aBTrwKC5y6SQlEdNuUH+xB4Do+NFvviptSBqHsH3+yt krG9czcFdiSS97uApg9FjjvOIgYAyEjOm+dNVtBN/dQVDuK8+4RUKLPyjpn+E4Vp8zn0 dT+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IPQsgK7n; 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 ESMTP id j23-20020a05620a147700b007673fd4863fsi5767527qkl.175.2023.07.03.06.49.28 for ; Mon, 03 Jul 2023 06:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IPQsgK7n; 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 1qGJrM-0007wg-0a; Mon, 03 Jul 2023 09:44:56 -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 1qGJr2-0007TH-SG for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJqx-0005fg-HT for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:34 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3113da5260dso4920350f8f.2 for ; Mon, 03 Jul 2023 06:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391869; x=1690983869; 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=lQVppiiyqsC0HGXhv0zk8KKZESG+1QKz8Jmvmi/GdQw=; b=IPQsgK7n209qs4XkB7Fd/G/Zdm8onghcBBOwRMlrUWz33Dl2FnUssZ7XscRAttVNJ3 uNwBfU+ELwkdpSocInK9Dy0zjdh+qdkOVfgr2pzOfGzM0byLRuoUSrE9328enBdDERNf Fx/T1i2m45e4HY2buGXUNVyTSLFGdT8og9DuT0LrbTEBtm8Wp4D/hHYnM3qkX7S+vIMQ WcQOSSDO5/bRtjEvcgZNrvHPFR2pCuVHNkWnjkLO+sJ7th/OIPS6QOcVTuoF7YXBvk62 W7C7Ul5zv6c3qYtVwgg3BF07Mj43oMGMa3t6S665OC+tpQE/G35UkLxfuD3M0dmvO6r1 61kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391869; x=1690983869; 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=lQVppiiyqsC0HGXhv0zk8KKZESG+1QKz8Jmvmi/GdQw=; b=BiqNNgqBDskWfaPLu0Wg55FOvHfywsWOpTCiqS2vVBZFBdMnUeDiZ/r/UbPhA8zdc+ q7fgtMUbn/78OmX8VJNfMG60aksuD1RZjnbWOCAmTQIllssmsa3FI8MhD4LaTYCL8yH/ gaSLJj0xPqHN3y8XVyVWQ8h7uFAQ7CywgSToVXQp1zkklB2AyK6eLOe6rkBbU6xpfzCJ AqBoYEbEUTkXpvTLtbWAeFqImjU7ihEc/1U495OoJYpx5qkA7kH1KmWk5H8LtSDjC/GV zkMMMgl3SaxvgZvT1/7CcamRRYGiaV5QcxS6GvKO4XC1nZ7uo/z99V63c9CFKE1bv4YX mG2w== X-Gm-Message-State: ABy/qLYdWS8xnp/oVVwSkYVcJVRqZAG7xZJptrEhECQjC+3y675E3Ptk tmxHaSdX0PZCJr+Ddom+0RVZ+2evPEqcr17tVfY= X-Received: by 2002:a5d:4409:0:b0:314:152d:f8db with SMTP id z9-20020a5d4409000000b00314152df8dbmr7535192wrq.58.1688391869747; Mon, 03 Jul 2023 06:44:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u3-20020a7bc043000000b003fbdd5d0758sm990766wmc.22.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 321321FFBE; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 03/38] gitlab: reduce testing scope of check-gcov Date: Mon, 3 Jul 2023 14:43:52 +0100 Message-Id: <20230703134427.1389440-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 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é Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-4-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698699 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761748wrs; Mon, 3 Jul 2023 06:52:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RlS/R4ALTUw0rFo+Xqm6IjWTHVEFNxF21pqWbqGO51Y6kY1PTX+O68pKgA9vHD03ZJK6a X-Received: by 2002:a05:620a:28c3:b0:75d:4101:2c9a with SMTP id l3-20020a05620a28c300b0075d41012c9amr13936134qkp.34.1688392338086; Mon, 03 Jul 2023 06:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392338; cv=none; d=google.com; s=arc-20160816; b=oQEG+IBaUvv57BIFuF+zQZvnlmNHTIne5cnuv5FuIJAnt6DBzEFgC4O6g9czLZK79M LUVJywoWBQXbD79AhGNlESn5T5sXBfogRhTdC5aP/4u4PWiBLEtXUrWXgECh/hwwbnRr +lkuKesgiI3e+QlNhBMbsZWOZy8sDfulOUqkcQUl7J4fwPnTgnB194Kpfd8632jT+ZJu uxy/y79p0qls01l1tuO/jb2esrlCJP3JB6QQRMdmvieb5nRDr2bnx/quBWA3C7cc1jQz jc402c+N51m+gYspxkTCj1cEGvvwYvkI0k3CKKZk8fpLh+4WTmR11QL2tR7kb8trhbZ8 6xBA== 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=aiQlfRY8hx1yBgb3vRhqIt9YmNckd07v2P9mNQ4jgVg=; fh=AJ16HRiNvBPC0QUZewcWklRkfU4lDw7360bTRpseLzA=; b=fUS01ktURlSQX6EbKrUBtoHPEKLr36neYc8YLoXloaLL3bDw8jdkaW3upeQmmhtmnJ uG4bZVwoLC9WlZkQdgvSdyvRDQjnSqzul2E4s2R/O8ePDzF3wpeCL8W3QDIN7LukYEhc AYJS3e3lWK4IK0MGJPYQHIKBLZhRbo/TYi5ktYoWTRuS612VY5VWWJVtYfHzs9bWmtfY i/KtL6gjw/W5vxJkoh8ZB89IwnoxflS0fyFNqP8KIwHqL7dwGBm+Y0bHl1AkZAZ9o4HD ao+NZGylG1ttT844xY4KNoELbPfgaSLO4aFzrakrXWwcDtD7ze+vNfNCTVsNBPbUndLR c2Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Po6kbvGT; 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 q1-20020a05620a2a4100b00765a52a6d1csi11602035qkp.241.2023.07.03.06.52.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:52: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=Po6kbvGT; 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 1qGJrK-0007ph-0l; Mon, 03 Jul 2023 09:44:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJr2-0007TJ-Sd for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -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 1qGJqy-0005fp-GQ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:34 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fbd33a57ddso18343015e9.1 for ; Mon, 03 Jul 2023 06:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391870; x=1690983870; 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=aiQlfRY8hx1yBgb3vRhqIt9YmNckd07v2P9mNQ4jgVg=; b=Po6kbvGTvKxsnURztTdT020UjaPCZfHnfdHEfbQnt7dsmximvpIBb65QPKrjecIuo8 w5Eck8ftlfMySe7IY9OOpgkjYyjtuiXr9H8ZVHGw36rMQggW+Yv4TWYK1V4tQ2xpz9X4 brJalduftFake2E7JlO9It88D5y77l6aYylfDdu8vDbw/voRnjwPUBiHFkYvWccmeERZ eK4Y8rYpCd8+Qp7UMQu9KQyMSC0mI9QUGNvK2N8h8MnidFefl05BO+6YotvXQeagqnJw 5aV0ndhg5SsGj6iTNWvT+WO0Kjldp5JnUCCY8oTopSVlL7MZ7OkMECkGi13pL+4rccks YsPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391870; x=1690983870; 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=aiQlfRY8hx1yBgb3vRhqIt9YmNckd07v2P9mNQ4jgVg=; b=bj9QqOjKx212fcrvCBgyWEIKHmmdwWhKCktI9yMSxwvoqkuf8RHOpy63zZ8o46MPb5 ph9tHKM9JELXnWaJ7iDjXp2FcL19C94XQrST4eOnmrE0J4tvPNPASSyvUPJ2h2mBreVq CXqw1k2vfMDDDrxF4FVDCMniB4Vwtb6DtOjT4oWTPyGv8+A+4892OsYKjipDm+jX/Ac7 FQTAfFtrYoNBAzGdD391zkYyGBX35oNhJtk9FDEygVcNLO0Wtq281xfKWu1fsDP9xC4r ekxQF5aW8Hl0ZR42Ab5B5ub1mGKTMPpRAXegoJoDpdPQIOI5HmOcthTfd2VlC3AQDGj2 64lg== X-Gm-Message-State: AC+VfDyS190eZs1WgR17NeIRN2cyAG6TX6zQew0s3QsqsUt1HmM75NOf r29kaxOMdCwlzezO60NY6SdGTChVWCLR/GlUw7I= X-Received: by 2002:a05:600c:2148:b0:3fb:a6ee:4cec with SMTP id v8-20020a05600c214800b003fba6ee4cecmr7893652wml.33.1688391869940; Mon, 03 Jul 2023 06:44:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003faabd8fcb8sm20974977wmi.46.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 498411FFBF; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ani Sinha , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Be?= =?utf-8?q?nn=C3=A9e?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 04/38] docs/devel: remind developers to run CI container pipeline when updating images Date: Mon, 3 Jul 2023 14:43:53 +0100 Message-Id: <20230703134427.1389440-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ani Sinha When new dependencies and packages are added to containers, its important to run CI container generation pipelines on gitlab to make sure that there are no obvious conflicts between packages that are being added and those that are already present. Running CI container pipelines will make sure that there are no such breakages before we commit the change updating the containers. Add a line in the documentation reminding developers to run the pipeline before submitting the change. It will also ease the life of the maintainers. Signed-off-by: Ani Sinha Reviewed-by: Daniel P. Berrangé Message-Id: <20230506072012.10350-1-anisinha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-5-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698682 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1758559wrs; Mon, 3 Jul 2023 06:45:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpgt2rVwyrqxG1t5WT3GyMjHYGb7Fzt2rYk6pGNt6nmNZRlV4sF0A0qb1oNC5bwffnDuTs X-Received: by 2002:a05:6358:c6a6:b0:134:d559:259a with SMTP id fe38-20020a056358c6a600b00134d559259amr7426124rwb.17.1688391934846; Mon, 03 Jul 2023 06:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688391934; cv=none; d=google.com; s=arc-20160816; b=HkSjp8j09p6aRvjIcA5Wubh5QtX96/I7NZ/6ayGFccq6Vh28YytvENzgScegBZ0RYg pPG/AL/HBOWRcMCl7SZN5670yHSa+UcllVJCc0JT2FNxvGY/1J/HHAaZCAccG0otSS44 K1HDRCr1GSGeev00NWdxwP2KHXj1OQCfbGgXajEgRQ7YtwSCfw0gmHj5g2KAgirzg7S9 NIuouqHFHhP/GoUEbr/ebrU4gmp/kD9VsH/H6ZD1yxAZ/fpBUDLFqdWbUFYiEdvd6c/f SkH3q2JFmuWMasEg6/geFKMiLQQ2QfOa7wzzv8vhMn+ndCxklXekFb3bUPU23m6x8LGb zT6g== 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=rotzDBtOd6/iqr5ugUGgrWbU+6kRG33xvmLRtv1TB5Y=; fh=rFIn06eHzsx0Ek45moioqGE6M4mnjlt+HAXgA4erE9I=; b=gadQXGa0uRuT9PgfOji7dzTDayRzkrAfVv7OS0joFVjXjTPdmr3V0fJgUNC93jg92L 36h6PTLTV33Yjds7fU+xvmkULm+7oMQgQRTBu+ZokVvyMRB4k2NYMeULdnFXIIZfkLPD gPojZnZdlcrvdzZfq2jSr0FxPuO59WEY5LxMmO11wSVOERW5ROl2JjyYZyGiTD0ybin5 KFNyDMnBQjWZfmrI3RlCQWkMBfKh0DZnSXi0Y9km0+KDGQpWAghBwXkV3sU0zziA7PXD GZaB1UyZpLCUymUzAtfzng+MauF7QEFeJjjFwgMOO0VkXLQwMntloUq+SDt+1R7wYBo7 upsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vnskl0aU; 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 t1-20020a05622a01c100b004035c1062e2si1515954qtw.68.2023.07.03.06.45.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:45:34 -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=vnskl0aU; 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 1qGJrH-0007op-1Q; Mon, 03 Jul 2023 09:44:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJr2-0007TI-Rz for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44: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 1qGJqy-0005fs-FP for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:34 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc587febfso36426075e9.2 for ; Mon, 03 Jul 2023 06:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391870; x=1690983870; 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=rotzDBtOd6/iqr5ugUGgrWbU+6kRG33xvmLRtv1TB5Y=; b=vnskl0aU8h7iL6Oiy4Zz/JK0brbW7saE/DoTj48FhYRW5vRKFltFoFv/a42nqEwzzx prYTXxShK1//JuAYXBUsDRXLUI/HUe1wIHtK9LoRoWvBOcClSC6zAPixodRQ4NGvijUx 44RR7ShP5cAmm5BcCoOhuxrcw8CD0l+c6+oALiWZ0ZRYU7nrDQmgMGtC7TpmmUSvXmlP TAoxXL81AvoAwskq9ZWGam7l5kkHYkZRqNrj2bBkQc8hhOlftdwJsJEhQ9WWvVujy305 wFXa5MQyeRM3hyQqwwBMiRIfANto8ECODqMSyxn0Qf5hHX+B9nWfjKSHdvSqd1K6ogVI xulQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391870; x=1690983870; 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=rotzDBtOd6/iqr5ugUGgrWbU+6kRG33xvmLRtv1TB5Y=; b=iBPl+7akeYSXlTrnKMFUZNWRFFXMwTeXl9+dl9ce3tdbJKrEg/cgJeEYME+FmrhR9j 5TBIbTHVlDeOSsthcCH0dttvjkipI+6zTPvn/UHDMFC24V/1gvuLWJl4CN6DuaaqkPiy ZkJPVAoNryGOTOWe0IXMjC/MWs63FU4kpC0Di3Ed2HK7V61TbQ3VjCee9CcqXubZ+jN3 ZOBofb6KPR1k/ekypIUrwsUGNecjyqzTj1IjbeL+vz2eSByrmh9Ll2TFCTeSLiFoGBYN 5+bFR2GVpPqbIMw3aTcJ8pGjLEJx+K8Ci2PGiw2YipPv7s+3ZHiThvVwCcbS6Uyx72qT fa2A== X-Gm-Message-State: AC+VfDyd28lSl/Xxf5Hr1M9g/4/GVSQ4m3VnksRMTWWTT0xamGRQmkx2 g/U6rZrMtfDutM0QdiUpWiatXo5n+mKrfHnX8LM= X-Received: by 2002:a1c:7c05:0:b0:3f8:f6fe:26bf with SMTP id x5-20020a1c7c05000000b003f8f6fe26bfmr7669929wmc.12.1688391870424; Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f9b24cf881sm29850195wma.16.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 607251FFC0; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 05/38] tests/tcg: add mechanism to handle plugin arguments Date: Mon, 3 Jul 2023 14:43:54 +0100 Message-Id: <20230703134427.1389440-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-6-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698684 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1759020wrs; Mon, 3 Jul 2023 06:46:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61zYOJIMaK3ZRbL3FX/XObG7sfqQ4s9vY9yW+KYzwNauV9qFMbNo8j6UXhhStImLZbcPg8 X-Received: by 2002:a05:620a:2847:b0:765:51a0:2df7 with SMTP id h7-20020a05620a284700b0076551a02df7mr12750634qkp.42.1688391987126; Mon, 03 Jul 2023 06:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688391987; cv=none; d=google.com; s=arc-20160816; b=HXHUmElFbgmJccl9JWQJMt4LFoIPmNOCWvuo1ut9FBZ1en2QrOh2Gjv2ilpMPya48l IKFYjej0z0oO6uGFbeGFVgGy5htvn7ec96ScSvjj0iCowJeLMyFiAiKdqUnb7poyyk0v 888bqknOj2ZM+DW79YjBz9Wm643iHu7y/ILNyskyvqlaHxoCPyw0Rv0EqmJ1xcn066Bx Wzd2SF7+58xqa3IqUf5vz9tJ4ZNkhJA1swADLJvWmCIwhwAFxWOGM0kXPJ8Sgxe0I6Oh Gu8AEEjFQKzpI2XkANq1Zrp30007mu4cyADIJDgpH6Nq7iLj34jrKltUXVToA498nsDJ v1Qw== 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=Fbp/Zw9eE5uqY/m4aZkgwxvYT/8MMMAgvc/DfnALRqM=; fh=q46Bm4Wf5TjccLG5fDhSk4BPPwVty0B7J779w4qejlI=; b=PESxJZphi0AyEjukzpDgXksPKAHnLPfYgjzjeqh0LKPFardoGUxfHV/tNhz/4oa1Yj mI+bBeaKRoOjKRDEMkAfIT1iLS1aN4qTSPm87MFYbJ3ldcsSrI+1meh9hw7ng+TNuF91 Cp44KymsvYveTYNp64+FrkdL2jWzKH4mYwc7jITmD8YkjZwdcDfD22s4QVrNq8r97XK3 F3SPClkLmqs7wF4u0Y+1KPB+4bIaDkATPjyf3h1iQJjMjaERvlBHT1v4U1fysi9N7/8C UL6pbfZsp4Ow3NfxN72LpZiwGRVSe+2ZCeaTmBKLEAHylPLOgcjgBMWjpeBf+TDVW//q hbEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kOc5lwjD; 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-20020ae9e60d000000b0076707cc1fcasi9368106qkf.269.2023.07.03.06.46.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kOc5lwjD; 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 1qGJrB-0007f5-UL; Mon, 03 Jul 2023 09:44: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 1qGJr2-0007TG-T1 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -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 1qGJqy-0005gJ-Re for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:34 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fbc12181b6so49639635e9.2 for ; Mon, 03 Jul 2023 06:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391871; x=1690983871; 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=Fbp/Zw9eE5uqY/m4aZkgwxvYT/8MMMAgvc/DfnALRqM=; b=kOc5lwjDXSZXbSVA4d/hKjBWUIE95aGT/ECqqJ+ApG6I4OXbn+YTNpTYAH0HHXQVRP ZOOApXAEcUxxT1bQV/MxGQonWYqACm3H54qsAYmzeDXuQnSZ1IQ+a7JTgPUGSHMLxmkB dmATo651J7hFQ3dJ/OvSu4fd5EnAUjZxO4jD1U+FRlf0YD/cuQjQzg+1c8cuXa9sqxtU Z8DgrOnqlpQTNuy+7tfmhn06ub3CqZVyMSYRVo2tYAWth+AxTkyorTbKQjghSqZ3KsBh mBCv8yunUtiXjK7lo8nvYC9clmnlSTp2wup6R9QvII/1K7dLreZrpdsXPk2BSpQuK04S fioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391871; x=1690983871; 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=Fbp/Zw9eE5uqY/m4aZkgwxvYT/8MMMAgvc/DfnALRqM=; b=BQVZSQ1VsQd0JCNEvJQlfzlPMdnjQbksi59Y1Ia21G1bMZ7bZXkmEdNCJCJnz4Khxa ShkGW/S48bvKC6J9M6MONbQuzZQ6UxPxnXkRptRun9Qv3o/rb89gwS0zTzy9aLBhQlkk krvMqMDkVGbZhzPtgWf6wb8g7NsxOnHxnB+nQrZ8kRv6Q1PE6ZLeNk8cza3O8mrvLqZy VUjkjAPClye2Dq5bSsc9vZc8fFMiFeA8cUE9hxE3GO9W3dN+YjYImsIRCJSvO+5pEeP1 8ouwvfnAPXlb0AQ9hEuOzNiIWALlam0JugvM/JpD/tCgSLHf3a7j9uHy21D+zh0yxhPh wD6Q== X-Gm-Message-State: AC+VfDwVHdR2jeRx/N4+44Z9Y0fiizsWlCe6aWQmUXwKNKacSKaxchN9 QgSmc4VxNQp87bIM7gMiYM/2xw== X-Received: by 2002:a05:600c:364f:b0:3f9:ba2:5d19 with SMTP id y15-20020a05600c364f00b003f90ba25d19mr8842130wmq.33.1688391871164; Mon, 03 Jul 2023 06:44:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t24-20020a1c7718000000b003fba9db141esm16768715wmi.38.2023.07.03.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7664C1FFC1; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Juan Quintela Subject: [PULL 06/38] qemu-keymap: properly check return from xkb_keymap_mod_get_index Date: Mon, 3 Jul 2023 14:43:55 +0100 Message-Id: <20230703134427.1389440-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We can return XKB_MOD_INVALID for AltGr which rightly gets flagged by sanitisers as an overly wide shift attempt. Properly check the return type and leave the bitmap as zero in that case. Tested output before and after is unchanged with the gb and ara keymaps. Reviewed-by: Juan Quintela Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-7-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698693 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761204wrs; Mon, 3 Jul 2023 06:51:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKAdFFRaBZWbLQW2mshYFAE8M1FpKRXH0e9Vu2VZIvzi4QacDC/9rA+ejQGs2Zkb1e+3Yr X-Received: by 2002:a05:6214:4110:b0:626:c17:8b55 with SMTP id kc16-20020a056214411000b006260c178b55mr11159499qvb.25.1688392268197; Mon, 03 Jul 2023 06:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392268; cv=none; d=google.com; s=arc-20160816; b=FJds2ZJUcMSTl7PWSfKw0Ro1dnCuqEoyFKZPNGthwX6LctMZJLo6OcVlpRb5XxbUnD YWThX6qZe++0Pn82fgZTrJ3h4jkYK+JbajfTnRwGBGNCs7+CGc4Anzs3hYfbmtO3Yrv+ RWz6ca7mqgvI+GIvNMr0bTHYx5B7+VJwk8ybOslC/8w2ogy4VNkNuO/OtPCULJaUVu7C mzQbq0zTQ6JCBvvoslWfYYB/NGkKqNC/idHcaczerl0FkqjXaPomeAIYajPsVlkWMdMT kLY7+W3ntk9JK5+8HkBBPppavzT6bK4TwGtOhvqz5SfpKXiIqP9Gk2VGv40xCrJdTVYM /4JA== 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=FeBR8GZv3DfL2Dr3RQS42VRWnzI9QYt8QP9XGBKiFno=; fh=zWe6VqLk1qfVEV9qLyD0W9bdW5NlpE2XFIwq8hxFyag=; b=nQIdrdI7r4rOQ7Zodf/xBfSWy4FNteEXiFhqbkfhkaWR7oKKNfHAd8ROYryL8Ttr0+ 7D1GPe82MHrMEhXSVlD79O4bJIkc8vyU8S/Crj707wMZiuy6hctYurkT5YCtHqg7N51q 0JJlrjpvCpmskmJ3kh8HT05MS8MJ4NfH2ShrWC29KFTbfmUiJx9Omyf1p7+XXrXKpwQ1 DdqNdZlgzrCzP207DMLzGwOjQEZf+gDBimGExQeNeEw/X2rIvtu0CFvW+YHENNCwVeQ4 /BOAVgJhiDUfHlszXWFvFY5z/gk2hmWyEwkWGcYqUDfGhqdJCUu8VxisXdivs80o0Rxx 5YlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vBhGM3LD; 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 fv8-20020a056214240800b00635b5b0256asi12124193qvb.181.2023.07.03.06.51.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51:08 -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=vBhGM3LD; 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 1qGJrK-0007qt-HB; Mon, 03 Jul 2023 09:44:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJr5-0007Te-Sc for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:40 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJr2-0005gs-Q3 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:39 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fba74870abso4370983e87.0 for ; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391871; x=1690983871; 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=FeBR8GZv3DfL2Dr3RQS42VRWnzI9QYt8QP9XGBKiFno=; b=vBhGM3LDh0qLDyoo3KAZQBLhM8IIL12ObF4VI/Mh4kkw50DVCgumZlC12xvyw86No+ IQAHG7FsH+XuwFUgyMCRZ8hom3oVemicGeUIfRZMKOLgj4c4noPlRxfz2BlMQe5udcNs cSZ/YKUVUqWMI6N4LYDmmO1XikwVUnPEQGklHHH+whJg2ES+JA8SulPumJaRu39RY2sc n8hsaJuU7xdU6mtQJFXo8JZw8sAFzNjRvtSUMqWaEG+KTzBYVGUXq763mi5itNHg+jnR tWmS5A2hV659APMMauYm6MYqnK/c3hUHayCxfRDdywJAxyEse4dY5SQZarMs4KQSwLbJ Dtgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391871; x=1690983871; 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=FeBR8GZv3DfL2Dr3RQS42VRWnzI9QYt8QP9XGBKiFno=; b=YJqpYr4bLQRbnKLsIb2h1EIOgR07q5HTnk15duxLYW6N70wHEUsc+4EcvwBL9qHmq3 QhDFGxODOuS0e6vHv5M8NReZ/X9+iTlKAKdWnBDR0OJHKb/IQkLk963ukBGjomh2HEeN P+a3viDtZBx07iwah03zBBDjP1/eFkRCaHx/0Bdvq6M1YRUQRrDrMNDKDZdwVKPQ+hlX VcyY0kadsKy3N9S92XNDb1G7GmWSY9JoCBQAb8bDqXR3F1bmhmiJKAMjjcg12HPRtCrb 5CrCd2K/YZbxYdsmrbAB6qSUDxMZ4PnPKRD/o1W2ruwIywQMjhtBnqwOj9SXOhFOLxOj fABA== X-Gm-Message-State: ABy/qLZIthBe/WmIANn0WCuYLd5PE4CxBfIOlL9iIH39kmlQgBqTbVj2 C0nClGDRSNX8XgGUvOSzDHSNww== X-Received: by 2002:ac2:5f9a:0:b0:4f8:5717:e41b with SMTP id r26-20020ac25f9a000000b004f85717e41bmr6062949lfe.41.1688391871359; Mon, 03 Jul 2023 06:44:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b17-20020a056000055100b0031434cebcd8sm3760582wrf.33.2023.07.03.06.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8D4CA1FFC2; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alexander Bulekov , Paolo Bonzini , Bandan Das , Stefan Hajnoczi , Thomas Huth , Darren Kenny , Qiuhao Li Subject: [PULL 07/38] scripts/oss-fuzz: add a suppression for keymap Date: Mon, 3 Jul 2023 14:43:56 +0100 Message-Id: <20230703134427.1389440-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When updating to the latest fedora the santizer found more leaks inside xkbmap: FAILED: pc-bios/keymaps/ar /builds/stsquad/qemu/build-oss-fuzz/qemu-keymap -f pc-bios/keymaps/ar -l ara ================================================================= ==3604==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1424 byte(s) in 1 object(s) allocated from: #0 0x56316418ebec in __interceptor_calloc (/builds/stsquad/qemu/build-oss-fuzz/qemu-keymap+0x127bec) (BuildId: a2ad9da3190962acaa010fa8f44a9269f9081e1c) #1 0x7f60d4dc067e (/lib64/libxkbcommon.so.0+0x1c67e) (BuildId: b243a34e4e58e6a30b93771c256268b114d34b80) #2 0x7f60d4dc2137 in xkb_keymap_new_from_names (/lib64/libxkbcommon.so.0+0x1e137) (BuildId: b243a34e4e58e6a30b93771c256268b114d34b80) #3 0x5631641ca50f in main /builds/stsquad/qemu/build-oss-fuzz/../qemu-keymap.c:215:11 and many more. As we can't do anything about the library add a suppression to keep the CI going with what its meant to be doing. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-8-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698694 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761224wrs; Mon, 3 Jul 2023 06:51:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlGqOuY+y+oEkU+0v9d4+3O66xpez26n6JRhOfDj32cDSRtAN5SlcJR8cL/b9KWldEgGA9xB X-Received: by 2002:a05:620a:318f:b0:765:8eaf:d721 with SMTP id bi15-20020a05620a318f00b007658eafd721mr10601032qkb.76.1688392270223; Mon, 03 Jul 2023 06:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392270; cv=none; d=google.com; s=arc-20160816; b=EbBjGkXrIvaVVeHiT7uSWWMD+f3Y9E87W0k189FQ4If8Y8CkvrHOr4n4npOcPfnPXM EHpwdlmjbf10X8WJFtFVsrXS7U60TXoePHAKKWgfxBcEToqs592qkCiOBVJxdBZ2qmfs 0L+yzjRNWetH7IWedRHnPr3+1a6PY6ZnyFA2dcEyJGXS630kyT64rk1EyC9h+hhYhlSA J6IVQKhIkcz/4lrvgRAND3AhFJRY21L6NYneQRuoDAP1FfjoRoexcywnKlx1+R2WPIJG GKgHfYq8fXzv3cE3JxHho7VciJ1Z8lgStKEpUnYjYIK9Gs4vwccCGFEZDO6uuqR6MvpV 5f0w== 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=pmUCRBf4Xho+2SbSl2R5MUiyr5uXTfWzrS4YFCHSA4g=; fh=C7se6AnBqv1GQxDY7AxWNrmmPMhkv7sd6XXMbDkf6Do=; b=M42dH+q3IkZ7ExLPeka6+L5qgYdG6MVvRfulWbg56xyNa0hKN2lenJxAfF+e/0h8iS JFykDtDWRVzLxCzTWO5UFMqS2iOb7SnSapcXFF7NWKN00r5ZX7LX3AN2vOzcqNIEs8Wa 6hU2XBY69JfNqpFAi04sBOKRVDbSA47qN8y52zw8WUhuHztBzwgOkZRhF9STxE0smtEr Mgyd6cNQBHwoZSqp4n8EkcjV4iThYlzixNO++TwLRk60k6w1cXsuEV4UYcd0D2SPmMBa TvfFfVuoBmhrlJfLqovtbYv+57pB6gwlIsQHNosgMUaJzdGNMi4XcVZfWq4LgeuQ/bRx cncw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sQsWG4Jn; 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 q1-20020a05620a2a4100b00765a52a6d1csi11600415qkp.241.2023.07.03.06.51.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51: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=sQsWG4Jn; 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 1qGJrC-0007hg-EB; Mon, 03 Jul 2023 09:44: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 1qGJr4-0007TQ-DZ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -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 1qGJr2-0005gy-JZ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-313e714342cso5193010f8f.0 for ; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391872; x=1690983872; 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=pmUCRBf4Xho+2SbSl2R5MUiyr5uXTfWzrS4YFCHSA4g=; b=sQsWG4JnxwwUgg3bfswr/m3hSFosv/XrraHXPWPTT40Lym1JdU56dvqpj9DUg5lwr1 qJflW2BG0u/diWZGGTzRvnNF7yhH+XOZZi9fb9Z/l7J6XrBXuB3PZF5/w7Ecz6FhaJv0 21xef3tynnpo76voOhV0/2exPPfbawi8yH3mP6OJ4rovTjQnBWK3RsG1mxUW29dpjH6P mngxaja0dQTO0iMV09xtwX8n4P0dJDy8iBTtrCmQBjxi9oyL+F7FaTlWrUrTnpF10ws0 vHv1pydgqrr/hqNrOVIJcsjKZvLKFv/JSnWNwaJp05AyrqSDBzclxWtlpo9SGOMlltdt boYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391872; x=1690983872; 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=pmUCRBf4Xho+2SbSl2R5MUiyr5uXTfWzrS4YFCHSA4g=; b=YJ5H2uEe2HsJpuR87alFtNVnivSjRnu7yxRPu9PCZANnW87OZ7mNDbdbY0Aq41XzKe ITBzY0WsE0e909YoIcC87HwJa5ZtSO3lWdy82wP9CZT1oKiujIW7k67Sc+pdTurJUb5T 8pGYnSahuRVoK2AUzMQxgDbR6pZ66YYWqXqZFeT05xlfcYiAEySDS2SZDPDD4Ww6jmwN HvT42HD/FT/W1O0DmyhIFvbeVOOkmTKfvIxUKNjUA1whsWr8X+Z1zhWlSS6fXLUpaR76 ex/JmeaqpdIJ/FB4G8dd7CC7AZBSMueptexFmUY35HK3ENzVcamjIdwtfEVYfmRIlc7P cYgg== X-Gm-Message-State: ABy/qLZx8LJTQETK0Oj7U5vSlDxuStcOhNk/FwCOzjD0Jeub5ZCQxtMQ 9NINEQ+5Qgql6fPL2WHKBI64Pg== X-Received: by 2002:adf:f84a:0:b0:313:e553:b858 with SMTP id d10-20020adff84a000000b00313e553b858mr8226389wrq.33.1688391871864; Mon, 03 Jul 2023 06:44:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l3-20020a1ced03000000b003fbcdba1a63sm7448104wmh.12.2023.07.03.06.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A441B1FFBB; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alexander Bulekov , Paolo Bonzini , Bandan Das , Stefan Hajnoczi , Thomas Huth , Darren Kenny , Qiuhao Li , Laurent Vivier Subject: [PULL 08/38] tests/qtests: clean-up and fix leak in generic_fuzz Date: Mon, 3 Jul 2023 14:43:57 +0100 Message-Id: <20230703134427.1389440-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-9-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698687 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1760506wrs; Mon, 3 Jul 2023 06:49:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qzusBm5tG0KzmiUdv96qALDxa8ZkiWACni2v/OhsHAKCq1pIuHlcSVoUkpZIjwrMslrhg X-Received: by 2002:ac8:7d55:0:b0:403:3aec:8b41 with SMTP id h21-20020ac87d55000000b004033aec8b41mr11652841qtb.29.1688392177575; Mon, 03 Jul 2023 06:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392177; cv=none; d=google.com; s=arc-20160816; b=vg9OFc3jB+yVOqPtBDRZLTxu2ArMj6ZIS/GTTY9ixWOqLZugDxEXgKP1DCqvXtJNLT ijezsDCLxfumoIezJNxh6V6sNu2mmjlBFcWVCnvRZuWC1VOn/jfPpH7kx6eN86A1V+0P IsClOktu9dwOMr9tiEL9Ci3h3OYi8GF+XGkoCqfWy4+6+8grsAVAy9rSfe//esqP3fjM EuQO381YiUEDddpJ9W4dcMX1ihwSJoUeHdtb5nmwkPWCgBt8+5MmSCfMrysR9wgyhjCs DmE+ngQ+SUNTRCWY3q49ltKapsA8Zv7HWf8/PfMmm/vFSLMQxH9NVVMq+ShJ7TKl2rSB KWPA== 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=7/2/UjZO5LVZdyjze7eK8CMBEgeqrfQyTKhD3ann+Ss=; fh=jznjowI5ivsNlg3nbmjj155VJjH1HVC9cOmgnw9lFfc=; b=xZ/0oDtDyLNrtmPuXnobbfOK2xztwZb5iX3HZq2mTIYVn/2xs9QY4z6b9qTaEhzfav J1tl1uvs/y4tkJAL7sX7d7Q4Q/pjTthvLOaG6pZcvvJoa0cGXnHJp3RMDJC/UXKZXIzM qVFoVjKWC8HN/1XlURxRkfLz8mwoRRpogzhDnNSdkSzuIUshrMBlKNmsD1Xt4gkO+h40 CJ8FwrmjZlgS8mngkHWEcDCDj16yoDKTZov+WFO8E03fR6UX6cV9szL4jtqO1ITlHlIq uG7MRm7FboFMF50LwfwXKUO5SML4HIoF10Clbf7M3yePRauS4y6b5kUueYMbScYjbNt6 cWDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aL4tMX54; 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 ESMTP id p13-20020a05622a00cd00b004035cbd0ed3si1422741qtw.151.2023.07.03.06.49.37 for ; Mon, 03 Jul 2023 06:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aL4tMX54; 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 1qGJrB-0007cl-Al; Mon, 03 Jul 2023 09:44: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 1qGJr4-0007TP-DZ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJr1-0005hE-K5 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:38 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so41218455e9.3 for ; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391872; x=1690983872; 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=7/2/UjZO5LVZdyjze7eK8CMBEgeqrfQyTKhD3ann+Ss=; b=aL4tMX547vLMqwHdyU2m767D1bE9axJA1AapZmOp64ZNnVPqDmGzZSFvcGL7iA7F2o Nnw1+lSqJfkqU4+3wUdErfCuggOskKnKS6qGyGSEznkgkq2QU6QZ8OW0vOfyiVrpJUHd QZOdjA5+b6+2DhQG/CLIBsFCE5rF3CkXlldCnUE5cRa4jrd5rSWJ1f+RMO08E/C5dbxA X0zh7XDOb/Vz7MwpLu9WUoic20/+dyF4IuhS4KjQzB/HLa+1gfXxA75LeZ5y4I9vclaf /Vw2QevodEcg1nFS5Skfzd1XMX7bpSfVadN4UGY0rzthC6MDtzn9PypDdPmLoUIQRcUY PnhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391872; x=1690983872; 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=7/2/UjZO5LVZdyjze7eK8CMBEgeqrfQyTKhD3ann+Ss=; b=XAbE7rl5Ma+t9dRhpVGXmOSMD4RvGLVhSe2GIbjWvbM0yrOoPt0BgayU7z77JuukRk XtdDcvWMna9HQVeBBVno+nHQpXR8OdRcmUuzuQnLyIolMZR/UEdhkAJLcWDykiH0hCN2 78yH41y3T26C0oIkPRQvoNtu4X/C7I7Oa5oES5I9TrP1we0xQwimQ+tsKkwkDu9JRI3Q IdpKQBH6TdAYkLBDaq4CC9qzbwdo/MAaXUxdi5ZFGaWvRrjyKegHDDbC6ksPzgx6QB+x 9JoB9A5YLCnNBqAWjszoBME1Bzx54d4Pcc/I5H2FI8WBg5K5x0saFwFyCNnKz45P2huY ShSQ== X-Gm-Message-State: AC+VfDw4DHWcVVR8Mp2ed9oZ/sLGMWR5Ab17l+R6j68UKzQa6M1inms1 NZs/fGdO6avRyIezE4RwBpMV1A== X-Received: by 2002:a05:600c:241:b0:3f8:fc96:6bfd with SMTP id 1-20020a05600c024100b003f8fc966bfdmr8033857wmj.17.1688391872299; Mon, 03 Jul 2023 06:44:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cs7-20020a056000088700b0030ada01ca78sm25629348wrb.10.2023.07.03.06.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BF49C1FFC3; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Alexander Bulekov , Paolo Bonzini , Bandan Das , Stefan Hajnoczi , Thomas Huth , Darren Kenny , Qiuhao Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 09/38] tests/docker: add test-fuzz Date: Mon, 3 Jul 2023 14:43:58 +0100 Message-Id: <20230703134427.1389440-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 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. Reviewed-by: Alexander Bulekov Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-10-alex.bennee@linaro.org> 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 Mon Jul 3 13:43: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: 698688 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1760781wrs; Mon, 3 Jul 2023 06:50:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlFoPoE4HfHtuB+AMpv+YZ5G9CQDCeg2hks/0P286pQV78XRPQbLW7H5kXHSnGShe9aVR3z0 X-Received: by 2002:a25:d6d8:0:b0:c14:8c83:8bd5 with SMTP id n207-20020a25d6d8000000b00c148c838bd5mr9508201ybg.38.1688392214561; Mon, 03 Jul 2023 06:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392214; cv=none; d=google.com; s=arc-20160816; b=QDHpDzxzsHV3ZH3SI0X4Hn63bW/v/Ra7jzuNTkpVgM6Wv7XGY8nHkx/9G5dGXL6S6O E8ZimsUwdWjRtAL0RSAQxHvYEid8VNkSElTT6P5yJ2qq6D+qS4iEqTAknWzAVktLlgxg AZYjkqisPAoVcYhBFGMVyWl+f98VC5ghI1ggbp4/1sD2whgmxnkviZmo5g/WiTQb76uu LHz2xz5G+HI/C5vY23dqkvzpj5FuqvJczoVuW1B8c8FQtBm7+TCT4ek0VfqfIm0jVIjs 4HfpHxF09bMJgjEIWemY8Bbs3erRvoGznwAFBm0UpfUvpepZFrBDnWeMbUWz/i6i3J+p y3bA== 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=E90hciyt1UffWPwONrp14kWIyQMFUouofO9E1/IMQIY=; fh=BAuzLsPWsfM/95UUGXnHwHcOOcnB4O9WxcHmMm6m8yQ=; b=D70kvAefaqn9SQ0kWEAGsKYnJ/wmxOmW6/SExSrUx73qUshnc7MXn1Hp3MP3b6mgug rKoFkw582bdh+2oHX2bSDypSfwQQXvMHObCKttg0TWUt4JhUQkqiLG9022AQgfgj5icV baPrCx0aAMEa1ubuzqsiN+XzAZVgaugkZuNGwNlZU9X7+qGfvmia0S/iAd0ieuaqgpQi FzQg2/WPSd27NlvebhldXJTF9Z3nAT7OQzQET8Gjkl1URoFua3aaIHPDTy7rU34aDx8v 3Npn/u4J3C4KiAc6OZVyRVYkVuuaVRAObiCzsfPKiyfJMGHL1P7AG/PDZHA8pd4noQNv +A4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nbAKNb/n"; 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 i10-20020ac85c0a000000b003f6c5812132si4378201qti.385.2023.07.03.06.50.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:50: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="nbAKNb/n"; 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 1qGJrC-0007gu-Az; Mon, 03 Jul 2023 09:44: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 1qGJr7-0007X8-6g for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:41 -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 1qGJr2-0005hz-Vp for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:40 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbab0d0b88so36801995e9.0 for ; Mon, 03 Jul 2023 06:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391874; x=1690983874; 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=E90hciyt1UffWPwONrp14kWIyQMFUouofO9E1/IMQIY=; b=nbAKNb/najijPAg6S4CwVHdw2yTxys9bBEMFq9hZ4B5p2kcotL4aMH7kdi+QzA4s/L /5tn7fcv1hkuNevkvGLOD2eb88Ffo4rvEf2YkqqOTGQ3yERxj2sf9CiSn/GVvtrUAKl4 QvGJkqUONAapAS+gIq6Gom0yHclLbOv3GSwuOmC2KK/z+zykkP943fEjZL2q1JAciY7c 7nufQVAYaqoJePNeo9+nlXxJX7izHDCSww638iU1ecYnap64VTWVqJwg5LH4RXCCBcxb yLGQsIUK7HHHf7zEr8tP7tr1jITB8n3d5rJsD78tXpDozkAUwnO57iPGuH4/hU9errTc oDsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391874; x=1690983874; 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=E90hciyt1UffWPwONrp14kWIyQMFUouofO9E1/IMQIY=; b=TynKdTjpNKk+JrCGEovAnLEtp9Jjb4JACqc0P+Xt7qn4zAK7QT4C7zBXyf1HdqB0M2 9sZ4rkS/kUtLp8r+PLg1hYMi8/b5AnrsepF0Slpa8g2MEFxUHNjnFh/ysByNditMiRhk HzuAe/E4taL7+RB30IYcBqgEfw/PHIvC063Nvby/w7BPWgcrRQSnHNfg0azxq077LWHy i4W3z4rwHQNg53PqAda7qKP9xNK/59zZF/WUB/m7bd8r+9tQIa63gBvk8Pn8MT7vkL9J pX40P3y865mdd8fMpRc0R3Gf34z8twIhypM265VNA2kM/+kHurYRrM2cDhSKYHXPPLBY KHVA== X-Gm-Message-State: AC+VfDxuldOw8Quq3mOn2DZQJp5qlUbRaNVIHs0r3+5oY82poWJHr/9G 1Y9JI8rEaG3mlstrsZPmyWz3K+F5BOkfuSrJRuE= X-Received: by 2002:a5d:51c3:0:b0:30f:bb2f:705 with SMTP id n3-20020a5d51c3000000b0030fbb2f0705mr14114027wrv.22.1688391874139; Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003fba94c9e18sm17097011wmj.4.2023.07.03.06.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D5CA51FFBC; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Paolo Bonzini , Thomas Huth Subject: [PULL 10/38] Makefile: add lcitool-refresh to UNCHECKED_GOALS Date: Mon, 3 Jul 2023 14:43:59 +0100 Message-Id: <20230703134427.1389440-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 This is yet another make target you usually run in the top level of the source directory. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-11-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698698 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761612wrs; Mon, 3 Jul 2023 06:52:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlHYKbEgOQ1lRWKn5o/tq+iBPmEaXYZ24edFAFXaMMs5FS5oZhwlfFvlnUjkp1JhfPjcHabF X-Received: by 2002:a05:6214:29e7:b0:637:2eb:6c23 with SMTP id jv7-20020a05621429e700b0063702eb6c23mr1094741qvb.18.1688392321201; Mon, 03 Jul 2023 06:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392321; cv=none; d=google.com; s=arc-20160816; b=rBsWoIdhh20KD8sTslUwmNaR6551cXYZT/KDvjYHWxXSdq0tfDDHWIjH4Kf7MaFCKp GZnXN+pVaC/u4rxkXVFK/OLbxkASNBHlh9NgjCusRtTQ+8YzViuihNlJM+EdG+ZCBQae WzENrajLPL49WKxzaWzKf+TszbQ2M0/aJbOiiXGB1bNcMFZmpopJLzzPYNQ8QULhdVNl 7Yy0pSZdJ4TDWScluJHKDu29oK284+NxPxBXJJ99N9i78at+/sG9DfX8IVBguV7J95Ht AHiNWTcLXtVTrJQZfzR/dQNJb5qYFIGoGBQSH6/hr9y6qzwnjStynV4NJjewJYACXmOM OvLg== 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=gbXOS2UafnQ3pS56dbbQl+HPmW3sM7cKkRCi6U8OV2M=; fh=TmZzSOFkvpO30PdZ4stjErulhTxe52hDZl3OxPfO9hs=; b=GndY/9xol9ZslYbxqFGrmR2I+qAwLIAGznCwwyyt7gbD7ixapJE9pr1jxRleR4OP3h g4ncQkg/oK8CXnFwfLbChDTqBLzmrLDIyv2nNpMtdI22LyQwCuyhgcfoB0d4LcN+kRFf TQR10Qm6nkYZ3SOtudpxHRmiPxLXHl1pnchuQxo9Bp0G1Xb2K8v5uzojjSj1r+WcC7Yd 5bT2LXSW3ouHLyvkHsxO08VxWVVBMzrdi5hnCWXS8A++ZocExrplMR4asRiH653fMZ4c I31aOwdfT+bKfP3tmKQQmKKveo9cho/D/OoeDl1y07/i9EvCN817yF5hYspl0QdmsN4M xsrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=adr95iLM; 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 dt2-20020a05620a478200b00766fbc47de1si10576655qkb.537.2023.07.03.06.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=adr95iLM; 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 1qGJrL-0007uA-1V; Mon, 03 Jul 2023 09:44:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJr7-0007YA-JC for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJr2-0005hX-Vz for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:41 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so40243765e9.1 for ; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391873; x=1690983873; 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=gbXOS2UafnQ3pS56dbbQl+HPmW3sM7cKkRCi6U8OV2M=; b=adr95iLMKKSXYwgVKi3Tu1zYHHlTiX2HfTGOdZlyPiqKiI+xbjMt2J55ND3JVMrY9c f/6/2YljddLM3guqoRamKcMBu22JCxC02UKpc3PfNoxEttRM1C28M/wcYbZtAN3xkA3A sy3l37WrG9qoCoS7t7af6PZLhisSnVzgQ8tWmwveVqwSCYWFfZroEZBZzG7V2sw3PGwB J4Xt10JVjp8yiAJrfFH8F2b0qPhwLD5gGXfZQvKj9k9tfhu4QQqbYhi/+aHq+7FkOnEY 7bTD0mTnSwCm3JoZIOCZik5N8Xutl0PE9r9iE+rpWJ4e+AduUcFDzcv54i8vyuKxYGuz Cslw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391873; x=1690983873; 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=gbXOS2UafnQ3pS56dbbQl+HPmW3sM7cKkRCi6U8OV2M=; b=mCYG0fsx67NPmzEPXtHOilyeyB8kC+7Zju8yS1BOhrMqflPWtk3HZeyccP1D2il7XJ qhyEEhBq0ci5cB76flbkK8wUJbIILwkHY43IoLsitgeYI3iHyNdFonXTVfpaO5WNPmos AfcVo2XjSm4T88UcJCXvEf+QOhy8eGIBMQXnEqN8ud4jRB3l6GzBqvQeU4oH4tRa1tfH aviytzHsDOSJMJbt8+6w65gSutU1K95otqiP2QPTuZDabj4YPdIwBtlM4hALIQ95Xt8X y9uS5D2avkpqFSscrR1psgZdrvCfXJ7DeFYWcPSxRDusfcxplb6EhxIy/Xwr5ptZIasZ kVTw== X-Gm-Message-State: ABy/qLYvD9hw65tqwy98+g71AKuKHdCfGtYOeylXWGLupNqKDOY/iZwh 7Pw4ATjrRnJmqtb3o6cmykkBgg== X-Received: by 2002:a5d:66c2:0:b0:313:ef08:c83b with SMTP id k2-20020a5d66c2000000b00313ef08c83bmr9300524wrw.56.1688391873007; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t14-20020a5d460e000000b0031433760a92sm4044732wrq.115.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F2B6C1FFC4; Mon, 3 Jul 2023 14:44:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 11/38] tests/lcitool: update to latest version Date: Mon, 3 Jul 2023 14:44:00 +0100 Message-Id: <20230703134427.1389440-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 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. Acked-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-12-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698679 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1758487wrs; Mon, 3 Jul 2023 06:45:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmoTH3FAW2i1euecTiVfU/gOAoi2p5at13OMZlll5QZcCnhXWEG7mBgf9rCCBJoXnW4LYM X-Received: by 2002:a05:622a:1b9e:b0:403:54d7:e340 with SMTP id bp30-20020a05622a1b9e00b0040354d7e340mr6954790qtb.13.1688391926863; Mon, 03 Jul 2023 06:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688391926; cv=none; d=google.com; s=arc-20160816; b=FwE803FwBVnr7MdE+4LTTLwYC8snd+6WLlVxOFIKzPL9ADT06zRUzJpZE6vX7tjz7c KzXpphPM96ZzVr/dOS69VXL/95o6D2sWoRgULXD76abru0s3Il+aKXzfYmIVSCVd2nlu DeFfHEYd1WVYasi2i5Fx5xtmeAcYsdppkT2tHtu+PJAq/D+GmlFElniAEXUdJxobKY19 roFdxdBPq0XTZSfu6a+KloFpBFtDI1xm35xq2MvVSkXTVKPNTR/EBbm1B8wZxC3ZGQxa hZZC07UAtdD0x6ttoQj9bgXKFUjHrGmcW319CFxOWNZSINLMOOCkLtQgkrZl/z9R5v/K RBdg== 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=/s2hAOhMVhGFCPzbYe/mdoQHVg5UiqmQFlUH/WTBHa4=; fh=is0xxhpg5KenEatsO4WOScu6BHJ+g4zluf3ryLZWvYY=; b=zmVH6TIA/v+qAmAalk83UKaJ+y9ObIyJ998Rhygkbvgn3aWE1eVsH1mQF/94hpjtaW FIzxZEEf6yS3jTB2xCv88yqx+raBOAONtPF0oPFwo6SMFMKxvUYOR0xrjTh8QGwfKjnB F6AN2G0VquDRFwniR92m2PuTa7r3yQ8ksafdgGF8JYk52WdpzQdUWfvUFi4oUH+guECS pNkcVW1v5DHEo2D5fbZWkuLXxaaiBdhxOwos74HVjosT8pgQZnw5P2JD/DSKqQveO12s iAbgEj7DTHCq1wQzZqvV5cwJYzTneNcIaLN1MbKredGAR7dL/lQBMoAsZInTDGrtJF2o c9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDblIy0n; 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 n13-20020ac85a0d000000b00403543ec61esi2717067qta.805.2023.07.03.06.45.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fDblIy0n; 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 1qGJrF-0007n9-HH; Mon, 03 Jul 2023 09:44: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 1qGJr7-0007Y1-HT for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJr2-0005hd-QJ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:41 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fb7b2e3dacso6905681e87.0 for ; Mon, 03 Jul 2023 06:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391873; x=1690983873; 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=/s2hAOhMVhGFCPzbYe/mdoQHVg5UiqmQFlUH/WTBHa4=; b=fDblIy0nKI9sTCPytEjJdKrggDpkQoL3T/hnyV0gCmiZ3rimSimcBOQgP+qCMr8+FP ywllZzmfEdJWaQRj7AaEJSnL34SD7NVcuy94vE8js9cDU7DmxWgM5dMSOEdoDYUO3S33 odBUpclt0Z+uzHk1N5obHNEfJ1jdN+XFga/4ijNYY+lqOjd0EBDwmCYYXKZaN5WMlksB ogRunD8P8uEJSEXWFRuRATntkeOHmzSEk1xwiZIat6maHTlWzdNrB6AbLgQvqe0UGTSH 5oNDtw/iCKZuXku+ufe4Tfa7uTJohweqvOHAVlQ8II72dNJg7VBKdAGrS0q7n/dqbFhy 7fQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391873; x=1690983873; 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=/s2hAOhMVhGFCPzbYe/mdoQHVg5UiqmQFlUH/WTBHa4=; b=Nfgidqkzu5krWmMO27E4lO/6Ec6Rw8fcwACaori+O9T6bCTdvhuO2Rv7yvkRY/wOsw 3VDZppbk63oOgw8KmYSY/n3nytuMupWWb22cr0/Yy11wQWelSg+x5K3l8d8pPFI80IMe tue443M6HyIRfC9BQkK+pQ8HPqDcs2KIcB0kBNQJrmTS9dvmST5EKEXyjnhKLZxF4aVo JRs6L8klRvQqZN8iyRAFGJv+hw5/9HKnpKSmCvbBIijdckXp/Z09nPMtCGSgWAN2zGQF r40Xh2TJ9R4R2pcIFmHmUDMjkN9DPlF0F21Lx3Ekl6aYvxpAA2asl0VhYfhLkQmw1IQd /y0g== X-Gm-Message-State: ABy/qLaJkhOFEOpporhrv0DEUk1csHOFDRDJdw8g7vufrAnPRhPGLIx7 Df3XLL2PUQ1OIF86hglapKoc+A== X-Received: by 2002:a05:6512:3d0f:b0:4f9:586b:dba1 with SMTP id d15-20020a0565123d0f00b004f9586bdba1mr7872346lfv.4.1688391873244; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l25-20020a1c7919000000b003fbb25da65bsm14778967wme.30.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2485C1FFBD; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Erik Skultety , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 12/38] tests/lcitool: Bump fedora container versions Date: Mon, 3 Jul 2023 14:44:01 +0100 Message-Id: <20230703134427.1389440-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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: [AJB: Dropped alpine (in prev commit), reflow commit msg] Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-13-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698706 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762792wrs; Mon, 3 Jul 2023 06:54:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlF3MnicK3LICoLi7v9WVBFIEbILShWLpzpdm8ykw/cCAQufg9g0jR2NVIqAxqcVo0T0DXSg X-Received: by 2002:a0c:efc6:0:b0:636:1aae:1bcc with SMTP id a6-20020a0cefc6000000b006361aae1bccmr10378240qvt.39.1688392490618; Mon, 03 Jul 2023 06:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392490; cv=none; d=google.com; s=arc-20160816; b=ABzDlKBjST0oJ4//KRpfnd4HWsKCnkwBS8RB8xfmwZBRFlDbGQ0L5kmoqMh8kJlvj+ eyJwAZSJOOsyskA/QYnlpc/nGyL1hUjan+6HNF5PtgEHqZKM4aTi1/ApyhbeAwwHisHu s15mccFyecELhWthNVWWt4J/hMZFHyMT+uZDV/v4jw6KM1xY00olmWdWYIBcf8okcv7s BB3ZVnanSJup0ZruOmeeWM/gmTf4bz2Xp3WyPmVResm3ucvuTnBqOsr0I6mPTdY2mG76 CfpRhkW2IGFWScmMBsHSk8x8p3XPusQIz5ktnq4aONj//tgM5cEKeGOtGmbUDDRAD/Ie 3WgA== 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=3g1ZdS6tVQBEMQ0D/vXzVLJC2cdpbVKGouDWEpjqWrs=; fh=TmZzSOFkvpO30PdZ4stjErulhTxe52hDZl3OxPfO9hs=; b=jOrrwA8x5rP9z4A1FpJFfvVnTBKKHXD1bptES/u+RsFosWfKisESY+51IHCSMZrAxn umnF/9KMcv/YqhkUyo5gnTf5506m9isCrHGWqzr1NpbOBRH1mVs04AYH20NGlsSKxpYe E3y2+5MF551Y/YvriQKeywDXP1hMtcgJK8BqSkGRAsz1oexIyLjHHeqSiW8yJOGUZ3Xz CTtldhtjHBpfGxLz741KDR8SFBX/oz5PUNVdybsUOjtXn8dHaRiaUJUoWwQbpxRone5N U11auo5YKfbv49IlkQIB8JcyQwwdQHbGcQpeNSFWdfFYPXOCPVBvRW2HWyWrCqOwGp+J ApHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BqNSa4sG; 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 fo12-20020ad45f0c000000b00635f126946csi9375031qvb.284.2023.07.03.06.54.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54: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=BqNSa4sG; 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 1qGJzj-0000YC-Ez; Mon, 03 Jul 2023 09:53: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 1qGJzg-0000Tj-P1 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJze-00081a-1K for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fb761efa7aso6914715e87.0 for ; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392408; x=1690984408; 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=3g1ZdS6tVQBEMQ0D/vXzVLJC2cdpbVKGouDWEpjqWrs=; b=BqNSa4sGy0jqk0Ng/If3hEBucc+vnYEzH3ZaGo1qowR+ht25Rog9GosjNLNCS26cDc qE7i7zn6idyWklVB9VBlVtYjYRMPn5SZb1Zd/8xSmoatv2STQ0gaNW5ODAZXYdZY0TJe jsvY9OWQAVwPt/+i9/K5tDaHQm4Rt2JR2RFhpv5wh14mgwKuTfsjRmLboP90LCulCa14 +i5jkjtbKS1B9nyN3LNbUmKw/UHtMbHGH3yo94Gtkh6/lj9cb75TCOgh5A+8XI11iR5n jUtcJUhA0mFqH4beqiB4bxbz+8sT5KHwJ08B2w/yP23cRV2zEBAF1cObGQGQqHQLuCR5 9R2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392408; x=1690984408; 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=3g1ZdS6tVQBEMQ0D/vXzVLJC2cdpbVKGouDWEpjqWrs=; b=YDK+ljMrFntFulAgZijXW5h/J1tkPazV4nu1tTDB0kGqDdKpzrtyQ1WntOsQn0Fd3C Pm1ESh47mdj5wrODnW6rArGVhPVoyhVjZBCyWk5s+LcJFRv2nCoJHjtDNiPqmGlEN/kB 04kX7fdS2kekXATVAqzeEgmDNediSqhI2tZeN1mePBK+NSCAuMmobqtfHtTaKk6J6nH2 NsOZV+ZetEORz4SoTGzp7aBBDRz9La9iG1UlzNP8e7oACQQdP0aBRG926YJLbTNEOcYw qiU5ixSQlzcToNEYdcnwVVnWnf0hPqWpj9305sxzO5EzUPS02qw3Ai0ytqkRz5MVV2Vp SJnQ== X-Gm-Message-State: ABy/qLZheIVTw5xEO+Zc1TbqbpYNhCW95SSYhh0doAL556ZP0nP51O9O vMCklcJKpS/Z1ggpq8EZdsjUTA== X-Received: by 2002:a05:6512:2811:b0:4fb:92df:a27b with SMTP id cf17-20020a056512281100b004fb92dfa27bmr8358926lfb.39.1688392408299; Mon, 03 Jul 2023 06:53:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f10-20020a7bcd0a000000b003fa99969e61sm21413074wmj.45.2023.07.03.06.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 595C01FFC5; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 13/38] tests/lcitool: add an explicit gcc-native package Date: Mon, 3 Jul 2023 14:44:02 +0100 Message-Id: <20230703134427.1389440-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x129.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 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. Acked-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-14-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698680 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1758489wrs; Mon, 3 Jul 2023 06:45:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JDL0EnrVVYhzk/mfpprAXj0ZrIQ3Jyz1akESekTssge1QM868BuSZ6IN+qdocUOIkmnxb X-Received: by 2002:a05:622a:246:b0:3f6:c253:a738 with SMTP id c6-20020a05622a024600b003f6c253a738mr13536732qtx.41.1688391927018; Mon, 03 Jul 2023 06:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688391927; cv=none; d=google.com; s=arc-20160816; b=DyMTUHYO73IJBCFiT0FLbExQxhpgoXoebNocRna+Nta0PXHjm/dJJXr6u3ZUF323Nr BXNoSaErLqf8ZH0Gaso7HQw/qoz5vgub/IQupziMR9eKq4sl7KzAJ5rV+yaH30zG93IN REtV7Y/vQmONkuu9/Ldlh/thX5Wx6Q0T9Vb4FeGXOr/GgscAw2QnVyRVbf+LaPKn3f+0 F/UFg9kFblwPRy7DtgYh+sUJ/Hxi4xA2f96yc4alurmQ+VQkSwI8fnSHKXSXENU9aeDG XYgqOeetZi8BApIBg7b1jI3sOIDUfFXKV4EpiJ9GkbtQ+w4rroBGC6YuH24cF+ykoVUG XEkg== 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=3QXiG/9ekTa+RipLUg3DjWaS82wOBRs7qXSyJ9mS8po=; fh=TmZzSOFkvpO30PdZ4stjErulhTxe52hDZl3OxPfO9hs=; b=aInmDZ1Up4U9YOnoEXjZI1IiHTsQCylvHNXRjehk/bM8aYC+TSn2rfb/gMyOD7tiht ztsqbfq33dKIyy44TzjySCt0LZQ1J7xodLykFaSzYXdAtAPjcgMsINFkG0j0hVw+ZWKu lhXi7kqtbYt6x8FQWgj+TGGD8AylmBwnKwKXb5NxWc6K1ujI3ITPX/iSdp872l1OJgF/ TD3TvtTwRm3BZwJxJdfAMtF+HU4A95tbtsP10SmQlAuPiGj9oJMHZg3TPCWKa69NAfMw 3K5X3DmoyXCUwjpAI6jnY9zZcDFnfivRan1x/QAzeo+zqA8E3PG+PNRXE0L47vGX83G2 1sLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OX8Lig9j; 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 n7-20020a05622a040700b004021ce498c7si9830222qtx.803.2023.07.03.06.45.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OX8Lig9j; 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 1qGJrO-00080V-W4; Mon, 03 Jul 2023 09:44: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 1qGJr7-0007Wi-4y for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:41 -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 1qGJr2-0005hu-Qa for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:40 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbc54cab6fso36477455e9.0 for ; Mon, 03 Jul 2023 06:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391874; x=1690983874; 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=3QXiG/9ekTa+RipLUg3DjWaS82wOBRs7qXSyJ9mS8po=; b=OX8Lig9jcvKXa/fhr8tRctbnhrcGwT4msuel2EO76pRQzOzi+YGrxVblOK3LFh4uPn IazMnh45lmJm4OAL+6b8MWd00oIXtadrjnCHQy8whDFSqkVxdFKnu/C9yHoxrZazQF8m 9Twlhhl2sAkolorUj5IoLXhz93X7Iw7XJEEYYXzqhPlkipVpzgisEL8vMtdBEFwJljqd nLx5UzzScVxJPk2qeTeZgFss+fs56qRgUxY9dXDhUlWj09oAjdflQZ6ZG9h/33KcuRoS jxdkTk1tlRgSbC+lTvWTlOzO/MGPg1G4Wj50TOl2mxNcZLQho8p3kJnDOyQTghcjU/cb 9RZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391874; x=1690983874; 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=3QXiG/9ekTa+RipLUg3DjWaS82wOBRs7qXSyJ9mS8po=; b=S5JHD+wWb24nZtEyxVRX0H4B4B6HEfuhpNDMDhcisLA1HFtRIJo++ASS4IWNFy/bbd qqJ9YQtah9dlVDWRvLQIWoNC3HlnTYU/JCnKNI+GUBHxicauvjJYrCfgmYb8YY5EcLRd 09E5fw2Hmf1h7jPkx7kmGQ1MQ2YxVTwdFuE6yEdUZZltCcwXKmJhgGvhK7Bmiws8HtdB cihCOfgp7Cl2cEA8wAIg9t/9re30lCWIFULE75muqKkAjKC7g+Iy2ACnF18nZPWM+ha7 j5F9cC9O+3H6egHHIB+IRLEO2n/Et9upiQlxmKC49B7GeJZpAWm9jgl/u/klU41NiDx9 Vl0w== X-Gm-Message-State: AC+VfDznmQiHt9yZvIdyOCnQSyB2w4cF9Y5yq1gn0FmVYCvT0/9iNuRT 8RGy7hM9JUl7bm8HyTsUjGiQS94mxlXrdBUI7k8= X-Received: by 2002:a05:600c:230d:b0:3fb:973:fdba with SMTP id 13-20020a05600c230d00b003fb0973fdbamr7789331wmo.31.1688391873937; Mon, 03 Jul 2023 06:44:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b003fba94c9e18sm17097059wmj.4.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:30 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 71A721FFC6; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 14/38] tests/lcitool: introduce qemu-minimal Date: Mon, 3 Jul 2023 14:44:03 +0100 Message-Id: <20230703134427.1389440-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-15-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698695 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761245wrs; Mon, 3 Jul 2023 06:51:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xu9AAavZcjnIOQb4+sguLLFf2whWPjxrMwqY/hNoRYn3x3WJGxDsmVEDga1gOe890aZnR X-Received: by 2002:a05:620a:2697:b0:765:8c98:133a with SMTP id c23-20020a05620a269700b007658c98133amr11634860qkp.9.1688392271999; Mon, 03 Jul 2023 06:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392271; cv=none; d=google.com; s=arc-20160816; b=R0XZ+8GHgxYaOeMn6oKfNbBQb8zKxG6sqsqs0ChhGQRCF2mt/oyYX1E+YGak/oCK2+ e2jdexVXBmmd2F+HpL9b1/i/pb+Qa9oHK2lniEFxg7LfR3pcbHg/mDal/u2yd9yro2YR jF+8qDglGQU9I5lIEA30bIdcjc0wOkzWMcX45jOdV0lTJHAEiM2soti4y2paEoNNh1ZA 3tIUM6GOqtSn+A+aLj8Etg8P6hZbWetADMBM7OKN1c4FoiWQhH9EYeNlzQzQqklWQJJn JnWQY/AAlQtN1lYyPETdRM222mKyHQuPcWP22MzxOSvGv+QqLrWA6cTBSh8qGSsnbTAL uYjg== 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=RSwlfu3OrMD7gLV99s4E7TTeOa5nvAq4Fdof1YBVMJk=; fh=TmZzSOFkvpO30PdZ4stjErulhTxe52hDZl3OxPfO9hs=; b=Rvq0QEfw9SEWmvww0iAt7Osea0sRZi+lFYwJBRFHzQNtEh2R6S6roDTO6232RGHvuw pwgm3DyRlEamYdouisjm9/tQg+8rqrTjzGclqno6fbh31WC8RIxvQsr/SGEEYxNFhIMH hNPVln9lxBZmIQZ5mPhGLOH2C0xgCFKTOJqyb688PdhFXiHnWKxRe6o8gxjgCVc59oa4 VJIoZx1+l8WpVAePJ8P3aTJbRXWm4w5C2FY/KEHFd7icxRPxgaBCnirS3acskmceaLvj l4bELJtl1D9aenYJXyihb3bb1p9BSRevll8YMLB1qWS86WNv0LLvH3RzgYsFQ/WpsB1d Iwuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BktkRqr0; 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 tt12-20020a05620a3e0c00b00766e43021b4si10006210qkn.132.2023.07.03.06.51.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51: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=BktkRqr0; 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 1qGJrO-0007yW-F3; Mon, 03 Jul 2023 09:44:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJrA-0007a1-Lu for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -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 1qGJr2-0005iK-WA for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:41 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbd33a57dcso22275295e9.0 for ; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391875; x=1690983875; 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=RSwlfu3OrMD7gLV99s4E7TTeOa5nvAq4Fdof1YBVMJk=; b=BktkRqr0prNHV/CNz2ExVOw9zp6oAMzSDay3IJe4eR1KHkp27ufpCklOk9HogN9ON1 e2GhaRZEUV/euPrzAyDUdKT+wupHSGsaxcnpe/lGoBiqjOW3J7ohrLKixlSAOocSDK85 AIRuQRA4CxWZsTj8mAgx7e4CVzGPufgCdv9EiHKDnuDOHn60dIuT99IjmvB6jBOaK1hl kZSCJvo+ccEepstaNux67K/QMq1ei5CLqDr9CJXFkWMi/x102DiAuBYmd8thXN81d+9l iAFKX7MVRb383j640MvtICmQx6ZXL/llZFKHDPZk4162uqhBlo3NZn1wNVWKvMH/eQ7a qXnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391875; x=1690983875; 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=RSwlfu3OrMD7gLV99s4E7TTeOa5nvAq4Fdof1YBVMJk=; b=XqI0rJG1GlALrxqw3NdGk3uQQhKD+JQAtowtEaC607Pl1b+grs/c0ju4DAhew7tlju LIHGCtljrP/81qj+r7ufjnUDOlwvlE+/xhrhMhHLk2p/bB4Sey5pN2p9sHHeZKCmq69q oCjHkCL4ySUOMySQFrVDXlcQuTV2gvR+aeoT1VjCJXYmCTkywkTEPCsjxfQxngtd/e7n FwIbXXg3WC3kiTq9C25px9mhqmM36Zn8vprxFvzxX+A2uGmmu2OIc+cNTcaMorpjPU57 Qv2ibd+WoxsawORxf8L+7nuIM0do8yQV5QeDVnSAeJAsiL8Opyt09vW81oEdEKYJs+Jd 9CMg== X-Gm-Message-State: AC+VfDxn5arxbvsOmBWzJ0uTeFYcN2fI4rYainG/MP3/rYW9RrkHNKUY RGiplHBjTBCfxSqOVwa8GsX29w== X-Received: by 2002:a7b:ca57:0:b0:3fb:bc6d:41f1 with SMTP id m23-20020a7bca57000000b003fbbc6d41f1mr8357943wml.17.1688391875201; Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a10-20020a05600c224a00b003faef96ee78sm20844505wmm.33.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8C6501FFC7; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 15/38] tests/docker: convert riscv64-cross to lcitool Date: Mon, 3 Jul 2023 14:44:04 +0100 Message-Id: <20230703134427.1389440-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-16-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698690 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761038wrs; Mon, 3 Jul 2023 06:50:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ea2Ii0M0+rNU94Bozgd6kWTKDAfXN9I7rCPjmopFU+jo50v7uCyxcWzTEWwamRfn73+W5 X-Received: by 2002:a05:622a:28b:b0:400:9c8e:9e40 with SMTP id z11-20020a05622a028b00b004009c8e9e40mr12633976qtw.19.1688392246879; Mon, 03 Jul 2023 06:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392246; cv=none; d=google.com; s=arc-20160816; b=UABOyHQ4Jdo4TWhZSE7AjY84qnbpHW2DESUhXuU+8N+7jHh0cHzd91AqpZfThRnjdB 1qVWDXdoSi3er9uns+8+6rb8I3YzY+H3VyTW48OEemHac2WD0UlyFekRCz/1tJEpgL4W cY7K4yC3KsySBaVKLyDcMsQPcYiToAfUu+zaYhxdGjub37xcNqT6xabUA6A53a5fS86D 4f+LIUJ5y9NHWFUmhTRuogq5sNouRmLU2q9Fq/BfAs2SF1KdCMjcBU+rY4EpKyU3RPVI VHP6kvdC4G7VcVZoXW+Wv+EEoSg/Ueqf71Yo1EJYIRPL+ph6VpbygWg+1sq87RestWTU BRTQ== 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=aGjH3JSHTLFWqge6ozBEiG9tPjMP6rkOckp4e6jlWi8=; fh=IxmlFGHlIxpKgcYgTKmajej732eqfdDBqUaogOME4Vg=; b=YbAR/8Y2hnYnydOd5DTz80/EJFPdXbfXjM9r9Tx6L1oOuAYAta7vdTrNSlqLk4Nwch F5VFVxamwJbxDEk1cgHZ0FhLoHKlo5dhlD6yt6paQabR9mKAZcF1bkIZHSHBAbjrySBm e/JO0L26yV57sUwggzSzuV1KQjHIHrFm5H99PuMzswX2EQGkc7NkqEpdGgWPFgyhBXkX T25fWl9JDcWtyGr032jY+8x4zl/bnEA2Ml0+jsBLBioe6vErpp8Moz+N1ClmzxLgeHdT mH6BgX/9/JZTlDbOWGolxj4zmVV3hqUJji7pSDi7s3UqRGjVB+iIkLl1g4wKGdmItg4q CZGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QagG5dx8; 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 z4-20020a05622a028400b004033c943ca3si5530542qtw.733.2023.07.03.06.50.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QagG5dx8; 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 1qGJre-00088q-VJ; Mon, 03 Jul 2023 09:45:15 -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 1qGJr6-0007Th-4E for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:40 -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 1qGJr2-0005i2-QA for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:39 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fba545d743so59667975e9.0 for ; Mon, 03 Jul 2023 06:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391874; x=1690983874; 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=aGjH3JSHTLFWqge6ozBEiG9tPjMP6rkOckp4e6jlWi8=; b=QagG5dx8KYXDSbk/Ab410y+YQQZR4zkbiIxa5jdY+071aO2Sr9jtrSzfirwdbt577L fYLtmI5gXqxYwxIXCJLQIzkgSlxbYgg3lTVmKGkjf4DCmyxyeGPZWyk95cSHiOfZNeLA tXBa0j+oW0UCxy2FAVvDPE6MHyqs+7a78j4nOWfQD9YBL0HdiEr/qkITxbqk4Mi1Pccd zRxfJQfv9jxJsfn/bglOa5rRvfwLBvZ56B6Q3+ZAmuKZHPvm2PRtXh2J8eCpCmL4jVqU BwVRYfjVEcv8QQyNiJWiETskGgDSPwi5e4y1D6vyIOmphjwPQEdXDrndj2c33JCWUf+C ECtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391874; x=1690983874; 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=aGjH3JSHTLFWqge6ozBEiG9tPjMP6rkOckp4e6jlWi8=; b=TA6Xf/kmsSDMUYmLBeyMzZqnHpapxZyAT3yUt71AnPN/6CH1mVmFXGpaM3EKu4xI/W Sj813ChM+HgFSNlee2IQJ41nxrg+/K/uyJjX8Qo1q8JMeU+KWmKu9TdvawSBJmsLZ/K9 jFWKIwbM1J/nAVXcOPBVuo5smHiJr03cBU3NTJ1NvpSICCAB5L/ccedX7u0Qqz31W7Og ZcMsvCQs1Wp1sKqRRsrmLbo+Xe9tc7nq/h5o38sjBZ7OQ292ZTdkDvwQ94n4ZOwPvbRy dZYT3uLp6sPs8+1XZlpaCRByvcJ1qz5DM1jPHTztRUPUz5BGqOhbZGUXVYacT+4BC9ba KiMw== X-Gm-Message-State: AC+VfDwwJ/CugGTeg6bXOd7v78Tve5tUH9u7PIvByzuv1kK1rqpryj9l KpU70BC2/1CZVALBUDnEg/HgKnCHUrT6IscwOlE= X-Received: by 2002:a05:600c:2213:b0:3fa:e92e:7a7b with SMTP id z19-20020a05600c221300b003fae92e7a7bmr9720745wml.15.1688391874564; Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v14-20020a1cf70e000000b003f9b2c602c0sm30137695wmh.37.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A3C191FFC8; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Marcin Juszkiewicz , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , qemu-arm@nongnu.org (open list:SBSA-REF) Subject: [PULL 16/38] tests/avocado: update firmware to enable sbsa-ref/max Date: Mon, 3 Jul 2023 14:44:05 +0100 Message-Id: <20230703134427.1389440-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=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 Message-Id: <20230630180423.558337-17-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698685 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1760019wrs; Mon, 3 Jul 2023 06:48:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNyrS5sX6dzvVrIWqQG3Qz+wdgMWjuf9KXgtGhAr+G1QtpJwwREfmTCQxz68zOWcDbG6kQ X-Received: by 2002:a05:6214:5197:b0:62e:ffc3:a9cc with SMTP id kl23-20020a056214519700b0062effc3a9ccmr12118578qvb.58.1688392108376; Mon, 03 Jul 2023 06:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392108; cv=none; d=google.com; s=arc-20160816; b=qNnBkr4lgyt5faroQR6RfUO/HzoNeRk5CnVqYPr7AeVhL27KNQYA2agPZfdmSlRHW7 BhHoxyvAvF5sbBHi7ouQTykmzOVKqi3/a4v1/eUaKg339GzfmvxO+/2O5qP+l9Q67qkU DE5tBP3DTgQ/JWVuf3mr+JMyWQL0eBHJqqV7hUBScSLc+sTfHOra1jK5V9EDeqApAqqb mfoWMp1gDTKJMDd5uv9erJzvsWm4JXBRvA8DytBH+iei6Bi4KKyIIqZjOBH/uewKSugW 0viTY2y9BgfFVednQdBdTt52KF8wmAG4uDyojReMpRqT4yU0mdGOooJXhKGocHW2Ts+i vP3w== 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=yHFer7VjnRbyKbTmhJ/jIDL23JfeX2bf67sUnbUfgAQ=; fh=jLYwRthNVQctC75KPk/a+uaJp5vniuLBi6uyEDIByMA=; b=swgkzfupAkCOJuFkwoetaHmsy/BwYaYPF/5wffOi4GrH1ZD3C8wR3LQEv5IfvheE5Q cdK6Ofz/96aeAxmCi91HXQGXr8YmEeZ3tVtyl5+wYGzHq3BVESAoYQaqBi8iEwZG74xV tvH1Btj6lZRIbxRNJWBJdvuKaKnFWOwWPzWB+d+EfkXyPQ/LlZlwWjOz2pf0JQLYAQeX Ru+zMEJ1fJDJrePKU7ZF7KjMHd1kEGvLXvoF4jFh3I9EJq/PlhPb+lY6br0et8F23QoP OGAlv4Dp0eVADP2XlIZv9ijkpnNvnWCjZfAoDd/5jjOCLLh0DYoP5yjygJKrdhnXWY0s EpqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v1eyvKOl; 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 c17-20020a0ceb51000000b0062ffcb656efsi7126790qvq.462.2023.07.03.06.48.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v1eyvKOl; 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 1qGJrS-00082R-Ie; Mon, 03 Jul 2023 09:45:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJr5-0007Tb-Kw for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:40 -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 1qGJr2-0005iS-QS for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:39 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so40244425e9.1 for ; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391875; x=1690983875; 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=yHFer7VjnRbyKbTmhJ/jIDL23JfeX2bf67sUnbUfgAQ=; b=v1eyvKOl7Wl/dIJra8S9QW4B7tcwAoa4b3FUF/FQedog9i0o6c1rraL00TUAEjNUiG pyiKTbMOJzPG0tSTyH+u/bq2gJ0n5W09xAX41WRdTnd7sLiUzU6ZGVnaIkDmCDd0ZgmG R/G4ldIUlrAeBgyMJq0WzP3P+LbDNzBm4e8ssr+9RKwwiWACpndM9YD0sETXYWXaeygD tI2XhOuN3m+XgN5z8X7Lltdf3vlJUEf1cMZXntyGmoj3PGRI63AtXb3PQJUGw0W2bUG6 5MzNiProwJOTegOLgTz3WPWmVwZP1+9NSEkxw+/eN5ZmJvAnI65e5uiatrRvW1ReXYb1 hM0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391875; x=1690983875; 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=yHFer7VjnRbyKbTmhJ/jIDL23JfeX2bf67sUnbUfgAQ=; b=Ol7+Pg6TGXzlKVrdfjES6St9zBXbgU24G2CDAiw7qzXKUrxEasyxYoRJ1aNO3UwXQW YY/B53N8Ukj0mh6/v0EKoPJ8DwRzH+VkSmDxJafiF0fUkaMCDPIIwPktg1zoGa2qfIcY WGnh5Ba84KGc/Gl+Qld4VCuRtFCDIywDlzjq+2ueTqo+dCSZ4ALGycl0xMqSQEdNiTnQ /xUR/dinGM8GLMRcjud6RkKsQwEkIoBCLWqaUcfMcMXEHthYbZsN98vAD/Vxh30M8XtX AnmoEPu/apmUR4DiAN2eiP3oGk6Ijnxq26YFOKPXS4TDgN9u1+1c0xdYltnC0/ILK39V V/Ig== X-Gm-Message-State: AC+VfDzQKrW+lmeeXR6xqjDAwUm5VVcjlUFahfZ+cmJg/sM/oxJHB1Cj PAKWtlQymrnb9N4cpXI//6uc9w== X-Received: by 2002:a05:600c:2217:b0:3f9:c986:a2ca with SMTP id z23-20020a05600c221700b003f9c986a2camr8815178wml.24.1688391875379; Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x8-20020a5d60c8000000b003142b0d98b4sm6485318wrt.37.2023.07.03.06.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BA6DF1FFC9; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 17/38] tests/avocado: Make the test_arm_bpim2u_gmac test more reliable Date: Mon, 3 Jul 2023 14:44:06 +0100 Message-Id: <20230703134427.1389440-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=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 Message-Id: <20230630180423.558337-18-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698711 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763217wrs; Mon, 3 Jul 2023 06:55:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZXKIwuiUKyVRtdypmCXhd1aW5klnD6HzW6zsYaQLDOnw/6gwX4+gOPoNRXWdArboid08j X-Received: by 2002:a05:6214:508c:b0:636:836e:8064 with SMTP id kk12-20020a056214508c00b00636836e8064mr7663047qvb.63.1688392549266; Mon, 03 Jul 2023 06:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392549; cv=none; d=google.com; s=arc-20160816; b=sOhITtttzKGfn7HUfoKn5wOY80Q/PjPh00Ct0lUgaHBRTZYDT+GIEgKJmWO3VNtapy ZaohnAPnakmMbOGJc/lIKuOI+2IghtbX3nHCowRipdrlVzD4jHotYNfCezKa30hyKgKj Sq/4BK+9UQ0SByLQa4DO7hEnAmixCci8UkSEKlRW9dYH8zAaTJetQ/2NS8D9dWGOAs8d Cenwakk7VEMXKW2XhFlEcuaVMqf4uIAjk0uhW6OCu/oWVoQWEAl+bFEB8jY0lnLh7XQq K0nqJsrYCdg7m0oGBWNijBRX4hVZzu6UN1rZw4OiGTI1GAMFUL9iiPz50fID8y43SEfV G8rw== 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=BaNMUangs5gWtxxq2cv83Ymb8o2XEiPMP7DPTxDoR+U=; fh=5l4T6DKG+thc8P//09XoeOWVEktD75tm5BvYKR6Xu0U=; b=xuoj7SPEhhOPoHXQt3OtaOEmTL27ngBtShhjteC0T3v66HBANTtTMZDAtxSthSv2wl YWgr+zQwj1atFWs1eXbJyY0jfnif2cDJbljkp3c88Qkh3AJXC8JdE4GTPoeCRsIHWkve ASR3j5W4zYKj+rMEqh30hGRygbKNevsp53HNia0lIAihcFcFCkJdK4p9jUckErCJ5eRa Bmsfta8wRR5UAWvbNIEnvJqUp6Ge5fWQG/EytFJMAo2Hmja7KE5kFZoAivQUyv+a9eq0 edv7W0PD8hzillecFeg4rRf5lMb3+otlAzgEeSPl5v6QqEOCRIyfNs5OummqI5hJVCs0 a2Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k8cnn9ut; 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 iy1-20020a0562140f6100b00623951524aesi8903597qvb.206.2023.07.03.06.55.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55:49 -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=k8cnn9ut; 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 1qGJzl-0000Zf-Lo; Mon, 03 Jul 2023 09:53:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJzh-0000WS-Un for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:34 -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 1qGJzg-00082P-8g for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:33 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbc77e76abso40419475e9.1 for ; Mon, 03 Jul 2023 06:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392410; x=1690984410; 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=BaNMUangs5gWtxxq2cv83Ymb8o2XEiPMP7DPTxDoR+U=; b=k8cnn9utKjqhc/wB4hnl10+Vki/oGFcndUUuw+pIP9f/5PWw0lP4PsnNMgXLtH1O7W dTSwmCkvvG031Tsjw4akbpvKBa7EW8vsWknwLiozhYm5dN+oNiIqKZdCA9/x8WHCo4qY vWmKl2k3rrjmiL4GjBJCJT4vuwaB3N5feZlj3YxpDEw8OXqzwBZMMLc+1Ai8Rt/AQeZq cHze8c3tizT4kAN5PaAcj4m1ZtA8IMve1KnQaC7fNGamyfYsOlpUUi4/1MI0jT5V/t8z UXL7gMCGcaT04CJOKFXG8ti2ckYyrRIEanZKAybHs8bUcSqTKoex3o39bYOJsCzhPGb0 yFpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392410; x=1690984410; 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=BaNMUangs5gWtxxq2cv83Ymb8o2XEiPMP7DPTxDoR+U=; b=gR3JULA8Xwk5/IpvYBIjwZ6Jz0TpVUEFnL3PHPBqbPHxBCipI9tlxRuQrHMH5dFV5h Y65MxEaiUkbtkZcURQmWvCSAimWSZDMzB6mWHyvOKFKZdgtjU0gZkFgawS9r7tXWELK4 fMcYsEchQKNefeTyn47D+Cf1T4aGkLCG9uoUNC9vWfzUfeHsQZQRadAnwoyqAdUYzKqI VaX0f5QLgqJ889Nl2iqlAPrUBYggxcYdh6iye4DucqHyWxFNpHc2owVJWv0NcJWoG71u kNWskVbyT9CfwPiSVW+UynTRdzKZYTpwVA0Sv9L0WNxreHtcMUckT4HklH3ge/dluSRr jt7Q== X-Gm-Message-State: ABy/qLb3zCYJTWS9o0pkWUrpD8fBS+/3o1nIka6+RYO8PhIst7VRYBgv zJQdgMstEMzNt6GvKMAAQ6vIOQ== X-Received: by 2002:a5d:6305:0:b0:314:1e86:e75d with SMTP id i5-20020a5d6305000000b003141e86e75dmr8223727wru.34.1688392410722; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id da16-20020a056000197000b0031274a184d5sm25819195wrb.109.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D11691FFBE; Mon, 3 Jul 2023 14:44:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 18/38] target/arm: make arm_casq_ptw CONFIG_TCG only Date: Mon, 3 Jul 2023 14:44:07 +0100 Message-Id: <20230703134427.1389440-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-19-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698696 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761268wrs; Mon, 3 Jul 2023 06:51:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoQzCgmgQ+SBi4y54ot4mVQs5fMpjsjIuf+l1qvhlWysJm2yb3MykvKBiJKk6EKl7Ogq0m X-Received: by 2002:a05:622a:100b:b0:403:5360:1dc8 with SMTP id d11-20020a05622a100b00b0040353601dc8mr6188255qte.60.1688392275541; Mon, 03 Jul 2023 06:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392275; cv=none; d=google.com; s=arc-20160816; b=Qfgjwnu+6JXhCjMDyFdFp+uRIgF8E7u+99cgDryjgUT3b6wTP+R3t5B28pCGJ20ruk oV/knxjHpgSAvthSYT41MZ+MPBMPnjs34Y+rkGgmF//DBs9oe7dWxNruwKKFwv+ZYRvk rbtoLU7zPC/DlIjwVN8KJIkBgv7rctfAUuP3ncA5Q9ZUXPPE94CViZ16A6+k56tB1wLU pmBwHLmLEpzswS6zFC4/yZnntvMvECWzbDFgGFww9q5hapojZeAAXP0uhHdcgM2p4aVI C4oCxH5jKkYSL+00B1Oj454nMkPTM8dR+uSFEDg5OaIpHHt/x9x2v9GVQWMZOq/AZcm5 SufA== 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=fKTgq9uBhU4V0WOGT1hkvfyceDee9sFu3Y7Qjj/4CPk=; fh=IbAFnUuL6uYgHLsGBhhqLXJ8ZdpzgsP0s4K4TB6zI6g=; b=ZtgcxF9Z2OAmYgGMdCK+sydnP8R2jRUus/cTs6cVNPyLcectPOVca9e+23W3ote5Xy Br9/25xO+B2cM5ETNyGGU+knlhAamXXWdVRdodN8At+JRWruaedPQDOw29hzHkd4PB8b lgnO+IOxPUTl8RS5ZNilVZZWq3U4S2Bz3gG5NeEO0baWYpLJXB3C6RlisoHPVnnHckrG HvAk2BSizLKB9l4n/H51x3sS8ngKEOINvX3oudgLACdELUnqHAdy6vBqZ8OGu5bFJZNV Xpl7N/6rzjTuzrwX/eXFCtXUqRL15x0TdDWhlJi1q+Cs39GxzFYPhYjTuLJmHbYgTj/B 9wyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Y3C4P6Q/"; 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 a11-20020a05622a02cb00b003f719daf2cbsi12196189qtx.730.2023.07.03.06.51.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51: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="Y3C4P6Q/"; 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 1qGJrl-0008Pd-Ei; Mon, 03 Jul 2023 09:45:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJrA-0007a2-LV for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -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 1qGJr3-0005iZ-5a for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:43 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3143b72c5ffso431318f8f.3 for ; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391875; x=1690983875; 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=fKTgq9uBhU4V0WOGT1hkvfyceDee9sFu3Y7Qjj/4CPk=; b=Y3C4P6Q/5PTpF5cTEX3mp5wEAJJn//lzTHLzFWr0vsXQBpc4AOaPwACpSOcIyApUiw uMZ7NYpKaJLK/eh3HtGK/X35bly/oaMI7ScmoMtGnYQr2KimEIoIXBUBdapUg+f61VBI 1WONwTDrk/mekWtrMlzibTv/h0fN0XGSSWF9xKE/gzXLhc14kWPlYYvcNaguNsmeLRHF oM90w8Thhb7BHyam47gbJ8niwFHnwu3wzaSk/vN7tMbwLdj4/T3MQveD3/57rlxZ8S/q aVYKMvU1xPE/fBlMCrkkbRwQiU5n2sTvEJAyqf73kmZvnO2pOiAATubVmHpSSsWPfpoE V3kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391875; x=1690983875; 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=fKTgq9uBhU4V0WOGT1hkvfyceDee9sFu3Y7Qjj/4CPk=; b=CEX6lFPPE5hZBPXHFHp8cJ1Krz02XQSMJtqRF3xvClH1P8dcQPKIkqvTfP1NoEnbdG KV3AFfnD8wbdrEqOULR1kBpyS6qEnHmd2pmiONP8F/x3ub5+v5ami1X7X26i+r4uuofE fBNJ1fkkXpdq2PnPWg5vubhe1QT4CIPf3X+WWeH4dX98NSYinZTKQJnnt6OmOLQqXeSX /BvmlbEbPri99Z5PEmkXMJ7F1YmLUhv+QFQcBGhqcEZeVVgmadrcXHxhLnHSj/tpvt4s SV2gQ31sWXc43xOWCL1PO55jKFySpAa3tAl/b4TB5EiuwBQdzqj51T8+QBimxuHmtgMP Vyuw== X-Gm-Message-State: ABy/qLYfJTR1Ke814z5CRGHKJVQbhfccCPHScVs+FJkh2CLfL4EYwwo3 UCDhRXcs9sVDLSWhxSmHyAJgGw== X-Received: by 2002:adf:ef12:0:b0:314:50d:4540 with SMTP id e18-20020adfef12000000b00314050d4540mr12164308wro.18.1688391875602; Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c8-20020adfed88000000b0031433443265sm4152449wro.53.2023.07.03.06.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 070C51FFCA; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Robert Henry , Aaron Lindsay , Paolo Bonzini , Riku Voipio , Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Yanan Wang , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 19/38] plugins: force slow path when plugins instrument memory ops Date: Mon, 3 Jul 2023 14:44:08 +0100 Message-Id: <20230703134427.1389440-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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) Reviewed-by: Richard Henderson Cc: Robert Henry Cc: Aaron Lindsay Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-20-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698708 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762878wrs; Mon, 3 Jul 2023 06:55:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlF4sc5GYHGPGOAQRIXRboEXuaYWjKc3pz9h2ZOEAvwBTMwBQ5Bf3GwCA7X7FjuqErCeQi+q X-Received: by 2002:a05:6214:629:b0:62d:f3a6:872f with SMTP id a9-20020a056214062900b0062df3a6872fmr12851547qvx.5.1688392506232; Mon, 03 Jul 2023 06:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392506; cv=none; d=google.com; s=arc-20160816; b=ylMP+5lFoSN3/fDlgcGTuwd2Uo0V4o+p7AvriF4+dB3CVpDklKBPB7cAU6LvLppxdT IAQhVXBHX6TRi5NsWXdwgtlM5FTTjmh+kGZnuyz1wr0pE+YkhDx0+has+0t4E/z7ushV vvP1Apo8F9aeWpX4ydF2NRTbHj7UtyYjTOKdejFVW5U4xaZaZyNPW5OVFoKYH6R1fNSF DDo1wtQwba7ptJrhe++9pWXQ7Yl65Po0iJdRaeAft2bTXNWPvOlChFR/4y6sDo84T7Ca AuLaAOdEB1sezSLHbXygHTre6BFRsQ+A+KJp5Wzn0obbvUq5MUZ5H/e0fiRjHiKVd4tq tCdQ== 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=p5nvMYyOs/RyJESBlIkw+wk/56rg5wafIOTXXNkBqK4=; fh=ZwXsvvL/nhd+Dy/uiMZ9/V2BSec0K8VCXdxuIltiAz0=; b=qarn7xPT2ZxQTtcJ6pQQCVopkaGdJyXhtVjlouc8VC3yqq2t2bqhwfSdUcvr/9Qvyd j5VQ6Xa3avzn5cw4ZB9PeqrW2uisIVkSk5F/sbD5JGGXH6oNwvH5r2pz7a0pAXNw50hC iQUdvSgvw18jPpXjhGIUgpbwvhXogIsbj7/hiUaMmrP2O8dHcG2iTe+MSBrym/HsarkD st6q9OuN+ccqkhbWRZXQdbw9oYr90zrNrwxv1YJfJCqm3PeMC6twZ3nccuEl8esrDpoH qC+0ZucZnwkwQIBHc2JQ6d3MVDdfg9ko/HpE31vwlpVq/SvPCTqUDnVpR3E6Y9uDsSWq X+dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SiBLqXUs; 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 a15-20020ad441cf000000b0063014e0981esi4537598qvq.290.2023.07.03.06.55.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55:06 -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=SiBLqXUs; 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 1qGJzk-0000Z2-6e; Mon, 03 Jul 2023 09:53: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 1qGJzh-0000U5-2t for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:33 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJze-00081q-UJ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3143493728dso1563669f8f.1 for ; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392409; x=1690984409; 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=p5nvMYyOs/RyJESBlIkw+wk/56rg5wafIOTXXNkBqK4=; b=SiBLqXUsUkT17mP2LOwb9c/Io2TnE42YLGzLAImcJIhBZPNoqUdg09cJ7YiGPKvZGK raPWHj3rpnLkilKipOlvIy2Z18rP6Z3VZaNZVFwD7KZ9UBorNrVO+BY03pvImgvw3yFN hMumBlEA9dgj0CDTBXtlmlElQydKqklvMHOGX5gKNYwlFhrSOrfvQYzFIL6JvN69aBHi OLNv/c/RYrh5p1e9FBOtHzjz5jRaboi7oH8d9OX+6RoU58i/tx+D/i87xoFiKSmC9WZ/ du6zx4ChaY7W3kwK6hMni+H6izt8R8CepGGY5WIxwfk9CEXf1dTI18grufjxGn/1Cfam XCFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392409; x=1690984409; 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=p5nvMYyOs/RyJESBlIkw+wk/56rg5wafIOTXXNkBqK4=; b=e4HZlCmL0CLh+HZkYr5YVSvwu0SZ6VuTGA+zXcPY8MgMsSbEbA1XESNi+NccMo2Cp3 VymSTVu5i1Fcxgug/ibnqwtiDVd/iTP7OCtjKRI8HOE2Sn6Opkrqan0jARF7itMbL18x DaVtJRSDUP3EuDkFzYP2qfBwEljKa0rt1ifuTRbcZT9n2O1jKU0pL3OxmFZ+alrWDZre msgXG1Ynj7SUIxnh92RayP05zXlRpuBg6506PMG2oYHnp5H+89fHZaNJVqEmu+BJ/xYl DkRB55PDIk1cU6UFbU+c8d5VmSUygCYkgusl6sDabPnkeIEKPnL/A7HNxTTVylP+hII3 o4Xw== X-Gm-Message-State: ABy/qLac/0OM8UVILVzOG0JhlMyXfWLgo+D8/fLLe7N0t82iY9JAdzQc UL0YphpqJRInzLMz3HN6K9h1/Z2AX1MOvPzAAAs= X-Received: by 2002:adf:fbcf:0:b0:313:ec5d:95b5 with SMTP id d15-20020adffbcf000000b00313ec5d95b5mr7438787wrs.60.1688392409301; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cw13-20020a056000090d00b003112f836d4esm25491334wrb.85.2023.07.03.06.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3C44B1FFBF; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 20/38] plugins: fix memory leak while parsing options Date: Mon, 3 Jul 2023 14:44:09 +0100 Message-Id: <20230703134427.1389440-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-21-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698691 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761118wrs; Mon, 3 Jul 2023 06:50:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ykNeBtgYqjkTG1jeJKeVZOvjBsO5ffSnsOa66Kzurc9b7hrYL+1LayC5BC3Da6+WxJwbU X-Received: by 2002:a05:620a:40d6:b0:765:3ab9:df8d with SMTP id g22-20020a05620a40d600b007653ab9df8dmr12403865qko.32.1688392258911; Mon, 03 Jul 2023 06:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392258; cv=none; d=google.com; s=arc-20160816; b=PLwk5lMVySfxMTYW8Y8KdYHU1OyYZTWjWE2M+fYGshFYcweRxGbIMeuCpgXj80XftO zRd63XHL8Z/JiXiFgIuja8AYYSepiPODyQ72s9VmXX/aSHCKLDrSMh0SxmPwupIXUkz3 EiWjbLt1VpIkea5bT0kV8JgYlwyNHci69FKRorzBiP1lASWyqNed9RK9YATaqoW0zrkO jvRWSClRvPKUYb1THkEj5PfNaN64FSAAvPOhbv90ecIFP0jmWK7N438zM6Pp9oxEvM+8 tlWeLZ61fN086Czfgt15RDZJDuiPQQ58CtRWygy0FGidpz/MhB7ShWuva25bPOfmxGwi UUHQ== 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=LKf4Hmc0LoALYt5gF/daH2iR5ELuErLCAXXDVmfzwLI=; fh=ZwXsvvL/nhd+Dy/uiMZ9/V2BSec0K8VCXdxuIltiAz0=; b=0V0ETn0vVp5CGtpLc/M9H5v0u4aCd8o75shb63EK4piJThtvYcdHP5xsU0s9GBhiSz inJtkC5nVTvPnUCgdxOgFb+mIpsel9hS+clJ0XSs9kF/Utdv4WJy+ln/TtGcnis69+Hf jPt716aPEay7wRrOiOElwFTrLRF2W9LhBFXUDOpTLQS6GD+JAdN2/NbJWqDA7Ju2XoUD EqRQgis6kNueJgigFbL4TD5bdDTsylYXHataRhq+pvHVW6nu66cdtgFmkxVVhujBzKAS iPh4joKEn1N/duObxP9shgXQXAdV2PkbIdrrDnFtvdOh6tZfHeUOEfL6pA3rdtylXoPW Tj3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C8Yloh7H; 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 v15-20020a05620a440f00b0076719299db2si9887707qkp.571.2023.07.03.06.50.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C8Yloh7H; 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 1qGJrM-0007xP-MJ; Mon, 03 Jul 2023 09:44:56 -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 1qGJrA-0007a6-Lk for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -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 1qGJr3-0005j7-Pc for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:42 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31434226a2eso2173446f8f.1 for ; Mon, 03 Jul 2023 06:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391876; x=1690983876; 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=LKf4Hmc0LoALYt5gF/daH2iR5ELuErLCAXXDVmfzwLI=; b=C8Yloh7HfS9kwwuB9RSijUKO3Qja1RNkQfSB3egVPGBct8nlLfWJ8nKpcMAHPU2KP1 iSvU2+O0L8opaVxfXV0frCcq3jTTgiMNUk+bxL9e8UHjbEHDRq0j4EHmYxpyceaqacO+ mHT/dPgODtslOiLaY/cNMeRbpHFn+M1UXEPq6xpvO+JEkla8jMytAv2/T1ZsVNS51hQx csy0b8/5FcePfwej0LVUZNWaY/qkTXyy27V86OZ0QJ1cjEPt/P1SarJ7kPPeRt13dHaM CZ9cXOABKFqHGBHEyFwP1MxEbLM2bslyGZg0fetZO7a3prklY3F/UA6AceN7oMdG0nd8 asFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391876; x=1690983876; 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=LKf4Hmc0LoALYt5gF/daH2iR5ELuErLCAXXDVmfzwLI=; b=SLgtu7fM9+/jZ0oA4moRWest4/MuSVHcQeKJ7Y3Aa5p2YizU6MpskOsEXNxYoa+Y5z C1uKOdzorX5dq1U8Zk/9lMCTgM3IdcazOd7fs4jp3gi6Aags5JaVnpn7AQnpPDFhK75e h9LGIWv7OKR15LGQZDU0rPdhOpFP1eqycF7VOgFzQCztmMNnyDWNRv0r5PL2cTFRBibF JbuOUPUTrFEWJY2Z2O9Q7+nnbsJmMx7Fq+WrfCLQfxsHwO+ffO1sZud0rQ8BXTAdhqSc ibZIahULIO4tGJDxHDje0LBHyQqwjVW6WN+sAOTytt/gv+qKIVyE0Q2I77KVbGMr+unm YZJg== X-Gm-Message-State: ABy/qLYxM46SX+AeU9YDLZr/NFg6pSKc9zybHk+vt8grYZD0rO6tKcFw vtgTpgFzWZZMHs3+lMcRvi5aLA== X-Received: by 2002:a5d:4f08:0:b0:313:dfa3:4f7b with SMTP id c8-20020a5d4f08000000b00313dfa34f7bmr12893609wru.20.1688391876524; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v1-20020adfe281000000b00311299df211sm25652592wri.77.2023.07.03.06.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 541691FFCB; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 21/38] plugins: update lockstep to use g_memdup2 Date: Mon, 3 Jul 2023 14:44:10 +0100 Message-Id: <20230703134427.1389440-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 The old g_memdup is deprecated, use the replacement. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-22-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698701 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762555wrs; Mon, 3 Jul 2023 06:54:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6V1geTIkqHZ2lLiYpMBhB5nO9w3wvqea8iuxgYpde7Ou755oW6sHSyA/1L0tZ4m7Z2rvuO X-Received: by 2002:a05:620a:6015:b0:765:8f07:da31 with SMTP id dw21-20020a05620a601500b007658f07da31mr11697537qkb.17.1688392455965; Mon, 03 Jul 2023 06:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392455; cv=none; d=google.com; s=arc-20160816; b=qEFEFPPUJGCZY1AenU+POWQoL3X7fZKiQrET17Qqa02U3wu2qk6ejEfVNoOundVsP5 sSUUSeCQq4RixmqGT/8iGDAAB85z5ykDIVn67aMKm+oOd5scTIFgSxCzwMMAEiRr3Axz Wr5kCQugyDGajd6PLEObjen66L74vvOJ5OzRpovcYk4DUg2ehmYccCIqH7JXuPzhGv+W MVYOuN+sSW4w+yP7mFw4KIktY7Lz9/1auDGW2VviBHQEaremosA7ZsUmjNBC3EjsNPok UeaBAumEwZ/9immAcMuZVGlsT/a9cUvMVN+WrvZ0G5lG9jyFCzRSPOFQWtcxYE+YhFeM 4xQw== 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=yWju6yYypmjiS4eVFMrIutfDiiFuiOcYWn1zgF31IBI=; fh=PBG3aQNbKjf/NFWM1qxyee0H3D/9r4Q211g07xhdiIA=; b=DAk2dtvDZhaei52gxQQ4fzlOVK+j2XTPKaJLzBCQ3yUWLow/TrKYsEq5IyXaDsq6F9 +Q8Xw8TM2w19siX2+cYiHakhTgHs+wNfnW8YErc2OwJ3flIkLuZhjwCfKjR9uiNJpO/r SfR2HzBvqrS+EybTNAZGLWvU4gIHa1rN3dXzVM2631fhP11LoxMB6+63BzcSa/2GVNXI P8HvLTjvxRsLO5Ykm3PK8NTzDJgLC0b9FIPiniqGhSiWHH1Go3sbdQ3Pjeh+elm+ER/G E/SPOU50qQAXz4GF2vOzSv5rxabvX7+UPnvkSqsyXRcQzAMwio52/BkQpmdU6sbkknHD k8Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xrzSzRfY; 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 o2-20020a05620a2a0200b00767162395f6si9903254qkp.435.2023.07.03.06.54.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54: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=xrzSzRfY; 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 1qGJzz-0000mX-Rt; Mon, 03 Jul 2023 09:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJzj-0000YP-O3 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzh-00083Z-WA for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fba545d743so59792615e9.0 for ; Mon, 03 Jul 2023 06:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392412; x=1690984412; 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=yWju6yYypmjiS4eVFMrIutfDiiFuiOcYWn1zgF31IBI=; b=xrzSzRfY+vom5vaC6PYW7WykOZ64DoyCzdCCVnthZkbjpbmkA89J9ZbXtX4jIk2fq/ BonZpzh38+kGtYkAsqofM+XUhctN6qIN4PT49GbjHRxmdBYCOEOBHo/r3Lhm2kzJUTbA YAwqMW8W/+MDOujgFO1gJBCz2+G1S5i2JaHrlLL9pEKbCvB21s2pDfhuG8EE5AJvxy7U 2uqUZWI1ACl79OsUiwn153hio9GTrYf4B25pbFg5AK3od/jAMlwRo/tehqVcheTsFYGm tK4dwnXhHQbX/6kE2fjgXklJH8YmDptjgkUV7uGm7XLF9tuz/p1KSn9jrcIxPPfxe761 6q5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392412; x=1690984412; 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=yWju6yYypmjiS4eVFMrIutfDiiFuiOcYWn1zgF31IBI=; b=QhFcMBjP865EPdnNKAciHzGeBgY4EPW8VRJJVgUG2sdjBvbwj4fedg4EtMA0HlPPX9 aAUdeSwEw0cQpcvZE1BAqOl8vL33JtEBgDZZTlyiRCPO87wKQ0QrO/U1LvB6IzyT1d6e +bCBUVyTGrc9MS5WUWPIIpDgVji28U9CUO0pRNDCWqoneHNt0eWRaDdQWH+P6tr7X/ry lKxx40wIufLVq5rpoqcg9Q1RdciOm8liR5Rg/SgdjfuAa0sMD96iNLnIP838AWKUx+G5 KOm4jBAT2CV0VTF4FWXgfS5gEkkiXyfdXOMFTRM5mzGx0p8bjecFDXXd9W9v/n1ZPuyv p0FA== X-Gm-Message-State: AC+VfDyO61yBB3P5FqWpTJJ9FnupaseFHMoCaGbBVQ4JvPOhYEzwQ9Yy REjps/BelTNGnnLNRz4Ne8L02/uB7R8+dmSmxgE= X-Received: by 2002:a05:600c:2213:b0:3fa:e92e:7a7b with SMTP id z19-20020a05600c221300b003fae92e7a7bmr9739218wml.15.1688392412706; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id da16-20020a056000197000b0031274a184d5sm25819253wrb.109.2023.07.03.06.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 745451FFCC; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paolo Bonzini Subject: [PULL 22/38] docs/devel: add some front matter to the devel index Date: Mon, 3 Jul 2023 14:44:11 +0100 Message-Id: <20230703134427.1389440-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-23-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698716 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1768069wrs; Mon, 3 Jul 2023 07:04:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFH5LCrx60z1cdaObL2Q3vWmFYiWfWI039f4dre8GxX1eK8BujJ974LXyoeV3PYJhCUYlwF X-Received: by 2002:a7b:cd0b:0:b0:3fb:d1db:5454 with SMTP id f11-20020a7bcd0b000000b003fbd1db5454mr4865623wmj.35.1688393076267; Mon, 03 Jul 2023 07:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688393076; cv=none; d=google.com; s=arc-20160816; b=yBX9W7WREWXUatrhNb/Pbc/oCLdffUYsfatLmihklDJZzaykY+4UWvv6a6xtofVfzJ EGZkxJQpmRZ/mCDwcuv3wXIz632iQ8V6lGlD5e2L6Y7VYHFvW+HKUOjlE10GLc9dolnu nin9FmJM0FKXXjhvC/gDQjn/aGm0WukXYtkibTNgpi9jF6zPiHVyetqGuRCIIU6FRxkH efC+WdIzic1PPyywup5blkaClar3JrEDGwvjbCcMUkXqPCqvhLawsGvnqG4yVDZDj4Ls vwgUhvyKZh3bNbaKNi7BvOGLMHwjQFBnj965ChLw5jJx8N7+0ffVN9/UAtryNapBrNEh FStQ== 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=cQkmXVVKUzbF6+OR87LtMoCxllrcwffkoSGo6NXeAog=; fh=C4nBcyabfogjfietTpwNYf444hhAP25h4cKmWJxWOBI=; b=UIbPxaHTllsllfBQAaBN6q8PPX+B7z6BmaJDiHMr/DMx+eYN92rBFkcW/Wk6o1jvmi vjism29Jx+V03TMYDjE/oBFnNjzEw2zMAMKhGr6mpVM9/ghknthiy6aCjb+jkNuCUY5s 254gga01eCfyOcF4ltB3q8m+jysEvQIIJLrRCiBiy5YU/TltEgYBA/OJ86aEWRuvHsbL 68HQcuyKuOzbhIvxUXXJuvwy8lV3IrymG4LGjGtsphVUhnIylH5dTOSrNVyWUMuNobxk jEzhABPVCfzbqirFWJO8zYWn88Yu5crNwbi9W8eDWFW9DRdpfKaP5MPHsSqep+Go3AnS P2XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lLSmml+L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l8-20020adfe588000000b0031438462cb9si1241312wrm.156.2023.07.03.07.04.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 07:04: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=lLSmml+L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGK9R-0005f0-2R; Mon, 03 Jul 2023 10:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGK9P-0005eU-4t for qemu-devel@nongnu.org; Mon, 03 Jul 2023 10:03: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 1qGK9J-000323-Pe for qemu-devel@nongnu.org; Mon, 03 Jul 2023 10:03:34 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-313f1085ac2so4988460f8f.1 for ; Mon, 03 Jul 2023 07:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688393008; x=1690985008; 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=cQkmXVVKUzbF6+OR87LtMoCxllrcwffkoSGo6NXeAog=; b=lLSmml+LsUgmELhfHKlmBppLRPcP+ic8+Q0VsAjN/fXF8OMrGnJacgSpSX0Ysfckfk cdOur8Znhv4V0NMMQrnbyE4haN+N9mtNa8aq/2us83TitQe5Ds99Zfvik0uTVIa8OUPO 1sXryrHVoKsHhvpoFbrISNOuE+dLk2ADZRzpWgsfRX/M2fioWynULeK9mIkPle5ogci2 fezhuK6rpxTKlTV9CPQtmW/BPQXz+fTNsP+WMne+VRepBb//Y2X+cXrjcc2uQ2PVlugP IgycS4GSov2dqz90qy+wEOsNuSb32ZymiRuvHarBaZEd5QgUvoNCeolHWPowvGsPUwsq 06fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688393008; x=1690985008; 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=cQkmXVVKUzbF6+OR87LtMoCxllrcwffkoSGo6NXeAog=; b=RpHbb/hQipQJ73PeVK3n4PZgwVTBZaS5NZDTxrS2MXWsUomuJoo3ncLxpRoGHrPnVi LrtfbLcCaKTMSpw3aRBqnrPD8tu2NXthGOtzRehzXzyFztZSZ/vk/9ar81evaLWPbFmh LTVERBqj1AIINkcGowgzcx2whSQ/jWjWjnN6P2Q1YYlAJlx64cX+02aaf1prV83YFA5i Jtj2QNWKuOc2NS9y5CausIGJY/HcStZ7Q1wxhKdkYowTpyUQXu4aKdINiEwy5Qp2WFqy skMhZfgue08r2k+zKKcEvurXwPK2tf6HS5CBspNadvCzZhlokM8G9teJvqQ8HD7NnWmY cdbg== X-Gm-Message-State: ABy/qLbdg1CEm9qkQ7nG30igLYtnJjC6mxGtWgtmCKPRND5busIfOTyz ezWf8yroKxSPI5un62GvmfvmLA== X-Received: by 2002:a5d:58d8:0:b0:313:ee2e:dae1 with SMTP id o24-20020a5d58d8000000b00313ee2edae1mr7762605wrf.18.1688393007868; Mon, 03 Jul 2023 07:03:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c8-20020adfed88000000b0031433443265sm4194573wro.53.2023.07.03.07.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 07:03:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8CDEC1FFC0; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Leonardo Bras Subject: [PULL 23/38] include/migration: mark vmstate_register() as a legacy function Date: Mon, 3 Jul 2023 14:44:12 +0100 Message-Id: <20230703134427.1389440-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: <20230630180423.558337-24-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698714 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763501wrs; Mon, 3 Jul 2023 06:56:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AV5zg9qM/LkVhHgcbb+ecAjAZH3MrANcIneFLbNaLLrtWBT1+JcPJBRfKR7qPkHJw8+J9 X-Received: by 2002:a05:622a:594:b0:403:3bc1:54f0 with SMTP id c20-20020a05622a059400b004033bc154f0mr11634329qtb.5.1688392591484; Mon, 03 Jul 2023 06:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392591; cv=none; d=google.com; s=arc-20160816; b=EX5is5UU6T0meIwoJqF87/si7JOOPweCv1c43ryi6k/PpLP8Hd3a/U7cJGr4s7mmQV Q7lOQoW1PEaElUK24454xiNJJYy9/p4pfpWfwoICNJDs7Z9O8uMaJ1LKhdWhEme3Tpib B8l/9bLqKKmkPTpSeYFtIceYid3+U/kOZNohseoMGVwOWZYC6moNcrH9xS1KQt/cX3Fj vRSG7ZcGk5GllwfDP1o74bjMsSr4eBc6tf0QOvsPEgd3lSFRcyAf5onhyD0jJyhZyeUB 2VSn3L09z/xt4+ofy03KRSs1C04e39G/JpsT/q4fhX4eSTrVOVn//Gn/S5LvsLBDrGsV KsXw== 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=yXoqNo5zhMfqN+q9Xb0Ld9NmVD7yxr6uP9Vn88g3zuY=; fh=NG/rP2sJxJChqAIYHK4fCILiSdPGVutAutCSGEt6+0c=; b=lgpk6vmA9ucQ6dGA5TnED98bv3Z47/+Rcq53Pkcpek975hOkqe6Ql0t3pcsqwMlrMj 2A59A7hu+uNecJ+BuNWMZfUwKYvxZdw61X2c60y/B4eZTGv9A+i1vkVt/8hMKm3vJR8s aPw4S7AfeNDomonoBUWH2Ha0ueBVxhyTdk8N7GacFhDRParzyjCdW+TStp8ipMe8XKlV 9Pk++Dp70Yh2d7DPFUoEOM814C3VsFncLhEAB/Dlfuz9q0tGG/SH4n8iEkxVrXeqz5Mz pVEKwlxfjFPLBgrKlBbZHR/iafa/rIgcV+MZ+37mgAv/PDROzwaSePVkUA60OrAeBAml 9hbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chWfElKb; 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 n16-20020a05622a041000b003ff429a469csi12000261qtx.778.2023.07.03.06.56.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:56:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chWfElKb; 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 1qGJzn-0000aN-Hl; Mon, 03 Jul 2023 09:53: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 1qGJzl-0000Zc-Ho for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:37 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzi-00083N-8y for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:37 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f122ff663eso6898953e87.2 for ; Mon, 03 Jul 2023 06:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392412; x=1690984412; 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=yXoqNo5zhMfqN+q9Xb0Ld9NmVD7yxr6uP9Vn88g3zuY=; b=chWfElKbqUT/CCNrrhn8XkLL5hD5x5OzVLzrYAdrtIlXkLTn9PBQFil/wKz/jGs7hY 32FvFw1I0jGJ22RA3eCXz7M+Mg52CooThkJ+0SFbXdbFn9HbwRvoZSKX2k1ta3tsb3hw lsAnQG7jB896SAKfZQ5KEc8PNNHm40Xfu1Y5wpOCUmHp9P3pj+Ac75KX6jz2h/MxBlti kT0R6BtlFS3O0i6uBtCE5eQgm0Is39dy6b17C45bDt/CXlbh4qu0r6D/nl+OQG+3euB/ 0zXsZJ2ioCsLUTe1MUBL+J5CsLbbgTMuOs8HjdxdiSrvCjNFk0vBXIaNyasGRDwrPyxk pjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392412; x=1690984412; 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=yXoqNo5zhMfqN+q9Xb0Ld9NmVD7yxr6uP9Vn88g3zuY=; b=Uq3kPyh75H+4fqkcD2liKpeKwXm7xvmJnQNtmz3VVu04fRCJYyM8MX2+uzX9yeV6kW oBsnjhv44+qIUv+lZqDihWjdjvuIT+9mJVLw3vXI3VHt85G3FSHDwFTJ+125/C6eOUW/ 5/eqVOZB6ZqUByuFLiaIYKB15ESrvFMO75HddSIP04h08daNMegHkvXUmRAd3LOHE7eZ IbBdYqJA022NgZu+fYRzLRWAyWTzgO57PiHdtwF/opH3hRjEiNuYJPDXcgqF5az9vims XGhqBVkmBDaaWsSKZ6uTJsITTTYvU4AQudc/tILEOQQrJAwL4KIb3PvVEdH77ZRkw8oo CcMQ== X-Gm-Message-State: ABy/qLakZXHCMVCQlGb36/G7XEaHLAk01ycooyCVF7Fs7NgNA5G6kZkJ bwqp7wRp1YCFBOQRJRrs7UAomg== X-Received: by 2002:a05:6512:619:b0:4f7:6a40:9fd7 with SMTP id b25-20020a056512061900b004f76a409fd7mr6730899lfe.47.1688392412019; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b00301a351a8d6sm25812343wrb.84.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A901D1FFCD; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 24/38] include/hw/qdev-core: fixup kerneldoc annotations Date: Mon, 3 Jul 2023 14:44:13 +0100 Message-Id: <20230703134427.1389440-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-25-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698715 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763516wrs; Mon, 3 Jul 2023 06:56:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlFgBtaFH8Uxxr+Xoy81gjLX3YnsBmaT4E1sLOJPebbY5Qv6j+/3b0EQCwJa2kAII89213dS X-Received: by 2002:a05:620a:199e:b0:765:ad52:7a4f with SMTP id bm30-20020a05620a199e00b00765ad527a4fmr12401449qkb.59.1688392593045; Mon, 03 Jul 2023 06:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392593; cv=none; d=google.com; s=arc-20160816; b=oHDRwGE+g5XatD9wWesBsvkAG6rWpEkpS1eQe+2nvnLc26VcwxuV2x2LvfvM40ZX6O Sduzg8Ks26UWRSZb6OsDRW6Y6ZWF9WnSBTx12dtInu1rId2+1KSdBikxartbDHpEYLq/ iZlQEVIEBx4asNT7998bW71tC0g43FggahWfbpR/IBM7/AGwwnXoNjVSs8oRYoqapmNN xPGsX94bS6tMg649R9iQbhQkokPhnEyd0Srorb0oU3nxlbp4I+cIMVAEi3GlLObBAMD0 Wo7SJNnhprH/pICtpjo6K19xHFsz9PcU6OvPvYibpO33AbwKbTzY+zTrFkKlL1oZ8tyZ GSwQ== 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=FpruFFgP8xcMdCiQPGu5amTD00E3kD8SzCu5zRJBIyU=; fh=kuKCmlg07jXrd8aNqmYasqXcFeZm8b14dP/IpdTkjzE=; b=BVmkeaMa7E/vtqMorFVVNNRaBJDgSlE1XB+XfmgXWSGp35hTgyAFbXMPNTyjkVVls1 6gPdBlY3C91xJYIrBvL0Q6UOiF5Ka2t2Xe58jTrBn0rSGmbKHtnTNVXrjsJAiJkGhr0t xh1/p9yTMQm+hz49wgC6o2+uaHuzyJIOwRb0NaQQtYcLEKdzfSXJDqsz4s2WjK4w8mO3 lPJRaE/hfKKi5ozrCmKHwVndaQEBDNG/hFCZi65MCQDP3uUmJoEb/2PmImUdQKYRwseK T4FnZGJxr7qHy+2qUvADNDNndIiVtHHTzjk+OASnHUVzODj7Gg7svHhs6qUutxx3yrnT xgCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jY20W9h4; 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 tt12-20020a05620a3e0c00b00766e43021b4si10012024qkn.132.2023.07.03.06.56.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jY20W9h4; 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 1qGJzv-0000jI-FH; Mon, 03 Jul 2023 09:53: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 1qGJzi-0000Wm-GX for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:34 -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 1qGJzg-00082V-FW for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:34 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so31245225e9.2 for ; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392411; x=1690984411; 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=FpruFFgP8xcMdCiQPGu5amTD00E3kD8SzCu5zRJBIyU=; b=jY20W9h4He/DZmm1RoxtgLDuURKBc6eTUts6ucQxCXljIDzhzJCbKKO/bshdDrXeft 7JDnbnXiP4CB8JP3Z/1lmuv4Mag+fjR98JFcvbLUT+HGNVdaYktBozt50VbkdKVyTKXd h8umoe0Mcis0tpBIY8BIGC7jDIbaPkLebBquLjBTbmjD9f60s6VfJTtc3GLrlFj6unsk h8QpH61qN2zYHrRXuXNfsydpsAQPi6ae2CvpPpT1JJReQI2i1JQreZXhUcw9kQkUtPbx qjO81ZW3B4roNHgiun60keWja0nYILRa9R2sL9/xibaXRwliu1DxwbyyB989+XX/9XYN YpOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392411; x=1690984411; 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=FpruFFgP8xcMdCiQPGu5amTD00E3kD8SzCu5zRJBIyU=; b=Bum75Td3TUAjktPMy0czv7Ir7MJkfJCBjNnYP0DQ/D/0fPMQrCYgTyZjvPI35yMqtp bqUZ9+NX+3fxoSOM2YcpoAAlCeOrHC7Bm4I97Lb0+AlCcif+MAViJmWIlbovBUZnqcXc zuoBfYkHk1tbfvL72gOiQVl0f1LFi/wmJVUrkrZ/hHGcpGzbpW0G7Gs3mI2QVbyjiMD+ 2/dGHHX5g26uSCPfI5jsH59qQuM0+q6/yEpSz6WU1EYC9FQl6Te/K77egZiuyZwaLl04 o+HXGTJd89b0JxWKNydhdpzxOwnNddhAgzCgGGtmvr9Q9i6woaxoScoDQqWpX032tO+L /rzA== X-Gm-Message-State: AC+VfDyu4HaxxeQOkktC6lXVEBl8/XUvvheatiuBllccrpp8PKeuPAUN nzUyC8/w9if5rvKp4XXiAKpzrQ== X-Received: by 2002:a1c:4b17:0:b0:3f9:255e:ee3b with SMTP id y23-20020a1c4b17000000b003f9255eee3bmr13612988wma.30.1688392410893; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y17-20020a1c4b11000000b003f9b24cf881sm29873522wma.16.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BF8E01FFCE; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , BALATON Zoltan , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 25/38] docs/devel/qom.rst: Correct code style Date: Mon, 3 Jul 2023 14:44:14 +0100 Message-Id: <20230703134427.1389440-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: 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 Message-Id: <20230630180423.558337-26-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698702 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762658wrs; Mon, 3 Jul 2023 06:54:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PU6gVrFrpRXQBctVLYkZydkOkPSFuy7crf60HLheprQmZYNU+KT8KqKjkw3wHQlpuKjae X-Received: by 2002:ac8:5b45:0:b0:403:2066:fd11 with SMTP id n5-20020ac85b45000000b004032066fd11mr14124987qtw.50.1688392472609; Mon, 03 Jul 2023 06:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392472; cv=none; d=google.com; s=arc-20160816; b=nVu8mleyfo2IHa5CrcSoKxxFbmxwMgzhPO+0jbBfY8FUmfOweQo+L00NmaEO3SRwfo OmbE1m0uWs5PN52Mz/Hw8JAzNAqKESZsZjLFJE6VoYrJ0mnP2OKCwc0+0rlTR6ur5oiD jEj3EEznO5l/RVYNoUWE99mRDDjT3L0icIksAzYeRj8PgASbeCoFYamZOEo4QR7ph8AF twEplQDwhgfBrwCd/MhV7NpU/9myDeAkxrTeKqa9IsvvBeCIIr5eXEeq2hmaxqelRDIj J6AOCVmVrvmctoFL3K1KLLCp892sxbBaIbeROaxr2il1H2AfxyaPRLb1b0MvLGRjlZgA rVmQ== 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=r6+iuI2PXGCyiWs8rbXeGtlJGrDRRAokHBPFrSzxP8Q=; fh=NG/rP2sJxJChqAIYHK4fCILiSdPGVutAutCSGEt6+0c=; b=TsA6G77jqTvp/yeiVoZgNe/sLZUMn+2IR1kSrvwgiM5gjHBd/HG0M1saKxwpFRR/HD suGQuGnGaxpDz3S4acbrnANfSZeiLETyz3IDgYt3ozDT04x+R2c1T20QVLNGTi4vhoZf DysGYMAWFaotRD7MmPdJkv/ml3p2aRgGJoFxb3XwC16inI6OjlwqvtCromvX4giIHsOK uKGMnaWhbvlT785ohDak1+dNEz6uJi3MGWUJsC4jcTTTRO1BkWzGkrVn5wYJxwuv05k7 V+vFVQtJOe5xNGY+z7yBdr3hSaxaHGV04pTmdK8ZemWbHMEuQnr+NhB1p2f5+HBfADPv YiXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RPh/NAo8"; 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 j20-20020ac85c54000000b003eb14b07a6dsi7094112qtj.125.2023.07.03.06.54.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RPh/NAo8"; 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 1qGJzp-0000bJ-5p; Mon, 03 Jul 2023 09:53: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 1qGJzi-0000WU-1F for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:34 -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 1qGJzf-00082G-Ql for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:33 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3094910b150so5196687f8f.0 for ; Mon, 03 Jul 2023 06:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392410; x=1690984410; 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=r6+iuI2PXGCyiWs8rbXeGtlJGrDRRAokHBPFrSzxP8Q=; b=RPh/NAo8meCrxfeAyfUEPm0XNeAD7iEDgaY/yWc6t0tvBhv3AeH6Wqo+wV7dDhYgqg VRZO78Y8TsbXKWm1Yu0cSC01oZ7hpNbecIzYS2ErRHIoR4LTxdxxkzVXJYNpTQMyj1NE zWX/dr85QW9KWIDh5nQ3Zi9WKJhCrk6fw9OoFOBet9YhsroPo8EOg18LEhNYaymyPYHU ARs0XzdGZbtotUvhErbC8SQknQv2+nxgBNh4iutFTW0PnyZkPMkl085vD0Rmo397c7X5 wPFg4MHbZUseJBxA0lM1LrmHkGTwt+z50E/3mp38eYAUoaOo4myDTpppyhNEbZ46KcH/ qUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392410; x=1690984410; 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=r6+iuI2PXGCyiWs8rbXeGtlJGrDRRAokHBPFrSzxP8Q=; b=UpFuuNku11bvx/OLZ2EwQ2m65ChPDWhWqADjibiFdEHX0HATByq1+jBMpNSO8lLz2h 6M7WyBZ+U/xKB9ypdXWLY4RLI0uVyn+VT3V1ElL+O785TObXV47C3PpZZMkung+3c9Ys 9wCqj/ByN5vJHZDsefZZjWNwe50B2aPy59uq7Xn4KGLRDbyDoJreW6YjmuQzlUDDJBOy uXWtKSW/Y2oQVj5g/JH3g7bX5S1j8dEwjqJN0y9GjSy2P1FkByHQibycwHqRVT5MbkVJ QfTxiTBvEom5uhRRCL1/90YTPb7DEe90mfF7TXK9BLJM7+XOas8zyQI1+zHzJ/Me0HQG MLew== X-Gm-Message-State: ABy/qLaDEguZOXdNBVhErPCT9iO+IsCHVFfmoo7rM00GchrQ065AWgUu XegTLhKETpApgSh4IjteuGp8MA== X-Received: by 2002:adf:df03:0:b0:314:f88:4fea with SMTP id y3-20020adfdf03000000b003140f884feamr8749266wrl.8.1688392410524; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s2-20020adff802000000b00313de682eb3sm25593708wrp.65.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DE7461FFCF; Mon, 3 Jul 2023 14:44:30 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 26/38] docs/devel: split qom-api reference into new file Date: Mon, 3 Jul 2023 14:44:15 +0100 Message-Id: <20230703134427.1389440-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: <20230630180423.558337-27-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698707 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762875wrs; Mon, 3 Jul 2023 06:55:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlHD7K+WBdne25F0Yn3smlNjvi626hGDqWd9MZz+1uUo5hTxa6Q425iM0+r2l12iclJpWyJU X-Received: by 2002:a1f:434c:0:b0:471:5cb5:11f2 with SMTP id q73-20020a1f434c000000b004715cb511f2mr4931854vka.6.1688392505860; Mon, 03 Jul 2023 06:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392505; cv=none; d=google.com; s=arc-20160816; b=Y6+Hs9MkuwBvLglirs7XXLslGwAW+mCSU5rzSnCNEMJTYyPeRQb+AmKN8neVgRelKG ZwsgaYh7/dNuOYF8ZegvRVUzHBfJDVfeTnrRU5hAxidnO9rqSrd0qbcp9QgcmvHMhy/T FUGoJyG9yJ8/9ZKH8sreBEy9CO0j9ScnSeMRPjUUyjEXLQ58i1NxICA9OT3zLk11cxnT xTaCxzUMf8xyo/xcTfRRZ73L5Yo6XoH3OVgWRxBMB6XiVVX9mFqXUi1Sl/oQVjqgOU4n 8I3AbqZ3NuxxGV+9or25LCWw8KBaIFBXIzwUYK/2o9sjxFoKDleoXzXgiAc5Wqtt16Lj jryQ== 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=A17Yk078G+WbyuMB1//no9fohhpFQD0Go8gJ1S9AAiU=; fh=NG/rP2sJxJChqAIYHK4fCILiSdPGVutAutCSGEt6+0c=; b=OlQM5Jbwf+7Bsww9MzXBJZZB+VPjEjAzwW5BrWTOoEQUAetKS25nxWngbJPG1NVlJS 2IaMLAotkRLKyWoBU1iPanzqTwj+ZXAzljmHainPCiQDvPZq2z28dbBdS7fBqAjZr0FQ N7r/x7mcYGe5GSaWHahcikd7Tq7511Hn4aUTYsbr42qpA1oDyOfnZ5kx/tNLhB7/3wft 50VzOM93kHdpkvsT4aoGfFgA9nZ3shVFeDj7xjXahKpNhYNDRxWuVYOj9pqFaMFHpfVy qA1WcxiTyfRTl5cevxMd6s5OrmW2AJ+1q8qFNgyEOPWcPWwSyZIOW0+ZpmQvs/BpDJqm 81Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eZ5PsvLO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r6-20020a056214212600b005f24d617fb3si9187748qvc.370.2023.07.03.06.55.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eZ5PsvLO; 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 1qGJzh-0000WP-VH; Mon, 03 Jul 2023 09:53: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 1qGJzg-0000Tm-Rb for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -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 1qGJze-00081o-EJ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so40370165e9.1 for ; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392409; x=1690984409; 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=A17Yk078G+WbyuMB1//no9fohhpFQD0Go8gJ1S9AAiU=; b=eZ5PsvLOgBLv4obSKoIdlRCg5HRhIqIe9eX1WpMgTqDeq62la+3crcuEfmXKPfqV/3 0owkz0G5MeXj60UOqXpQyp+nWSthpmWSiFal/hJ3YhpLpL9w2PTsyXG69Tew1oG5cQuC TckuUW1FXspwH2v656whuq9vXNKugscEC4CruzVNGg1wzgo8xa45/b2O/yTJLCrhuqgQ Qwi91Syes3zUw8/4KdcWFXpG3nOCMsK23t/ps92gbRc7ThGih8TWWkFd8ZQShASPH7Vo 4ny9k5fV9h9pk+JnkJEu5XosEgoFS9HxT77zgftBcYpAyEoqiLYmPLas5GHAJ+19yET+ UU7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392409; x=1690984409; 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=A17Yk078G+WbyuMB1//no9fohhpFQD0Go8gJ1S9AAiU=; b=kweBZXFej/J3vfud4fg1B/syssE2Tu3F+9HAAZJZpPm//cAnlJMMSlA9dlf08RA3U4 lk0J4PtR3WBMDfPf2DEySlHJCX1jvtmt42QlU627OT93+tKfHqG6N/tF/ilayyljTu+F mZQtRLOBLk+x7hIMDAzaE/DTneHaL5kI89AmLKhsn+sJF8C8GhTUvuKyDeSfvpgk9xTf HAndN4Wzdf0+46X9HwTDJQM9h2MJ6F+3G0EKFfAqRCOAkgO5Gw+6w+XYrW/gqlnAZUGq vsOi1lhgzK2DI1GNmQsX/SpA6+TJu6G0KrD5xHjUCR3yUtXxI0dT/vxtUxahTDGEeT8l rTnQ== X-Gm-Message-State: AC+VfDy/lVeaGyqDDQyKGKA5bKSNTIUR/54Qv3VdfZ06tOY7Pn1nF4Rh j4GGM90ZXyfxUkSw7Sf8tPxKHw== X-Received: by 2002:a1c:7512:0:b0:3f6:58ad:ed85 with SMTP id o18-20020a1c7512000000b003f658aded85mr8587791wmc.10.1688392409105; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4-20020a05600c228400b003fbc216b137sm10762158wmf.3.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 02E241FFD1; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 27/38] docs/devel: introduce some key concepts for QOM development Date: Mon, 3 Jul 2023 14:44:16 +0100 Message-Id: <20230703134427.1389440-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Using QOM correctly is increasingly important to maintaining a modern code base. However the current documentation skips some important concepts before launching into a simple example. Lets: - at least mention properties - mention TYPE_OBJECT and TYPE_DEVICE - talk about why we have realize/unrealize - mention the QOM tree - lightly re-arrange the order we mention things Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-28-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698689 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1760899wrs; Mon, 3 Jul 2023 06:50:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGxYIC4QkMeehq0qKp54RhzEDqEyVuvvmuVmt9lvl4AAqhtiCUXRb6ZIe+KXpyBKq4WyPCp X-Received: by 2002:a05:620a:3901:b0:765:70cf:d7a4 with SMTP id qr1-20020a05620a390100b0076570cfd7a4mr11331407qkn.71.1688392228265; Mon, 03 Jul 2023 06:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392228; cv=none; d=google.com; s=arc-20160816; b=IJ1khqL6FWPp6DasV8kEauE7XcMMQDKOtMkSRYQE7oIn7RkymP3TGx1hV+u6CXC4j7 Fwfx3qbK71PWHzwxMy0ULeaMmVIjKIIsRLg+l+EjzEi9sC8mCkzDULH4MjIB0T5yqNbk RnubGSLl5FA9TO8vUC+PApjMN8oamUpJmCXWjw1HqNtx/Wo3zLmvyWrJxnMCx/Hd66jn 3I0DGynrKyzJU2WGi5cez4mWnZJLodFDr6EDZPoWN5g1/V4T9z3L5NC+gx40z5TYXzij D3OgTdnV7+GucOL+EUNwl1VUvTdaKSjpYEngupP81TW8Ez5OtgsGWedG8TDe5le7j38O UQmw== 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=jmuKSf2VcTxuXRVZK5WsSbiqmIzeKDjZMTTPleVdJHM=; fh=rFIn06eHzsx0Ek45moioqGE6M4mnjlt+HAXgA4erE9I=; b=IRvlyEIF9qXozRl9whr7spAMMbLMRYy/4bErfEC9rZJHG9DvP3jquk0CEgPIQ4kqtO 2+YtvtYurvxW5BvI/wdy+IRifhYTbx5+/lxhc9nkt5SaM0iNAPlzAYjoO0yCTT94kkZl Z7blSn27nnwJRzxWuopHhLMl52656nNH9lqhFkAUjH/cKyshAn0C4uLOLkrnejPK1gX1 Ny3bVjqDZe75eAwfa51l4Xx70/xmzuoN8+KSsAcE+2IXzyNjCc6RGWNrDN4JcW4PNGBD zqvnkRCmKvql+2lyRR7+n/zkp74hGug2h7cpr+ZxSZi6u3yST+5jRo6I5M+0INCVuSvD baRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nAehpB0d; 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 b25-20020a05620a119900b007674cb23139si4657732qkk.762.2023.07.03.06.50.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:50:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nAehpB0d; 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 1qGJrd-000873-B5; Mon, 03 Jul 2023 09:45:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGJrA-0007Zw-Lc for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -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 1qGJr4-0005jH-1P for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:43 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-307d58b3efbso4945943f8f.0 for ; Mon, 03 Jul 2023 06:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391877; x=1690983877; 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=jmuKSf2VcTxuXRVZK5WsSbiqmIzeKDjZMTTPleVdJHM=; b=nAehpB0dqhFbx05sjTAYP9thSJXd5zlPIIXvFyvfHiLHxGSCczf5SR8aoPgCuqMrH8 GDEdIL1lcXW34BAbDPxztcegZ7dI7hziGuUqDKI3MPTcqMZEbUMvNAdlOAwCFLesbMcK rj1NpnVHxRVosPZGJeOaE2HXwv53mMDiNJoyEdGYQ+rTckBXox94+Hqv1EIn4Bimw++g dO2fVjf8R2dPk7G5sZ99+K73okjhMBlwjKFSX0n7/QDcXXl7XUZQaLUOSx5Zq1qms6/r cAs/UOywjGCQZlzaYr/DIEm2NE/90GONr5IQElDEYCgqBjqmmUJUeB6ay+z9PnCJ7dub hb7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391877; x=1690983877; 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=jmuKSf2VcTxuXRVZK5WsSbiqmIzeKDjZMTTPleVdJHM=; b=hldMEwUiIN7jvQg+gzItILOEL5xu9hDLYze/mypbOPv6VTSm3h5j1DUum+hbQDZ44v dHHzglIR9LwkThZ2pDvkj7IQ0OIZ+pH3p4SVeS+qY460UqHvPtDgbz6DOSZDsEK6wn2a Sx1tLtBEVzI36GJpZR2Gn5YF6N+75+R0fij/hMG/Z546lQa4rxHDLnX11ay8GwmlyjRY NrquBlHeImNV5kVOtH3qlX1C2NjsryDuqMjHfRUFg3quxtPzL3cJWm71Tz3E/iJO9k4D G9fqL+N8/NUIGE9OfOiz2IA1Gv1hBUTe0bze+NiMPQDAvHEiE0lH8fsWRlfKimHjil6O pntg== X-Gm-Message-State: ABy/qLY6LrbkPGabK793yNa+4lUNAL0n9DdsDHNrx3Cwzl4NZtzGL3mJ rWsUgKnzAOKHdIpHtu3/cqB9DQ== X-Received: by 2002:a5d:452f:0:b0:314:35c2:c4aa with SMTP id j15-20020a5d452f000000b0031435c2c4aamr3118277wra.8.1688391876848; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d1-20020a5d6dc1000000b00304adbeeabbsm25621931wrz.99.2023.07.03.06.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1AA8A1FFD2; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 28/38] gdbstub: lightly refactor connection to avoid snprintf Date: Mon, 3 Jul 2023 14:44:17 +0100 Message-Id: <20230703134427.1389440-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 This may be a bit too much to avoid an snprintf and the slightly dodgy assign to a const variable. But hopefully not. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-29-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698703 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762677wrs; Mon, 3 Jul 2023 06:54:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlHf2duAarHDhT812++rvIg+ulkWFbVVz+MTUOThmgOLn+RSKAV7vqeuMMIS8S3u5C3S70yD X-Received: by 2002:a05:6214:518f:b0:635:dda5:bb88 with SMTP id kl15-20020a056214518f00b00635dda5bb88mr12345247qvb.53.1688392474868; Mon, 03 Jul 2023 06:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392474; cv=none; d=google.com; s=arc-20160816; b=CHXTDSWpe17GsjdoDcD0IOKGnUQbdBnSpixjo1dH0F1qe3UtT7lAo4AY8ue4F0JFuO vBn+MHFxpQUW9yUO4fOIgykdEIqSHDWXYM0plC6EWH116Ew7aPT7Mozr6FKSwAJbGylZ K0KQvnZSoCtB1xRI6yOFfmnQo7Hq8qgThbvrPEXBTqlGlW623cI0FJl1KnRmaS+SSR17 E6INp3AOK8S163/SxHa1BzBi1j78VzqCNrFR/nHC4l2KiTLUc6MpEpCuJXP9Ce91BPV0 P4jAjvrBlrm1jXhnbaAUOTWaMt1SvwicIquRDyAibD4VkKtPRrB++4FWZSxFkkAQjuPf RhxA== 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=26POj3Pp+gIP3un1OHTdCprJFHUE2qyF+wMmQYT3qCc=; fh=Y8TRRYG1QdS8sAgFvmAxFM5bbl6KJN803Tcgs3gYDWs=; b=Wnq7HSOAaPTfxBuGlr+NAr0HthOqlYTqskl2euiNveKDEXPge1FCWJnGDDZpAyGnTk 5npdhP/zoa3AeVQ2sk1Ec9K0o6zFXF6bYcIeOgRvSsRYE8TzStefgPeABkx6A1g6ZxEA 54ciPQvpeeylXSj21Yebs/ZQdlu/GmnV/nGJBz4jLAhuj8ACnMNSXwNmY+ky36dN/V9d eo6TxHbUgWSMoqiemocRAD9CkZjC+e8guS8UNNLL+Pu+jVXD3tmejSk1nVjJEakwlmMG mE8IB6YxLbbnGDdg1HaAO7pJbSMl2byjEMgHV4aasZO1ivYaoEWcudGTEXHwZS9FsD5U KwVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n0XSF8Rc; 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 8-20020ac84e88000000b003f8682e1200si4411989qtp.13.2023.07.03.06.54.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54:34 -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=n0XSF8Rc; 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 1qGJzk-0000ZT-T0; Mon, 03 Jul 2023 09:53: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 1qGJzh-0000UD-5e for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:33 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzf-00081y-5J for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:32 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb7dc16ff0so6924531e87.2 for ; Mon, 03 Jul 2023 06:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392409; x=1690984409; 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=26POj3Pp+gIP3un1OHTdCprJFHUE2qyF+wMmQYT3qCc=; b=n0XSF8Rck5Et9usUCtaJvF4oZ43rppy52jY2c61oPqRrP3tJtXTeIAfn7bdkVqfPe3 vMMIRxsYYJlfwqo1MdLldWMzRa1lXVPJvzoKIY/H93Lf3PQSYHhkchTlzRaIvoOcA+cW S5x3n4EIyXSPs0E1RszfUAaon/FNCoBF2EJWFzzPTrN9Cm8H07nIGDneM57MxT5fKGA5 2btc96bFB6OmS+gMdzdG/samNINXcLikDocFq3dVeUmNmqhlWMZq7LKQimNimtzrn421 TQTsKbLTh0bTBXPJd3lt04q0AcPKWuwMLvqUFpQqOaVGN2qzf9h5qVZMHPLVzN2riGDl 1O9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392409; x=1690984409; 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=26POj3Pp+gIP3un1OHTdCprJFHUE2qyF+wMmQYT3qCc=; b=dClu8EVnRdvVZUvCK0EZ4fFUBbbbSeKvXPMLyyGmHJdS39UL4FMH4MJVALRrp14JM/ ZxfTr5AxJXVcWpRB6jQ/BF52J4NwUvUFvjstZbeb9vJmdAiCf5b3pOfNqJVgHDqoQnxO qQ4aCmruSDX4jyN8RKHjkGVJ5ws1rb49zcayRMY0icSrQT73SB5KtwawfGjxT7hPvmHp 9mRcdHtX/Y9Zim+ClSnSYcLtSfUOmqhMH/eobO1G+AdIE+0wfhw0hvlPkJlYSWGpWPvC 9eHgDQhqKZyYNPSMQIln3Qoha3C941fURoFwIgknfX1z0aPx14FBjUvsO9ZRLPg5hrAl EXTA== X-Gm-Message-State: ABy/qLb1kCDoWuxzGFtWxXUeU3khcEzwplpf8B0vK9yWr81+hhPbGUd/ oivXM55WbXgwLRnl1UeJANHKau0Hg9doeYylHQg= X-Received: by 2002:a05:6512:2107:b0:4f6:6b:a43b with SMTP id q7-20020a056512210700b004f6006ba43bmr6581280lfr.52.1688392409507; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b2-20020adfde02000000b0030c4d8930b1sm25548544wrm.91.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 317E61FFD3; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Nicholas Piggin , qemu-stable@nongnu.org, Matheus Tavares Bernardino , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Taylor Simpson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 29/38] gdbstub: Permit reverse step/break to provide stop response Date: Mon, 3 Jul 2023 14:44:18 +0100 Message-Id: <20230703134427.1389440-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Message-Id: <20230630180423.558337-30-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698710 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763007wrs; Mon, 3 Jul 2023 06:55:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Kzz1k0jLX8W3m0KCroT0bBV1ORhr+PNmQtvuRjOOfStGISQKGiQpgz2GtiRb3dAcludHg X-Received: by 2002:ac8:5c10:0:b0:400:82b1:ad05 with SMTP id i16-20020ac85c10000000b0040082b1ad05mr18732703qti.7.1688392523536; Mon, 03 Jul 2023 06:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392523; cv=none; d=google.com; s=arc-20160816; b=Yq+GEvMfRycUjfp1nckshgkKGBrsfuDripKEUJOXceu6TvguP3DZEGW34IO2+ygDc1 cWOQKBX3R2NfAQ8tUsBeWFc0XpQWIn/lS0NB+dQwGGkON9DDK74huRaWACaoDhyQ+Ws6 IaUx/hLIAfF5rG7AMqyRKibkFkdadewWCBj/yqdo5JqyozRmVDDxfB9eQh4crTyM/xOY AnxB6OcNxdIv9s2BKrxZ4Jcb3TInbfk6s7RZquakqjmGTDpcccF0b/oWuHRPQb3VQHg2 MLIPAYAP92S4E6S0HmKvCx5Rr1sZ5Bf1PVPiW1yrtvmQDtrHf3Ly0Mf8xK3p5fynwSkk SNEw== 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=zNMPVNXEa7UqeTcFlr3/SM98KrOm4fYZhU+BaBqT8mY=; fh=rFIn06eHzsx0Ek45moioqGE6M4mnjlt+HAXgA4erE9I=; b=SECgQnRqZhweauMhV0pCyj7cHPyno62Eq07lk0W1iTPIto+6KT30jguJ1EaeZU9AUV cfSIDYhe55I9NA4IV0O/GDGZZikT/lxeH6FyVHpvQuyztClIbJfh/duj0uZ8qWLO+9Q7 40gResef3KcIXClzLXZlz6zuLQFzlK1NblrODc+cE879EN8SRxraQmhZJfekCzqKMwMN BvXQu3axRRByk+0JAjqn+p76Bct5AK7qfbHreEp3WZrw5Y1+3ZylB1bYxtgqjHyWehjU 1KqWEdazzsU0oxSi7yRCJqDPQ0OvVBFhdpB+YhRfrofbeG2QP/9kFZ0KEwa3MxumkbUD XWuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uV9ZPLS8; 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 k9-20020a05622a03c900b003f502461662si11934211qtx.421.2023.07.03.06.55.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55:23 -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=uV9ZPLS8; 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 1qGJzp-0000bX-Gr; Mon, 03 Jul 2023 09:53: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 1qGJzj-0000YA-B8 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzh-00082s-38 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-314172bb818so5153877f8f.1 for ; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392411; x=1690984411; 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=zNMPVNXEa7UqeTcFlr3/SM98KrOm4fYZhU+BaBqT8mY=; b=uV9ZPLS81d0MTVEY2cXnk2V+85sjXaItitw7BNEe0vITv33afOl6HFjqmyV8LC912u 8J4ONws8InNEoZ7jXMdLonNXnd/ledyMXbioCq8y0G5DWrlWheBJJRuu2pK/JS4DJWpm 8jMEHcH9F4ekDUddaTIVCA8o5mZ7xzZg/6hMs2dtAKg/xpqIzMSI/YWAytml6gabZ64L eqhI+rlYq6KFU7fzwMZnRFKewmNijj0IIaivjJQUrqLX1U7EmvzIvtGtd4o68ECNgCR1 p4HRyC1ChOiYd1uDWlzBsMGcsbT8ULupwp+Oa/GzaS0VVHcozwwUNyenlDr3p5YGdzZ8 YnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392411; x=1690984411; 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=zNMPVNXEa7UqeTcFlr3/SM98KrOm4fYZhU+BaBqT8mY=; b=h+rHrX64cfAc49CBY3PoEEMqKU7utLxpm0dvz63CRafADD4Kv9a5Lh5FosmkdIQZXT N4xJ75yxAqL9RP0b+E9pH+UdBLbwHAiJBETVkKxGNGXnXNw+D7TSmOzXk/Zb/6gq5Nzw z6XdaqId8n7E0Zs49EAj7shU1dtTF68p3fd+kKOjwmmif4E93jL4m0h/hNDuMz3hGpep mhB/kcDyZ/8zp0cPlFEwCto5lOwwB3Yd3wXKy7ya4R+JUvEREaD2XrEbgsJRxX0X8Cnz kRfJAXe/C3OpVEeEnI8yK4qIfGEjNarorRyXb9ztqP32LVQwRXUyfQtKWHp5yPEuhQBx 5zeA== X-Gm-Message-State: ABy/qLaooFA2dQwfdI9KMl6SCHQEKgznEJBNFwwtrmbNXJC6Wi23lRFS PSID28BWL1YLhxBGEwz8huKPIA== X-Received: by 2002:adf:fc08:0:b0:314:824:378c with SMTP id i8-20020adffc08000000b003140824378cmr8597854wrr.20.1688392411749; Mon, 03 Jul 2023 06:53:31 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w10-20020adfcd0a000000b003141f96ed36sm9420092wrm.0.2023.07.03.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 49DB21FFC1; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 30/38] gdbstub: clean-up vcont handling to avoid goto Date: Mon, 3 Jul 2023 14:44:19 +0100 Message-Id: <20230703134427.1389440-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We can handle all the error exit cases by using g_autofree() for the one thing that needs cleaning up on the exit. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-31-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698705 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762749wrs; Mon, 3 Jul 2023 06:54:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlG0pBkUC8bmDWZ/tS3yeiH6+Fd2QtOPu9xiQLrhibAQExMP8PTSaC2vcjTFsrvZR/H/oeQG X-Received: by 2002:a05:6214:21a5:b0:636:29e6:a52f with SMTP id t5-20020a05621421a500b0063629e6a52fmr10078487qvc.19.1688392482655; Mon, 03 Jul 2023 06:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392482; cv=none; d=google.com; s=arc-20160816; b=AHDfkqXhU9FpMevhPSTuM1/lTO5MvpeQUxX/Xu3QcVbE+BPYI1y0OjZxA1k7d5ggPY KafpeRNAfT25RGwy9A20YUslQdW+IAyTaZYSy892BmSZsTWFjLxVLgmfl/t4HjSdbFrf F+CiZdxabVekYnQAXzNXgB6sJB+fUceABf7zjlpgQqosaHGL7lWA5wVVqHrelVu5Uw9V Ohs0FeBIQvgYQ88XM41chQTlgfj/a/MkFWjRmDT5wGjY2y8xHNtFI/bpLP9T9YTeI7pR vE52pmfyl6wLiyyHqkxCtG7qGxad4L7rxMIDA+xm6xqS0NPFhvN1vLEGI2RUXPFFIxyL gz9Q== 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=/yGVpWL1h/+IqCMQOCfJngBlrYt5BXqNJvwRRIuY57g=; fh=D2Rp/LVqP92oybp44Lc4WqHSiNHRumdEjZlh6dY9LNQ=; b=IoBYht6n1/rj/chSOEy7Qc6s384YFFrVUKmsXc5FGyGi+nmIz6lIcuZPkTh0o3psDD cY8TNaX41+3Czx6NKVTCeAKY4/kBH+NDLUvo/LEI5z3uwisNWqnK++yTMZoVIRUJfS1b BFPDyfK5vOxGepK6DcidufgjBJJI7VTmZtOJODxIfqIhxTuY0HGU1zcvPHdWZYQSWvJm cTXcCcsyqm9hXnCfFQWPItNmqjmnVDVRcj8F8Rr+rOfmaijzVL2C0r92iWqE3K3qoEiT V+JX8qgrNI04/SrhwOXMdj/1NRvQW8Q2KYd8kmOrzk1/RwmT7Q79H/Yze+n0aRpZr6sj 46AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n49eFMd4; 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 tv2-20020a05620a3e8200b007651047d45fsi10056810qkn.596.2023.07.03.06.54.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54: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=n49eFMd4; 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 1qGJzh-0000WK-Ul; Mon, 03 Jul 2023 09:53: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 1qGJzf-0000TL-S7 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:31 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJze-00081W-0u for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:31 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbc12181b6so49761855e9.2 for ; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392408; x=1690984408; 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=/yGVpWL1h/+IqCMQOCfJngBlrYt5BXqNJvwRRIuY57g=; b=n49eFMd4wsoc4kdl/Wv9g3JnFvKxwkDXKgxRn+RQGOjKKSlYIJaWZAE3Y/6E+IOoTJ /xAHwQeUaN7jur6IhG/cz7u2rA1QWEpDtvntwRi3HFQpQfstpI6xhqGRNYnODmabLBrC WM4Pz817eEUpcfJW21y0gek6I3Zo3qoU3SbpEo4TQB+X4Xd2qHVECtpdxUZwhhTu9yPe LNmvFSZjsv0bsY/BxpGrZIc0LkYtFIFJh8eXVJgJzfXjzD5fE6S5QGyPtAOoiM1DMQMz bWp5eSIXSJieOhwnJfGuW8w4VNC2pPWXpBdL3eXE+w+rFU0SUuNN0yg+4ZN060M19p4w mQ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392408; x=1690984408; 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=/yGVpWL1h/+IqCMQOCfJngBlrYt5BXqNJvwRRIuY57g=; b=XWtn42bryM1FGPAfA36ETTjlbQkFH6kJL8bYdfPWO4TBLKq82nMw9EfqZuZrnuaKGt ksdJ3AWK6D58InkWOubV6AY8RlQ4IRKZRQcBYxj8q/KoQXTM/uKIwd65QpmJMZgqixiO 3rWvFfyFZsbas4pPFZhuHtPZXl97W6RvDGq3ZtIyUp0AqToIP1/hYzPkIkDEogcR0gFF IgIwL++Uy2QahGmxH4g/VSgYwW1Do542CY7LQX+wkOVzL0CUPkY2oLY3RW/baxBOXAJu wkvEF2ust/PJHTWXCs7pQONTLll2iVpRSMdk99hRbYIMYCyjL9Cpl102k90FOdyopYNG g3YA== X-Gm-Message-State: ABy/qLY7p2K0TKrRcvDlKp5V6pUv6facHAwTdPgP1wY4aHTSur8ZkKa3 8HYlRZUGRlcs3QEXMV2RdWdbA8pfoUdcZJVQqrc= X-Received: by 2002:a05:6000:545:b0:30e:3caa:971b with SMTP id b5-20020a056000054500b0030e3caa971bmr8957115wrf.51.1688392408096; Mon, 03 Jul 2023 06:53:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id cw8-20020a056000090800b00311d8c2561bsm25559859wrb.60.2023.07.03.06.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6388B1FFD4; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Subject: [PULL 31/38] linux-user: Expose do_guest_openat() and do_guest_readlink() Date: Mon, 3 Jul 2023 14:44:20 +0100 Message-Id: <20230703134427.1389440-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich These functions will be required by the GDB stub in order to provide the guest view of /proc to GDB. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-2-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-32-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698704 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762703wrs; Mon, 3 Jul 2023 06:54:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlE1wwDZUwX3MWbpEoyCkNmAQ1DVMrYm7OdRebLjtUk1xxjNgI0sQLXyZ0F2F7kIS+o31OcI X-Received: by 2002:a05:6359:6797:b0:134:e4fe:e162 with SMTP id sq23-20020a056359679700b00134e4fee162mr5506371rwb.13.1688392477711; Mon, 03 Jul 2023 06:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392477; cv=none; d=google.com; s=arc-20160816; b=I9PzWMnmdl5vmHB6KmBHnbkFgAkjQn2hK8baJSrZDJAq5seqfJt2eFdVcfvpGNu6Z+ l/YbY75oggLxmNLMWaRtQjV9aKpsGiGUJPQU9u4mpQzxTHF9dJbceflS5i+klhvCmaKW HZXTG1vLxP9E88SA0iaKD9nuqYBpgAp8hyTeUMdTVziy4GoTy/Pev9teTJ4jBiMtA0CO Nb13IPiPx2sukCZJwp3xlXC1efC1SQfhxN5Fs9LmiwO3rAzeEsd66X/m6fSlImKp5Pf+ 0GuoiVFPlXonSBARIHP1hyGNblBwA8iXm4Wn6Da3nT1DDRj1FCW1XRs9WdnB3ZA18VQN RNUg== 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=7Mnp8y2sy0S7tTiA16Y+6uh+LPx0EUvTSKKrt0wZYOY=; fh=D2Rp/LVqP92oybp44Lc4WqHSiNHRumdEjZlh6dY9LNQ=; b=N9QPQz1yAla8DawNNLfZNvNkH4gjKsTwzlbVCEnQM0Qfl3tO/cLEpHFV++3WG0bdGX ZLB0G7ww9qenTEqwJDldSv24CPbmngwzxCs9pgybIDlA2vgN8F0c4vwNVK8W0HgWqLEM A2ZxM0wwRQP2Jttco6NEF9owvKdnpqS9JVRrf6kqkRsEFlairEBTENa9SCpcwm2rZByh YQ3p6ZbX67+0zvkpsTzFVwDwM9z4tmEJBwhvYiI8wGOmWTh8mhSxQZe8hnOFjzlwlAS9 WE9//DEhke5dc32s7te77008eNsRDcWem1G1vXu+q3GveQKGpQUQvdxmXHBRpLj2priv DWgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qL7nZT0a; 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 p19-20020a05622a049300b003ff242dc090si10445931qtx.18.2023.07.03.06.54.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qL7nZT0a; 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 1qGJzr-0000ec-Js; Mon, 03 Jul 2023 09:53: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 1qGJzj-0000Ya-Sd for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzi-00083g-4E for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbc6ab5ff5so40371005e9.1 for ; Mon, 03 Jul 2023 06:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392413; x=1690984413; 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=7Mnp8y2sy0S7tTiA16Y+6uh+LPx0EUvTSKKrt0wZYOY=; b=qL7nZT0aCCIujUGSsKbP9AuPbtlnvKLalFwg5qxpruA24pzhu8Xw84nglQtw4F/X7N Ayx7inBY8OFjh3auk3hN3MilXUYj038wIMO4C6glg77wnw8aVL9Kbbft67f0SB9MFZ0T qUfl0yQMEOXlgW+edc+JF7YCRf96CiyBj0+f42NrTK/4EPIGvCvJ7rXfwnOmCD6lzX0C BPVbCeFhBNyHsMc3eKWB1cqC9fnrgi+DQzgUSc2++M1OacHGMRNCQLiPjXcQ4AYY0QHy 0ONOtrI2pqup453j3WgtrKJR+NI6ekmFgIMGno0eSxTW9rK/LEE8Ywah3TWx1cTvs1r9 E9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392413; x=1690984413; 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=7Mnp8y2sy0S7tTiA16Y+6uh+LPx0EUvTSKKrt0wZYOY=; b=a9s7ZrDHwbe9heKaUhuz8nhug1CEqOJDL3ONHimRwkw7i2jXZGi5j7b1K2hYmzu/49 2lDBv78m5N58GMnvXOl+wA/VXElKE2TQrXo15EGNvLxwOB0iv9udG/aw3KO66BQP1QCO YQzuLgGJ3qmLbXrdthZY/lC5MMKU8YHiNH8G5BR9VewBOVfNHk9tRzWSwO5qubCJ/xzT WNoT6YazfMmeRNJ0cH8d09kv4TcXBcuWIRycfu/6t/XmzPVNBakOMLl79ZVBye8WrCmx jPdwFPGDKC1hTFqUdimm69WCov/U9VDjrNu566+en++x+r9AiIMOgs7bc55bvZBrPYSb g6YA== X-Gm-Message-State: ABy/qLZKiMe1V3f7bHb/fW5WZHp6piV0Yf0TGJ5hv7LlSmeTGPyA8tD9 nL7GtaA5XnBLfzS6FaLuG4hhJA== X-Received: by 2002:a5d:494c:0:b0:314:3724:6fcb with SMTP id r12-20020a5d494c000000b0031437246fcbmr2801262wrs.50.1688392412875; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w11-20020a5d680b000000b00313f031876esm21505406wru.43.2023.07.03.06.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7DAD81FFC2; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Subject: [PULL 32/38] linux-user: Add "safe" parameter to do_guest_openat() Date: Mon, 3 Jul 2023 14:44:21 +0100 Message-Id: <20230703134427.1389440-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=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 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 Message-Id: <20230630180423.558337-33-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698700 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762472wrs; Mon, 3 Jul 2023 06:54:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlEGdEowekvZMK6K0OU3x03lThqllkxmiWMpnORQAT43deVpo8nC7as9QHGCa1AcmXo30yXx X-Received: by 2002:a05:6214:e47:b0:636:955e:3de0 with SMTP id o7-20020a0562140e4700b00636955e3de0mr6742671qvc.5.1688392442224; Mon, 03 Jul 2023 06:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392442; cv=none; d=google.com; s=arc-20160816; b=Ul6qd6Ncp6vQvTSdjvwMpK74zLJHC19670W1I/ixOBy/+Osu9aD7yawaqDmS17epdk yaomwYcyFlzfq4d0YqmOY9FpDR4wiLmJkKdyecPxyIq+kpTXIH+OEIWUXV94zQqL7pvF OWexh8erV+BJCFivKgczglZGtx5KpiU92y+dndnzedj1bRKU4BMyvY4HQGx43/OcwK4i mOWFqG7EwOsO+XqcJG2jocDaqeVuG3WJwj5kyfzclSYJLe8KqN6o+ezmNp4To6MS9yjc pn1gs7KvJu0mNIdGzENC0JuCgmVw0DSV+wRcEsv06FyQPuxLdIezuW2vMKVrcunROsp3 +v9w== 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=w6WYXW4Y2CRXzJldZHFZiOGa1GgkyQ7N7MNmvXCUxfM=; fh=D2Rp/LVqP92oybp44Lc4WqHSiNHRumdEjZlh6dY9LNQ=; b=uY52daQJJFRer2W4/R2vc6MxZEXCHwwuWzbwWbMkBtzyL8TnFSb+uiqygRYNp9+Nxw v0644EhFHEHzxFDlpUzKjJVAbZik4+zmPv/Y6d/jajmv5rIACipGcLM8NEOXQHlAS1Bx CHjsvefPGPxTsn8wJEiCaL33ETHxPQoKG0hNj9Lk1GzzDTPL89ovwzYibrATrhXaoxIr q7HGx9fgzdv8dmKy+KihSbuGEj7fUdIBeRoPSbv6Grp5AspuTO2G/TgWejaOxOJ6CPYH FyKir9cv6CL8sH3UF+KzoWuYnFgmyzjkt1YJjpzHZUQMx5dTCnz3/L6TxWJnspTEksyX 2viw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yZ9K7324; 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 gg12-20020a056214252c00b0062755601ed5si10905363qvb.282.2023.07.03.06.54.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:54:02 -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=yZ9K7324; 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 1qGJzg-0000TY-8X; Mon, 03 Jul 2023 09:53:32 -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 1qGJzf-0000T6-7O for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:31 -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 1qGJzd-00081U-DM for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:30 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc1218262so54673825e9.3 for ; Mon, 03 Jul 2023 06:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392408; x=1690984408; 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=w6WYXW4Y2CRXzJldZHFZiOGa1GgkyQ7N7MNmvXCUxfM=; b=yZ9K7324qeFp4nFloVx8dob12Bc1ydtmXPOANDeAunnpBTm3/jaW/8K4faEQxjNCkK jFLQdve+mN4MmXPx25tsorihiHYl6kGCR3pbmwwayQKWG+tXVm5pBLVozZnmOHPie521 g5sWwDUGMaY8/H8dB8dc4ZUyzlWTepTMxPyzrhXpoOg1mzgsn6+0bp+bb0WwHeA4eH76 FSpSYIbs+jbJr23rEs9JWAL3kxbHuDlBD8xfjO3ZNj8IJ1KZH5KeLQ3oJ24jP6xrXVK4 aUXVpUvrOEg4KCzWmiEFiXiZU0EBgoiGbG9RLsDMfxx/WlWmkjrcFD3wVrDltzyjhoyP 7G3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392408; x=1690984408; 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=w6WYXW4Y2CRXzJldZHFZiOGa1GgkyQ7N7MNmvXCUxfM=; b=DVH7EDMV9PxL4IYeWeAu0qoHtXWOi5qfMpPKwSFkKIBBKc4UYNHIigLDvpbMxY2HpG V5WoB/r/oOUsnLfFcOB/po0n5pUiVyi4sb/o02+A/bAXijJvTdSXghp8aGmJMBctgRH8 yLBk6TOdqvaksTz/ZAL5Sq13MKp3SF0Bo7rzl1xgISlkiIdNdJ3kGYlfrvbHzBsRRPVY 5tb+T/DGxrO6CDyQw01WAA9pNzb9hDxeXbmTGSfDybt3gq7Oq2Lp2u/2jTszITPpVEua fJ1ZESOQmDby1XOOo0kU+tZDbrocaQHJmpjmcGZtlWhZmtrZyEYbd6iEcUu7CvSdlXuY KtDg== X-Gm-Message-State: ABy/qLYtzEsz3sc8PO8elj3wH+t/ISyiv/9kn1i/OQ4Ok9RnkQqwn6Wh Nr/lne2TY/6fINd5mS/LcxX/Mg== X-Received: by 2002:a7b:cb94:0:b0:3fb:dbd0:a7e7 with SMTP id m20-20020a7bcb94000000b003fbdbd0a7e7mr1704581wmi.39.1688392407875; Mon, 03 Jul 2023 06:53:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n9-20020a1c7209000000b003fbacc853ccsm15777974wmc.18.2023.07.03.06.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 972C81FFD7; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Subject: [PULL 33/38] linux-user: Emulate /proc/self/smaps Date: Mon, 3 Jul 2023 14:44:22 +0100 Message-Id: <20230703134427.1389440-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=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 /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 Message-Id: <20230630180423.558337-34-alex.bennee@linaro.org> 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 Mon Jul 3 13:44: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: 698709 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1762967wrs; Mon, 3 Jul 2023 06:55:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlE2Oe4sI7yyq5chbonk7nessVKOHm+SnpB6Fk0lDP8Vr4KNYJfH1ZJC9UP/0WkgaDXcpkjt X-Received: by 2002:a05:6214:1310:b0:635:eff8:2b4c with SMTP id pn16-20020a056214131000b00635eff82b4cmr14427938qvb.31.1688392519466; Mon, 03 Jul 2023 06:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392519; cv=none; d=google.com; s=arc-20160816; b=QDJtSHsuK4sX/klOMKv6MhJ8EVPBrYpLOhCdTT9G6p0DjMeRYghLfcGc/nk67exCKL z+Ey+aTj6XAqJjPibtaRDHflGnZLaftnpSZlmwGN1RsnDQwxb/rK9WJ45eSJW3Ihdzw0 bmmuzp0S1K1GMUtHmDmaBLNQxaO9jq+Nuupg2kDk+Sx9JcOMIsFdkmykRh6QsJXTr04k OEldqFkNqGSpBOIiwKB4pyNRK907NlbmY0QtpCYmKkt5QhW+NBd8hBUqsxV4KDQiLU94 mH04kTaVZn7y8r0tIVuHtanT/uOZoPAv3o0h+G9am9TydjzShJA/lzjlMHrC1n8vIoiH 74Ow== 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=Sa+wfZu+Nea0/Jly4iHaBSQb1C7qOF4WA65LCb+E1bE=; fh=nJoHa+TEz/Iqgejv5tq02EzBq7KB5/EaExtjL3TSfSM=; b=qr6n3fN2/FPLND1yRz7F5JgyhiZHMLWGc/UHuOrXfZhJmxvQ3RJ+IHxr9KWNhTegua w0+a8aH4lYjnK5B+0OET2oBqI399JOfBcWETtzvPMCqMg6QmnnrSCAJ+PTQluwkeMl46 nXOJYguRHPO3xCTQzr2eOBvaBV7P0FAzL9ayZ/r15Ul9rqJAnQROepS0E1Mj+DqcU1Ov 0AAzjrructADr0NFEtrdB7zKDji0PA3R/IP9TuOfCQSO1l53/ZF0gQvn6XMV8JGL0U+5 OrS7ODTRupIzI3Z3qDp6v8Z8vA8A1nJazUWgzkKYjgeiK/hyZIaUW+HojR284oOC0DMd 7m1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H6+sjVpM; 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 f5-20020a0562141d2500b00635cdb809fesi11433775qvd.320.2023.07.03.06.55.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55: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=H6+sjVpM; 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 1qGK00-0000r7-7F; Mon, 03 Jul 2023 09:53:52 -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 1qGJzj-0000YG-HY for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzh-00083P-PJ for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:35 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3110ab7110aso5171568f8f.3 for ; Mon, 03 Jul 2023 06:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392412; x=1690984412; 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=Sa+wfZu+Nea0/Jly4iHaBSQb1C7qOF4WA65LCb+E1bE=; b=H6+sjVpMtyJgDkrpuWBa8TZDL8eqFuD3F0QZwLyApRSmCMwf8vYPtM+56oxmLAYOky zOUiqsu/obBJYrM4OhKl4BnxOfWCp3/mqQtUlfSfUFxq3DtwlB5rywBJOuWXlPEWkliu KKquyfA3biRf/j0oZ8GOapyU1VsBRJ92Obcsp3xO2vcwpQvSsnqkdb7g8VQBNH6YQ0nW utt0Be4LcpQGoEf7K8C1IMuH6nBuIWyexi+mSsPBQdkVhe+XwK3Y8RSn1Mo1Iv8cAr0j u9ak4XkFS83RaXmjcD4LfnnEo2dtKcARWSa35QrYeRbexnwDwvA5FRATVp1kwisEB37d T1KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392412; x=1690984412; 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=Sa+wfZu+Nea0/Jly4iHaBSQb1C7qOF4WA65LCb+E1bE=; b=XCpc1n5RpB40U5vzuQUO8Jwe/2fhGoVX8oG+3wXRTTb+8rLf4teOAAsdRNZk6uBnuR myqjhr5jpwNhuvG+JfXOp3d+9u422oXBBGWLWOojJAJbIDDywS24HeIOfVBz99Wh+omz skgvxOBugkjdmByskiW6YL8vAohbo8rTPqHmxNphWFvwk6iJNLhqeT/5OBVYHLkKT2DL 75V/C/dNYxItelrd89NeF0mdWQJsdk4Ja1SbWXPpuZ3o/y7EMFu0NtlL1pZTrAzuycil Pz4Fz6RkA9EEuNSBecx/nOY97mKgd4qeca+to9FSXqHAUIDkP123Xf+kngCFHw4Cibz4 x4Yg== X-Gm-Message-State: ABy/qLZbH0CfOJgiq6oAml+ijoD+y7uze0n0tf/+19xXhWVw+5pyZy7R UeGf6p5FZJ6whTJ5AhDRwFZ1uQ== X-Received: by 2002:a05:6000:1250:b0:313:e526:f6dc with SMTP id j16-20020a056000125000b00313e526f6dcmr8256973wrx.48.1688392412482; Mon, 03 Jul 2023 06:53:32 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a11-20020a056000050b00b003110dc7f408sm25801998wrf.41.2023.07.03.06.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B22551FFD9; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 34/38] gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process() Date: Mon, 3 Jul 2023 14:44:23 +0100 Message-Id: <20230703134427.1389440-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 Message-Id: <20230630180423.558337-35-alex.bennee@linaro.org> 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 Mon Jul 3 13:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 698713 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763507wrs; Mon, 3 Jul 2023 06:56:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlF0X8HQg6IaL+TNzsXuiNbDURIe6cbcypZX6HdHb/Hen50ia1GtPlmaGuzyojsmLv2ci3DH X-Received: by 2002:a05:6214:2626:b0:636:1d3f:3d77 with SMTP id gv6-20020a056214262600b006361d3f3d77mr11759613qvb.14.1688392591881; Mon, 03 Jul 2023 06:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392591; cv=none; d=google.com; s=arc-20160816; b=TalfurZeK4MMj/swEU0zSu/HD2EunFxQvPfaX01x0YtH2DximIyX2UxHbYF0DykcVd 28pp7qz20cDMPvhbXHQXyOf/Rg6FHGpxF/Jn3ScjVqWm/6fYrDfoENBWi3nEb7z+/EIx A1tQSahLHdcTlEeD3uZUn2dBb6f374ZX7U4P9l1aFpxOTRKog++8S7ktiS661Nk+oSwY IqEHNB6O4ZCa41zF29AaFxAxyYM9aAsxJ+cXTNYwQY5aS4G/3gGJ2zBsYAga+hGDO/HG O6dZvS8MsAzkOHw1K4pPT9SDo/68JxLqlwkV7PC8s3YT74TgM7NCrW8cDJdHEHn8XGBR RS6g== 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=8cD1juvMLwUrVgA78Nj95KzI+qlKYsgqazsEWOJa4kM=; fh=nJoHa+TEz/Iqgejv5tq02EzBq7KB5/EaExtjL3TSfSM=; b=EopLUi2dSvIsbYCfHAZCyheABmI2qK2X5+cB2/FIG02nhnLwVXJNSmqB6DLOJWXWvu okscKo1szCw57p1ggLOpQ9RMim3Q1H+KxoDkU3IfgTCizUKSBS9mVKNL7o8uDtQFRpOP WRuFKr99zy8TdyTDz3afnxQWF3GbEGQFjKzZKjgWhLUIQsiB7I8NX08xiR3E6ZTtKIX+ kqBfUV5l4TJy3ERaEMxgWNapgTGe+0F8wN4dmRY4n1xIOcxvGOOptHOhoNeJIbKnYMaZ qGerzG92yzmrF5SLF12W+BvKJS0hC2C93O1ZOWUCO5xA9HyynsfCrMYdUfvq3/yoViIt grWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ne/oC345"; 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 g10-20020a05620a40ca00b007623efa62fasi8673369qko.243.2023.07.03.06.56.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:56:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ne/oC345"; 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 1qGJzn-0000aO-Kg; Mon, 03 Jul 2023 09:53: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 1qGJzk-0000ZR-OY for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:36 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGJzj-00084J-5z for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:36 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbac8b01b3so36818035e9.1 for ; Mon, 03 Jul 2023 06:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392414; x=1690984414; 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=8cD1juvMLwUrVgA78Nj95KzI+qlKYsgqazsEWOJa4kM=; b=ne/oC3459NmHqDNO0SQtOOCxAL7b/YaAKykEFoo4m9WWY0Vcuztse0cMB4UKZ3V/PU 6f4WAgaggdog8fzA3ByRUCN9oQeYY4IaN9+zMhi7/9T5DGegiGVj0lxGxt+77AkSVvB2 X0y8iKj9axsQuU0PvLNkV+pSG47SiNo+fS5WaT1Or9RMYiLb8x+Wf5RKTO/rV/HpaUjX qXxJfXcjaWA7e+EwQ8LIgSiEP4owbKUv+oCCYwgVHDpkaxXpArTqejoH5Hb/gJq3Wb2p HW/IJAwRpYgjONuGo9T+Drr4dJhvHgszfZXM/rmjAjhFl5+W5oZkPPK00+4wTxwY+Wsj 0DEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392414; x=1690984414; 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=8cD1juvMLwUrVgA78Nj95KzI+qlKYsgqazsEWOJa4kM=; b=Lys5tjofcrQKgJCKwKY6IiAfGLH7Emk6PEHXW7xNajii0qVkgr+mk0GIKPH6xnQfcG ohMLs5ERTdFlmSe//m4cI+s0WM80lsY+q4JuaktW/uu1KVjP/45O/9loCzit3JNhlcFQ 3wB2A/ft+fzY+hU71r2OGFvoU7GtMDFUXw8DOYWyk6yO9faWxcYeDRzX9m6QV7OWWVSK lh1wbO/osHOpJnn4npGYyTAQ1d3/qQovXF1GTuUfa+juOxcDMfr49GWmqJb1l5U5KP2p 9tj66dYQq7jPOoJiUQuVW//WXDp/QjVjah66wFTU+Uyth/v78LX2NAO9++BF5vebaKYx R5Wg== X-Gm-Message-State: AC+VfDzlDw+3DOkAZyutEsFu9oPuJAM+RexqLgPcWlim04GucaNiF/p/ zEeX8EiijIKf5uBCJXySrjadhA== X-Received: by 2002:a1c:6a1a:0:b0:3fb:2d92:ecf1 with SMTP id f26-20020a1c6a1a000000b003fb2d92ecf1mr9020465wmc.7.1688392413921; Mon, 03 Jul 2023 06:53:33 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d13-20020adfe88d000000b0031438257aa9sm2236910wrm.36.2023.07.03.06.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C9F7F1FFDD; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 35/38] gdbstub: Report the actual qemu-user pid Date: Mon, 3 Jul 2023 14:44:24 +0100 Message-Id: <20230703134427.1389440-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProcess. Add an assertion to make sure that future changes don't break it. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-6-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-36-alex.bennee@linaro.org> 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 Mon Jul 3 13:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 698712 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1763215wrs; Mon, 3 Jul 2023 06:55:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65hru8TlR+ndwkb8yfbtGFsQtI2QPf7bEmu817Ye85L8blGjXjJTCHwpCxi25U0sY5cFTO X-Received: by 2002:ac8:5b03:0:b0:403:2842:4d0e with SMTP id m3-20020ac85b03000000b0040328424d0emr12892771qtw.62.1688392549245; Mon, 03 Jul 2023 06:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392549; cv=none; d=google.com; s=arc-20160816; b=yKV7z4gtoc4+GAMF0Dq6EO388FlV+GewNo4Kg/uAfgSr16KYljjEbr5R+cIFCimIfY XGt0/iJhdia118Z5uMguuE4yWHUKlU5zQIP0Auycb/arCT6W3n8soIX0OZYM1nDWFQSi BPTXdIJcTYl/eKfZmHhjnhLeFQo9I9KVShwWUf+t39E1eDKh5zx3u8jXYA5w14+SqL7e NVuyQVRG0Ljsc7wjDUhOFjn3fG2jHQ1fpYtjowsFHZKc2qlhEqZiPQiGeaUxXuXqjSoj TBkd8ZEum/a1Xuu297/8uAivx9H1oTjVWBY+te7JfvhDXXIBNSX+IB9omphQEIpZwXy1 Mq5A== 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=0VsK9/3tU0+hejhhrfU2ALG7tWi27m7Wvg/SQNXP0qo=; fh=Dc6CYKjE+2Xo66l4OOtRz+X99SenB6pkcJAQJ0OmJVU=; b=UmH2kMtxh4AjzDtxkU2KIgkBpnTR/t+LyS4t5YPB3ra+T5Nt9JVWqHlaO/2t263UNv yI/0k1L51iLOMq6lORuHub/LhxCyPCxVSvIdpQySkqdNF1pdzZw8UUu7xgx4t2BpI/Un OO397+FkLOHgUi+qXc6zxzm/3E3cfL0QZVYKchz0NvDgasb/KKq5+eDtjSkk594Ed79t SLyxj+Gkg7ul1D9c3/sIbhG99mND12Hvg/gRs6LBVeCac6ckqFbRL1ghQUVcIFd07fr2 DmWMyMAYr+VmXEQiYlCd0DmOV2enX7K3EaTFIhdY0MrqpzeGr4zjYT0A1IOCtNKndWJv ONTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZK2dmClZ; 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 t27-20020a05622a181b00b003fddb499f7esi8574523qtc.751.2023.07.03.06.55.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:55:49 -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=ZK2dmClZ; 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 1qGK00-0000q5-3I; Mon, 03 Jul 2023 09:53:52 -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 1qGJzl-0000Zh-MC for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:37 -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 1qGJzj-00084b-Hx for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:53:37 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31434226a2eso2184446f8f.1 for ; Mon, 03 Jul 2023 06:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688392414; x=1690984414; 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=0VsK9/3tU0+hejhhrfU2ALG7tWi27m7Wvg/SQNXP0qo=; b=ZK2dmClZmO7T6iHa8m2roJx+Y13+jY1ze2Fo67g7n2cTZCzyPHTECWp5AEA9aTB+lT ZZt+woYbpx47UvbFvClrt3jaakLPfpnEUIH0NnkrrKwZRBzizHW+MSQYb8AwfL+Tce5i 6R0OpafgtaDW3WWtPDk9jGmTvtL647bFDb2nHXbBnkLJ+9ipeLwtmSEqn7rhXGXhrSud Vcla9NNUOv15CKwEl3hw0MRynesrJpmUlgKql53wFaQX3P9icsHv6PpOL7JKueRJ9/jo IwbmcM7vk7CzVuV46UQF8EDDmRbYGeEtLlTlimzQ817xadi2qrT66DfwUrdLGP934CUr NjMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688392414; x=1690984414; 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=0VsK9/3tU0+hejhhrfU2ALG7tWi27m7Wvg/SQNXP0qo=; b=cXLu30SXZjiQhT7gINFchwRa7uccPT0iD73hyjNNak1Ds+j77Ri2LN0wGK4eeiHUEr y69hjTv3UljUMSFSv0wyu9n1Vmg66iVWykKMeZY8ogGf8qJyZhA0hvcABPWaAlsjrsyo 5The+oc3o8MozytN1SgWgBn3E+YaZJYfuS6Uk4UD9E/f6NbozwrU74V1UG/TShgoLr9u 2sU66DAygU4KZBvMLV8E/03swb2LY9cmWmsS6eJd3J6YSfN8SAuWwwfC1uXlA3m5d3gf m8A0TfWYiE6FGThqtjXUvsOc4vXkMbDdghqImreuViIi19uQXx7I2sxczP3tkyu+Dfl5 5MDA== X-Gm-Message-State: ABy/qLbaZOoD+c2Y9LdOEq2r3ts6NkwIYAjyEtj+pRWpQ8m8D8vRwDgt MpcY8rOs2KzeQ67u2iVslt+L/g== X-Received: by 2002:adf:f08f:0:b0:314:c7d:78aa with SMTP id n15-20020adff08f000000b003140c7d78aamr13017804wro.62.1688392414151; Mon, 03 Jul 2023 06:53:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v2-20020a5d6782000000b00313f5babb18sm19714523wru.9.2023.07.03.06.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:53:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E7C7E1FFBB; Mon, 3 Jul 2023 14:44:31 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , Dominik 'Disconnect3d' Czarnota , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 36/38] gdbstub: Add support for info proc mappings Date: Mon, 3 Jul 2023 14:44:25 +0100 Message-Id: <20230703134427.1389440-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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: 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 Message-Id: <20230630180423.558337-37-alex.bennee@linaro.org> 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 Mon Jul 3 13:44:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 698697 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1761310wrs; Mon, 3 Jul 2023 06:51:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/9OYbymUKK3eZBOHdlIJHKhGvbiMdle31xh5EUMPAGPxkIL5UcKQa0qxkigeFGtMFsmA6 X-Received: by 2002:a05:622a:d3:b0:402:3dbf:85fb with SMTP id p19-20020a05622a00d300b004023dbf85fbmr18436438qtw.33.1688392281745; Mon, 03 Jul 2023 06:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688392281; cv=none; d=google.com; s=arc-20160816; b=XT4nI50eFtD3Y6oQ51mFvsXWHEA39BNmt47AMV72vKRbFrTimezSWj3WqBo5mftJCh yTgjOFgfmxsQUiTIQnSAJF6GWeA7Tis174KXsQGv7a4qAo3Ni92S/u6Wsd1jKnkvURSV YJTZegBLi2nomOwi9a/cB6fsYPbfqS9dhG6ilLElocg8442Aj3GqzE1D3LVCUs2V+2Z3 cupaRqGZ8ulcMs4FcrSSXUZnDDWaJaTqEwRpDbEyay7A/LLN27IebhgQCOI1BX7NKWbx 0FnM+eBpGfI0VPqVJnx9Ftp7su9MPB7LxlRA5pL57sQHunh4cof4TMZUqbFZBJZd0T31 18RA== 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=9GVtKOcv/SO0Bd9fPGHoO3oydZ4Ss+XbZE8K/rNAROI=; fh=nJoHa+TEz/Iqgejv5tq02EzBq7KB5/EaExtjL3TSfSM=; b=uGSOurS9mNoIViQwNtMJpgerMrb0FS5GmUs8bFuNiZePs1ZMvjUCgoXgAamTi9xd/r 7pS8hHs/uyFACMlNtUDp8n9AtkRByoHhFmRRr2hFADpP9YlS0XFBcXI4kzBKCU0CQq14 DDtKpMHEVk+oXHMB1s6BL8pR05mM1xIukS+ssw+pgzxBckftg8M/XXAElayDsxVrProc PP+PSahv33YjJDvleI/CBgIuyuSR0GjCh2IAt7Mzdb5ogTBdsx/DSJNhewoecV37VXlf sYe/X2h5NGni7aoSUn2qn1F0zHjmUYNBqyPJ+uAZFy59Y7DOloLRevcMoNvgxLNcdobh Bqlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ulBqrqnI; 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 21-20020ac85915000000b004009ecafcb5si11209202qty.131.2023.07.03.06.51.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 06:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ulBqrqnI; 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 1qGJrh-0008Gs-Cv; Mon, 03 Jul 2023 09:45: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 1qGJrA-0007Zy-M8 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:44 -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 1qGJr3-0005jF-VE for qemu-devel@nongnu.org; Mon, 03 Jul 2023 09:44:42 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-307d20548adso4964207f8f.0 for ; Mon, 03 Jul 2023 06:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688391876; x=1690983876; 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=9GVtKOcv/SO0Bd9fPGHoO3oydZ4Ss+XbZE8K/rNAROI=; b=ulBqrqnIHNwslD8BYQYozsIYKhArQG13LS7wlZBbbKCmASC2bGAnTC6zs++DRrFcSh vi5lpxEK22WLrtqbo4SM2rB2y8faZ61ewqO8+HCgf6wIidzd6YL8fBMajy3nCE/yhf4x S1bxAXlsVXoDU0JNdYCxZo0lkDJrpQbzTBrBhWnofLEvinJlauKjRov2ks3SomwV0IyP wNRHVMFXOcp7iBlk02kJdlVxU35cS6qVZv4J8ABFs+Rgdn6RfTfMlH75WhMPYEKUUxvC Ty03ddKgo8Eal9Fha6KLggrCGFUGE31b+jUFlNTuPsVkYBFXdf8tPzST3DErBel0o7UJ ebXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688391876; x=1690983876; 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=9GVtKOcv/SO0Bd9fPGHoO3oydZ4Ss+XbZE8K/rNAROI=; b=GJJgjGkSOW8itHG5niT+WkvSe0mmDqN9Xkl05B2Xi5cVpgJ2HJ1ixVeCyTMLzvKzxp +hjgzRZHhyDAgzOovnq7ruvpbr3XIeQ7SyAoQ5BCd//Z/W48LhaCzoGFcd6mhN2Gal6a Cjgds2RE3ALjYuyljatyDtLERKqvzltWyZOTu1Vx2UvgYBVAHjx6QLnwE0j5Mm4MqcG2 SxxPK8J/XegR0eIUT6Yz2rp0HMK4RDtC82PzBS1a2y71pk1nfsbdsb0hGOpLNxPOqoYi 5q6EImWnR7VFCvsYnI+jNlbnl8fyQyKgtrAKa1ME0NJlWp4F1ZQ03/dv770aJe6N9H+P 4LZQ== X-Gm-Message-State: ABy/qLbfpIIkhEVpfGmPp89sRJJvRc9MsprN66qajB9Wmj7LikBP8hb3 daNF+aTk7wEzqST+dy2YdPQZ5Q== X-Received: by 2002:adf:de0b:0:b0:314:32b6:af3 with SMTP id b11-20020adfde0b000000b0031432b60af3mr3993166wrm.5.1688391876660; Mon, 03 Jul 2023 06:44:36 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003fbc0ea491dsm11258914wmc.40.2023.07.03.06.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 06:44:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0BA161FFE2; Mon, 3 Jul 2023 14:44:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 37/38] docs: Document security implications of debugging Date: Mon, 3 Jul 2023 14:44:26 +0100 Message-Id: <20230703134427.1389440-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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 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: <20230621203627.1808446-8-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-38-alex.bennee@linaro.org> 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 Mon Jul 3 13:44:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 698717 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1768070wrs; Mon, 3 Jul 2023 07:04:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmx7fuwu/AqpdaC/ikx+7WMr8yq8pYN8t7DWZ/TqNDGB7sF5pplm0gJmg6VDGa+KcsY+5j X-Received: by 2002:a05:6000:124f:b0:314:3746:d44b with SMTP id j15-20020a056000124f00b003143746d44bmr2885684wrx.41.1688393076411; Mon, 03 Jul 2023 07:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688393076; cv=none; d=google.com; s=arc-20160816; b=YFkZyp343eF+hd5aAy9Hr4cAHP8NmQc33ag8d29xr/XRmOnTXvhX630bNhgSo09Xhk U/81IxHfXFxpqg1KAa7Fe32zEcCWLJD+5qRFoBT1/lZntuAfgAn8XPg2SDnHF4lho2+E ws31NVnDXm9cXvFjKqyyxaWYc73bm0YHVUtC0GIBc6xLyNF9S+DSQNo7Hy6Lo3OYX82D M7FqUGlEjDGOPSgQ0sASeaTe2ap2I3eAQj8uQjzD3K0axVIzud7aw6sqGxL5V/Lpiaqw cZJKCyLb9Cr9UoPWH1/NA6SnTYEpMud3X4xhIJ6mwfQReXUlT7zrE9lSV2+IYulrl3oE +ZkQ== 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=L10INYSmGRMwfYRjSmnypN3cJI3i4gGGNLhvyw0OvLw=; fh=nJoHa+TEz/Iqgejv5tq02EzBq7KB5/EaExtjL3TSfSM=; b=KPHIVNs8c0HNGgVabSZjjRRK1M56IsvcTlr8CW/OEqXi4EY2wmlllO9qLaDsdIlqxH WOsIE8HpIB/p6zrhcWShoCugbAjwuJixAc6qwtJnQxuyBOVDTZkA7kxWJmxQGfQNrvUH A9oQ9DSjo21Ao4MeMoMsoPMKUjzZmrqmy7KyxrO3iRr8W/FwoFYJ4epqrRyyKHuvNEaq HPNAcPRLC8ngbvF+Cr+t3O9c+TEPanvimL9hiZSgqox9ep5ikelrajRVKyDSPFyBsn1O CFM5Jil1DAEIMm7mmtz/twAN5XqamaM2N9KVw8vPzZPwTvXubeIoOnfmeHYoK1kBKcYW nt+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q3alv+OL; 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 v5-20020a5d6b05000000b00313f92e8110si9710679wrw.90.2023.07.03.07.04.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 07:04: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=Q3alv+OL; 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 1qGK9R-0005f8-MY; Mon, 03 Jul 2023 10:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGK9P-0005eb-DI for qemu-devel@nongnu.org; Mon, 03 Jul 2023 10:03:35 -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 1qGK9J-00032D-Ps for qemu-devel@nongnu.org; Mon, 03 Jul 2023 10:03:35 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so41492605e9.3 for ; Mon, 03 Jul 2023 07:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688393008; x=1690985008; 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=L10INYSmGRMwfYRjSmnypN3cJI3i4gGGNLhvyw0OvLw=; b=Q3alv+OLG6ICh/CvIFWfuaIunr1LsU3WJ9fnmjnHe7ImeagwTr3XnphHHPZ04ekts0 Es9cWPFDfS+z1i0BC+5GbGa9X1PwA3PGKFdS8QvEydJ475Z9xRfxA2tC8sKJr8moKGw2 lhQTNg2xodjYaBkCA03X2Qj3QI9B8Mf+QVnENApYS5S9p0AEfCaGLvOolZ9dSDXpYUEY Cb2e6kJ+sCCYcNBUEZsF8t9LlrMQ/nK8bUtxLaTWFTiEZu0GakUI62RKgtZOZoAsFmHl +cQtDUBXk6cVxpxmYIJ691LumioAcyBPTkNMjJSZEfyTQCChrG9vcMxh5rlG9aMuD3z8 nMhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688393008; x=1690985008; 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=L10INYSmGRMwfYRjSmnypN3cJI3i4gGGNLhvyw0OvLw=; b=LVlHynbmHytnLU/wLRAjmx2hPwIFYwW1JpPiuFo5PWNUq5J9DMni0jqRSWwuc3hAv8 pMh5m2ciDkhhyoxbGmarafNBr+g8A6ZjInOaixrRxqDj2Jsm+JUJfPtZ+q+O/qSxBS/h SBB+Eslc76ci04qOBQHjwMzgx2zaLky+O4Wottv07GBVpL3YSZBeR2XeJzp9gf99XBYc zWmXYea5bU0UryUwaAgaE7Rjdy4aubDj4ZudQWLeGI3TdayVnsRTTrY9i2x2GNHSytX4 V8MSEPgaRDzW9PqE95vihyS7HJJZhVodmPFnt02P2h6Xwys2Xb/NPd2CT1IEHJY3uXAA e15w== X-Gm-Message-State: ABy/qLYeuRGtTaXgrdtdzkZKl5JWqWOEXBc9dLi6s1G3nySOwssOZSWL veG0tiH5Ux6VJRj6ovWy+RF5Qg== X-Received: by 2002:adf:decb:0:b0:314:1e47:8bc2 with SMTP id i11-20020adfdecb000000b003141e478bc2mr8509635wrn.0.1688393008118; Mon, 03 Jul 2023 07:03:28 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z11-20020adfe54b000000b0031128382ed0sm6636413wrm.83.2023.07.03.07.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 07:03:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 257671FFE5; Mon, 3 Jul 2023 14:44:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 38/38] tests/tcg: Add a test for info proc mappings Date: Mon, 3 Jul 2023 14:44:27 +0100 Message-Id: <20230703134427.1389440-39-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703134427.1389440-1-alex.bennee@linaro.org> References: <20230703134427.1389440-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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-9-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20230630180423.558337-39-alex.bennee@linaro.org> 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()