From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392263; cv=none; d=zohomail.com; s=zohoarc; b=Wi+LZt4eGzgCUonR9exHkGggeGIkGNkv9dPNNpWlA1y0eDHHoK9AsH2+65lnjZ8jHeiEbJEWH3jVheOGClQC7oQSNfSnwIx0rBjEbY/PixPvEDTnuL4VhmAKSI6qTuyKzEXvsvxa/CM75nz7XQdxyPlb9smY2R0mv7VdblU36Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392263; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mBABYgdiyToLjyHowniWhIyVXJ273GgxeMYZV8p8dqk=; b=H2mDAa8YCgnsfsqrz33jFApHXvL/3tPDzlveSRbltmipP0IIinWmdkXOP9wPRePeKBgoNqxGL9ks5kdepXP+gZJ3ecT2BfB04A5ZnPQgugPG64yU0WpydC92Tx6Jj+UnxQqgLzgyk46WW6OnmAAGeCpDfQ2wdWPCJWr0yEJq5Y0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392263138210.2249612062285; Mon, 3 Jul 2023 06:51:03 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlERKH2n2OlEPlJESt1HCL2ESaEYOgd8+SU7nICequM4zRd+IlmUG8XOVeEdXuWv20gBWggBjA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392264890100001 From: Daniel P. Berrang=C3=A9 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=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230503145535.91325-2-berrange@redhat.com> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230630180423.558337-2-alex.bennee@linaro.org> diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-t= emplate.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=3D$(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 =20 @@ -184,6 +185,7 @@ cross-win64-system: or1k-softmmu rx-softmmu sh4eb-softmmu sparc64-soft= mmu tricore-softmmu xtensaeb-softmmu artifacts: + when: on_success paths: - build/qemu-setup*.exe =20 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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688391943; cv=none; d=zohomail.com; s=zohoarc; b=QzgaI69UiznVCrOmEe7tJZyUdsSRrtvfrVG63Hen42mDew1EVMMW5/KGHQh3Ne8jmBu19HTwAXR9OdqyWyEo4bJohOVo4vcFsL69+R2Z3fj9MkSgsby+IIxCjIszKFXF1AXFEWwshDMboquF+4EhroIptadKn9wkVC5BPIphtiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688391943; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GeRzCQ4EwzWGsNcRrOpl+FoUKZGHEnv7AIluzaFf2u8=; b=MFqFUvnQjnXwN69zt9WUqYhQ4nDIqlE/5uIp+GfDr+9pv4KaBTgXSZ5fv8fCIjxCAhlBGHczbcCwZvGUHUH2u3qmKAWMYbPFf3HLybDcjLWV+K+ALTls+Srv6pArpyzBr7HtQ1XlS00tNHXLAxqbtTjorHvXWPdLhgUGwTiEZXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688391943196998.5928794284953; Mon, 3 Jul 2023 06:45:43 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ7gxkPgQNR3XVBeWoJh6ro2f/6hsgABnKy4PO0qLgCuSbDzN/fbvrg0iuSs/M+vHAVBpyJxSg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688391943863100001 From: Daniel P. Berrang=C3=A9 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=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230503145535.91325-3-berrange@redhat.com> Signed-off-by: Alex Benn=C3=A9e 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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392150; cv=none; d=zohomail.com; s=zohoarc; b=V0G2QK/kwC4aoBH0Nv6HsxvfURcCDKvOcuKD9yerUo7R+GMuWutL5Dysk433IWhthZ6HqSdQEUGj0BzuDQoReCDeSFalRUlWkGEnKBsDH+wwz1MgUsVk/yWmiNtlvFPF3LHydbXt8eQb+ZM5Ad6XxOh2pdMYzSSL1b3WBZwODaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392150; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lQVppiiyqsC0HGXhv0zk8KKZESG+1QKz8Jmvmi/GdQw=; b=PFD1+LGUVE82iSGUuL1RMDPyxzibffcb4SJ+/lGUgZM5EnpKWc+Nja2hPwA5mcT1WDPzELPD5ehz1w75Uh0BvXT/hLnMMqbpmxkgXHHp82Jz6v9iWVoyCYrqY0oeL596rUAH2KwzNkX8EaCxqvwIedIfFlJ8B6E8S9/VtJfHciM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16883921504891023.9069187935204; Mon, 3 Jul 2023 06:49:10 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlFnpGSoqU2W61roIkWwsRja7jisWLp0D3KJGsLWnHjr6RhWXuRfQUrAQlyiRTudHWBHsgr40w== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392151528100003 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=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e 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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392337; cv=none; d=zohomail.com; s=zohoarc; b=kGJEgMQKgETYIpuTl48BssCZMLYXrTIFV6lCfSpjQIEM0UNe3PKIoalA2lY/qcDNEwP+olEDbIYWVfl3o9Q1EmDTfjw8SthNawJxn6GywarENmbpxaXkAQfbw0gqA/wdD4aSb2VdYhheXz14BsXHNYiDxLtL4jY3BZiCHeXQHbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aiQlfRY8hx1yBgb3vRhqIt9YmNckd07v2P9mNQ4jgVg=; b=H5doNnRmJ2QA6H/Nt5KERM/SzioVjqZ87TxFruM8GKP1/boJyN1yIhdEsEO9B9reHXfisFP01kImeQ49xtKwDiP7eeaPY29wja5Zz29PNIH15Pbk55GrzZD2P/vyUWntmSYzRS35/bmoZ6vthmSXodGzIydrjycw+gfs9o9jl+A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392337647627.9968988241018; Mon, 3 Jul 2023 06:52:17 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ6TmNvEiGZfFF4y02iCvlU7DbIV7lR3kSo2i8MivChqFMD+/UMrTgLA6qsrjvnOqtiyGdfGbw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ani Sinha , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392338708100002 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 a= re 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=C3=A9 Message-Id: <20230506072012.10350-1-anisinha@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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. =20 + * 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``. --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688391935; cv=none; d=zohomail.com; s=zohoarc; b=bhL5uIN+osp8t5WrHgt2ONf0eQZpEkzIM8ZQwHieYi8W2zUOe66yhpf7Xe4ew8ACTJltl1gX+3gf3IjuLAgPdz7VOeYeZ9KUiSOzPMKJbCuhreSP+gahnyhcy7aRSxHdROBL0ig0aCsUrfl+WqaaS9PXE5JRCDtqEWSE7o5Hruc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688391935; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rotzDBtOd6/iqr5ugUGgrWbU+6kRG33xvmLRtv1TB5Y=; b=co/jS93m8CXv74pH7PcxaOf1CCmWMs/TJeWfSqdX7pmKprK7B59g2z/CniKc4mCCsb2/daF+/YMftLaYf4tm7vUcKAFdHI6CUPesqKqfM82JdQECyfyi3rLIhjCyZcaWv6Iz97Z6RxgHG0g5SsmXYKBNBn9YMy+/te39+KYQ6XM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688391935369335.1259484763747; Mon, 3 Jul 2023 06:45:35 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ6hfZ4okCTkSqbkim9gFgc2T4XUsyX84nTYgbi7jvalbFCu6zVhtXO3QKlpWjGTGqnvcM74aw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688391935879100001 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=C3=A9e 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 =3D $(wordlist 2, 2, $(subst -with-, ,= $1)) =20 RUN_TESTS+=3D$(EXTRA_RUNS) =20 +# 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=3D$(COMMA)inline=3Dtrue$(COMMA)ca= llback=3Dtrue + ifeq ($(filter %-softmmu, $(TARGET)),) run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<) =20 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=3D$@.out$(COMMA)id=3Doutput \ - -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \ -d plugin -D $*.pout \ $(QEMU_OPTS) $(call strip-plugin,$<)) endif --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688391987; cv=none; d=zohomail.com; s=zohoarc; b=kT7H8zy8iisbaEzMGobASdtCcIIN1SsEpUQil2Q2s3kQ0bUpAonTk5kVE/PEHxKd98uJ13/YtbIWvEHZKNHc0zDgg01Jbtib0nWrt8AhcvrR/J2utNWTvTb2p4S2/GJk79mNq7wqx86uc8d8x+bG91QeLr6q39e3ubLHeJlZVFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688391987; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fbp/Zw9eE5uqY/m4aZkgwxvYT/8MMMAgvc/DfnALRqM=; b=SvIdHlsxLJPEA+TprudqGM8uNIZrCAGxVMzUGNANuKD3GnG3NpYFz7xE8pnaeOi0XDZYSxk6OwazliA8HlzNdTqUj8jhOGqrKhrTxxCqs1XttBarvL/Sn1Lybxdj+nYzlTBL8QcyM/60HnPc+rVQvG1nG7rdf61x+1BjKPILnxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688391987617867.5919465172221; Mon, 3 Jul 2023 06:46:27 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ7i/mGf2oW0ScX2ML0nYmVY6L9AVbTvOJO2vyPnnGYuHU+2pZMshbgps1Uim9ldvkOz2hA3rg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688391988591100001 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=C3=A9e 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 ?: "-"); } =20 +static xkb_mod_mask_t get_mod(struct xkb_keymap *map, const char *name) +{ + xkb_mod_index_t mod; + xkb_mod_mask_t mask =3D 0; + + mod =3D xkb_keymap_mod_get_index(map, name); + if (mod !=3D XKB_MOD_INVALID) { + mask =3D (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)); } =20 - mod =3D xkb_keymap_mod_get_index(map, "Shift"); - shift =3D (1 << mod); - mod =3D xkb_keymap_mod_get_index(map, "Control"); - ctrl =3D (1 << mod); - mod =3D xkb_keymap_mod_get_index(map, "AltGr"); - altgr =3D (1 << mod); - mod =3D xkb_keymap_mod_get_index(map, "NumLock"); - numlock =3D (1 << mod); + shift =3D get_mod(map, "Shift"); + ctrl =3D get_mod(map, "Control"); + altgr =3D get_mod(map, "AltGr"); + numlock =3D get_mod(map, "NumLock"); =20 state =3D xkb_state_new(map); xkb_keymap_key_for_each(map, walk_map, state); --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392267; cv=none; d=zohomail.com; s=zohoarc; b=HFlmPzKa+dd/X+/2Hpytaj99ZNVAPVQgGgxJcZOR5037LOAqsuz6O6USVMhKF+M1/MMSWM3h7sbwSAoJt6w9FL/kEwDy0Udw1PDMvRXoZJLX9uc1HMY0y1cwvfaGWM9dLjQBBhN2FTzN5WsPu70F6sbq6oGkLK/fwTpvOZ1AGNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392267; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FeBR8GZv3DfL2Dr3RQS42VRWnzI9QYt8QP9XGBKiFno=; b=CO1ao+hlebAJTExEiiT2SMnQ+3oHZU9hoFAvotgRWfIFOD2l7EpiGt5PPqlllaO964i4PtnXa8clABIOvBVg4RnJTgeQZf5iCv0FUkYL0O5NNl/ZQQdYpF3ldwnQs/qVm79XzgxrmA3AtZn16pU24jE1RXNcA0APKJkTrFfnbDk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168839226762495.1625786362165; Mon, 3 Jul 2023 06:51:07 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlEmPlZUBMbbZobnayJLhxoLMovPHCicGNFCXwUkIYxzGF9Q46n3jE5jl3l+CI3QFLciWl0Ipw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392268264100007 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D3604=3D=3DERROR: 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: a2ad9da3190962acaa010fa8f44a9269f= 9081e1c) #1 0x7f60d4dc067e (/lib64/libxkbcommon.so.0+0x1c67e) (BuildId: b243a= 34e4e58e6a30b93771c256268b114d34b80) #2 0x7f60d4dc2137 in xkb_keymap_new_from_names (/lib64/libxkbcommon.s= o.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=C3=A9e 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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392269; cv=none; d=zohomail.com; s=zohoarc; b=Wc/VJxJQwrwVmsnwthaaLrSpBOQ/n9NW+OAat8vRKemAaYpRdBn1FpGmIybAzhxpV8qZgg4HW9cUmzZ/IqSrHSlQmtYkXk7dJAlsZPGQyHMOn54D99veywhA5pKWp9+G7oaAwNRr+8AgANTJFUoD7Ee4BryOdgojtt6AzyTGBFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392269; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pmUCRBf4Xho+2SbSl2R5MUiyr5uXTfWzrS4YFCHSA4g=; b=EpMkEE4w8A3sqa8a8yakEcv6vjIxmbUagLJdFJZ8R9B6I/HAQ21jvqP1lWrDs5d0fnJ3+nbV25foiut4WGeLUBMSIkTDmgclrRt6W6LwwWVuLDeraRe9Ryr4m+He5xnbOPhIA0gTMrEZ9+0zLx8UxQ2QmEIkrKLxH5eNCMZYH/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392269792104.24389326723951; Mon, 3 Jul 2023 06:51:09 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlGUqsC3UU9tPfvlan2VLd3btE5qSBWOosBiObtY78zyGTmeD/Y18QRkE+vuQvW2nvJy6JBI/w== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392271954100001 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=C3=A9e Message-Id: <20230630180423.558337-9-alex.bennee@linaro.org> diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuz= z.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 =3D generic_fuzz_crossover }); =20 - GString *name; - const generic_fuzz_config *config; - - for (int i =3D 0; - i < sizeof(predefined_configs) / sizeof(generic_fuzz_config); - i++) { - config =3D predefined_configs + i; - name =3D g_string_new("generic-fuzz"); - g_string_append_printf(name, "-%s", config->name); + for (int i =3D 0; i < ARRAY_SIZE(predefined_configs); i++) { + const generic_fuzz_config *config =3D predefined_configs + i; fuzz_add_target(&(FuzzTarget){ - .name =3D name->str, + .name =3D g_strconcat("generic-fuzz-", config->name, NULL), .description =3D "Predefined generic-fuzz config.", .get_init_cmdline =3D generic_fuzz_predefined_config_cmdli= ne, .pre_fuzz =3D generic_pre_fuzz, --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392180; cv=none; d=zohomail.com; s=zohoarc; b=aPa81nR5IjvDO06jTjgTSs7rnnGPzmpKu0y/VKJIickfdnklxHVs1XSFbvnpTQqqp2PjN+DxP844BOdPzf+YKSc688U7vV/zZnf/lY/IfEc3Izx3ocjLOhmgy9ajJHvV3OOW63bGPek+ZGsV3yEjuG7cquXyVY1SFS2ZjKN7QN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392180; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7/2/UjZO5LVZdyjze7eK8CMBEgeqrfQyTKhD3ann+Ss=; b=GogWdbxZYvO2d898NJJhkLy0/tshk+yGV/ggQhU2f7MmZRjFNqEdpovE3kx540HkOzcK8izrb8YprZ0ZS4uuavROEmjNQuNqC/4Du5tRHMq1nb9Sos4nKmsnIkpBoZBle7uuvInCrzvnW6W4FTLSnHLZY8Jw6mFYBd/0nT1uglA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392180112910.2002433593343; Mon, 3 Jul 2023 06:49:40 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ5JAuMCsDBTPZ//efmJh2gUcB44JuKBgiW28vPBIwVoGGPVH6W0dG3DnfhfhMpOrhIaUxJhLQ== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexander Bulekov , Paolo Bonzini , Bandan Das , Stefan Hajnoczi , Thomas Huth , Darren Kenny , Qiuhao Li , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392181453100001 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=C3=A9e 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=C3=A9e +# +# 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=3Dsuppressions=3Dscripts/oss-fuzz/lsan_suppressions.txt +env CC=3D"clang" CXX=3D"clang++" CFLAGS=3D"-fsanitize=3Daddress" ./scripts= /oss-fuzz/build.sh +export ASAN_OPTIONS=3D"fast_unwind_on_malloc=3D0" +for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep= -v slirp); do + grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || contin= ue ; + echo Testing ${fuzzer} ... ; + "${fuzzer}" -runs=3D1 -seed=3D1 || exit 1 ; +done --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392214; cv=none; d=zohomail.com; s=zohoarc; b=Sqqgk1ysfwtRpHchNuycVVg/piBoCQKndkeJmQrDZfDP81lnrRx9dm+mljvK242feDVFRm4rDXNNKdPYZssRs7RMDgN85ShpasepVFdZz9qHFsGqSWoTe1oYPGg3lpia9Mh9PzvClS0WCNjP/0BAHXvKGBzYlMf0vPqXnTlC4Ss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392214; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E90hciyt1UffWPwONrp14kWIyQMFUouofO9E1/IMQIY=; b=gq91jGBtvrGRt6NOZMNXR1TuC8/wxoyk4xmZeE2loz7wJ0cnHzOCpPKqjqXnF4ggeOBJ2/dIAMSCGVax80HTmLsDy261ZNo96Qp/n7+mmmr1fzXY8G+Gg0FsU/Sr4EJhqhTrnKyNX08TX8+X7oNqsJv6m64HXoPpZI57xqlnSaQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392214936308.3896382521176; Mon, 3 Jul 2023 06:50:14 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ4KMn1pRSUQY/yOATnKes0sYMA2WFdkOReRT0oUptOWGTGK6HTrucUkmeTNxz1pMyk/IWJPEg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392216542100003 This is yet another make target you usually run in the top level of the source directory. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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 =3D $(quiet-@)$(call quiet-command-run,$1,$= 2,$3) =20 UNCHECKED_GOALS :=3D 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-% =20 all: .PHONY: all clean distclean recurse-all dist msi FORCE --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392318; cv=none; d=zohomail.com; s=zohoarc; b=lDn/sU4UrUkHWf8MP8u3tVmismTpsW3pIYBMJ6XM4m9HCKDE6+lxjtjH3M0NnCFKydmGiW5SIJZzo2iSESLxmQxLtHgpeciAKnCHRjGwohZZIYnbQARH850hClN8J2USDLOQtuwKJEI0H7xezT1ZWAp/q9jCEn0WRgbdwH7N3tI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392318; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gbXOS2UafnQ3pS56dbbQl+HPmW3sM7cKkRCi6U8OV2M=; b=fZmvwTCSZ4h1Bl9Q1MZgTY6DKdKDcT8Owmf8jKw5XGvnRWgXwyELV66/Q8aVCn63w+Jat5nV8I9MokBP9cK8UKh2mCLI5iIbrLa03ecM9AmjT3rw1s5DxArK3UYM3euqp2Xb7DfNtk6nhF7Cr7/1JRzfS/5h8Ed6K2oy2xd1LsU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392318862205.9574676462446; Mon, 3 Jul 2023 06:51:58 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlFL61SyA6lixMr08cLZ4x7P0x9BtM6zI8bjNFiuR9qCyyaRkJ5n66yquZ+lvCuAWR8UZ/rEOA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392320109100001 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=C3=A9e Message-Id: <20230630180423.558337-12-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfi= les/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 =20 -FROM docker.io/library/alpine:3.16 +FROM docker.io/library/alpine:3.18 =20 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=3D"".join(debian11_extras)) --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688391926; cv=none; d=zohomail.com; s=zohoarc; b=Q+yDiNRRtVlhheUjx8dR2gIJBnQnERgHzKDTTmJnYgA7LZDs+FjOr/coGblgJSZfdAUOl6J/FfsCnl/6enN+BnTsfLKtTL5yDh8J3pJAH45ON9KW7kbXqxsQ809PZ1mwLTpTWvmB39OrTBD8DHeapWJfj7d3kZNJKSt46S03BXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688391926; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/s2hAOhMVhGFCPzbYe/mdoQHVg5UiqmQFlUH/WTBHa4=; b=hAKxXxsREYChx352xLGkbCdOTcFaV3SLqRqxFT4v180T2cjsRyoXsIn9xxK2wt65SQZ2QMtixbm/YrqRSo4wqZh17oLZbLik051bwaW/YYttkYPXkcbVKuj7/aHzVvuERkCV/MNMhOcTbpXQjm2ezoNdRXiYLcvKZpji8m1Q2hU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688391926895436.475754518657; Mon, 3 Jul 2023 06:45:26 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlHiFt5Xq/FCQVMi5pMjLc6AZ3jyTK/2g7ykD73xGv788sgqxK0P2ym7LD1s6q1LCqh/RWi3Bg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Erik Skultety , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688391927774100001 From: Erik Skultety Fedora 37 -> 38 Signed-off-by: Erik Skultety Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: [AJB: Dropped alpine (in prev commit), reflow commit msg] Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230630180423.558337-13-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/doc= ker/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 =20 -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 =20 RUN dnf install -y nosync && \ printf '#!/bin/sh\n\ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/doc= ker/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 =20 -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 =20 RUN dnf install -y nosync && \ printf '#!/bin/sh\n\ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfi= les/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 =20 -FROM registry.fedoraproject.org/fedora:37 +FROM registry.fedoraproject.org/fedora:38 =20 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=3D"".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=3Dcross_build("s390x-linux-gnu-", "s390x-softmmu,s390x-linux-use= r")) =20 - generate_dockerfile("fedora-win32-cross", "fedora-37", + generate_dockerfile("fedora-win32-cross", "fedora-38", cross=3D"mingw32", trailer=3Dcross_build("i686-w64-mingw32-", "i386-softmmu")) =20 - generate_dockerfile("fedora-win64-cross", "fedora-37", + generate_dockerfile("fedora-win64-cross", "fedora-38", cross=3D"mingw64", trailer=3Dcross_build("x86_64-w64-mingw32-", "x86_64-softmmu")) --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392491; cv=none; d=zohomail.com; s=zohoarc; b=EiRV35AbepnjM9/b8t5mpV2MKrp70ELH0jktd3PHQ1HY4Dk1bJM0z2oPIkzIAqYUrkHhKoja1lS+ygD/J7tJqvBEgCl9+7iXt48/uQrUtTE63281GREX3vjkb2NVwW/jjTh9p/KQAAEtpNfgdKdZYlwQkJmgNQ8IA7AKboSh0zY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392491; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3g1ZdS6tVQBEMQ0D/vXzVLJC2cdpbVKGouDWEpjqWrs=; b=gHFpdsmZLw/Md2kNuPAMjx5/U+8wQUUOpRkZRMK6MM7H0uDdawD2DIwcOkc8k5EV5sJS9QHX8MSWEJTb+3ugHr7l7X55dDSq4U0fNo7ccn5Ai9CvwTTqPjVhX4HNDmpKqJ45DhUeAQdSrSun4PCEMiAxM49udV7f8Gse/BCo6FQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392491367110.15984037235444; Mon, 3 Jul 2023 06:54:51 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlFYOChk+Y5gCp5q7eVR23Xaiy+busrbhNoFMfd6wL50EV7OBP+My2xi+q/lsic3y88HO/mraA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392491669100001 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=3D987818 for details. Update the packages while we are at it. Acked-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230630180423.558337-14-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ 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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/do= cker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/d= ocker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/doc= ker/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=3Dnoninteractive && \ exuberant-ctags \ findutils \ flex \ + gcc \ gcovr \ gettext \ git \ diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/doc= ker/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/doc= ker/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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688391927; cv=none; d=zohomail.com; s=zohoarc; b=AKLwsFw3sACReEMVnAWJx/7O0JtXD+mEKAaRplxgWYmkO57eRvSi7cQCcBmcyfwXOqqVl8/Oiu3lzeMX+kRWOonZ3+qkZXpf8iNQuMxU7UQbcyaHh/MogHM1MaeFYzTYyp7S3edM13psyX4lV1L1XVDtEozPVSMfNYcI0bMbSbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688391927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3QXiG/9ekTa+RipLUg3DjWaS82wOBRs7qXSyJ9mS8po=; b=ZGpjA/WosewREGm7ZjdiBG1eBn74I93mhVJiB6pFQ4AIv/eBdyS+zMiZkklo4lsgCsLRCV5gj35jfk0LWKr5l0V/LmvHEyYBq7WCpflmM7mFK9uEK7MLMa9IDfj1685sH46J0+xWJvcDWBNHMhtOF4q8nux485AssyKh+VVKTJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688391926993677.107217502389; Mon, 3 Jul 2023 06:45:26 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ5rNk1fo9IPiKahAtLooApFx7yq8FIwtVmdG5MQL4wbCJECLG7Z9LvoCWyeY5jRsFZLmmM/GQ== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688391929093100007 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=C3=A9e Message-Id: <20230630180423.558337-15-alex.bennee@linaro.org> diff --git a/tests/lcitool/projects/qemu-minimal.yml b/tests/lcitool/projec= ts/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 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392270; cv=none; d=zohomail.com; s=zohoarc; b=Xbddui797fky+nHm79CHgYClP+/iwD4AindrG71bRiqGJrFJ/9SQmkwziwomdMbbOb0/p/DcoDKAa3ZCMbCclL2e2iK0TaKk3qSqZe0PnOoLXrZbfNdMPvp6WCb1ONjp6Ail6NGvG6VXp9146Cim0tjEyRnGu2YiVwlijdKDwiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392270; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RSwlfu3OrMD7gLV99s4E7TTeOa5nvAq4Fdof1YBVMJk=; b=mvV3a8Bpk/EwtJ98nttHC1s5csirHABA0UvbBIDY/X33TBTMMcd3xKxXjNR6QCyuqLWYUFtSmjx1STtxgfAUXUCNyhRQHhd75NphRIYlB6/3hNXbOmOVNoBMy5d9/Zxr0hUa2aoe1E497myibKAcrSjtDkYUS8Z6b+y0ueZs2Nc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392270564618.0508565887928; Mon, 3 Jul 2023 06:51:10 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ4X1Yn3pLRAC35K1bJgZ76Nk7ZfDd9l6EYua+EdRPqlug/HD1UeFqEtaMm8ZAQm8DCg6cbnOg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392271982100002 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=C3=A9e Message-Id: <20230630180423.558337-16-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/d= ocker/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-minim= al # -# 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 =20 -# Add ports -RUN apt update && \ - DEBIAN_FRONTEND=3Dnoninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=3Dnoninteractive eatmydata apt update -yy && \ - DEBIAN_FRONTEND=3Dnoninteractive eatmydata apt upgrade -yy - -# Install common build utilities -RUN DEBIAN_FRONTEND=3Dnoninteractive 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 =20 -# 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=3Dnoninteractive && \ + 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 =20 -# Duplicate deb line as deb-src -RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sourc= es.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" =20 -RUN apt update && \ - DEBIAN_FRONTEND=3Dnoninteractive 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=3Dnoninteractive && \ + 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/ unreleas= ed 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 =3D '/usr/bin/riscv64-linux-gnu-gcc'\n\ +ar =3D '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\ +strip =3D '/usr/bin/riscv64-linux-gnu-strip'\n\ +pkgconfig =3D '/usr/bin/riscv64-linux-gnu-pkg-config'\n\ +\n\ +[host_machine]\n\ +system =3D 'linux'\n\ +cpu_family =3D 'riscv64'\n\ +cpu =3D 'riscv64'\n\ +endian =3D 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu &&= \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --sh= ow > /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-c= c && \ + 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-g= cc =20 -# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV ABI "riscv64-linux-gnu" +ENV MESON_OPTS "--cross-file=3Driscv64-linux-gnu" ENV QEMU_CONFIGURE_OPTS --cross-prefix=3Driscv64-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 =3D [ " id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n" ] =20 -def generate_dockerfile(host, target, cross=3DNone, trailer=3DNone): +def generate_dockerfile(host, target, project=3D"qemu", cross=3DNone, trai= ler=3DNone): filename =3D Path(src_dir, "tests", "docker", "dockerfiles", host + ".= docker") cmd =3D lcitool_cmd + ["dockerfile"] if cross is not None: cmd.extend(["--cross", cross]) - cmd.extend([target, "qemu"]) + cmd.extend([target, project]) =20 if trailer is not None: trailer +=3D "\n".join(add_user_mapping) @@ -164,6 +164,12 @@ try: trailer=3Dcross_build("powerpc64le-linux-gnu-", "ppc64-softmmu,ppc64-linux-use= r")) =20 + generate_dockerfile("debian-riscv64-cross", "debian-sid", + project=3D"qemu-minimal", + cross=3D"riscv64", + trailer=3Dcross_build("riscv64-linux-gnu-", + "riscv64-softmmu,riscv64-linux= -user")) + generate_dockerfile("debian-s390x-cross", "debian-11", cross=3D"s390x", trailer=3Dcross_build("s390x-linux-gnu-", --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392246; cv=none; d=zohomail.com; s=zohoarc; b=YJs82XKzQijjouIdWMLi2CpiXKn47PqWf5KMXr90rVfYGuLqR1rjkPc00qEou5HEmGsKqMFZ8axj+oRV5szTFFyqWTa0dMkx6bIuwOw5esw9GXgSjTJuGF05LSELt3rOGGKJVP4t32a+PXU/Xaw2+Oo0DU7aXPn4WYfu7ElDq6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392246; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aGjH3JSHTLFWqge6ozBEiG9tPjMP6rkOckp4e6jlWi8=; b=U8PmETjKs758nH7mt6sbNXoFksNt1vwFHolrCMBVtKORMBuKDqrdAf1khbe536IpZzbhsVSZYKogV5gISR6AUoHnS9FhxBFgw35DH3Zw+dc8O7hPqFV1FNnM97nNbRyE8GS/8UkZFtQDSRmqsdGKlcPxM1BCKDVT4UaxXLUFlQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392246673982.0817172753848; Mon, 3 Jul 2023 06:50:46 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ6DwgorNPRaj35eHp/wmFcli+W8pxjethMIx0kGDrnC7OXW/wabRxPmSpe4TGYgVcV0l8S/tw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Marcin Juszkiewicz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Radoslaw Biernacki , Peter Maydell , Leif Lindholm , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392247909100002 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=C3=A9e Message-Id: <20230630180423.558337-17-alex.bennee@linaro.org> diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machi= ne_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: =20 - - 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) =20 - Trusted Firmware-A - https://github.com/ARM-software/arm-trusted-firmware/tree/5fdb2e= 54 + https://github.com/ARM-software/arm-trusted-firmware/tree/c0d8ee= 38 =20 - 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 """ =20 # Secure BootRom (TF-A code) fs0_xz_url =3D ( - "https://fileserver.linaro.org/s/ATnSmq6k8SoXgbH/" + "https://fileserver.linaro.org/s/HrYMCjP7MEccjRP/" "download/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash =3D "a210a09692bcbe0a3743ffd0df44e80e0c7ad8ab" + fs0_xz_hash =3D "447eff64a90b84ce47703c6ec41fbfc25befaaea" tar_xz_path =3D self.fetch_asset(fs0_xz_url, asset_hash=3Dfs0_xz_h= ash) archive.extract(tar_xz_path, self.workdir) fs0_path =3D os.path.join(self.workdir, "SBSA_FLASH0.fd") @@ -93,15 +93,15 @@ def test_sbsaref_edk2_firmware(self): =20 # 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") =20 # 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") =20 # EL3 Runtime Software - wait_for_console_pattern(self, "BL31: v2.8(release)") + wait_for_console_pattern(self, "BL31: v2.9(release)") =20 # 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") =20 - @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout= ") def test_sbsaref_alpine_linux_cortex_a57(self): """ :avocado: tags=3Dcpu:cortex-a57 """ self.boot_alpine_linux("cortex-a57") =20 - @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout= ") def test_sbsaref_alpine_linux_neoverse_n1(self): """ :avocado: tags=3Dcpu:max """ self.boot_alpine_linux("neoverse-n1") =20 - @skip("requires TF-A update to handle FEAT_FGT") def test_sbsaref_alpine_linux_max(self): """ :avocado: tags=3Dcpu:max --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392108; cv=none; d=zohomail.com; s=zohoarc; b=ZNWKIg9bWMaQbNjy9Ol4YMQEbxBYYorbsEmZHzOpcQ5ik+pvKM3vzeOBqep+XzsoUvn+it2LPFBZK5gAiaLCBRxh1GBHt9HoQe3AKqi7zdZnBjZA7WMazjuh9lqnMhkX+NSMIFQxAssruyZchBpPUDNy4a2mz/3TBauj/YquWFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392108; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yHFer7VjnRbyKbTmhJ/jIDL23JfeX2bf67sUnbUfgAQ=; b=Gvp/GtA/Kt4k0eTJx20rSbJdXuujH9qeiMnAO+UmLTiVk2jIsDRrYNRZpXUIkunlcnbKczblc/R4sSs2OOg+j3oNJD+Ikj5qVoxzmAMcOMTqtiOuzYvxJw7cAzOZsaJUJIRcTj//5ip7OPHhNvCOR3coqW8SZlQ4JFOg36yKNu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392108545742.9310970279547; Mon, 3 Jul 2023 06:48:28 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ5vvoCjsNgAVrefSqUSmQB2syYYoAOl6VCjdt/mbba75gtgj6U8ban2/MdRpmiIdgHVI4cKaA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392109118100001 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=3D" parameter instead. Signed-off-by: Thomas Huth Message-Id: <20230630161604.446394-1-thuth@redhat.com> Tested-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e 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 =3D (self.KERNEL_COMMON_COMMAND_LINE + 'console=3DttyS0,115200 ' - 'root=3D/dev/mmcblk0 rootwait rw ' + 'root=3Db300 rootwait rw ' 'panic=3D-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', --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392549; cv=none; d=zohomail.com; s=zohoarc; b=FEHkRoa9Og+X4QUo5RZjNJgkzi7aO3rH+iDsj7CqbJzj1X9tkFpvlKKIBCTqsQCXBqwrcsTU/0HHhgRuL76avipiHxXImYPfwl8DS33Sc7GOoBnHviwGPGBCF2/bAleBds36++h48SG9ec02mm8WnxQ5GY4/nyiVv1bXZ3CbF1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392549; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BaNMUangs5gWtxxq2cv83Ymb8o2XEiPMP7DPTxDoR+U=; b=Nw3OrSuCMIAsqX9BRU3BLYqv6aVsjcVCKMvmWoqrkg+JhLf7bEUGDrL4cp06t+kmtFKVC5KkYlSfcqBVPfjCboZN4dnyAhchsCMKZ0qjNFxfexknsSHmF5zCJ1kWYrPljyPt/esH+w6VVCCvA0Hq1PoVn8bZ4Tu03jfAzhJgzG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168839254964392.51876638040096; Mon, 3 Jul 2023 06:55:49 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlFxuL+HfYd5sI70sHeztTfo6np0kCG61rGkK4CBM4sHwh+FspeZ6y0vPxgHtWpjGqSOzH+2Cg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392550270100001 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=C3=A9e 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 =3D ptw->out_host; =20 @@ -709,7 +709,7 @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t= old_val, =20 return cur_val; #else - /* AArch32 does not have FEAT_HADFS. */ + /* AArch32 does not have FEAT_HADFS; non-TCG guests only use debug-mod= e. */ g_assert_not_reached(); #endif } --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392275; cv=none; d=zohomail.com; s=zohoarc; b=Pp4M7XY2mApAqPUqM79JQ6uORCQoDxR87iWksVJkpC5oXggCNwojlc76A9zldyO9HrgZJdjSSyADrt8Zwhnma2KqxmnueBwRc4h7Do3CxMZGd4XJug2AsmaRYxxtElZrnfXyz8BUAe0h4C8ZHT26DhX/MOKFF/6Yf7in/5CStuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392275; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fKTgq9uBhU4V0WOGT1hkvfyceDee9sFu3Y7Qjj/4CPk=; b=IPeiryx/Q2AIz8nJIpBSu4Q/mvgjRdQCN7Q6Q36zZSZYnHvd5+27WzllvpEV40YHHd/Td8/9DpRsMRDj25dYY3Ygw6rYfgOmam2qbc3X5OhnxqxKe05Gw34CanMwFHy7cCMtRNAWAJbnfbjdPwur3hshm9sI2UP7AG5i1wh1IQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392275872925.7627620557522; Mon, 3 Jul 2023 06:51:15 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlFYfnyc9hFfv+NPVHP+tK+bPZVGNRkqT3JaOEWO4rMVeZYEvYoKZgaRxHJtRmsjs2x+M7APOQ== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Robert Henry , Aaron Lindsay , Paolo Bonzini , Riku Voipio , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392277875100001 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=3Don \ -kernel ./tests/tcg/aarch64-softmmu/memory-sve \ -plugin ./contrib/plugins/libexeclog.so,ifilter=3Dst1w,afilter=3D0x40001= 808 -d plugin gives (disas doesn't currently understand st1w): 0, 0x40001808, 0xe54342a0, ".byte 0xa0, 0x42, 0x43, 0xe5", store, 0x40213= 010, RAM, store, 0x40213014, RAM, store, 0x40213018, RAM And for user-mode: ./qemu-aarch64 \ -plugin contrib/plugins/libexeclog.so,afilter=3D0x4007c0 \ -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, 0x55008003= 70, load, 0x5500800371, load, 0x5500800372, load, 0x5500800373, load, 0x550= 0800374, load, 0x5500800375, load, 0x5500800376, load, 0x5500800377, load, = 0x5500800378, load, 0x5500800379, load, 0x550080037a, load, 0x550080037b, l= oad, 0x550080037c, load, 0x550080037d, load, 0x550080037e, load, 0x55008003= 7f, load, 0x5500800380, load, 0x5500800381, load, 0x5500800382, load, 0x550= 0800383, load, 0x5500800384, load, 0x5500800385, load, 0x5500800386, lo ad, 0x5500800387, load, 0x5500800388, load, 0x5500800389, load, 0x5500800= 38a, load, 0x550080038b, load, 0x550080038c, load, 0x550080038d, load, 0x55= 0080038e, load, 0x550080038f, load, 0x5500800390, load, 0x5500800391, load,= 0x5500800392, load, 0x5500800393, load, 0x5500800394, load, 0x5500800395, = load, 0x5500800396, load, 0x5500800397, load, 0x5500800398, load, 0x5500800= 399, load, 0x550080039a, load, 0x550080039b, load, 0x550080039c, load, 0x55= 0080039d, load, 0x550080039e, load, 0x550080039f, load, 0x55008003a0, load,= 0x55008003a1, load, 0x55008003a2, load, 0x55008003a3, load, 0x55008003a4, = load, 0x55008003a5, load, 0x55008003a6, load, 0x55008003a7, load, 0x5500800= 3a8, load, 0x55008003a9, load, 0x55008003aa, load, 0x55008003ab, load, 0x55= 008003ac, 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=C3=A9e 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 =20 #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, i= nt 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 =20 /* 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, CPUWa= tchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); #endif =20 +/** + * 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 =3D tlb_index(env, mmu_idx, addr); CPUTLBEntry *entry =3D tlb_entry(env, mmu_idx, addr); uint64_t tlb_addr =3D tlb_read_idx(entry, access_type); vaddr page_addr =3D addr & TARGET_PAGE_MASK; int flags =3D TLB_FLAGS_MASK & ~TLB_FORCE_SLOW; + bool force_mmio =3D check_mem_cbs && cpu_plugin_mem_cbs_enabled(env_cp= u(env)); CPUTLBEntryFull *full; =20 if (!tlb_hit_page(tlb_addr, page_addr)) { @@ -1553,7 +1554,9 @@ static int probe_access_internal(CPUArchState *env, v= addr addr, flags |=3D full->slow_flags[access_type]; =20 /* 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 !=3D MMU_INST_FETCH && force_mmio)) { *phost =3D NULL; return TLB_MMIO; } @@ -1569,7 +1572,7 @@ int probe_access_full(CPUArchState *env, vaddr addr, = int size, uintptr_t retaddr) { int flags =3D probe_access_internal(env, addr, size, access_type, mmu_= idx, - nonfault, phost, pfull, retaddr); + nonfault, phost, pfull, retaddr, tru= e); =20 /* 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; } =20 +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 =3D phost ? phost : &discard_phost; + pfull =3D pfull ? pfull : &discard_tlb; + + int flags =3D 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 &=3D ~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) >=3D size); =20 flags =3D probe_access_internal(env, addr, size, access_type, mmu_idx, - nonfault, phost, &full, retaddr); + nonfault, phost, &full, retaddr, true); =20 /* 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) >=3D size); =20 flags =3D probe_access_internal(env, addr, size, access_type, mmu_idx, - false, &host, &full, retaddr); + false, &host, &full, retaddr, true); =20 /* Per the interface, size =3D=3D 0 merely faults the access. */ if (size =3D=3D 0) { @@ -1644,7 +1670,7 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr ad= dr, int flags; =20 flags =3D probe_access_internal(env, addr, 0, access_type, - mmu_idx, true, &host, &full, 0); + mmu_idx, true, &host, &full, 0, false); =20 /* 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; =20 (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 =3D=3D 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, va= ddr addr, if (guest_addr_valid_untagged(addr)) { int page_flags =3D page_get_flags(addr); if (page_flags & acc_flag) { + if ((acc_flag =3D=3D PAGE_READ || acc_flag =3D=3D PAGE_WRITE) + && cpu_plugin_mem_cbs_enabled(env_cpu(env))) { + return TLB_MMIO; + } return 0; /* success */ } maperr =3D !(page_flags & PAGE_VALID); @@ -767,7 +771,7 @@ int probe_access_flags(CPUArchState *env, vaddr addr, i= nt size, =20 g_assert(-(addr | TARGET_PAGE_MASK) >=3D size); flags =3D probe_access_internal(env, addr, size, access_type, nonfault= , ra); - *phost =3D flags ? NULL : g2h(env_cpu(env), addr); + *phost =3D (flags & TLB_INVALID_MASK) ? NULL : g2h(env_cpu(env), addr); return flags; } =20 @@ -778,7 +782,7 @@ void *probe_access(CPUArchState *env, vaddr addr, int s= ize, =20 g_assert(-(addr | TARGET_PAGE_MASK) >=3D size); flags =3D probe_access_internal(env, addr, size, access_type, false, r= a); - g_assert(flags =3D=3D 0); + g_assert((flags & ~TLB_MMIO) =3D=3D 0); =20 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, S1Transl= ate *ptw, int flags; =20 env->tlb_fi =3D fi; - flags =3D probe_access_full(env, addr, 0, MMU_DATA_LOAD, - arm_to_core_mmu_idx(s2_mmu_idx), - true, &ptw->out_host, &full, 0); + flags =3D 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 =3D NULL; =20 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; =20 env->tlb_fi =3D fi; - flags =3D probe_access_flags(env, ptw->out_virt, 0, MMU_DATA_STORE, - arm_to_core_mmu_idx(ptw->in_ptw_idx), - true, &discard, 0); + flags =3D 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 =3D NULL; =20 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, =20 flags =3D info.page[0].flags | info.page[1].flags; if (unlikely(flags !=3D 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 } =20 /* 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 =20 TESTS +=3D sha512-vector =20 +ifneq ($(CROSS_CC_HAS_SVE),) +sha512-sve: CFLAGS=3D-O3 -march=3Darmv8.1-a+sve +sha512-sve: sha512.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +TESTS +=3D sha512-sve +endif + ifeq ($(HOST_GDB_SUPPORTS_ARCH),y) GDB_SCRIPT=3D$(SRC_PATH)/tests/guest-debug/run-test.py =20 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392506; cv=none; d=zohomail.com; s=zohoarc; b=Pr86So0S6hV9nec75zH2tBx0EIZQhi/Ri8pwEn8kokrYu6BagkJLRQ02yke6Ounz/Bv06E7rzTyH7wcUJVWTe8uDOjncWkmZmc/UpLcLS3il6WdGHEJimaj4TgduFbFUlhz2RYNn5sB4VkS3d0cFFh3o1umdlomaSQBZJM7fiA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392506; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p5nvMYyOs/RyJESBlIkw+wk/56rg5wafIOTXXNkBqK4=; b=dL9/dvKrx70TlJKKhspNw46nFMxG5v+d57r7H1unWhuaIAmjEMJjid02lMtZ1H6710FUWQDPQ6JhSZ7EfEARj963ESNBvdXCKLLaqXyyLI/v08IiEfEOw8exQgmrqERerWYiCNuLftdF/vEnk11nJPkr4ejhyIg+jeABzQkhmRQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392506294244.4793620788455; Mon, 3 Jul 2023 06:55:06 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlEdWfCdVpDDocviV+6YdhihBQxWrjiKDnR9rDCNJRCeEvVoxaMkEl/g6aT/1fiAy7Lo6Qvymw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392508095100005 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 wit= h 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); =20 if (g_strcmp0(tokens[0], "iblksize") =3D=3D 0) { l1_iblksize =3D 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 =3D 0; i < argc; i++) { - g_autofree char **tokens =3D g_strsplit(argv[i], "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(argv[i], "=3D", 2); if (g_strcmp0(tokens[0], "filename") =3D=3D 0) { file_name =3D 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, =20 for (int i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); if (g_strcmp0(tokens[0], "ifilter") =3D=3D 0) { parse_insn_match(tokens[1]); } else if (g_strcmp0(tokens[0], "afilter") =3D=3D 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 =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); 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, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", -1); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", -1); =20 if (g_strcmp0(tokens[0], "sortby") =3D=3D 0) { if (g_strcmp0(tokens[1], "reads") =3D=3D 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, =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(p, "=3D", -1); + g_auto(GStrv) tokens =3D g_strsplit(p, "=3D", -1); if (g_strcmp0(tokens[0], "inline") =3D=3D 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, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); =20 if (g_strcmp0(tokens[0], "track") =3D=3D 0) { if (g_strcmp0(tokens[1], "read") =3D=3D 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, =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(p, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(p, "=3D", 2); =20 if (g_strcmp0(tokens[0], "verbose") =3D=3D 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, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); 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 =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); 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, =20 for (int i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); =20 if (g_strcmp0(tokens[0], "haddr") =3D=3D 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, =20 for (int i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + g_auto(GStrv) tokens =3D g_strsplit(opt, "=3D", 2); =20 if (g_strcmp0(tokens[0], "print") =3D=3D 0) { if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_print)) { --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392258; cv=none; d=zohomail.com; s=zohoarc; b=aK62bd5IxSXdA7JN4h+BdDWXAEp0VeG+Z5N5vaxzuwl2wM2EL52C/yq7A35BIIpophetzk6qCB46JSlP7ajSDPOvgJTAvNez/9b7kDPoY5X94ArZ5aNXSvrx8IkXiVCLLQpuAMLvIHVfS7ZXV/wdTyj4T+tEGuhzYqCE5yKtffM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392258; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LKf4Hmc0LoALYt5gF/daH2iR5ELuErLCAXXDVmfzwLI=; b=AGXlOQU3Haua9UIgs4ldia3n7On1BDl9bPZXhVBgM9q0Su0TehTfRD9voUM8sE5xKTd1qqDcuWg/UlYVoD8cvWYP90fJBJxY3HCvuSF90oYcx8HZ3xBOS9QvvfjZ/2I54+4pGKVfsU/YsAmdRViiXcltniHDV715BkD6L8sA9Tw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392258306629.2377045472476; Mon, 3 Jul 2023 06:50:58 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlHTRRwBY+9VLdCJs+sbq7diSPRx2c7QHBJUGzVNd15tCyo9nJk+2sZFSZ2txAUGMJYcVcvC3g== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392259001100003 The old g_memdup is deprecated, use the replacement. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e 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 =3D g_slist_prepend(divergence_log, - g_memdup(&divrec, sizeof(divrec))); + g_memdup2(&divrec, sizeof(divrec))); =20 /* Output short log entry of going out of sync... */ if (verbose || divrec.distance =3D=3D 1 || diverged) { --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392456; cv=none; d=zohomail.com; s=zohoarc; b=jwbnI/ReA6rHoMPNYVeMM1FC1uDe+LrO0JjRJkDiDbHjvDXzfmXF60kaX3U/+iuvObq9Igi2iRHss6qu85i3NCiK0IqVRrJ30cMEpCZDTuoGWGyByDZDmV/PNuhM4+19/s3r+rZtsPJuMgI9oewERANA2F6coDJq+jUK9ijJyB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392456; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yWju6yYypmjiS4eVFMrIutfDiiFuiOcYWn1zgF31IBI=; b=GID/C2QJcuchVj0BeD6rETZGplaPqwwVNtkEY5HkApoQk1CYfqTvS4MhCkEV2L1KytfEK7+Vb/xtiv/tC0P6B4/G1fP/iZCdoGf8CTpfnBkh6ZZGzXxOxVvzTEbAc/tjkv543MUONaYOM8GNYNrBdytDlBtU8T6N0+bWXq5luvo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392456328231.725918699364; Mon, 3 Jul 2023 06:54:16 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ6Sz4TxfvYhJmiT02wOR9G4a4W9Rzj2CvhqjfrMRKFOxJ7s7fhXLfTha5wlil27+X0XZA7nvg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392457765100001 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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 ------------------------ =20 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 ------------- =20 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 --------------------- =20 -This section of the manual documents various parts of the internals of QEM= U. -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. =20 +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 =20 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: + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Translator Internals =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688393076; cv=none; d=zohomail.com; s=zohoarc; b=X4d1C7CzT7SVKYePNdxZ/e/eSCIWfbkLW668LaVyjsAYSrZXtCpJnNbZtj+jYMiHwmaFRXMqb4UtOofCh4kzbN15s3Uf9pmGYWH5t/QOEOSUfo7gJruEumhjKYedKcJeiZp4QRNre3qq3YV7+EONTUl+OJkssd7LypMdHF3PaFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688393076; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cQkmXVVKUzbF6+OR87LtMoCxllrcwffkoSGo6NXeAog=; b=R9CV/EGA76cyjikXAnjO1c944Qf91R3y8QQObPDsA/qSWPxP20sakss/C4PdrZ0//gM/ssOQWbn3OmRbmnslXArvezQX1NuS+4LgDRQK2T4zh8kR+tHKrKtUeeBNKB8qxy7TXJ4NI97EZhif6ez9HT2oHllmFqZ2rx/3br3qMX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688393076280605.8842864517597; Mon, 3 Jul 2023 07:04:36 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlGEDcddN9hwcOZAY2OT5DnGG82JvPvIJIumoLPHCzApyCP3hOtj3AXNUSsSh25qVnSxpOa1QA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Juan Quintela , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688393078421100001 Mention that QOM-ified devices already have support for registering the description. Reviewed-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Peter Xu Signed-off-by: Alex Benn=C3=A9e 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, u= int32_t instance_id, int required_for_version, Error **errp); =20 -/* 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) --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392591; cv=none; d=zohomail.com; s=zohoarc; b=bAiGqAccIztgAO0DKCz+7Y7k3URVcu7tBzW1CoV35lxRMuufglWijZrPt0ZPImLRvsC/W6OEy9CSFcjRaQArEgA0rT/WrC5Kj6ezfol5DuxHQCPw6yr9Z3ZWh8mcOiEoOW3FFLLTlQJasN3eTjLM3Uh5aWjUTfarR8IsoHU2nUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392591; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yXoqNo5zhMfqN+q9Xb0Ld9NmVD7yxr6uP9Vn88g3zuY=; b=QC8AvpcDnhrSyGlCxLMmux8kuWOfi/jak8JB1CXnGij8xbTKCpo5ntH1UEbKs/SOeRekmc2xcwNSb6nHtXO+VNGQI6wr3ay7FHcLPIPJQQ4U5azyS27fZU9Fb2ROdHYMVOYpG7QanvNtMtaBSsk+5xLGZhYcEo30qxFE1BW8jPI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392591847112.31101516064587; Mon, 3 Jul 2023 06:56:31 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlESy6kcORRROtGVsE+5i/B2tGqZapsHgotx5IsxootmHC2jBjhIAirCYIR7ccqsGMAbq2uaTg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392592561100006 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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" =20 +/** + * 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 @realiz= e. + * 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 examp= les. + * + * .. 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 =3D -1, }; @@ -38,7 +97,7 @@ typedef void (*BusRealize)(BusState *bus, Error **errp); typedef void (*BusUnrealize)(BusState *bus); =20 /** - * 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 @realiz= e. - * 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 childr= en - * 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 v= ia - * 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 examp= les. - * - * - * - * 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 >*/ =20 + /* 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; =20 - /* - * 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_; =20 - /* - * 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; =20 /* 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; =20 - /* device state */ + /** + * @vmsd: device state serialisation description for + * migration/save/restore + */ const VMStateDescription *vmsd; =20 - /* Private to qdev / bus. */ + /** + * @bus_type: bus type + * private: to qdev / bus. + */ const char *bus_type; }; =20 @@ -167,37 +201,96 @@ typedef struct { bool engaged_in_io; } MemReentrancyGuard; =20 + +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: */ =20 + /** + * @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 migr= ation + */ 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 setu= ps + */ 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 inter= face. + */ 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-entranc= y */ + /** + * @mem_reentrancy_guard: Is the device currently in mmio/pio/dma? + * + * Used to prevent re-entrancy confusing things. + */ MemReentrancyGuard mem_reentrancy_guard; }; =20 @@ -264,13 +357,24 @@ typedef struct BusChild { =20 #define QDEV_HOTPLUG_HANDLER_PROPERTY "hotplug-handler" =20 +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; =20 - /* - * 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 interfac= e. */ - - QTAILQ_HEAD(, BusChild) children; - QLIST_ENTRY(BusState) sibling; ResettableState reset; }; =20 /** - * 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); =20 @@ -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); =20 /** - * 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% other= wise. + * 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); =20 @@ -392,6 +505,8 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Erro= r **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); =20 @@ -420,16 +535,16 @@ void qdev_set_legacy_instance_id(DeviceState *dev, in= t 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 unl= ess * machine handler overrides it. * - * Returns: pointer to object that implements TYPE_HOTPLUG_HANDLER interfa= ce - * 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); =20 /** - * 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); =20 @@ -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); =20 @@ -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, cons= t 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, i= nt n); =20 @@ -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_ir= q *pins, const char *name, int n); =20 /** - * 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 l= ines * @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); =20 /** - * 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 behav= iour). @@ -762,14 +887,17 @@ int qdev_walk_children(DeviceState *dev, void *opaque); =20 /** - * 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 resettab= le * interface. It triggers a RESET_TYPE_COLD. */ void device_cold_reset(DeviceState *dev); =20 /** - * 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); =20 /** - * 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); =20 /** - * 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); =20 @@ -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); =20 /** - * 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 *listen= er); void device_listener_unregister(DeviceListener *listener); =20 /** - * @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 **er= rp); =20 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392593; cv=none; d=zohomail.com; s=zohoarc; b=j3xljvq2HQeGTMd7MAGtck3+USD4oEJg7gJA4k0USiM84ziJVCdyaaKhVAth4FWfdn6Yny4eYuoVnpx5JIfRtqgBdNhp0oAgerWIn9bvie6t+wUOWMcRRozee4zRGgpYAtdmuyE+OUIGWC8NDU4bo3LkS7/3dYzeo7FBqTCFPxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392593; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FpruFFgP8xcMdCiQPGu5amTD00E3kD8SzCu5zRJBIyU=; b=Umq5K8W02IxFY/KJG5oG8BBdBDAg9LxgHsj7nr8+GBIFy4eFkT4B8zrpQg9FFmLCFatM9SOJ8Mb/y4dkADvkV9y7KEssFc2cYiOnlZXIc5crFUTQLT39LjaB2WGhTEbk3BSg3OtUJCcWUaS08TuhMbPBsYb0uCJxsu0izv8ER2Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392593855951.1868125664492; Mon, 3 Jul 2023 06:56:33 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ778XVMueB7vhDy51j6b5CAR3ADYSwRVtAgkNww34d3vA6XyNz8YXKBEio8+jZGpZr2MNIBcw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392594722100001 From: Philippe Mathieu-Daud=C3=A9 Per commit 067109a11c ("docs/devel: mention the spacing requirement for QOM"): For a storage structure the first declaration should always be called =E2=80=9Cparent_obj=E2=80=9D and for a class structure the first m= ember should always be called =E2=80=9Cparent_class=E2=80=9D Adapt the QOM rST document accordingly. Reported-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230622101717.70468-1-philmd@linaro.org> Signed-off-by: Alex Benn=C3=A9e 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; =20 int reg0, reg1, reg2; } MyDevice; @@ -147,7 +147,7 @@ will also have a wrapper function to call it easily: =20 typedef struct MyDeviceClass { - DeviceClass parent; + DeviceClass parent_class; =20 void (*frobnicate) (MyDevice *obj); } MyDeviceClass; --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392473; cv=none; d=zohomail.com; s=zohoarc; b=BVMIsFVOaJ3kvY9luZALOPATm0pjf1WbB9R9WE8xuJ7cT1A3/ATVA0Hj2asxY0TTrLSv0VigyGul3nUbjN64VSDyek/EmVRrmN0VPKwZaTYJ5d+VoS0WTuhR+Brkn/GS49h2WODcveDPWA8GjrkzNc9/rw0dsOvHvv6g0Ot1NGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392473; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r6+iuI2PXGCyiWs8rbXeGtlJGrDRRAokHBPFrSzxP8Q=; b=QtWOpNjqXMe6Ft/mfqmjfuMmKu2PEIk5yPsn/joTiyFkRkTjV8FSeBxU70XEnkXFLQZ1mbFxGfeb4zU1yfb4ZwgDFf/9Y77zMc6DjGeyv2RJ/5vBU6E8087dzzay4WL/4IYLy86yGNvcftbIAyT1xyygDpfR2al0+DbNS4UcuHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392472968219.32363879162142; Mon, 3 Jul 2023 06:54:32 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlHPmHmMlsdMNXTCLMw/8M2G5smLhWJaHMynMhhvOADVBiQp638qH+kqBjuCS/JfnlC7KNTtXw== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392473906100003 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D +QEMU Device (qdev) API Reference +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D + +.. 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: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +QEMU Object Model (QOM) API Reference +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +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 ------------- =20 -.. kernel-doc:: include/qom/object.h +See the :ref:`QOM API` and :ref:`QDEV API` +documents for the complete API description. --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392505; cv=none; d=zohomail.com; s=zohoarc; b=mjvJFoMx1mNeWZWpncC1H9bSU9YcsgoOp5VzKdxmuS5uqFYVMhgtwCYIqLWZ0kxqGeC6h4DSRTQmIYLci4SUAQwH90+mcLG8wbrmuSxrUo0jm0oqe+0WRCRYJXh1fs1SeOdPya++rtg8cqVOVYBZDCrH060rLE7fWWaGg5Txm3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392505; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A17Yk078G+WbyuMB1//no9fohhpFQD0Go8gJ1S9AAiU=; b=MgbKPOdbK+I5MuBOegbhl2XehFDwFfJcG9JITlAfamgSTUU+s8hZIZeZ3GXOQL6zxwzliNj7pePW5lZ8mI+2GH5bxOmqqU8yzgnu3q3XLfUaXzVlsgh/iWy83vtn1Y2dHuzdbLkjzb5WoFigcIjK2iDs0ZvX+eX/VTl0p+dcJ0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392505895633.9926041607158; Mon, 3 Jul 2023 06:55:05 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ68hURcB6WrCJEJwX3Bk1hsRuhO+th/xKOQFGULbNLlIr5auds67n06cHkjOLRmqJlrEAoLxg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392507434100002 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +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 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +A simple minimal device implementation may look something like bellow: =20 .. code-block:: c :caption: Creating a minimal type @@ -48,6 +66,12 @@ In the above example, we create a simple type that is de= scribed by #TypeInfo. #TypeInfo describes information about the type including what it inherits from, the instance and class size, and constructor/destructor hooks. =20 +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() =20 @@ -98,7 +122,7 @@ when the object is needed. module_obj(TYPE_MY_DEVICE); =20 Class Initialization -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +-------------------- =20 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: } =20 Interfaces -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +---------- =20 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 SomethingI= fClass, or to dynamically cast it to an object that implements the interface. =20 Methods -=3D=3D=3D=3D=3D=3D=3D +------- =20 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 ob= tain the class and its non-overridden methods for a specific type. This would correspond to ``MyClass::method(...)`` in C++. =20 -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`. =20 Standard type declaration and definition macros =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -382,10 +406,32 @@ OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used inste= ad: OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) =20 +.. _device-life-cycle: + +Device Life-cycle +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +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. =20 +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``. =20 API Reference -------------- +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 See the :ref:`QOM API` and :ref:`QDEV API` documents for the complete API description. --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392228; cv=none; d=zohomail.com; s=zohoarc; b=FOLHiza3B98HUCplCMXOS/ImOQDrafEd0k6Z7g23fFbWczfK1l84h5lPm35YEiOZmnikF7sAdR7jbHihDxouL1q+T6HGBp5L4PIPq4fv4F1OsUial7AL7Eus9qKtF1NyPWifDkaBrqMxR6kghlkhOZ1w3zHeuwdrK2sOmXBd9qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392228; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jmuKSf2VcTxuXRVZK5WsSbiqmIzeKDjZMTTPleVdJHM=; b=R+OFYiQcpU/kTSiD6rbTlDv/l70/gP3oZMKWfL/dszLRJE0CNUUoIwQbCVTFUCg71vy1VAS9Cf25lwWb2r+gh9DmM4IW9ddF2EZYkgCBTJacF6H7XNL9WJEW6+HGeneg1rc0A5jhoghcd83w8mqx/1OQvzSBCA3Zv46sbPK96B4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392228464568.2979699786904; Mon, 3 Jul 2023 06:50:28 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlE/pJ0ZU62cDVFDxAtrv+BkgJBQzKkXHMmSU/tgQPyK0lk6pd8xP8t5cpteZP5bcaHXnMOfiA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392229831100003 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=C3=A9e 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) =20 int gdbserver_start(const char *device) { - trace_gdbstub_op_start(device); - - char gdbstub_device_name[128]; Chardev *chr =3D NULL; Chardev *mon_chr; + g_autoptr(GString) cs =3D g_string_new(device); =20 if (!first_cpu) { error_report("gdbstub: meaningless to attach gdb to a " @@ -350,15 +348,16 @@ int gdbserver_start(const char *device) return -1; } =20 - if (!device) { + if (cs->len =3D=3D 0) { return -1; } - if (strcmp(device, "none") !=3D 0) { - if (strstart(device, "tcp:", NULL)) { + + trace_gdbstub_op_start(cs->str); + + if (g_strcmp0(cs->str, "none") !=3D 0) { + if (g_str_has_prefix(cs->str, "tcp:")) { /* enforce required TCP attributes */ - snprintf(gdbstub_device_name, sizeof(gdbstub_device_name), - "%s,wait=3Doff,nodelay=3Don,server=3Don", device); - device =3D gdbstub_device_name; + g_string_append_printf(cs, ",wait=3Doff,nodelay=3Don,server=3D= on"); } #ifndef _WIN32 else if (strcmp(device, "stdio") =3D=3D 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 =3D qemu_chr_new_noreplay("gdb", device, true, NULL); + chr =3D qemu_chr_new_noreplay("gdb", cs->str, true, NULL); if (!chr) { return -1; } --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392475; cv=none; d=zohomail.com; s=zohoarc; b=D35FUiq04uVXQ6CcbJ4xVcZx9Q13p5LG3Myix6/o2NqFE4lIpX92nd9BTFqn7uRoob0xX00IpxidasGUCPk9egDPzUMBfa2Edpf0/FSffrMJf/Xi8/L4jAhl0AvBxhLg7O+ki/wFcGYaBNygaJj++1sR01dFbl9IlSbyV5WW7n8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392475; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=26POj3Pp+gIP3un1OHTdCprJFHUE2qyF+wMmQYT3qCc=; b=SJQvZjq/+T8sdfFGoCVlKl4gp8yspW8DjfjcC/jmmxtov8hk/TmquXOgKaICXATGrjjFYYhQYXbTWGey7SPNsSNXlrB99DNaS5HyflJh5QHaKKZnv9porAn6pNg6XdnbIRZ7UUz6jRRkzSDWgqH90A+rUoY95ansuBKcaz+xqMY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392475198926.384547701894; Mon, 3 Jul 2023 06:54:35 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlElOqfeWjkzQsBPWBLtXT0qguqx2dLPL3JRJCHnaWfpe4ghIvao7DdaBbZ/I7PpfibDKZBIYg== 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) From: =?UTF-8?q?Alex=20Benn=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=20Benn=C3=A9e?= , Taylor Simpson , =?UTF-8?q?Philippe=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392477282100001 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=C3=A9e 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=C3=A9e 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 =3D handle_backward, .cmd =3D "b", .cmd_startswith =3D 1, + .allow_stop_reply =3D true, .schema =3D "o0" }; cmd_parser =3D &backward_cmd_desc; --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392523; cv=none; d=zohomail.com; s=zohoarc; b=I+rjC2w7HnemPRBTHVxF+QpSCYfRgFEnvEoEjwzQ5OadQni0vBHBDXfJikKMN8zRE8WGRXKm9+lNX4sWdZPh7fB8330MUehfW04WrB9D9AbvDk86RxSYNsTbaXY2gMwddKkQ4TbD+sNRqopUsDDTW16o/1UUGC4smkFqjKl/7t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zNMPVNXEa7UqeTcFlr3/SM98KrOm4fYZhU+BaBqT8mY=; b=Y29Fvh5wp8oeKwjLjWtTAPZpYLV3eaWH6lEfu047O1c5pFnrUJl2NI/xDoohkA3rf1ZxXcnVSP+JypkLMjMEzXJxHNPB/GfVolnTzYG2qvPRgorvfvtzNLK3h99wJZ0qQNgdpAn8sqqaxo+xNQQiNPlmLgG26ZKKSqjLbwGpjdc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392523835577.8604765350775; Mon, 3 Jul 2023 06:55:23 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlF1hDSDIHbWsmZ7oSZQR7ecBNg+bE6k6dYf0ghtct1fE4AnPWe2xcUPhSIYeulgnc57ThT5BA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392524294100001 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=C3=A9 Signed-off-by: Alex Benn=C3=A9e 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 =3D 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 =3D gdb_get_max_cpus(); /* uninitialised CPUs stay 0 */ - newstates =3D g_new0(char, max_cpus); + g_autofree char *newstates =3D g_new0(char, max_cpus); =20 /* mark valid CPUs with 1 */ CPU_FOREACH(cpu) { @@ -597,8 +596,7 @@ static int gdb_handle_vcont(const char *p) res =3D 0; while (*p) { if (*p++ !=3D ';') { - res =3D -ENOTSUP; - goto out; + return -ENOTSUP; } =20 cur_action =3D *p++; @@ -606,13 +604,12 @@ static int gdb_handle_vcont(const char *p) cur_action =3D qemu_tolower(cur_action); res =3D qemu_strtoul(p, &p, 16, &tmp); if (res) { - goto out; + return res; } signal =3D gdb_signal_to_target(tmp); } else if (cur_action !=3D 'c' && cur_action !=3D 's') { /* unknown/invalid/unsupported command */ - res =3D -ENOTSUP; - goto out; + return -ENOTSUP; } =20 if (*p =3D=3D '\0' || *p =3D=3D ';') { @@ -625,14 +622,12 @@ static int gdb_handle_vcont(const char *p) } else if (*p++ =3D=3D ':') { kind =3D read_thread_id(p, &p, &pid, &tid); } else { - res =3D -ENOTSUP; - goto out; + return -ENOTSUP; } =20 switch (kind) { case GDB_READ_THREAD_ERR: - res =3D -EINVAL; - goto out; + return -EINVAL; =20 case GDB_ALL_PROCESSES: cpu =3D gdb_first_attached_cpu(); @@ -649,8 +644,7 @@ static int gdb_handle_vcont(const char *p) process =3D gdb_get_process(pid); =20 if (!process->attached) { - res =3D -EINVAL; - goto out; + return -EINVAL; } =20 cpu =3D get_first_cpu_in_process(process); @@ -668,8 +662,7 @@ static int gdb_handle_vcont(const char *p) =20 /* invalid CPU/thread specified */ if (!cpu) { - res =3D -EINVAL; - goto out; + return -EINVAL; } =20 /* only use if no previous match occourred */ @@ -679,12 +672,9 @@ static int gdb_handle_vcont(const char *p) break; } } + gdbserver_state.signal =3D signal; gdb_continue_partial(newstates); - -out: - g_free(newstates); - return res; } =20 --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392482; cv=none; d=zohomail.com; s=zohoarc; b=h/nWwBvBv01YnT7cRlslxamtnDZqVP3v6vZSO+u4hyK0+ISxLwaODRPwBHUvxOSxAlA0RNZeT/0Qm5kkfrSWf0zVFeHIDuZQDME4oTO0gCFnqkOHZI8lRAkUoOxAHvVfj5lVKC0iWFkx/yOooeyYE3fAdbJUW1ensX6KUZLLYXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392482; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/yGVpWL1h/+IqCMQOCfJngBlrYt5BXqNJvwRRIuY57g=; b=f8lZypTyeKfLeouSz3Y2dZAZNUVTms9QE2NMYaZrU5VWHRh6DiY2lpHla8VS/lr8X9dzk7wDLswOpCT3g9wFowWBxrkn+F7MP+j6cwNFr62kIr739tMpX1cwedfqohKtv4zkHrLal2anI/lx/9je9bxDWGWO4C+2+MaJ/lhujrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392482968868.6574395107629; Mon, 3 Jul 2023 06:54:42 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlErF4QONpj/AUEwtYU+APXkcecdUaiOabb1TD0g9DibYLlYAnhHQfbDviNYz2+EVuJ5iHlR3A== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392484033100003 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=C3=A9e Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id: <20230621203627.1808446-2-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e 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; =20 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); =20 /* user access */ =20 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 f= d) } #endif =20 -static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathnam= e, 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 dirf= d, const char *pathname, int return safe_openat(dirfd, path(pathname), flags, mode); } =20 +ssize_t do_guest_readlink(const char *pathname, char *buf, size_t bufsiz) +{ + ssize_t ret; + + if (!pathname || !buf) { + errno =3D EFAULT; + return -1; + } + + if (!bufsiz) { + /* Short circuit this for the magic exe check. */ + errno =3D 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 =3D MIN(strlen(exec_path), bufsiz); + /* We cannot NUL terminate the string. */ + memcpy(buf, exec_path, ret); + } else { + ret =3D 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, in= t num, abi_long arg1, case TARGET_NR_open: if (!(p =3D lock_user_string(arg1))) return -TARGET_EFAULT; - ret =3D get_errno(do_openat(cpu_env, AT_FDCWD, p, + ret =3D 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, in= t num, abi_long arg1, case TARGET_NR_openat: if (!(p =3D lock_user_string(arg2))) return -TARGET_EFAULT; - ret =3D get_errno(do_openat(cpu_env, arg1, p, + ret =3D 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 =3D lock_user_string(arg1); p2 =3D lock_user(VERIFY_WRITE, arg2, arg3, 0); - if (!p || !p2) { - ret =3D -TARGET_EFAULT; - } else if (!arg3) { - /* Short circuit this for the magic exe check. */ - ret =3D -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 =3D MIN(strlen(exec_path), arg3); - /* We cannot NUL terminate the string. */ - memcpy(p2, exec_path, ret); - } else { - ret =3D get_errno(readlink(path(p), p2, arg3)); - } + ret =3D get_errno(do_guest_readlink(p, p2, arg3)); unlock_user(p2, arg2, ret); unlock_user(p, arg1, 0); } --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392477; cv=none; d=zohomail.com; s=zohoarc; b=fRgoAA3lMZ56pZJYSIqBF5DkDYXPMFWAC13scGg9l6ETDdBio0dhnsO783jx14OtkMY9FRT+S+KtaICWnjcffNsBX2k0p1hp43eCpjcGbnK0w2f8szOnrpp/r+Ql8V2vwCErBAyzbu5OfW6PD7YbxJgHXqRzFCyF/OO9YKRCiH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392477; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7Mnp8y2sy0S7tTiA16Y+6uh+LPx0EUvTSKKrt0wZYOY=; b=CHhIjiTHB9LlL0J9ZZrETHNmry7BIQRTdXclhd892KyAfhVZ63cD8oAzKX2urt8wOTwWAyiyoCagbVIYNq4BcLq50B2ncZe8Ot/11XjFPayKPFfuklW/EeyyBm42NaZeWNjuC6JmzvqKZv1dKBfJyXKfDzzcTojuEu5R0qYUCnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392477879319.83038390951936; Mon, 3 Jul 2023 06:54:37 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlER0lnSS4EVEK3wr2WGTCEQHsZ5M398nu/ODNUbuRibgp/CHXUepZPnXgr2+jHNVHhRGL8Jtg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392479786100001 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=C3=A9e 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 { =20 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); =20 /* 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 f= d) #endif =20 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, }; =20 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); + } } =20 for (fake_open =3D fakes; fake_open->filename; fake_open++) { @@ -8518,7 +8522,11 @@ int do_guest_openat(CPUArchState *cpu_env, int dirfd= , const char *pathname, return fd; } =20 - 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); + } } =20 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, in= t num, abi_long arg1, return -TARGET_EFAULT; ret =3D 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, in= t num, abi_long arg1, return -TARGET_EFAULT; ret =3D 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; --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392442; cv=none; d=zohomail.com; s=zohoarc; b=EUCKzAHAC/d23Tm/jAeYuuLDDhyKRqybtm4PLMGX2YRyuHImW/DzL/d9jhYBEE6lmSe1Rtp8NRTd8m1ZSHrtbWVQiO+Yjn/qfuH7kccKkPPkqrfDJtOYGdqAQN4TnRUPxJFnE8XYmB0Y3Dde/oJyQJ6okCnPd1OFxAYHeJPVvHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392442; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w6WYXW4Y2CRXzJldZHFZiOGa1GgkyQ7N7MNmvXCUxfM=; b=HRiZn0FZdaiVxfIdMjIXi3j7xKhxuyAnHe0pl23ZWwMMArzokK3npkX+dWpsD3eNveNBiHvm2HxUXrAS+ybn4GAOqYwR9jaGz+b4RCaWEaG6oLe3F/ZGaX25AkSB9Z2LenqOko6f8mFpsydZz7PTbcB1ynCfEfCHZ1ooOjJj5Ug= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392442580681.1801041321391; Mon, 3 Jul 2023 06:54:02 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlEwI+tG4ka4X2WNFrHru0XlOSGB9dLQ9eXnOSSpFsQHBJt+RN/8bIpmrn6QnYGuNMPgmd4O8A== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392442995100001 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=C3=A9e 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; } =20 -static int open_self_maps(CPUArchState *cpu_env, int fd) +static void show_smaps(int fd, unsigned long size) +{ + unsigned long page_size_kb =3D TARGET_PAGE_SIZE >> 10; + unsigned long size_kb =3D 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 =3D env_cpu(cpu_env); TaskState *ts =3D 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"); + } } } =20 @@ -8103,11 +8144,25 @@ static int open_self_maps(CPUArchState *cpu_env, in= t fd) " --xp 00000000 00:00 0", TARGET_VSYSCALL_PAGE, TARGET_VSYSCALL_PAGE + TARGET_PA= GE_SIZE); dprintf(fd, "%*s%s\n", 73 - count, "", "[vsyscall]"); + if (smaps) { + show_smaps(fd, TARGET_PAGE_SIZE); + dprintf(fd, "VmFlags: ex\n"); + } #endif =20 return 0; } =20 +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 =3D 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[] =3D { { "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 }, --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392519; cv=none; d=zohomail.com; s=zohoarc; b=Z3ofFAplCXPnQdKj+MlKOmSW+RyVBoLhmla9BSjCpZGcpWH+eOCGMMXbwdqGSvOFd8PxB1lPQLtcWAFCJ/AVVBSG1DGey2BwSHzW0FpJdMupvTwGeSeFQcYtX1NcEi4R4+CcouDCKs/8k2tDrqGns8j0swU8V9VIHGcgCp5CkDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392519; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Sa+wfZu+Nea0/Jly4iHaBSQb1C7qOF4WA65LCb+E1bE=; b=Es3GVT47RzxsMxbNtW5F1OlkSOpEDWds63yYfkVN0+GlOYFEM1BdeZR4+byueI6e6ReYW+seVOQQKnjX95uSxgLyZwErTpIVhZb6XHryy/uPxu9acFMXM1gjaTofEVWfDL5qvzcshPb3CF5uWl1R7NPerWOwK56HUOKWy3lZ4d8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392519908210.21100005259586; Mon, 3 Jul 2023 06:55:19 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlGaR7W1Y0I+l++kxgWd/Nut2Fv4fGcybvp/ptVolf1Cg2GXfwLoJPs3n0a+UPTyBUr17VJPpQ== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392521918100001 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=C3=A9e Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-5-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e 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; } =20 -static GDBProcess *gdb_get_process(uint32_t pid) +GDBProcess *gdb_get_process(uint32_t pid) { int i; =20 @@ -247,7 +247,7 @@ static CPUState *find_cpu(uint32_t thread_id) return NULL; } =20 -static CPUState *get_first_cpu_in_process(GDBProcess *process) +CPUState *gdb_get_first_cpu_in_process(GDBProcess *process) { CPUState *cpu; =20 @@ -325,7 +325,7 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid) return NULL; } =20 - return get_first_cpu_in_process(process); + return gdb_get_first_cpu_in_process(process); } else { /* a specific thread */ cpu =3D 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 =3D get_first_cpu_in_process(process); + CPUState *cpu =3D gdb_get_first_cpu_in_process(process); CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 len =3D 0; @@ -490,7 +490,7 @@ void gdb_register_coprocessor(CPUState *cpu, =20 static void gdb_process_breakpoint_remove_all(GDBProcess *p) { - CPUState *cpu =3D get_first_cpu_in_process(p); + CPUState *cpu =3D gdb_get_first_cpu_in_process(p); =20 while (cpu) { gdb_breakpoint_remove_all(cpu); @@ -647,7 +647,7 @@ static int gdb_handle_vcont(const char *p) return -EINVAL; } =20 - cpu =3D get_first_cpu_in_process(process); + cpu =3D gdb_get_first_cpu_in_process(process); while (cpu) { if (newstates[cpu->cpu_index] =3D=3D 1) { newstates[cpu->cpu_index] =3D cur_action; @@ -1270,7 +1270,7 @@ static void handle_v_attach(GArray *params, void *use= r_ctx) goto cleanup; } =20 - cpu =3D get_first_cpu_in_process(process); + cpu =3D gdb_get_first_cpu_in_process(process); if (!cpu) { goto cleanup; } @@ -1393,7 +1393,7 @@ static void handle_query_curr_tid(GArray *params, voi= d *user_ctx) * first thread). */ process =3D gdb_get_cpu_process(gdbserver_state.g_cpu); - cpu =3D get_first_cpu_in_process(process); + cpu =3D 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(); --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392591; cv=none; d=zohomail.com; s=zohoarc; b=XLZfqtEuBU18C2hk6lgtJ3WT+ks+BxhqeNuimOzc79QGwLT8cYXCVqMOpnh4oeQ8/obrWH9ZLrsVFMfqcKIV3yPH7l5hBNUYUjGv0j+xypdle783LBgb2H6xEF/O27yX8Zi1NJmSkRK59UtGYbw5bJzBAnKPYm/ok3c5J76s3aM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392591; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8cD1juvMLwUrVgA78Nj95KzI+qlKYsgqazsEWOJa4kM=; b=CjjeGxYUqwcY6V/YS+ZbHsmJv5/7drj11CXyZgLq+bMUsT7SbrquHdju2nWMZflVuNmofjz9SNgOOmVC2/+P2tJs+tCmKlcDh3Za/fycgWa9hrMx3xQO4H9u2EUBWbeuG8F+uRETy9EokoeRHy8SOvkBIw+FQ6KVSCq3pyG30zQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392591804698.8558554617323; Mon, 3 Jul 2023 06:56:31 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: ACHHUZ6cvN3McEbazb9Zi2FnxYT6PBnD6AWvrCoAqZOyWzqNOD1mLF2RIT08j0TOmftbX37g93vWmA== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392592292100002 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=C3=A9e Signed-off-by: Ilya Leoshkevich Message-Id: <20230621203627.1808446-6-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e 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 le= n) =20 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 =3D=3D UNASSIGNED_CLUSTER_INDEX) { /* Return the default process' PID */ int index =3D gdbserver_state.process_num - 1; return gdbserver_state.processes[index].pid; } return cpu->cluster_index + 1; +#endif } =20 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 =3D 0; + int pid; =20 +#ifdef CONFIG_USER_ONLY + assert(gdbserver_state.process_num =3D=3D 0); + pid =3D getpid(); +#else if (gdbserver_state.process_num) { - max_pid =3D s->processes[s->process_num - 1].pid; + pid =3D s->processes[s->process_num - 1].pid; + } else { + pid =3D 0; } + /* We need an available PID slot for this process */ + assert(pid < UINT32_MAX); + pid++; +#endif =20 s->processes =3D g_renew(GDBProcess, s->processes, ++s->process_num); process =3D &s->processes[s->process_num - 1]; - - /* We need an available PID slot for this process */ - assert(max_pid < UINT32_MAX); - - process->pid =3D max_pid + 1; + process->pid =3D pid; process->attached =3D false; process->target_xml[0] =3D '\0'; } --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392549; cv=none; d=zohomail.com; s=zohoarc; b=NK+ZvpHWV4yBpx4fr93aIKyYDlo9RVrzXJTC9pIdp6iDXqD4PSQkr+sJywOFF5Ezekp3w4VvGutMuzG7iU0iZbcOBxNhziI64wrCnl/dUBBCQ1QL03KHpt+5OaHAe4BA3LXMpXyqp5Xev4Z2mBiEqrQxJLB9GmElppyKDor7x+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392549; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0VsK9/3tU0+hejhhrfU2ALG7tWi27m7Wvg/SQNXP0qo=; b=UUihpXz4M+5CgqtwaSah+PYy4zXocKDwr4MZbPaNzB2tHdZbTRn37x61S0UBr85bmV+EEJPieavcwKO+2VtlIg2DaxTra6D0gkkFcJS2ZWe4vUYwrqkj7aCOq+dJip9hzWCvDHtUVHUlxkY0l1FB8nzy5ct3bea2evFVdk0OoXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168839254949238.49854889859682; Mon, 3 Jul 2023 06:55:49 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlGfVIU99Se0E2g8fr6wgC966wyaDGMdBTULMV+/K3uJSPaJpQ3l7uKhFTP1gVhLS0yEhgFr8A== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , Dominik 'Disconnect3d' Czarnota , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392550283100002 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=C3=A9e 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); /* u= ser */ =20 void gdb_handle_query_attached(GArray *params, void *user_ctx); /* both */ =20 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[]= =3D { .cmd =3D "Kill;", .cmd_startswith =3D 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 =3D gdb_handle_v_file_open, + .cmd =3D "File:open:", + .cmd_startswith =3D 1, + .schema =3D "s,L,L0" + }, + { + .handler =3D gdb_handle_v_file_close, + .cmd =3D "File:close:", + .cmd_startswith =3D 1, + .schema =3D "l0" + }, + { + .handler =3D gdb_handle_v_file_pread, + .cmd =3D "File:pread:", + .cmd_startswith =3D 1, + .schema =3D "l,L,L0" + }, + { + .handler =3D gdb_handle_v_file_readlink, + .cmd =3D "File:readlink:", + .cmd_startswith =3D 1, + .schema =3D "s0" + }, +#endif }; =20 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+"); } =20 -#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 =20 if (params->len && strstr(get_param(params, 0)->data, "multiprocess+")) { @@ -1615,13 +1648,21 @@ static const GdbCmdParseEntry gdb_gen_query_table[]= =3D { .cmd_startswith =3D 1, .schema =3D "s:l,l0" }, -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX) +#if defined(CONFIG_USER_ONLY) +#if defined(CONFIG_LINUX) { .handler =3D gdb_handle_query_xfer_auxv, .cmd =3D "Xfer:auxv:read::", .cmd_startswith =3D 1, .schema =3D "l,l0" }, +#endif + { + .handler =3D gdb_handle_query_xfer_exec_file, + .cmd =3D "Xfer:exec-file:read:", + .cmd_startswith =3D 1, + .schema =3D "l:l,l0" + }, #endif { .handler =3D 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 =20 /* * 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 =3D 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 =3D get_filename_param(params, 0); + uint64_t flags =3D get_param(params, 1)->val_ull; + uint64_t mode =3D get_param(params, 2)->val_ull; + +#ifdef CONFIG_LINUX + int fd =3D do_guest_openat(gdbserver_state.g_cpu->env_ptr, 0, filename, + flags, mode, false); +#else + int fd =3D 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 =3D get_param(params, 0)->val_ul; + + if (close(fd) =3D=3D -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 =3D get_param(params, 0)->val_ul; + size_t count =3D get_param(params, 1)->val_ull; + off_t offset =3D get_param(params, 2)->val_ull; + + size_t bufsiz =3D MIN(count, BUFSIZ); + g_autofree char *buf =3D g_try_malloc(bufsiz); + if (buf =3D=3D NULL) { + gdb_put_packet("E12"); + return; + } + + ssize_t n =3D 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 =3D get_filename_param(params, 0); + + g_autofree char *buf =3D g_try_malloc(BUFSIZ); + if (buf =3D=3D NULL) { + gdb_put_packet("E12"); + return; + } + +#ifdef CONFIG_LINUX + ssize_t n =3D do_guest_readlink(filename, buf, BUFSIZ); +#else + ssize_t n =3D 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 =3D get_param(params, 0)->val_ul; + uint32_t offset =3D get_param(params, 1)->val_ul; + uint32_t length =3D get_param(params, 2)->val_ul; + + GDBProcess *process =3D gdb_get_process(pid); + if (!process) { + gdb_put_packet("E00"); + return; + } + + CPUState *cpu =3D gdb_get_first_cpu_in_process(process); + if (!cpu) { + gdb_put_packet("E00"); + return; + } + + TaskState *ts =3D cpu->opaque; + if (!ts || !ts->bprm || !ts->bprm->filename) { + gdb_put_packet("E00"); + return; + } + + size_t total_length =3D strlen(ts->bprm->filename); + if (offset > total_length) { + gdb_put_packet("E00"); + return; + } + if (offset + length > total_length) { + length =3D total_length - offset; + } + + g_string_printf(gdbserver_state.str_buf, "l%.*s", length, + ts->bprm->filename + offset); + gdb_put_strbuf(); +} --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688392282; cv=none; d=zohomail.com; s=zohoarc; b=RQCwW50l55C5JASlyvXS4rerRZeuTkrSYxoMHFhLh5y2A+CEx4a4Cc1nvGAwCCC0JVv0O/lQ6E6zbxZqRqlJZgxpAyuIXpP5/5R6b37zNmYlDqmH+sUZYRqbPnEi722IVbkoJaPqKvz0gQf535ongY2F2fs/SmkuaubrXmfeWYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688392282; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9GVtKOcv/SO0Bd9fPGHoO3oydZ4Ss+XbZE8K/rNAROI=; b=RcnUlrtRSW2tLJi4RMjSBFlt7X4WYX4r59sS9qI1lfyiMh59FdsZQd8BByEm47O/jSnhw/6xJkr5jrCq+j4HUr81HlAAji8Z+oi4l3+fcOKqcw1XUbWfswBRxKtWWGrPBqzNdYuNfENmGVFiZK0GFPYJ8k+CihK24/RknrvLJTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688392282346175.92294171760773; Mon, 3 Jul 2023 06:51:22 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlHFbkggSkW8k+Ha1HWC8H87j7dK4RsZij8A/UvuF2TF3lcDgyQXKnmapw/kgYtOZ5I0e7y9+g== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688392283855100005 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=C3=A9e Signed-off-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230621203627.1808446-8-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e 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 followin= g command: =20 ``maintenance packet Qqemu.PhyMemMode:0`` This will change it back to normal memory mode. + +Security considerations +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Connecting to the GDB socket allows running arbitrary code inside the gues= t; +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 t= he +host. + +The GDB socket is not protected by authentication, authorization or encryp= tion. +It is therefore a responsibility of the user to make sure that only author= ized +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. --=20 2.39.2 From nobody Wed May 15 08:25:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1688393076; cv=none; d=zohomail.com; s=zohoarc; b=af9KOoYgabKLgMAH3ZowG/KzURTF8DRfAsSEUbPa8egnah9uqf7/oexDq+Vj0v1w9VxOcfJNx9rOE1zwfCcNL+lub+3MaZsG2wN3g3QtxJlTnUoVKjZaM/+25Pksi0zKFUv8upmT5s/avs3Kv3iVPrIuCQNidrY/owbvWZiNQ+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688393076; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L10INYSmGRMwfYRjSmnypN3cJI3i4gGGNLhvyw0OvLw=; b=Ic0TnBlXeHDZOwFJRA9S6mX6bpWLWj1TvVNVGA7PRuGAAH5llO5jKcqbcO0Cgo+GtkQX0Jje+feLJuHLebuJ7aFw+Ub/pnt20CAJK351xTe/eqL9moEd+hDoFM0Df27g7PlzA4gk7Z++iBK1d+zkongWMMfGJ81deo84pCDgAb4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688393076272837.7760370208249; Mon, 3 Jul 2023 07:04:36 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: APBJJlHn8ZYYnr7wkJtxLulKPxyFdaIbJNVfnJoxo8U0SRhFV5WUw54dG8ivbsOSxTxnPIyydTSYfg== 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) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Ilya Leoshkevich , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1688393134377100001 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=C3=A9e Message-Id: <20230630180423.558337-39-alex.bennee@linaro.org> diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.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) =20 +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 +=3D run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ - run-gdbstub-thread-breakpoint + run-gdbstub-proc-mappings run-gdbstub-thread-breakpoint =20 # 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 =3D 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 +=3D 1 + + +def run_test(): + """Run through the tests one by one""" + try: + mappings =3D gdb.execute("info proc mappings", False, True) + except gdb.error as exc: + exc_str =3D str(exc) + if "Not supported on this target." in exc_str: + # Detect failures due to an outstanding issue with how GDB han= dles + # 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 infer= ior") + report("/sha1" in mappings, "Found the test binary name in the mapping= s") + + +def main(): + """Prepare the environment and run through the tests""" + try: + inferior =3D 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') =3D=3D 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() --=20 2.39.2