From patchwork Thu Oct 24 09:55:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8AA04CDDE6A for ; Thu, 24 Oct 2024 09:57:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua4-0001En-PT; Thu, 24 Oct 2024 05:56: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 1t3uZh-00017p-A0 for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZd-0003lw-N7 for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:13 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a9a850270e2so111784266b.0 for ; Thu, 24 Oct 2024 02:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763766; x=1730368566; darn=nongnu.org; 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=WlYwCLJPntZpps5540Jdj5JvD8apt5/VR01vEu64SdQ=; b=TTFN/MvGzrtOITIT2IXQYJhqQtOwoheglbAWN0LWxNJQJveL6eNXnsdWhBWW71gKpW DPhQ9iwRJyxIp9R0NKFz9sUjQB95H5GlLAuCTJDbVfBr+aw/rFlfAMzIlMa4lWbliHO3 baRZO+U2M/+AK7qfI96l80tZiT6vcj/nSR5WdrONfHJHFG+lP8d5mLjbYiA/LUrZ90Yz 28naikF53mWGQiVKEgDPoRCUqd9vQRDPUZreSCl9Cg+5+QL3j8Z7MsqEPFekh6SVmAxA EcuJRT/82w+T/PGqOtXYZC6rjFWwyKh+bzZt0ZqaDuAjfmrRSr9ZL/La2Lw/E9Vc68r7 xAJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763766; x=1730368566; 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=WlYwCLJPntZpps5540Jdj5JvD8apt5/VR01vEu64SdQ=; b=UQMS6ik0Vqf72OJve9Y9JPUFVZNm4iUogI+pw3zcnO5DeCtJcwxSmrhVgkS/Lej044 WS0bynbh5eQkVtPVY0vyrbWbpel8nZBeronMrFHpTgfe8oWShAO2HAz3nZikJyAblfyD jX1/PKHec5g/FI0cqCxS0M19MlRSzn8EfpKNIFbRYSi9MEfggBHbIOCC2lTp6orBXmeo HQCf7xDs10K5TwJI71cjjNqbASYWyaCi/wsksdnnBUoJwLdF7wwwne8hqTnCoEa2c/aj CIilRvc0QK2OhvaNuCnG4l4utNOtgYTOF4nPq/RPODqhzMdfLeUVWRQpoYLGcflU/2jH tBgQ== X-Gm-Message-State: AOJu0Yxa+RmGcFfGoTztaiqQaEnAvMuhitiY4u3yClSWD39sufEtsmHz 6xQMYMLF8dDBbIZH7G+syrg/MMNmqot0HGk4ytTKHQXInLOrZzRUwyWRsfjNr+M= X-Google-Smtp-Source: AGHT+IFsPt0ZN/1WYYftpt5idLLMwmTAGSaC5DoxOHWJKgqdzcaThMvPoTm9+zJR4CyEKltMgzA2nQ== X-Received: by 2002:a17:906:d554:b0:a99:5ad9:b672 with SMTP id a640c23a62f3a-a9abf853500mr478993666b.10.1729763765825; Thu, 24 Oct 2024 02:56:05 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91575894sm591717166b.185.2024.10.24.02.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:04 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1F7CA5F8AD; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Peter Maydell , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta Subject: [PULL 01/17] tests/docker: Fix microblaze atomics Date: Thu, 24 Oct 2024 10:55:47 +0100 Message-Id: <20241024095603.1813285-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Ilya Leoshkevich GCC produces invalid code for microblaze atomics. The fix is unfortunately not upstream, so fetch it from an external location and apply it locally. Suggested-by: Peter Maydell Signed-off-by: Ilya Leoshkevich Reviewed-by: Pierrick Bouvier Message-Id: <20240919152308.10440-1-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-2-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh index 23ec0aa9a7..c5cd0aa931 100755 --- a/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh +++ b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh @@ -10,6 +10,8 @@ TOOLCHAIN_INSTALL=/usr/local TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root +GCC_PATCH0_URL=https://raw.githubusercontent.com/Xilinx/meta-xilinx/refs/tags/xlnx-rel-v2024.1/meta-microblaze/recipes-devtools/gcc/gcc-12/0009-Patch-microblaze-Fix-atomic-boolean-return-value.patch + export PATH=${TOOLCHAIN_BIN}:$PATH # @@ -31,6 +33,12 @@ mv gcc-11.2.0 src-gcc mv musl-1.2.2 src-musl mv linux-5.10.70 src-linux +# +# Patch gcc +# + +wget -O - ${GCC_PATCH0_URL} | patch -d src-gcc -p1 + mkdir -p bld-hdr bld-binu bld-gcc bld-musl mkdir -p ${CROSS_SYSROOT}/usr/include diff --git a/tests/docker/dockerfiles/debian-toolchain.docker b/tests/docker/dockerfiles/debian-toolchain.docker index 687a97fec4..ab4ce29533 100644 --- a/tests/docker/dockerfiles/debian-toolchain.docker +++ b/tests/docker/dockerfiles/debian-toolchain.docker @@ -10,6 +10,8 @@ FROM docker.io/library/debian:11-slim # ??? The build-dep isn't working, missing a number of # minimal build dependiencies, e.g. libmpc. +RUN sed 's/^deb /deb-src /' /etc/apt/sources.list.d/deb-src.list + RUN apt update && \ DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ DEBIAN_FRONTEND=noninteractive eatmydata \ @@ -33,6 +35,11 @@ RUN cd /root && ./build-toolchain.sh # and the build trees by restoring the original image, # then copying the built toolchain from stage 0. FROM docker.io/library/debian:11-slim +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ + libmpc3 COPY --from=0 /usr/local /usr/local # As a final step configure the user (if env is defined) ARG USER From patchwork Thu Oct 24 09:55:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7656FCDDE6A for ; Thu, 24 Oct 2024 09:57:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZo-0001A5-6e; Thu, 24 Oct 2024 05:56:20 -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 1t3uZh-00017d-0E for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZd-0003mA-NV for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:12 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-539fbbadf83so969164e87.0 for ; Thu, 24 Oct 2024 02:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763768; x=1730368568; darn=nongnu.org; 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=hfBF4IG40gAq+z9RjB260Feq7LCLvZW5XqsT3NxYVDE=; b=mtWLgmuQ+RlKG0X2MAomOroPvfwcwEiRSAFcuk0SnlaGojAcGh4pn1jTrpINZNjSBd gPcXkQEgA9LCx9kiTt7ycJ+h6VDqdwPaAqEjCVeNzWaZfJpJphhkK7DEMiMhsWJaD0pQ 03VJy6KAKK2sGSW0twCSsexYN/TwiIYUivKfqg0dH9hFM23jJqOAkaTxbHgOGKjsNtXY RtraGVqHsEyG1xdwowrudKCXkFrMJqGZRdePYoKUR4929simx4EKM3zqbqhCOKNhq8ac x9mYv5kyeyl/x7mhzZIR9cxHfKIdPAwCso7u4tRk3jTpo8voBu1+m4aN0EG5uQPrlEmX gkwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763768; x=1730368568; 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=hfBF4IG40gAq+z9RjB260Feq7LCLvZW5XqsT3NxYVDE=; b=FwlSgZEVc2a0zN/gKFNyCmXAgbYNFRT3q281ZXUn4nvEO1Ha+/vRHJ2bWwKAhRMqhQ omdXHfXpOOxwuFqvwYrgm9eFu6EhhyN4G0uSe98pMDzFnZlPbFhvOC9XrLZWkzmcs9N4 H8KIJ3/8Uuh+WYyteUgTmn3OZh1D37pNLF0TSWuNu+WSuA1tQL11Z0dwywVYIym6CnnB BemgKhhbbBLRzi7RZksgkzZpiN1UhApv4u4GiK/XZqcY646ed+GA2YSG/HIigJ3KMbel BfAXfCIjrkt3/tGm0LPiH/7Wn6cf4uY01Z58tTkdMNkDkXzeFT3ZaVyR4Mt+imxLgKZ/ ZTXw== X-Gm-Message-State: AOJu0YwZxTi714c85KLsTqBUZE8QKzCxx/C+WS2STqlLqTZy8IlGCaPh YFm9Xt7LKNTcOZ7ul7Y+IyhS0XzSFqAGl0uF9AOE8363xQgc9adP625ZSFE68B0= X-Google-Smtp-Source: AGHT+IF7kdZyumI4T2msl7eoIy24jwpbHZUpjzxCoNwJtV029L5SORwtsuiPQHzC/cM9wL8o5/oWqA== X-Received: by 2002:a05:6512:308b:b0:536:53a9:96d5 with SMTP id 2adb3069b0e04-53b1a3084c0mr2882148e87.17.1729763767865; Thu, 24 Oct 2024 02:56:07 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a6a8e4sm5491664a12.56.2024.10.24.02.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:04 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 349965F8B5; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta Subject: [PULL 02/17] tests/docker: add NOFETCH env variable for testing Date: Thu, 24 Oct 2024 10:55:48 +0100 Message-Id: <20241024095603.1813285-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Testing non-auto built docker containers (i.e. custom built compilers) is a bit fiddly as you couldn't continue a build with a previously locally built container. While you can play games with REGISTRY its simpler to allow a NOFETCH that will go through the cached build process when you run the tests. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-3-alex.bennee@linaro.org> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 681feae744..fead7d3abe 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -92,10 +92,10 @@ endif docker-image-alpine: NOUSER=1 debian-toolchain-run = \ - $(if $(NOCACHE), \ + $(if $(NOCACHE)$(NOFETCH), \ $(call quiet-command, \ $(DOCKER_SCRIPT) build -t qemu/$1 -f $< \ - $(if $V,,--quiet) --no-cache \ + $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ --registry $(DOCKER_REGISTRY) --extra-files \ $(DOCKER_FILES_DIR)/$1.d/build-toolchain.sh, \ "BUILD", $1), \ @@ -177,6 +177,7 @@ docker: @echo ' NETWORK=$$BACKEND Enable virtual network interface with $$BACKEND.' @echo ' NOUSER=1 Define to disable adding current user to containers passwd.' @echo ' NOCACHE=1 Ignore cache when build images.' + @echo ' NOFETCH=1 Do not fetch from the registry.' @echo ' EXECUTABLE= Include executable in image.' @echo ' EXTRA_FILES=" [... ]"' @echo ' Include extra files in image.' From patchwork Thu Oct 24 09:55:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BBFACFA451 for ; Thu, 24 Oct 2024 09:58:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZv-0001BC-R9; Thu, 24 Oct 2024 05:56:29 -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 1t3uZh-00017k-8s for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZd-0003lx-NG for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:12 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c95a962c2bso886204a12.2 for ; Thu, 24 Oct 2024 02:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763766; x=1730368566; darn=nongnu.org; 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=KSs6E5PwhxtwynJ2m8FxX2eodRnAG1Hfy7dip8EgKxg=; b=yeZpcmdOhwj17W53h6axwsMgW8F+fDR2c8XzDAcofUJ86uZ0KfaPNWUqQsgXyC1p53 6fK+2MI6GgO6u+RaA6g8xC4PBXE3rlsebV4loByRQUbhdKNc99HFrlo4PKLrWrOB83tA 6n1vqf+ahXWoOU0um8PqGqeak4Kq8bxeiaatHE5g4Gx5GQL7ALcf/v0NKUzHO4kMEzxy 8scxNpzsmdHRAPZrW+fGVytoJ8EkMlN7ZgemLGGnw8qu2GHBJXWDJ9yYjNGSYiYSYfV1 Oh6le+9ElrXiqD9+vgWQCbkFiSj4WU9A2QTriZ7yyeaKGy4SCaHjUGFy9jTbSV/snRmD +AJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763766; x=1730368566; 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=KSs6E5PwhxtwynJ2m8FxX2eodRnAG1Hfy7dip8EgKxg=; b=M1iDF2sY0ms6ada9TEeZd64umyWbyCL7YwroXZ+onY5FJI317+dxMdQ6J73sPEQHSj EKBU2UK7TLx3MmH9TKi8hmTAPYPSl5qbkC+fbrt2b7GJwZ/6hzWWKlwqx1bJ8ceCMvCL nT8UmeL7CPpbUgdmWVx8aup6QW1VEgQA53g6gwyjXk7Tnk/+j+RfFiBxO8ORfEbTbGup 18sMf4hXy2lcZo84Jp3x6A/rMkYGXLxWvAVjVPc/NyCgjucnemY91xMu8yCynCt4Ohti oFgG0bLjXUG7NMy3fLO8SNxSqDyCe4lfeZyDyu+0a+ryM+J6sNcOxuO32HEHjND/6ILK baRQ== X-Gm-Message-State: AOJu0Yw9Mo4MXAmt7wvYTbYzt+w8X+dPz3TEHOw53Ix33sc+XHz3v7I+ HffgHG03TOTCXJdYueZg2d6FWklrcnlOYG8AMEeHAcuidOvbeXw57Uh0EUCVjpLTezRNkWeutc8 Z X-Google-Smtp-Source: AGHT+IG9uBtFWMTKPiz8U/WNl6JMpMr7oepz9omcXdtox0xpidrEs2xG87CI3NaVscY8VAcCijaLFQ== X-Received: by 2002:a17:907:3dac:b0:a99:ce2f:b0ff with SMTP id a640c23a62f3a-a9abf8a4f1dmr554338466b.33.1729763766132; Thu, 24 Oct 2024 02:56:06 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91597c10sm586570666b.200.2024.10.24.02.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:04 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 492FE5F8CC; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PULL 03/17] MAINTAINERS: mention my testing/next tree Date: Thu, 24 Oct 2024 10:55:49 +0100 Message-Id: <20241024095603.1813285-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org I put it under my name as there may be other maintainer testing trees as well. Reviewed-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-4-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index c3bfa132fd..ef1678a1a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4080,6 +4080,7 @@ Build and test automation ------------------------- Build and test automation, general continuous integration M: Alex Bennée +T: git https://gitlab.com/stsquad/qemu testing/next M: Philippe Mathieu-Daudé M: Thomas Huth R: Wainer dos Santos Moschetta From patchwork Thu Oct 24 09:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EDA9CDDE6A for ; Thu, 24 Oct 2024 09:58:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZm-00018x-Bp; Thu, 24 Oct 2024 05:56:18 -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 1t3uZg-00017N-7j for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:12 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZd-0003mC-Nb for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:11 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c984352742so719560a12.1 for ; Thu, 24 Oct 2024 02:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763768; x=1730368568; darn=nongnu.org; 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=Lfu7y7t8iZrdGD3A91dZIpglo3CjC4+pIrt7G7QYlLM=; b=GfKuh3ZSKVbma+A5LNy3MJZr+Wpiov26iJ7Lqk20RY7kYIdgRwtCMHRjZe4CmpC0lu JgAScjI7U/etD18ALqRwVmfvD3x8uSjr8wrnAB8iwIFKkAIC0FtycWpY0xjzRRCVQDRq 78O9Jm9pG6mdR9kierMfyy1NfcmGzNy0upbjXPYAT/XAZkqX1726+QOP2T9gNSKWKvPW Ava3EmPRWJxi7/MOsQtq3RET2S+7U6Qb2VH9XFzGIL4OwAqxelZB/Lj9FysMmypNTMk6 hQMA8IUEq+7KrkJUl+a9FUoaQ4lc0QL7yueBGn3A80TJED3NpU2Wdcn1LubJfMd9Br5I MO7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763768; x=1730368568; 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=Lfu7y7t8iZrdGD3A91dZIpglo3CjC4+pIrt7G7QYlLM=; b=nj3rCbixCBMNumcKCVMsVcX6FOXoFaedYL/6KRWPgsKOJuQoYTqxVN4xrNE2Eu5ZKl RMC1hBb5IURtRhZKB8ZZ4/aFSNvOucVJ7uM3UOozf21/xBvbwADn5rWOZ/9WRjAhYU5j K02hi/CSjE7n78ED0Qub4q6r5MkUMllMpJTQtTTE4aAGhgVMkpkXcthahEYsjC97TIxL 1UuW4nbB12EdFAzAebQedXaxrbxnW/edXpnYVqN2yAbWtZASC1HINYgcgFid0VKLx1Az CstJw5GZV1pVQcZRk1hZTkwJ7szBEF9YVCTU1yz7o6nZuHxEIe6m/UMVtHn7H5r3JzLV o5Nw== X-Gm-Message-State: AOJu0YyTbzcmpmAWoUiXceUPaBibU4peUaSvtVJ1RnsW+H9p6gbvs7TD jz/P6sstn5WuSXkQ8Xepy2T7L7OXRMVjU6tuogWu+F6g/fykDSKQFnhh8Vm/0qo= X-Google-Smtp-Source: AGHT+IFJjwj7sxl6LoYsQDKJLsRjNitDygi9tI3Cw6jaIM5CEYwTMCpVUKNmGNVzeA3VU2YY0gzLKw== X-Received: by 2002:a05:6402:51d3:b0:5c9:8b00:3c13 with SMTP id 4fb4d7f45d1cf-5cba24a030amr989505a12.29.1729763768173; Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a6a468sm5736775a12.47.2024.10.24.02.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:06 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5E4FF5F8D7; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PULL 04/17] meson: hide tsan related warnings Date: Thu, 24 Oct 2024 10:55:50 +0100 Message-Id: <20241024095603.1813285-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/include/qemu/atomic.h:36:52: error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’ [-Werror=tsan] 36 | #define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Pierrick Bouvier Reviewed-by: Thomas Huth Message-Id: <20240910174013.1433331-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-5-alex.bennee@linaro.org> diff --git a/meson.build b/meson.build index d26690ce20..bdd67a2d6d 100644 --- a/meson.build +++ b/meson.build @@ -538,7 +538,15 @@ if get_option('tsan') prefix: '#include ') error('Cannot enable TSAN due to missing fiber annotation interface') endif - qemu_cflags = ['-fsanitize=thread'] + qemu_cflags + tsan_warn_suppress = [] + # gcc (>=11) will report constructions not supported by tsan: + # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’" + # https://gcc.gnu.org/gcc-11/changes.html + # However, clang does not support this warning and this triggers an error. + if cc.has_argument('-Wno-tsan') + tsan_warn_suppress = ['-Wno-tsan'] + endif + qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags endif From patchwork Thu Oct 24 09:55:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C394CDDE69 for ; Thu, 24 Oct 2024 09:58:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua3-0001Ek-Uc; Thu, 24 Oct 2024 05:56: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 1t3uZi-00017s-CI for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZf-0003my-QT for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:13 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5c941623a5aso3166406a12.0 for ; Thu, 24 Oct 2024 02:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763770; x=1730368570; darn=nongnu.org; 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=WuPv/uXk8QTOtd5rNfjJz9xPAaD3KPuwf7iO+KnrLkg=; b=wfQEW69eG+mQvNAazfIKrfp29Z6eUgqpHNt+Ja5vKBJPl636fk4UTNrEypeckAeQb7 ZuGv39nm3voKUjXqA3MbLZ/KvZs5EW9//QU7gd2p3kjh2t/eFSCrcjQWVP/adH/4iey9 1DTGm4FhxmsShQnQ6ZcuwGLNqMej40hqUtDO3MKDkXs6gNFxpMFfurYEPZBEbm2Pi7A3 sUtEdwEw7Orm3shDURbhcETffCwHbwptakofW/+3e83i56H7oiCaCdJIFJ7qWi5kxC6m TS1XfDltaEPt/ClQiD93XOx4veSwTuVBmg7DxDS0/ph2Ciau7EvTzFu4gHUshGzBsN4v uyxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763770; x=1730368570; 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=WuPv/uXk8QTOtd5rNfjJz9xPAaD3KPuwf7iO+KnrLkg=; b=kg++Ilvfwt6tIYUimirsWXA5MFrJCKlWQPeXCHWXkgpEv9RXglECSMkW5DwqW0Ivo/ 5AdTMyug4sDYFe7ZhdamF92UAeFyafFl9eVI+xGfHkC+0ETJ+C/Se1e7NI8+vjVfly2i Cl7O5dc+IOB8CAsfcsSaBKfTWh1W5zDBd3p6GxDYZo+mnhOHOXMbyjr83m5b+f2kBkLL Xchu5okQbF2jQx5RadhWiodX4J6Z7vIzPpYO3SMaCIvLgEAQk6lDC6WwnFE26aMzipZA na58Z4OoVXKtGIqEQuITNLm2VLRPvgxZiPGxF6cHex+wR9v3mb+dK8l44ETg/Jbipi3f G6fA== X-Gm-Message-State: AOJu0Ywsga7z/ro3qmQJviUL+urJRit0t8/tenIiOIwJSf56N/hB1qhc LKTUqGK2cg3Bjynrl+DhHFEi1E89/OrC6iasNSYdzh78h43oCoFkcRpFhJ8IVYU= X-Google-Smtp-Source: AGHT+IGb+p8drTF+pi2SEgMn3a70w61fJDUo5Lty2W+rJpJ+ghEy9r0nwLvRtHhXrEVJlUdKE5VDNw== X-Received: by 2002:a05:6402:2486:b0:5c9:7f41:eb1b with SMTP id 4fb4d7f45d1cf-5cba2110569mr1905298a12.17.1729763770192; Thu, 24 Oct 2024 02:56:10 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c725dfsm5478729a12.81.2024.10.24.02.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:07 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 748805F913; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 05/17] docs/devel: update tsan build documentation Date: Thu, 24 Oct 2024 10:55:51 +0100 Message-Id: <20241024095603.1813285-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Mention it's now possible to build with gcc, instead of clang, and explain how to build a sanitized glib version. Signed-off-by: Pierrick Bouvier Reviewed-by: Thomas Huth Message-Id: <20240910174013.1433331-4-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-6-alex.bennee@linaro.org> diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst index 09725e8ea9..91f4dc61fb 100644 --- a/docs/devel/testing/main.rst +++ b/docs/devel/testing/main.rst @@ -628,20 +628,38 @@ Building and Testing with TSan It is possible to build and test with TSan, with a few additional steps. These steps are normally done automatically in the docker. -There is a one time patch needed in clang-9 or clang-10 at this time: +TSan is supported for clang and gcc. +One particularity of sanitizers is that all the code, including shared objects +dependencies, should be built with it. +In the case of TSan, any synchronization primitive from glib (GMutex for +instance) will not be recognized, and will lead to false positives. + +To build a tsan version of glib: .. code:: - sed -i 's/^const/static const/g' \ - /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h + $ git clone --depth=1 --branch=2.81.0 https://github.com/GNOME/glib.git + $ cd glib + $ CFLAGS="-O2 -g -fsanitize=thread" meson build + $ ninja -C build To configure the build for TSan: .. code:: - ../configure --enable-tsan --cc=clang-10 --cxx=clang++-10 \ + ../configure --enable-tsan \ --disable-werror --extra-cflags="-O0" +When executing qemu, don't forget to point to tsan glib: + +.. code:: + + $ glib_dir=/path/to/glib + $ export LD_LIBRARY_PATH=$glib_dir/build/gio:$glib_dir/build/glib:$glib_dir/build/gmodule:$glib_dir/build/gobject:$glib_dir/build/gthread + # check correct version is used + $ ldd build/qemu-x86_64 | grep glib + $ qemu-system-x86_64 ... + The runtime behavior of TSAN is controlled by the TSAN_OPTIONS environment variable. From patchwork Thu Oct 24 09:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24AD1CDDE6A for ; Thu, 24 Oct 2024 09:57:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZq-0001AW-7h; Thu, 24 Oct 2024 05:56:22 -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 1t3uZh-00017q-BP for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZf-0003mr-Pr for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:13 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a9a628b68a7so104777366b.2 for ; Thu, 24 Oct 2024 02:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763768; x=1730368568; darn=nongnu.org; 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=+1eumqy3h/5b4LE5b3DAzQ7GuSzOPVfRg6wnoYa9yiE=; b=L3mPNGEbQYtJmA4WvyeWfTc30HYhrNzmr45+we6l4UB25MbKbsL/wbKxtHhjSlOcEi hKgZiIS6YiOGrl3PHssFrn+8L1b8YiXu41PT1ilMzavv1nsmptusilJgI4P5VWlV629d T1jaM+N6xVng/B/yOfJyVagls3CEx7NTlWPCbSmhHNWShNiALKpHHLLjgShHukHtFZg7 uIv4QSR9y2k+Uepxf4WUzDu8aUu8bnpY3RSzPf55EqEK4tQ9MLodUqxFc6bYeNea2vaH 73gC5oNpKOJHXdsu03Kf7o/l3Dt5mgOModRAj1gje71ZxlOasEQ73SNZnyljXQO75Tqn u9/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763768; x=1730368568; 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=+1eumqy3h/5b4LE5b3DAzQ7GuSzOPVfRg6wnoYa9yiE=; b=Ui5BXfgAmjlokoUq6plXps4YzcJDkXIKXj9kCYN3ivxuOinenvWkZES33Z/8St8Xrz dd0M9UjZj60JyCUUaZ3Kgt540cZYjYqYBlGslrla13/K4GVYBYM06pnm4/6jZf7/Il5j 8Jn0lWG+H+D+UokLaDKAluzoGxaTEmeKiFl+9e+PUbSoz1P5KSd1c9EWlphJ2/x8Ia32 +C3quVhEQY2edHEeDc5H70Rj8uJOnPF3Tjqjv0LHijLgjsVbo8xeZaZpwL72pItVbfPl av0TEDluw/OmrOz+Pe7NIoYPH73ZRdEWDev7x5D7gnoqkSU8+DYXJgnb6auBdvMOm15o NOfA== X-Gm-Message-State: AOJu0YwZqFZGBHNr2x3XPkA85RdmkS93/BCaFsyDTT/IPDj+94l51iCy OViDm2WA4t6xVJuJu0ciDXLgkwsjM6GdCXOvMXDnlG8FAt8Bf9vsN1NEBiFcbZE= X-Google-Smtp-Source: AGHT+IF+lY7005x5dQ/iX9CFmRlF58PSCa65ez4p6JHJVbueoM5TIursVEXyTNthXx5cdVwyQvl1Xg== X-Received: by 2002:a17:907:869f:b0:a9a:4ff6:44c0 with SMTP id a640c23a62f3a-a9abf94d4f7mr548883466b.49.1729763768557; Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a9159a214sm596616066b.213.2024.10.24.02.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:07 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 89CF75F925; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta Subject: [PULL 06/17] scripts/ci: remove architecture checks for build-environment updates Date: Thu, 24 Oct 2024 10:55:52 +0100 Message-Id: <20241024095603.1813285-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We were missing s390x here. There isn't much point testing for the architecture here as we will fail anyway if the appropriate package list is missing. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-7-alex.bennee@linaro.org> diff --git a/scripts/ci/setup/ubuntu/build-environment.yml b/scripts/ci/setup/ubuntu/build-environment.yml index edf1900b3e..56b51609e3 100644 --- a/scripts/ci/setup/ubuntu/build-environment.yml +++ b/scripts/ci/setup/ubuntu/build-environment.yml @@ -39,7 +39,6 @@ when: - ansible_facts['distribution'] == 'Ubuntu' - ansible_facts['distribution_version'] == '22.04' - - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64' - name: Install packages for QEMU on Ubuntu 22.04 package: @@ -47,7 +46,6 @@ when: - ansible_facts['distribution'] == 'Ubuntu' - ansible_facts['distribution_version'] == '22.04' - - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64' - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 22.04 package: From patchwork Thu Oct 24 09:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D77DCDDE69 for ; Thu, 24 Oct 2024 09:59:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua1-0001Ca-0B; Thu, 24 Oct 2024 05:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3uZk-00018a-FA for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:16 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZh-0003nG-7h for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:14 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2fabb837ddbso10551821fa.1 for ; Thu, 24 Oct 2024 02:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763771; x=1730368571; darn=nongnu.org; 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=HSlmWPNMrg5OrykjRnktSuC1Tqo7nH3XFa+CQSsRA/o=; b=vkJCjZox6QnjbAgc+oCOKa/XHsIeLGP9N/QXJnzb3m1XajE0OUDNjCX/150i7g7ka7 /Zr5U9o9PPnqyttWTqxt1rhoRg911YEnl0BKHpjpe0dg4TwjcporDpNsKHKkvziul2/m OPCL6bRucpptD4TLzJgFCKI+eOk5oSfNthQD6Q5rWr63CTHIENsqz/Fsxam03+BoSZ/E WAr9WEmn4buJryg3GSD39tkEflE8JI9pNeSMQqqRHUZurPghg1MQUw59r+KI53QoFlbN dX5y/FtgUtC2GmkzBAF8FwhbD97xaRUr7XCXyAs/DwaFfE9CBQUceHB7NgAwgl9sS7vl o2Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763771; x=1730368571; 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=HSlmWPNMrg5OrykjRnktSuC1Tqo7nH3XFa+CQSsRA/o=; b=bGtZvDR6a6iFsV6dMitLpw3Yh7/GYogyWcwFVJSdSimSZUEx8grc7cTt65rM/Vtjnc XYdq4MOEqBjJBAh71KEO5MiWizHTqrde8HOH8zV3CY8z2Vt4ltM6bR3gAkMIrf6k6GIy NS3VdYe5mA8dlCCA7AacClwDznsjb5eBAlzAT20nJKU9eMphTpw/f5x0VkXBXzanJHoL ypwX8YWb38+9P4s22AFVjwiPa6b1ddEx59CuYFRuQ32hA5zW4uIX+3YNo6L9h/eZwrph 0GuNll+Xn0/66YL48wlNscI2Y9VTg+QWF++byFpPpBwutbtzEVBGSzUZKXelWJZcSE6p 7SAg== X-Gm-Message-State: AOJu0Yxxj318ML1YuWsJMG2F3SzzYpaYsWv9KNp+ajlZa+p/sVNCUZDN J+/lZFn79NRXp4KLr05+64OGetG73fXegUM3zfT5iObirG3krW4pgUjSZo1g94s= X-Google-Smtp-Source: AGHT+IG7qnQdWmi+JRqp+4Gr4qbymWp4ge/X7S+WrXxbJvveyHQLmMLTBOrfPtquIUbttLIAFs4jWw== X-Received: by 2002:a2e:70a:0:b0:2fb:61c0:137 with SMTP id 38308e7fff4ca-2fc9d394bfamr37878451fa.40.1729763771039; Thu, 24 Oct 2024 02:56:11 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912edb6asm592112566b.49.2024.10.24.02.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9F9425F92E; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 07/17] tests/tcg/x86_64: Add cross-modifying code test Date: Thu, 24 Oct 2024 10:55:53 +0100 Message-Id: <20241024095603.1813285-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Ilya Leoshkevich commit f025692c992c ("accel/tcg: Clear PAGE_WRITE before translation") fixed cross-modifying code handling, but did not add a test. The changed code was further improved recently [1], and I was not sure whether these modifications were safe (spoiler: they were fine). Add a test to make sure there are no regressions. [1] https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg00034.html Signed-off-by: Ilya Leoshkevich Reviewed-by: Pierrick Bouvier Message-Id: <20241001150617.9977-1-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-8-alex.bennee@linaro.org> diff --git a/tests/tcg/x86_64/cross-modifying-code.c b/tests/tcg/x86_64/cross-modifying-code.c new file mode 100644 index 0000000000..2704df6061 --- /dev/null +++ b/tests/tcg/x86_64/cross-modifying-code.c @@ -0,0 +1,80 @@ +/* + * Test patching code, running in one thread, from another thread. + * + * Intel SDM calls this "cross-modifying code" and recommends a special + * sequence, which requires both threads to cooperate. + * + * Linux kernel uses a different sequence that does not require cooperation and + * involves patching the first byte with int3. + * + * Finally, there is user-mode software out there that simply uses atomics, and + * that seems to be good enough in practice. Test that QEMU has no problems + * with this as well. + */ + +#include +#include +#include +#include + +void add1_or_nop(long *x); +asm(".pushsection .rwx,\"awx\",@progbits\n" + ".globl add1_or_nop\n" + /* addq $0x1,(%rdi) */ + "add1_or_nop: .byte 0x48, 0x83, 0x07, 0x01\n" + "ret\n" + ".popsection\n"); + +#define THREAD_WAIT 0 +#define THREAD_PATCH 1 +#define THREAD_STOP 2 + +static void *thread_func(void *arg) +{ + int val = 0x0026748d; /* nop */ + + while (true) { + switch (__atomic_load_n((int *)arg, __ATOMIC_SEQ_CST)) { + case THREAD_WAIT: + break; + case THREAD_PATCH: + val = __atomic_exchange_n((int *)&add1_or_nop, val, + __ATOMIC_SEQ_CST); + break; + case THREAD_STOP: + return NULL; + default: + assert(false); + __builtin_unreachable(); + } + } +} + +#define INITIAL 42 +#define COUNT 1000000 + +int main(void) +{ + int command = THREAD_WAIT; + pthread_t thread; + long x = 0; + int err; + int i; + + err = pthread_create(&thread, NULL, &thread_func, &command); + assert(err == 0); + + __atomic_store_n(&command, THREAD_PATCH, __ATOMIC_SEQ_CST); + for (i = 0; i < COUNT; i++) { + add1_or_nop(&x); + } + __atomic_store_n(&command, THREAD_STOP, __ATOMIC_SEQ_CST); + + err = pthread_join(thread, NULL); + assert(err == 0); + + assert(x >= INITIAL); + assert(x <= INITIAL + COUNT); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target index 783ab5b21a..d6dff559c7 100644 --- a/tests/tcg/x86_64/Makefile.target +++ b/tests/tcg/x86_64/Makefile.target @@ -17,6 +17,7 @@ X86_64_TESTS += cmpxchg X86_64_TESTS += adox X86_64_TESTS += test-1648 X86_64_TESTS += test-2175 +X86_64_TESTS += cross-modifying-code TESTS=$(MULTIARCH_TESTS) $(X86_64_TESTS) test-x86_64 else TESTS=$(MULTIARCH_TESTS) @@ -27,6 +28,9 @@ adox: CFLAGS=-O2 run-test-i386-ssse3: QEMU_OPTS += -cpu max run-plugin-test-i386-ssse3-%: QEMU_OPTS += -cpu max +cross-modifying-code: CFLAGS+=-pthread +cross-modifying-code: LDFLAGS+=-pthread + test-x86_64: LDFLAGS+=-lm -lc test-x86_64: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) From patchwork Thu Oct 24 09:55:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 725E3CDDE6A for ; Thu, 24 Oct 2024 09:59:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZm-000191-D5; Thu, 24 Oct 2024 05:56:18 -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 1t3uZi-00017r-CI for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:16 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZg-0003n7-Bp for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:14 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a99cc265e0aso90920866b.3 for ; Thu, 24 Oct 2024 02:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763771; x=1730368571; darn=nongnu.org; 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=ZqKopH4arkGRC9gLv/9n1TSlUFMfVszFCtTC30nfocI=; b=qPmNTHk6Vf1NQF/0IrPsiO0cxkWAL5cfiDpsxN7FUoI6dXBfC8IBVrPoxOW7GTwhM/ 0yVgHG0UfX150JbNE0iecquUKG6p+YHDa7tYmiKF2KkxKTY/Pq9bIcIQb7JvNyXEaXL3 EpLSosioYQNEFC8rsvwZyTTSVNZbqqKr6eH8lzkvA2lIPMBURjGBDsnPL0EYAPLd53xt Gaula5Gs1/POqlzWfT/sk8fH9inWiUBgfWdtiuzCAesGWT60zOvIg8HCRmhULfrFifCW ayFaw4azalapR7Gj4XRUWep5r53amyH72UdfLMFDSVqCWy6ZTQh5AJvmsaqWmpip6qPa knvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763771; x=1730368571; 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=ZqKopH4arkGRC9gLv/9n1TSlUFMfVszFCtTC30nfocI=; b=Iiq2VeNQuL8NlyCTiq73zSDOkkXyiDGA9WIofTRssbMlalQM54/YCvjJTPHfQDrYTl 8rMZJMd+sd3q1zcBZpVcZsi270IehVSg0ENIN21ZyKMvR0c91MHPU1EkZA27f37OS20M DmyFo0Lf8f0fLJwe9I4g2IpXTtoZIqWCBFGkZPxVEUWXxTde/Hha2i9wQg0K1JREofbJ w6OHd8GeCK/YOT53xCUkeTooucQXBCo7UV+YQ+/uXR/Z+GZwSx/BoYJDFmbYmd4F9pkN DxYJUhpN/Fy3FaMmII7JUOazN3CUE+tr5sYg7b57DGvJCcTo3mXCQh33Y5WyGQOh/tut YScg== X-Gm-Message-State: AOJu0Yzhpo0L0ivE4/A7QwwkLSR/UEZKWEgVtsLmCYbNcActdIGETpZ8 isNI6QrwzgxejZWReAr120RrTEFfGr8fGjrzq5Ci+JJamftWi6xe2JN/tLnRkZc= X-Google-Smtp-Source: AGHT+IH3L57uMPNEc5ciPkQ6Z6wKF8jvnpf0tCdMWPVSnLqDnskZjGBVZMguPh/NVov8hdxYdjsAeQ== X-Received: by 2002:a17:907:97cb:b0:a9a:1792:f24 with SMTP id a640c23a62f3a-a9ad27317d7mr119974866b.24.1729763770701; Thu, 24 Oct 2024 02:56:10 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912ee061sm593766466b.63.2024.10.24.02.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B71765F942; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Riku Voipio Subject: [PULL 08/17] accel/tcg: add tracepoints for cpu_loop_exit_atomic Date: Thu, 24 Oct 2024 10:55:54 +0100 Message-Id: <20241024095603.1813285-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We try to avoid using cpu_loop_exit_atomic as it brings in an all-core sync point. However on some cpu/kernel/benchmark combinations it is starting to show up in the performance profile. To make it easier to see whats going on add tracepoints for the slow path so we can see what is triggering the wait. It seems for a modern CPU it can be quite a bit, for example: ./qemu-system-aarch64 \ -machine type=virt,virtualization=on,pflash0=rom,pflash1=efivars,gic-version=max \ -smp 4 \ -accel tcg \ -device virtio-net-pci,netdev=unet \ -device virtio-scsi-pci \ -device scsi-hd,drive=hd \ -netdev user,id=unet,hostfwd=tcp::2222-:22 \ -blockdev driver=raw,node-name=hd,file.driver=host_device,file.filename=/dev/zen-ssd2/trixie-arm64,discard=unmap \ -serial mon:stdio \ -blockdev node-name=rom,driver=file,filename=(pwd)/pc-bios/edk2-aarch64-code.fd,read-only=true \ -blockdev node-name=efivars,driver=file,filename=$HOME/images/qemu-arm64-efivars \ -m 8192 \ -object memory-backend-memfd,id=mem,size=8G,share=on \ -kernel /home/alex/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image -append "root=/dev/sda2 console=ttyAMA0 systemd.unit=benchmark-stress-ng.service" \ -display none -d trace:load_atom\*_fallback,trace:store_atom\*_fallback With: -cpu neoverse-v1,pauth-impdef=on => 2203343 With: -cpu cortex-a76 => 0 Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-9-alex.bennee@linaro.org> diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 51b2c16dbe..aa8af52cc3 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -29,7 +29,7 @@ #include "exec/page-protection.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" -#include "trace/trace-root.h" +#include "trace.h" #include "tcg/tcg-ldst.h" #include "internal-common.h" #include "internal-target.h" diff --git a/accel/tcg/ldst_atomicity.c.inc b/accel/tcg/ldst_atomicity.c.inc index 134da3c1da..c735add261 100644 --- a/accel/tcg/ldst_atomicity.c.inc +++ b/accel/tcg/ldst_atomicity.c.inc @@ -168,6 +168,7 @@ static uint64_t load_atomic8_or_exit(CPUState *cpu, uintptr_t ra, void *pv) #endif /* Ultimate fallback: re-execute in serial context. */ + trace_load_atom8_or_exit_fallback(ra); cpu_loop_exit_atomic(cpu, ra); } @@ -212,6 +213,7 @@ static Int128 load_atomic16_or_exit(CPUState *cpu, uintptr_t ra, void *pv) } /* Ultimate fallback: re-execute in serial context. */ + trace_load_atom16_or_exit_fallback(ra); cpu_loop_exit_atomic(cpu, ra); } @@ -519,6 +521,7 @@ static uint64_t load_atom_8(CPUState *cpu, uintptr_t ra, if (HAVE_al8) { return load_atom_extract_al8x2(pv); } + trace_load_atom8_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); default: g_assert_not_reached(); @@ -563,6 +566,7 @@ static Int128 load_atom_16(CPUState *cpu, uintptr_t ra, break; case MO_64: if (!HAVE_al8) { + trace_load_atom16_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); } a = load_atomic8(pv); @@ -570,6 +574,7 @@ static Int128 load_atom_16(CPUState *cpu, uintptr_t ra, break; case -MO_64: if (!HAVE_al8) { + trace_load_atom16_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); } a = load_atom_extract_al8x2(pv); @@ -897,6 +902,7 @@ static void store_atom_2(CPUState *cpu, uintptr_t ra, g_assert_not_reached(); } + trace_store_atom2_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); } @@ -961,6 +967,7 @@ static void store_atom_4(CPUState *cpu, uintptr_t ra, return; } } + trace_store_atom4_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); default: g_assert_not_reached(); @@ -1029,6 +1036,7 @@ static void store_atom_8(CPUState *cpu, uintptr_t ra, default: g_assert_not_reached(); } + trace_store_atom8_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); } @@ -1107,5 +1115,6 @@ static void store_atom_16(CPUState *cpu, uintptr_t ra, default: g_assert_not_reached(); } + trace_store_atom16_fallback(memop, ra); cpu_loop_exit_atomic(cpu, ra); } diff --git a/accel/tcg/trace-events b/accel/tcg/trace-events index 4e9b450520..14f638810c 100644 --- a/accel/tcg/trace-events +++ b/accel/tcg/trace-events @@ -12,3 +12,15 @@ memory_notdirty_set_dirty(uint64_t vaddr) "0x%" PRIx64 # translate-all.c translate_block(void *tb, uintptr_t pc, const void *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p" + +# ldst_atomicity +load_atom2_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +load_atom4_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +load_atom8_or_exit_fallback(uintptr_t ra) "ra:0x%"PRIxPTR"" +load_atom8_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +load_atom16_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +load_atom16_or_exit_fallback(uintptr_t ra) "ra:0x%"PRIxPTR"" +store_atom2_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +store_atom4_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +store_atom8_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" +store_atom16_fallback(uint32_t memop, uintptr_t ra) "mop:0x%"PRIx32", ra:0x%"PRIxPTR"" From patchwork Thu Oct 24 09:55:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 694ECCDDE6A for ; Thu, 24 Oct 2024 09:58:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua2-0001DS-6k; Thu, 24 Oct 2024 05:56: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 1t3uZl-000194-OF for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:18 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZi-0003oN-Au for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:17 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a9a850270e2so111800266b.0 for ; Thu, 24 Oct 2024 02:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763773; x=1730368573; darn=nongnu.org; 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=XK/zHX8qgXptgXry27/12QWgnPSEzecfyqvscRlng8I=; b=Uk8IoZjWBQqffroCcYl7dTuvjJc99N1C+USThumofJ7AUSSdA9ucF5RQIJ5GdpjPgH Z0xs5dwOu70SgUuaZF1fDmilPqaZO0qjHhWDJA03Bu+jCadso+QmVBsMdeZ4U37HHxI6 UAA5DnNyY0UvArdqyj9xq07tXNtqWiGwbPbR39KvR3IDWXlHMoATeGnvPPs58o8DBwYs DYNR1//L5DkWW5/YTEkc4GUxj4Y0tRhfZo4Ez2vvbsJHAUvyIh2jm/HflBoiSsxV0UmD JzI4hbzaCwwS7mbU97hFazPaIipn4f5mXBvaKgwcnXddf4sG120GT1FPngXwu4P6k9ao B59g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763773; x=1730368573; 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=XK/zHX8qgXptgXry27/12QWgnPSEzecfyqvscRlng8I=; b=nJLr/iwKVI3jNtQzv7DFov7KCOGeUXX0mYGedo+O8wWOvmG3x6WNgHkglyusoUTCTx Yhd4D+FeYXZ52q78rw75pYcKssmVTYDrsRcs4vr+9bwchi+xJQCDYhvXFJScc+sCp44c dqYgxiUnwF3ABBOyBVZD2iLsWaoexAbJuxd7lHq0UCoN6WH6hZiMcnynEY8M4hbxYDJ4 9mgN3D6Giz0yBiy6WzIbs6l6OwCTLQQMrH4NBZlruwsTSG4LKHE3bNGf7+1jZSoLqPKF hOcdvftcEMH5jsdiE9jVBAc/hcDSdzCLWt0WtxUp3RCty+yXoOFBw6tKGrj1pa7Dojki D6+A== X-Gm-Message-State: AOJu0YyyjZ9l5aHWDhLBtX9c2l0gvZLudN1ZFxsUIMICWWEEJlTg3Kx5 KnKoKtf0AZ4z1E7wabjAs8e+2sXxIXIHeH6w06LNBwqdAVcdu2GPGmQPqqNANLA= X-Google-Smtp-Source: AGHT+IEOyQePChGWLvPydUo9luKyniLHTcp118GzZqLsR/2s04p0bWt/3Zyp/9H6Df53O9jmGDr9mg== X-Received: by 2002:a17:907:9405:b0:a99:ee42:1f38 with SMTP id a640c23a62f3a-a9abf8aefbdmr501541866b.31.1729763772859; Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d623fsm594030066b.9.2024.10.24.02.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CC4E75F9D0; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Wainer dos Santos Moschetta Subject: [PULL 09/17] dockerfiles: fix default targets for debian-loongarch-cross Date: Thu, 24 Oct 2024 10:55:55 +0100 Message-Id: <20241024095603.1813285-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier fix system target name, and remove --disable-system (which deactivates system target). Found using: make docker-test-build@debian-loongarch-cross V=1 Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20241020213759.2168248-1-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-10-alex.bennee@linaro.org> diff --git a/tests/docker/dockerfiles/debian-loongarch-cross.docker b/tests/docker/dockerfiles/debian-loongarch-cross.docker index 79eab5621e..538ab53490 100644 --- a/tests/docker/dockerfiles/debian-loongarch-cross.docker +++ b/tests/docker/dockerfiles/debian-loongarch-cross.docker @@ -43,8 +43,8 @@ RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2023.08. ENV PATH $PATH:/opt/cross-tools/bin ENV LD_LIBRARY_PATH /opt/cross-tools/lib:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib:$LD_LIBRARY_PATH -ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools -ENV DEF_TARGET_LIST loongarch64-linux-user,loongarch-softmmu +ENV QEMU_CONFIGURE_OPTS --disable-docs --disable-tools +ENV DEF_TARGET_LIST loongarch64-linux-user,loongarch64-softmmu ENV MAKE /usr/bin/make # As a final step configure the user (if env is defined) From patchwork Thu Oct 24 09:55:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C43FECFA451 for ; Thu, 24 Oct 2024 09:57:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua3-0001Ej-Pf; Thu, 24 Oct 2024 05:56: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 1t3uZk-00018c-Gr for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:16 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZi-0003o7-5D for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:15 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5cb72918bddso924291a12.3 for ; Thu, 24 Oct 2024 02:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763772; x=1730368572; darn=nongnu.org; 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=oznrXdsmNzi0LevvMQ+H5t+DJg+P+IM2tS40pZyVrfA=; b=x0q0xeHBKxpNhFsIyXY/YHQvE74daImtzAciR+yBHLzJAgiHzzJ0ebmyRGwzkw15PU 0x6aT/xPhtr6jaByFAAIEYV/YoNWrMMV+9r7ACt0FEJR7+sEsIt20zrflEY+LKqeSRfK fDrVLdArDZ4uAnB6wwustEbnF3gHfOeICQhF//o3rcYjaJ2csafvhPMa2uH4lIHouIe0 iIAdgtSoRlV3XDlVV7aaNi2BhYVsLDHqA5P7X005ri9nPj/2XvcU5sqrtRsONo2Xzlm6 IaSWEv+OnRxFbe05jjO3VjGHZOXagaImfYpDs0gZgpllKjEZBHuZPP2OB4HWFSbA+2s0 BThQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763772; x=1730368572; 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=oznrXdsmNzi0LevvMQ+H5t+DJg+P+IM2tS40pZyVrfA=; b=MSyT9C2rjjcykjFthMiyuDOE8lJvbsSo+gRMQRo4ObK6exJTxXv0jnh3PhH0SmhOxC 5PObsgIVZVB/A4DVUBbH8KyLMExiyitBNY2dU9EWllOMo8I305o047KANhZ9NHCLbsIX Rz1lPCch/CG/9VpiN9f6pea6OyIEjvyvYRAooFaJke8PDiceYcMUgjSp3JwyjFaCCk8P Xch4uUUFSQ5FmOvgP2PbovNrkGrNlDog4n4wXphOReaxJX9GzjtO3mNbHPUaI0Gv7U1Y EEFu9bC4GxDL8xN9cG42bV3TZQljbqOqYU0oX2YxNRBmMWeTzL9NlfXPscfakIQBmSZ1 sLuw== X-Gm-Message-State: AOJu0YxUklAfZcY40deCSuAbeoOoAz2673MnmtAMTwD1eXY9sBOg6Ggf c6H/uY462VolY5QgDB4Sa7bx8J2sFr7nDqFbZNrV6u5Gp6nVf1FMn2VbhcHTTVI= X-Google-Smtp-Source: AGHT+IEAt4uQRfFQMY1XCHNNH9YcWuMTzIuRnlV7XfaHyMRK555hRQferXZcRgvyPr4sFdu1oGtJOA== X-Received: by 2002:a05:6402:254b:b0:5ca:da2:b2ca with SMTP id 4fb4d7f45d1cf-5cb8acba591mr5400530a12.19.1729763772509; Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c73b50sm5442472a12.97.2024.10.24.02.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:08 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DF8A25F9DD; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Daniel_?= =?utf-8?q?P_=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta Subject: [PULL 10/17] gitlab: make check-[dco|patch] a little more verbose Date: Thu, 24 Oct 2024 10:55:56 +0100 Message-Id: <20241024095603.1813285-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When git fails the rather terse backtrace only indicates it failed without some useful context. Add some to make the log a little more useful. Reviewed-by: Daniel P. Berrangé Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-11-alex.bennee@linaro.org> diff --git a/.gitlab-ci.d/check-dco.py b/.gitlab-ci.d/check-dco.py index 632c8bcce8..d221b16bd5 100755 --- a/.gitlab-ci.d/check-dco.py +++ b/.gitlab-ci.d/check-dco.py @@ -19,10 +19,9 @@ reponame = os.path.basename(cwd) repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame) +print(f"adding upstream git repo @ {repourl}") subprocess.check_call(["git", "remote", "add", "check-dco", repourl]) -subprocess.check_call(["git", "fetch", "check-dco", "master"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) +subprocess.check_call(["git", "fetch", "check-dco", "master"]) ancestor = subprocess.check_output(["git", "merge-base", "check-dco/master", "HEAD"], diff --git a/.gitlab-ci.d/check-patch.py b/.gitlab-ci.d/check-patch.py index 39e2b403c9..68c549a146 100755 --- a/.gitlab-ci.d/check-patch.py +++ b/.gitlab-ci.d/check-patch.py @@ -19,13 +19,12 @@ reponame = os.path.basename(cwd) repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame) +print(f"adding upstream git repo @ {repourl}") # GitLab CI environment does not give us any direct info about the # base for the user's branch. We thus need to figure out a common # ancestor between the user's branch and current git master. subprocess.check_call(["git", "remote", "add", "check-patch", repourl]) -subprocess.check_call(["git", "fetch", "check-patch", "master"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) +subprocess.check_call(["git", "fetch", "check-patch", "master"]) ancestor = subprocess.check_output(["git", "merge-base", "check-patch/master", "HEAD"], From patchwork Thu Oct 24 09:55:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B02BCDDE6A for ; Thu, 24 Oct 2024 09:57:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZx-0001BI-M2; Thu, 24 Oct 2024 05:56:29 -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 1t3uZn-00019f-0r for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:19 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZk-0003oo-60 for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:18 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a9a6b4ca29bso73774666b.3 for ; Thu, 24 Oct 2024 02:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763775; x=1730368575; darn=nongnu.org; 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=FhQHhqHevFKxT3wc53Jhmtmk1x6HH6VYaEHocgPtTIY=; b=oIQ5/t3lKl2bjVlc03tsKAuFZq/vICRqO6/Ccy8ScjVVcDXsUglROmk3t42u++5uCW LHblbJ1UrvcKmyUJwY9AlIbFD/eyL2OHXx5FCmgSvL3HXvuW/tTKiho1gdzDQJKEd8f0 +rw1OuAVllVKWIaHgmavOfmB8sRofqgttmqMBU0+RzaksQ34iKF4Ujq0VPptq+0dKEJq S5PU7dYV4Jzl+fnFGuahlYRT1KWMu+DY2s1yEXePSe1kHGFcmFoT6GXss2oNC6bnLRM/ vSnRKR5qnThJCwnS2ORNxkrvDCCrj7InbVoT2Usw6Og8opL/0REEWY+MPcyEEz8qLZhu xt5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763775; x=1730368575; 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=FhQHhqHevFKxT3wc53Jhmtmk1x6HH6VYaEHocgPtTIY=; b=avphdvWLp2B61p/kwkODuCQ/FYkTJ/TpyPMtVOCHT7/+EssFmMy7TE7bRPjHygnOjM SFCBk0ahG/2FHlukV3/dhOlSOk/lgt49z3m2qP6rtb6I3lgy2lTxxo5TWtgbIm6Z0jHw qHs7zw2p2zUHTowYVFhTmj8414nBo4kSD2ORrrL/xbEdsKPhdo2wMQGV/OBb6iSC58Pk pEK7izQpOF6ucsWG7Pg1K7XcRmgWuTJmy4WYYjlbXySYdqzFQuRl/lC35DGDbzkxJn6C Cx1ZYJjBfEBPW4nUE/tSTTKvXf+q6RlJrTPVy+DuqYBGkkwlhPnZlpvkA8haSDnxaPfK Tz0Q== X-Gm-Message-State: AOJu0YyY3Ln1g1hJbrq1t00SkHPPr8piBTtuc6V/aFD2Sf4MutQjlVZS QF9TzBCevVVy5pib891vmmxWzKkW4uILIXQwFRBkJH65K1bjeJym/sqYTgDImdk= X-Google-Smtp-Source: AGHT+IGp9X2kKIjWNxGXRtVWNZ/XN4045hxggZ7+x5tHr0FmH9J7a+QEALpb0GCGMsktJR465maIEQ== X-Received: by 2002:a17:907:7290:b0:a9a:478:2ee3 with SMTP id a640c23a62f3a-a9abf92f3b4mr516951566b.40.1729763774607; Thu, 24 Oct 2024 02:56:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91599362sm594433766b.197.2024.10.24.02.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F381D5F9EC; Thu, 24 Oct 2024 10:56:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 11/17] MAINTAINERS: mention my gdbstub/next tree Date: Thu, 24 Oct 2024 10:55:57 +0100 Message-Id: <20241024095603.1813285-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make it easy for people to see what is already queued. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-12-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index ef1678a1a8..7eea7b7954 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2984,6 +2984,7 @@ F: gdb-xml/ F: tests/tcg/multiarch/gdbstub/* F: scripts/feature_to_c.py F: scripts/probe-gdb-support.py +T: git https://gitlab.com/stsquad/qemu gdbstub/next Memory API M: Paolo Bonzini From patchwork Thu Oct 24 09:55:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FB60CFA456 for ; Thu, 24 Oct 2024 10:04:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uhb-0002W9-3l; Thu, 24 Oct 2024 06:04:23 -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 1t3uhW-0002V9-6m for qemu-devel@nongnu.org; Thu, 24 Oct 2024 06:04:19 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uhT-0004he-PH for qemu-devel@nongnu.org; Thu, 24 Oct 2024 06:04:17 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5c94b0b466cso872516a12.0 for ; Thu, 24 Oct 2024 03:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729764254; x=1730369054; darn=nongnu.org; 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=0+jlZEC6qFazfkTWcWtzUB5SL3dgpYSY93VUraV/tM0=; b=QVCYemubPHJodtNNFIJ+mTyB6QGKIuZUyemcv8W6wuO5xpZYtRxpbiDjuuRNjyfwxQ vZb4tHjY+1iewpCBV46aLugOl6qlEtafkZynG9Dcv0//wDMTMR8uZ8SKi47vYllREvhD hjM/DnuwdmVB7LUs7xUnyNSNA6Wu/+/t44V+njZS1C+YCetLZa6RzvGiFmxjpi5g1YU+ mYTEI4inUEB5zFC/ONjqkH21virIcFP5v7OUljCMWRECB/bZEKEJuHIlHGJ/+cvbCt6x lETR3ZOVa843KPx4ATJgb83E8ztTRKzaaXrUnHwEHVy6X4JtJpubk2gKH9gx4n0RPulN K7Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729764254; x=1730369054; 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=0+jlZEC6qFazfkTWcWtzUB5SL3dgpYSY93VUraV/tM0=; b=I6mqq0y22wJakgoTDRMMU0M0lsif3C4ZwQQEQAA6mDuzI3hF0gXmXJCLyyfhpnL1pc tTuFvHnQQ54ZPsG1QUrAsS0cEupF/XvXsjZ3ZXkCM3Km4FoR68bLLjYOetJy9vPpJiRk fhgj/PsV1ryhxZnz1Nnz1cB8A3Qwi3UyhhfyUyVELAbI4JW3Vp7krsTfdaa5ZoZADGNk DPsumrJt+Voix6sr4NsyRzNGdCKvvmJBXtxV4OJ1IA0/yKloqYWm2EN2prhFUgIQWspH EO5ZO2GOgVuZgLOJ+HNrT+uzzH1vvZ00lPG9iGJ/w1UGv7rHLhOYf5ls/97CyNMPvBLd hX0A== X-Gm-Message-State: AOJu0Yz/Gi8JidqpYnNEfk1OsPcdRsTfYOuTFJma8ycVsFnB46lUhXOL WPGCDJwEpXwWCYWZJtX2KBYcMgUMZLLAkOlMh4RYQJXUfknuLPIRt87QnZcLHEY= X-Google-Smtp-Source: AGHT+IFQFUjkvmTK19x6m02r/ToGWPoIeBmoPp4NHDXyd531jLKV1v5GOfPyButmRHchKGDlASnfPw== X-Received: by 2002:a05:6402:520b:b0:5c9:3818:35e8 with SMTP id 4fb4d7f45d1cf-5cba2492ebemr1017020a12.28.1729764254223; Thu, 24 Oct 2024 03:04:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c6b163sm5717769a12.76.2024.10.24.03.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 03:04:13 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 144D95FA0B; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Laurent Vivier Subject: [PULL 12/17] config/targets: update aarch64_be-linux-user gdb XML list Date: Thu, 24 Oct 2024 10:55:58 +0100 Message-Id: <20241024095603.1813285-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Attempting to run the binary asserts when it can't find the XML entry. We can fix it so we don't although I suspect other stuff is broken. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2580 Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-13-alex.bennee@linaro.org> diff --git a/configs/targets/aarch64_be-linux-user.mak b/configs/targets/aarch64_be-linux-user.mak index 778d22b2a9..dcef597a80 100644 --- a/configs/targets/aarch64_be-linux-user.mak +++ b/configs/targets/aarch64_be-linux-user.mak @@ -1,7 +1,7 @@ TARGET_ARCH=aarch64 TARGET_BASE_ARCH=arm TARGET_BIG_ENDIAN=y -TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/aarch64-pauth.xml +TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/aarch64-pauth.xml gdb-xml/aarch64-mte.xml TARGET_HAS_BFLT=y CONFIG_SEMIHOSTING=y CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y From patchwork Thu Oct 24 09:55:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE79ACDDE6A for ; Thu, 24 Oct 2024 09:58:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uZv-0001Ax-CV; Thu, 24 Oct 2024 05:56:27 -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 1t3uZn-0001A4-Rh for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:20 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZm-0003pX-3R for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:19 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a99e3b3a411so316251066b.0 for ; Thu, 24 Oct 2024 02:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763776; x=1730368576; darn=nongnu.org; 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=A03x4ApYrzG4JVI099lHX3Os6mDX4d3dhyCYN2Nj2wk=; b=gkTR9a7GRw4twuIas8dysy9i8btH5tardylC+YKdFeI40vczg1qCYkeIVCqxnZUGXd RlKSvTYuV42r1yWEyqeKIyse0CWLyLF1WSg3lud7HlEqYvi8Ld6Ac8VKa6zeVkV4fm6T uNjBLVweQxPVvHnVH35AgLLpj3aiyZ3JLMsmKzL97D3al3SkwUTbRPofvogoR6cbB+Pw 2UwsZ7Zkw3B7Br6v6DqlH4cnVNiCneS6cto374vDTDg1NNbnFKByCEa7pmMWdqIGxBBg BmOnmR+kckPloU8HzABfwDme+ZHQFKiorLOC/1hOqFfRxwZjwHhAYBcRiAS3FEgYnQCM TG5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763776; x=1730368576; 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=A03x4ApYrzG4JVI099lHX3Os6mDX4d3dhyCYN2Nj2wk=; b=r4O5hWazNKLnOaAFICOcNU8bjVAKyCDLJ0hr4UTeVPYFB3CxW7RhmHoEWvC3evovBb xjlHM87/zXlePSwZls+LR7oLG4kfPjtFQfdHdkJjK+iV3ZhPD8Kc8sV24mpepNIi8x4a Gey+iaV5uma1t8wN9gNQ1n5Lm6zZ+U2t0bBF6JcPxHcMgnI9mLjyLRjkKhFjXw9cbgd8 FxKVmdJZt5F7b+3vR5ojZYEVkp6yB3gNotzskQRykxwEragy1MUlHBtIP5c9EXayW0UP Sxh0fSvUrozfaNzE5k45wUGu8yOPODso2ZE36oaihaAYPZgskSeel8vhYH/qhqytIT4M Of9Q== X-Gm-Message-State: AOJu0Yx1oVyOomFNCrO4Cw0pEhsf0WRX5zU2tfQooiI8zljgSt9VtocM fpkzV5uGpzVSaz66/FBwyDW+9MEan/hOrmSirtT+L7UMhh2nairWf7HBtiZrL0A= X-Google-Smtp-Source: AGHT+IEpJhA5Mu9CDgeirkDU9E6i0Xb3uDgefNA6HWIxoC9psgD/Je2YL/R2WCL04ADplp39J9gvRA== X-Received: by 2002:a17:907:1c9c:b0:a9a:1af0:ee1a with SMTP id a640c23a62f3a-a9ad199c38bmr149257766b.6.1729763776440; Thu, 24 Oct 2024 02:56:16 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912edb6asm592120866b.49.2024.10.24.02.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2BB5B5FABE; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Thomas Huth Subject: [PULL 13/17] tests/tcg: enable basic testing for aarch64_be-linux-user Date: Thu, 24 Oct 2024 10:55:59 +0100 Message-Id: <20241024095603.1813285-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We didn't notice breakage of aarch64_be because we don't have any TCG tests for it. However while the existing aarch64 compiler can target big-endian builds no one packages a BE libc. Instead we bang some rocks together to do the most basic of hello world with a nostdlib syscall test. Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-14-alex.bennee@linaro.org> diff --git a/configure b/configure index 72d1a94225..7dd3400ccb 100755 --- a/configure +++ b/configure @@ -1418,6 +1418,7 @@ probe_target_compiler() { target_arch=${1%%-*} case $target_arch in aarch64) container_hosts="x86_64 aarch64" ;; + aarch64_be) container_hosts="x86_64 aarch64" ;; alpha) container_hosts=x86_64 ;; arm) container_hosts="x86_64 aarch64" ;; hexagon) container_hosts=x86_64 ;; @@ -1447,6 +1448,10 @@ probe_target_compiler() { case $target_arch in # debian-all-test-cross architectures + aarch64_be) + container_image=debian-all-test-cross + container_cross_prefix=aarch64-linux-gnu- + ;; hppa|m68k|mips|riscv64|sparc64) container_image=debian-all-test-cross ;; diff --git a/tests/tcg/aarch64_be/hello.c b/tests/tcg/aarch64_be/hello.c new file mode 100644 index 0000000000..a9b2ab45de --- /dev/null +++ b/tests/tcg/aarch64_be/hello.c @@ -0,0 +1,35 @@ +/* + * Non-libc syscall hello world for Aarch64 BE + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define __NR_write 64 +#define __NR_exit 93 + +int write(int fd, char *buf, int len) +{ + register int x0 __asm__("x0") = fd; + register char *x1 __asm__("x1") = buf; + register int x2 __asm__("x2") = len; + register int x8 __asm__("x8") = __NR_write; + + asm volatile("svc #0" : : "r"(x0), "r"(x1), "r"(x2), "r"(x8)); + + return len; +} + +void exit(int ret) +{ + register int x0 __asm__("x0") = ret; + register int x8 __asm__("x8") = __NR_exit; + + asm volatile("svc #0" : : "r"(x0), "r"(x8)); + __builtin_unreachable(); +} + +void _start(void) +{ + write(1, "Hello World\n", 12); + exit(0); +} diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 2da70b2fcf..9722145b97 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -103,9 +103,14 @@ ifeq ($(filter %-softmmu, $(TARGET)),) # then the target. If there are common tests shared between # sub-targets (e.g. ARM & AArch64) then it is up to # $(TARGET_NAME)/Makefile.target to include the common parent -# architecture in its VPATH. +# architecture in its VPATH. However some targets are so minimal we +# can't even build the multiarch tests. +ifneq ($(filter $(TARGET_NAME),aarch64_be),) +-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target +else -include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target +endif # Add the common build options CFLAGS+=-Wall -Werror -O0 -g -fno-strict-aliasing diff --git a/tests/tcg/aarch64_be/Makefile.target b/tests/tcg/aarch64_be/Makefile.target new file mode 100644 index 0000000000..cbe5fa0b2d --- /dev/null +++ b/tests/tcg/aarch64_be/Makefile.target @@ -0,0 +1,17 @@ +# -*- Mode: makefile -*- +# +# A super basic AArch64 BE makefile. As we don't have any big-endian +# libc available the best we can do is a basic Hello World. + +AARCH64BE_SRC=$(SRC_PATH)/tests/tcg/aarch64_be +VPATH += $(AARCH64BE_SRC) + +AARCH64BE_TEST_SRCS=$(notdir $(wildcard $(AARCH64BE_SRC)/*.c)) +AARCH64BE_TESTS=$(AARCH64BE_TEST_SRCS:.c=) +#MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=) + +# We need to specify big-endian cflags +CFLAGS +=-mbig-endian -ffreestanding +LDFLAGS +=-nostdlib + +TESTS += $(AARCH64BE_TESTS) From patchwork Thu Oct 24 09:56:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAC92CF537D for ; Thu, 24 Oct 2024 09:58:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua2-0001DO-7h; Thu, 24 Oct 2024 05:56: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 1t3uZl-000193-Ly for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:18 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZk-0003ok-5R for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:17 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c96936065dso743619a12.3 for ; Thu, 24 Oct 2024 02:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763774; x=1730368574; darn=nongnu.org; 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=71XaNHfUGhL3lLQ52efa8tYMyfFJrkhKl2IJh8FAjpc=; b=D0GFp8oOG8h01qoSTimBU4G8oXqDBKvf1KOU3guNO4AlNV5XMqiGs7ZFpmO8WrO00g wtIOGDMHgAvfzveFvRd+B6phzs4Bv9XqyZJ+6ebKmS2EB1hqmiJHhI4Mff71nNu2xP0+ Mj/c79WaztfLx8wCND5EeFce+yKhH0w2xUB4jmv4JaF6xrSm9SvlI3iImKP0CwSXpp8b ovs8fsNm53lQ5pBg+shPt96m+gaqzPDgxXlFkYc36Dm9rkG4zbIdC+NPKUOrGWtMIqQs ABvkWzQ6Y/Rx20O4IjhC1ptFI8ttupK09MJA/P0/czTFUbFE4jJ0O83Ckj40SNxyxE7H FQKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763774; x=1730368574; 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=71XaNHfUGhL3lLQ52efa8tYMyfFJrkhKl2IJh8FAjpc=; b=LSS3hYVepsesocFlumQPSoKThtXtqD1XvGCWgyCu/8LZcIt9MEy5smXRY5nmnjiH5r Wz7JAYXInJh7rczmAtmGYCFBsidx6uD/0bYm6MdbK33roeNVLYQjn1wLunLPjC4MPaLI uj147N3xZuMCF6Kl+XZ7pBKutshfgru0waa7v4kp/fEtGQSxUFsfYqZV/RjngWBbChQX /9VjQEXn2gUMgAxrxUCYd1OB6YN7z8KP9CVoxLTGsB29ct4c33kY7ZCLb3HUJBsd40Sm Yej7BRv7ihq5IqWzWtJuqlbGtlzSkeR7G2SmjCC+lmuaSX2a1TYrDOZRdzaYmq9CyOg4 Irtw== X-Gm-Message-State: AOJu0YwVXCpWHP5VtWBHJknAUHDg6bnC7d+Dbt/DLEjZNswQ2HvKZhti DgYY+BPoUG3jRDEo9qE34Wn40XgZOi/9/PpkWPXXzp/8Kkz90/8wJ0uDLUeO8DNChW3+ZPPhBnz D X-Google-Smtp-Source: AGHT+IE/wBZQD87Dey/aX/z0U9zV0xenAh70yHxCbHrpfIqTMaF32FGJLkaPo6a5EdiJIUm4xcQ60A== X-Received: by 2002:a05:6402:84a:b0:5c9:3ff:2734 with SMTP id 4fb4d7f45d1cf-5cb8ac86aa0mr3955509a12.12.1729763774311; Thu, 24 Oct 2024 02:56:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a6a45dsm5735432a12.42.2024.10.24.02.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3E07B5FBDC; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 14/17] tests/tcg/aarch64: Use raw strings for regexes in test-mte.py Date: Thu, 24 Oct 2024 10:56:00 +0100 Message-Id: <20241024095603.1813285-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Gustavo Romero Use Python's raw string notation instead of string literals for regex so it's not necessary to double backslashes when regex special forms are used. Raw notation is preferred for regex and easier to read. Signed-off-by: Gustavo Romero Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20241015140806.385449-1-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-15-alex.bennee@linaro.org> diff --git a/tests/tcg/aarch64/gdbstub/test-mte.py b/tests/tcg/aarch64/gdbstub/test-mte.py index a4cae6caa0..9ad98e7a54 100644 --- a/tests/tcg/aarch64/gdbstub/test-mte.py +++ b/tests/tcg/aarch64/gdbstub/test-mte.py @@ -23,8 +23,8 @@ from test_gdbstub import arg_parser, main, report -PATTERN_0 = "Memory tags for address 0x[0-9a-f]+ match \\(0x[0-9a-f]+\\)." -PATTERN_1 = ".*(0x[0-9a-f]+)" +PATTERN_0 = r"Memory tags for address 0x[0-9a-f]+ match \(0x[0-9a-f]+\)." +PATTERN_1 = r".*(0x[0-9a-f]+)" def run_test(): From patchwork Thu Oct 24 09:56:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4079ECDDE69 for ; Thu, 24 Oct 2024 09:57:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua2-0001ED-Oh; Thu, 24 Oct 2024 05:56: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 1t3uZn-00019h-3h for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:19 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZk-0003os-ED for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:18 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a9a0ec0a94fso89118466b.1 for ; Thu, 24 Oct 2024 02:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763775; x=1730368575; darn=nongnu.org; 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=QHD6OSG9G96Lp9DOw44GLfWhawl8Jnq29lPwNBLaOd0=; b=MQZ55JRv9Ay9zhaQVyQeHfLFEoxDVNeLkSId7qSgmu5vYGKfERxlMo4lZrSWOvNTZX xz2O17oz58msUE0CwFzxJSm1O3ghK1ntNNeBnupT7jPqbWHYOQrvSWutof5cTRBY51Ww rwsh18C+mcLzBIsw+4KO9uwPtCvY616RxiiTSufQAJKcy3cbu1b2alnaznJ/+uiFC8xS OtI8Tc5Yquf0eFExchKDOT38ruzg7bkQOBfLKMiYgcTkRAz151OyDzAi2UhHtWCc2F6M NAfwAUoSIwx9SIaheOvJO3KEwwnCFWESPpUDr+lyNgYufKdhrtUdYIQ0UruUEg7qDNtk I4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763775; x=1730368575; 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=QHD6OSG9G96Lp9DOw44GLfWhawl8Jnq29lPwNBLaOd0=; b=wcZmAOMyuTLayo27AHey/6qvFcTmMuYP/1DQR9HiBpDeqjonU3JfUDn7IKQvcD4i+p i2W91gJlnLwlwXUzoCuuyc+dRvezhkbU5sXbxluVA+PkcPs4qTwm8nKbuXxZCWGsPdIN p6iuA7RsbUNeSXqol/5tR87ZotC3wrGTpMbbRfeLoSSvo3HrSU4EynFuo2eflUYfj8OA fqTtlnQ12RfiKJ+UfPM1rKyiY6d7HJI5wztO0IGI3OzLkYQs89KlPrePerjWggHd7GFW xeVR3Vdz8T/RqFKENZ1w0PD2gL8zo5RW04cyYlFAxewiFzw1p6Bx4ZJtvM0UiWToZqhe 7ljQ== X-Gm-Message-State: AOJu0YzMcMpTebnHc8UzCI8SMN1PVYRxVzrUARm4gTiPRIMTOUJWB2hk ntDQouNsFi+4A5ntzJ0Q/Xq4KmOe+8j3HscVcnBHymR2FBgpWhUyClrhqZ8xwEI= X-Google-Smtp-Source: AGHT+IGCsaMbmOTOf+3c/DMi6woJkuHw4MIY73V/BSGn9M/Lh7e4Pb3FyGCd9VVVVXJBajnEQ6qGRQ== X-Received: by 2002:a17:907:1c19:b0:a9a:8a4:e090 with SMTP id a640c23a62f3a-a9ad2813d7cmr134421466b.50.1729763774960; Thu, 24 Oct 2024 02:56:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91370e04sm590077066b.108.2024.10.24.02.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:12 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 50D515FC0F; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , John Snow , Cleber Rosa Subject: [PULL 15/17] testing: Enhance gdb probe script Date: Thu, 24 Oct 2024 10:56:01 +0100 Message-Id: <20241024095603.1813285-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Gustavo Romero Use list and set comprehension to simplify code. Also, gently handle invalid gdb filenames. Signed-off-by: Gustavo Romero Reviewed-by: Pierrick Bouvier Message-Id: <20241015145848.387281-1-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-16-alex.bennee@linaro.org> diff --git a/scripts/probe-gdb-support.py b/scripts/probe-gdb-support.py index 6dc58d06c7..6bcadce150 100644 --- a/scripts/probe-gdb-support.py +++ b/scripts/probe-gdb-support.py @@ -19,58 +19,61 @@ import argparse import re -from subprocess import check_output, STDOUT +from subprocess import check_output, STDOUT, CalledProcessError +import sys -# mappings from gdb arch to QEMU target -mappings = { - "alpha" : "alpha", +# Mappings from gdb arch to QEMU target +MAP = { + "alpha" : ["alpha"], "aarch64" : ["aarch64", "aarch64_be"], - "armv7": "arm", + "armv7": ["arm"], "armv8-a" : ["aarch64", "aarch64_be"], - "avr" : "avr", + "avr" : ["avr"], # no hexagon in upstream gdb - "hppa1.0" : "hppa", - "i386" : "i386", - "i386:x86-64" : "x86_64", - "Loongarch64" : "loongarch64", - "m68k" : "m68k", - "MicroBlaze" : "microblaze", + "hppa1.0" : ["hppa"], + "i386" : ["i386"], + "i386:x86-64" : ["x86_64"], + "Loongarch64" : ["loongarch64"], + "m68k" : ["m68k"], + "MicroBlaze" : ["microblaze"], "mips:isa64" : ["mips64", "mips64el"], - "or1k" : "or1k", - "powerpc:common" : "ppc", + "or1k" : ["or1k"], + "powerpc:common" : ["ppc"], "powerpc:common64" : ["ppc64", "ppc64le"], - "riscv:rv32" : "riscv32", - "riscv:rv64" : "riscv64", - "s390:64-bit" : "s390x", + "riscv:rv32" : ["riscv32"], + "riscv:rv64" : ["riscv64"], + "s390:64-bit" : ["s390x"], "sh4" : ["sh4", "sh4eb"], - "sparc": "sparc", - "sparc:v8plus": "sparc32plus", - "sparc:v9a" : "sparc64", + "sparc": ["sparc"], + "sparc:v8plus": ["sparc32plus"], + "sparc:v9a" : ["sparc64"], # no tricore in upstream gdb "xtensa" : ["xtensa", "xtensaeb"] } + def do_probe(gdb): - gdb_out = check_output([gdb, - "-ex", "set architecture", - "-ex", "quit"], stderr=STDOUT) + try: + gdb_out = check_output([gdb, + "-ex", "set architecture", + "-ex", "quit"], stderr=STDOUT, encoding="utf-8") + except (OSError) as e: + sys.exit(e) + except CalledProcessError as e: + sys.exit(f'{e}. Output:\n\n{e.output}') + + found_gdb_archs = re.search(r'Valid arguments are (.*)', gdb_out) - m = re.search(r"Valid arguments are (.*)", - gdb_out.decode("utf-8")) + targets = set() + if found_gdb_archs: + gdb_archs = found_gdb_archs.group(1).split(", ") + mapped_gdb_archs = [arch for arch in gdb_archs if arch in MAP] - valid_arches = set() + targets = {target for arch in mapped_gdb_archs for target in MAP[arch]} - if m.group(1): - for arch in m.group(1).split(", "): - if arch in mappings: - mapping = mappings[arch] - if isinstance(mapping, str): - valid_arches.add(mapping) - else: - for entry in mapping: - valid_arches.add(entry) + # QEMU targets + return targets - return valid_arches def main() -> None: parser = argparse.ArgumentParser(description='Probe GDB Architectures') From patchwork Thu Oct 24 09:56:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD0D9CFA457 for ; Thu, 24 Oct 2024 10:04:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3uhZ-0002W5-SR; Thu, 24 Oct 2024 06:04: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 1t3uhW-0002VA-7A for qemu-devel@nongnu.org; Thu, 24 Oct 2024 06:04:19 -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 1t3uhT-0004hc-NP for qemu-devel@nongnu.org; Thu, 24 Oct 2024 06:04:17 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-37d473c4bb6so615374f8f.3 for ; Thu, 24 Oct 2024 03:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729764254; x=1730369054; darn=nongnu.org; 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=/bDjSLop2+Mv88gsL28Dq0gY1HwGEOHZaaOiGIRGhO4=; b=aFBnmU1GJGmmX+ONiYx0nSwfmJyZnVEvqIfxmJV3ZPDYEuz/Ws5JyJVEAneU1lkBXb DzwraBsVC110h833WZ+vLK6po7aAynSkzY5HkFTg5wbLF4SN0wIV2QIs8moZW6GkpR2j jbg3y8cO0ZsJqRe6Y1PDgaUZmyU/HxSq2gNueXtHyKCbnv5khEGt2gwViU043OiFUs3E omI7Q3PZKZN3T98eo8lRZC/oHP4FHauWDJto65fhyIeWZLd75pwQUoPkFTQ89/qJtQCc hKYBwjECj9W66Sc6A8Om/+udmyMZPdVHQs48y+lgvEO/M4/lrMBRuB4GVqhZ+4NF4bLB mW9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729764254; x=1730369054; 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=/bDjSLop2+Mv88gsL28Dq0gY1HwGEOHZaaOiGIRGhO4=; b=BBcAKzcfjO70AqpFmhoJC3qv5TalZPIOnzTrAR6OKDAaEMKAZiSVuAFl3tQgumpap8 /iVcUj08Y9JMcdWkGhwhLBSY9e56XjbfUtPUaUuwXw/1w0aZSb9eXSHLRzpa9FyM9v8K NODZgZa5Xuo3PhJChYNzjZPl6xgZMDeU/A5vkwRnsey4kY8NTgzUR3BnaC0q9Nnp45NV qFzRRYRKQkS2+vJTOjIGDWCHFczv2RYqoFezFOeaG1YXbRBL1HZIBBmTLg3QKcUiRKaC ZRRUME67zPqgGGhlvgibLTQpeuEesXBqDvcsl3koonF9VNk5qXK68PnRJRPs2w/zX3JP a7GQ== X-Gm-Message-State: AOJu0YwTDvwp1dqGgyoTs4603y+Xb0T9+aLaC1iKNcFXJwrCGZrWSPSU 8n5+4k489+7y1tebPHXctarYRoM0nGXWr2JdtEEdE35fJ8/S6GHqA/0WYDTGX2Q= X-Google-Smtp-Source: AGHT+IFjUxXUDvKTBNYDbMnyfVMcNwydMZOy8lY/C9qD3+uYIbolltXGmV6OCLOM8eVIK9SvDfaRRw== X-Received: by 2002:a5d:4f84:0:b0:37d:3e6d:6a00 with SMTP id ffacd0b85a97d-37efcf84845mr4685390f8f.47.1729764253961; Thu, 24 Oct 2024 03:04:13 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91571ebdsm603839766b.148.2024.10.24.03.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 03:04:13 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 62EFD5FC11; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PULL 16/17] MAINTAINERS: mention my plugins/next tree Date: Thu, 24 Oct 2024 10:56:02 +0100 Message-Id: <20241024095603.1813285-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make it easier to find where plugin patches are being staged. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-17-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index 7eea7b7954..5b6c722a20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3708,6 +3708,7 @@ F: include/tcg/ TCG Plugins M: Alex Bennée +T: git https://gitlab.com/stsquad/qemu plugins/next R: Alexandre Iooss R: Mahmoud Mandour R: Pierrick Bouvier From patchwork Thu Oct 24 09:56:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13848680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E583CF537D for ; Thu, 24 Oct 2024 09:58:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3ua3-0001Eh-BJ; Thu, 24 Oct 2024 05:56: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 1t3uZo-0001AG-BQ for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:20 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3uZm-0003pc-Bg for qemu-devel@nongnu.org; Thu, 24 Oct 2024 05:56:19 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a9a1b71d7ffso104950366b.1 for ; Thu, 24 Oct 2024 02:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729763777; x=1730368577; darn=nongnu.org; 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=WhyVCt5uiJi85ejZ/liwkfrDbqe1iEIJ3VaYNksmEf8=; b=KGCauwgxMeLcAMQpET/y7GQ3CRSX460Fykcw8GA6Ssl0eeTVh9ZZfj6Drwlqv8Wtjf yUz+Cp/jlxvFWtoMQ6PKL/kx158T6I/s5DwZHLQnYN/cDCLRCk59IVxpORtlvO6W7zJw Bmf7/4sKDV1XnFiACOSN1XGUwW6uc/j3SQvDzPwaIdoKvCvWSz6TntQcU8VPdkpgbCj1 dv2pVVzZDHkRuHaqaZPwPEgUxHwcoSdyYOVlXHXtTKZL3DRoFfO97ZkrDp78CoJNRMjZ yT0leupqxhICUNWUqTtRMKVgofoD+UgBA015tuJ2LnruubSjJxUVc8ShcSmmFXZoAfYL EPHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729763777; x=1730368577; 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=WhyVCt5uiJi85ejZ/liwkfrDbqe1iEIJ3VaYNksmEf8=; b=CkHT/8rVP6ihXnwCHowj/M8FC8Qpi32BuRIRmjaHQflwtyoesut1VX+r3jB6w58Twc aN42XS2CP4S/vKqjAvddLngJu/Vj8yvxOqNE24wOn3ww6gAdU0F2qaFwAkSXJU8EO1vP 3ncdNq+46h1hL4D7MDkO2r5NniCG/KzUZpHsKZlmYf+pJvxKgYO7bBLf2hP79YPdtDXQ vrl0rBamdkK25R+8801Tv9Y4mHsg2QrJ5V0b+qNe5zRda6SxJvBxLvOm4GBk+AETCSmF oJ3kYOiWpL/RgViS8vqt0Nnw0d4Z280KRor6M3PizaIRg5Vp33Tbc/8ulUflmyvyrDCp x4WQ== X-Gm-Message-State: AOJu0YzmzVChnpVN36eAXoXpV8YsdJTgoePnFg+NHSnXlvAdNHz6Vz5Y NXQEGHV/F0f92YMduSkd6UOEmHriaw9en2Umed/JNK7D/sz6sJEujhFVbquDKKg= X-Google-Smtp-Source: AGHT+IGCeuP6tz39a/1oAphVljr37cgXvwnlFyGo7pPmvkn6YhDqvl9o0PqOocbWZE9euzvxzmsvfw== X-Received: by 2002:a17:906:db02:b0:a9a:f53:a5c6 with SMTP id a640c23a62f3a-a9abf96b501mr572318266b.65.1729763776966; Thu, 24 Oct 2024 02:56:16 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a913706b2sm592190766b.121.2024.10.24.02.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 02:56:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7A0F45FC19; Thu, 24 Oct 2024 10:56:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , Robbin Ehn , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini Subject: [PULL 17/17] plugins: fix qemu_plugin_reset Date: Thu, 24 Oct 2024 10:56:03 +0100 Message-Id: <20241024095603.1813285-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241024095603.1813285-1-alex.bennee@linaro.org> References: <20241024095603.1813285-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier 34e5e1 refactored the plugin context initialization. After this change, tcg_ctx->plugin_insn is not reset inconditionnally anymore, but only if one plugin at least is active. When uninstalling the last plugin active, we stopped reinitializing tcg_ctx->plugin_insn, which leads to memory callbacks being emitted. This results in an error as they don't appear in a plugin op sequence as expected. The correct fix is to make sure we reset plugin translation variables after current block translation ends. This way, we can catch any potential misuse of those after a given block, in more than fixing the current bug. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2570 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Tested-by: Robbin Ehn Message-Id: <20241015003819.984601-1-pierrick.bouvier@linaro.org> [AJB: trim patch version details from commit msg] Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-19-alex.bennee@linaro.org> diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 2ee4c22bef..0f47bfbb48 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -467,4 +467,8 @@ void plugin_gen_tb_end(CPUState *cpu, size_t num_insns) /* inject the instrumentation at the appropriate places */ plugin_gen_inject(ptb); + + /* reset plugin translation state (plugin_tb is reused between blocks) */ + tcg_ctx->plugin_db = NULL; + tcg_ctx->plugin_insn = NULL; }