From patchwork Tue Oct 22 10: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: 13845541 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29C801993AF for ; Tue, 22 Oct 2024 10:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; cv=none; b=sSzbscSaxYYzjH0ogjFDl2/+6Lbd8NoThHCyUkQKkEgjMO3pyl0JkZbrGdvEgZLxocbXdjXJ6cah+kzkKtDBmPw72m7FOXv6EajlUjCfZzkck5RbYhqF5XrdxPP74eCpktfGIpafteY/w2ZTEFMDGM8Ol3URL4bRw62LFYzCJWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; c=relaxed/simple; bh=3ocp18cipe28Y1G4M2yx66dkQYTqfF/PEb1KxGFg+rU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=X7y/naC5kONFsQNhlJ1GW5N+dG65MNgThANWJazashwMkiaQ5GeeATub9SQXTHRSlogm/L49+lHJNlGLewdfzpMVsoQawu+ucFoCaAFkBHLqZQuno9IhbQT5QvvpN9HpRnOYNo/BtHxx0qz5RWN2wf/ba5Y1Q1Ilqm3XpAUkkW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TD6CnZVG; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TD6CnZVG" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-539f84907caso6173422e87.3 for ; Tue, 22 Oct 2024 03:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594579; x=1730199379; darn=vger.kernel.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=FXjwiUjPDmRUKmjejukivCx1FVXlutJ/frWtXF30WgI=; b=TD6CnZVGnEbUutRk7CHgsMOhkfnxV21JSxucRhiJLlh8JMtTWVUSKN9aFhaNHNnVa+ D0QRmmcYFvBP0UX66cto108U246jr4+NKR/ZztBZqxt8UhFniZdihU2fRKqBvWiYdSAW NfiU81JMosnRSK/TLCZQJaLUa6SzotF9Cra6UIN4UbDjm4RDF5SdfXcT59KfgCtknlzS K+EESU55I8YbVfHPLFKy+zRJoZt3iNk5dnLzzWAgIug+9uNlP5xXxic4oLU/t0AvbCsx ux/5eq57XTUnh9wIwYddjF4LXUxQo1B1wbIXB9JcIcalkGHW4ISQZpjbUi/zvUTLSIOH jz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594579; x=1730199379; 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=FXjwiUjPDmRUKmjejukivCx1FVXlutJ/frWtXF30WgI=; b=Ggw91UbI6led7sRmAHOWkH195KzzRUOxZPYXsXmGp6XWZztG16I8GSVVlZHZt4q0QO JuIoinF/fYpT8dnViYZvEccSb/whs21pHEJnk75twBCbSGIjvau5+SyQ5XDi417Gzyfn 7s8mFDsVKsAfg+ya0PxxgCCubCqTXy/Wi7bvHKBeKWrufXI8xbZBsWKoQ1pd3sBHvvpr HvmR75rO0PhzptFGsQLlg0CXSdYN1YJfO85vQWpqTPdx+wN8VojPGPBWb5/drDgKCGqz O31W8vrSc6zGBUdy4gW9z4DXiy4l9iHKttjo4tcAA/+C6X2a0jwyxFh9s0YEalQb3ytx keKg== X-Forwarded-Encrypted: i=1; AJvYcCWgpsnIxe8lbBq2BMKB/0tFe+8ahR4VM00z2r4D0sIiymdS04z1AOrjTmL6qt8E87ur5VA=@vger.kernel.org X-Gm-Message-State: AOJu0YxxHRxSpvwr9Bpda7VjQXVJA+RTRYZw/WVuoNElV2wSxrIMOH3v y+dpN5x7jeIOSlWMmr8w/T+VH87d0VTDfyHH4aiwAZuJLIotSxJbH6dHVnsNpHs= X-Google-Smtp-Source: AGHT+IFnyQzZQ7bHbDbOpYPXpjtSnilsQDL7HRDM+s0y4d6oS+Xo96+ra1aRtC+YDcuLeBLbm75Uyw== X-Received: by 2002:a05:6512:108f:b0:536:9ef0:d829 with SMTP id 2adb3069b0e04-53a1544afc8mr7923850e87.44.1729594579206; Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb675eb1bdsm2947453a12.10.2024.10.22.03.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:15 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BF0265F8A6; Tue, 22 Oct 2024 11:56:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , Ilya Leoshkevich Subject: [PATCH v2 01/20] tests/docker: Fix microblaze atomics Date: Tue, 22 Oct 2024 11:55:55 +0100 Message-Id: <20241022105614.839199-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Message-Id: <20240919152308.10440-1-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- .../debian-microblaze-cross.d/build-toolchain.sh | 8 ++++++++ tests/docker/dockerfiles/debian-toolchain.docker | 7 +++++++ 2 files changed, 15 insertions(+) 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 Tue Oct 22 10: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: 13845542 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5170F19ABD5 for ; Tue, 22 Oct 2024 10:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; cv=none; b=lscoHLfb0EIUohv1COj62plOlXLyz3OSSMSMeZ/S2SwNVfVlT5cgz4rgiPtIuPeHyu3qeGE2XDv90B2qK/jPp8/LWT9KFwOFUhREz6B+YUzQ95yOAhjj7slLqa8f29d1QwEP/xQ8R7WXerZT872ZENkfgxz0xsZHcw3pbC3hNmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; c=relaxed/simple; bh=aS2l+vmDfLF2uLItNIzgkZDSryR40qUXakZxJbkgV9Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Wj+3eRbk+Bc7y1VSKpXLDSxNyRykwz3DN+ZvZnDNcPk4QEDYPEdAX1CBxvnTGUxvqyJff4xin6gl2Y4O8jUuH463JJrHxwm5gra1dZoJV07XvUg7T4jWES47fMQ6wCRMvHj4+mtcOGvH7GrY/O9AapnFij3mauYKGlsEvKaNT8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FqBZ+GWQ; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FqBZ+GWQ" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5c99be0a4bbso7348791a12.2 for ; Tue, 22 Oct 2024 03:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594580; x=1730199380; darn=vger.kernel.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=LfxPswSzpy5PJY7wIfJ4Znven71oBCSA3p2JUb9OqOg=; b=FqBZ+GWQvug7iZSPtu+eRwtit9ZFbQ6GAnVhkiAzvmI1cbOZ84YttoaDwashOVNkyc B6g2eGIrs4yvOeIS52d9sDxsSbZgrv4shKSl3OyrF8Vy6Hha/SXCRhdY/0Yt8pZl9UQn aF8YaQNJptbgCy52iMJPkbA0HQKMb0ny9VPMjZKGhVzIhFElfORMua2bi7VrxD+0f/cU HUGFDaRW+uEQcVktWRSHDc5mfNHE1LeR0PLVCoUTV9CM5KFOgHde4QaMITguWcxky/sE sDVcW2cu/XoJNwn5T6MZCkWsqHPnv5q5uGXtVBQhAETMzN58YAWxfQPWRFvFqWNnYcDT Z3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594580; x=1730199380; 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=LfxPswSzpy5PJY7wIfJ4Znven71oBCSA3p2JUb9OqOg=; b=pz4znYn5MjWjbfgFCug0iFXgLpAIvWH6IQeDmomzo/mrYRQ3hHW5f2MMfKiqVTudr0 uEsgq7LJn4n+Mxs8yNv36avZ9pEcIHA2i0905Ec7HDyk/WKpj5RyBYqF4Ea5dmm2jAKD DdTdRYOCQWbSRIlFWRcc4K3dQNafitZ+p37AzpNkxwz5fv5dFCeZtLenuAnjzUJneiHQ AmUaXHw8SsjBe6BRWRM2rYGr0fTzV4fxOxoaqRc5JoVjBnPxIXjko5XOMfVDrahBVVIr zW2Y8uIrlRKudP3Zi0mHbtGZpwsOmr7cf3ixcqUbBbwhQ/LXJHs0yPyAd3bkjf7tiLZ2 005Q== X-Forwarded-Encrypted: i=1; AJvYcCXnt3SIuz14iUf2/JiGc6V4QnZFN3ULNtWK+GZgoMsefK1M+h0bpLxxlf6b6WSEX5qMVTU=@vger.kernel.org X-Gm-Message-State: AOJu0YxviJwlVjhqTtYffLL2+2iCdGFxBJJkiBUcg3NOw89V6OniITLy V2vZyDlCre78yZRtLtzI83inY8mmegj6WytKWkQhzjhM4vdLxXoO9xjOZKb9Xds= X-Google-Smtp-Source: AGHT+IEWTHq0nZKsD5+vd+nTSltz6qRpJ8m1ZUA3e2J9fRXNb4Q6Dz/tYps28BHQ7v9MYQ4wj/pQ1w== X-Received: by 2002:a05:6402:1d49:b0:5c9:57bd:e9d with SMTP id 4fb4d7f45d1cf-5cb782f9e3fmr2351410a12.19.1729594579617; Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c7262bsm2981150a12.82.2024.10.22.03.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:15 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D35445F8CC; Tue, 22 Oct 2024 11:56:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 02/20] tests/docker: add NOFETCH env variable for testing Date: Tue, 22 Oct 2024 11:55:56 +0100 Message-Id: <20241022105614.839199-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- tests/docker/Makefile.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 Tue Oct 22 10: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: 13845538 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 312DE199246 for ; Tue, 22 Oct 2024 10:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594581; cv=none; b=n326xcVNs+HTKxAsW5rr6NxZK20oMCJ7tiECmipqT+gyioX9fOHt5tTkBgsbNwHbLVGJneNoNvRSw1y6ZJ6P0TIgrDpwxWUJ178fFmyj++1Z7eto2Ah0G397VydsJKFn9wRRSja+9SURArER0pz3Y/UtJKvMp6b5sz+Cky+sga8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594581; c=relaxed/simple; bh=abAMXQAwQ2MoPuA+FlXwtgJwTb8SfN7qI0SuliOBmuM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Oyk305LBalFXAspvhLyS/ambt3tcwcjoD1ZnizR3pD4rnXaCxgjlmMTOPhvMvONc72kuotm34oFTMXqo9R70KMcGCWWpvLeCTbyAUwxcPO7sKrO4y6ebMSZvpdthEy96a47pvReMqsRURfszaLhA6K1unDl5WZa2ZMyRP0o4BvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wWF5RZsi; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wWF5RZsi" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-37d4ac91d97so5282404f8f.2 for ; Tue, 22 Oct 2024 03:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594577; x=1730199377; darn=vger.kernel.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=VedVTeltUD2hOjhTzgZcTRLZkzOYBwLXkPWLhE+aU3A=; b=wWF5RZsiCwbBWwIlZgwQUw1EHOuNScuw3v9sDQOfuaSW5eMzPixOo/TiV7PmsUHg1a y7DQdSirlOi1kAGptBEKgIKv/2QUQeMZdXt8QrhmfUszizNnScd52ejMOg/2cI3ojN/e eu2kDRdyrgoPOLmrZW8b/zZz+jH07zSjOJe/hJS4odBP1TEUkoq/LTmWozJYe5X8NR7c yEtvrk+OV0hHC4257gZJGLez18eYpZr2w0rkf6tAJvYVxdUWvAL23OnYns64wthHfPf6 NJPs+UxRI77b+ZKokZKdLpUfvPDhAQm3gdn2G+CVSeKHgawiGIQc8LvclKD0Eo10DIWW bR0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594577; x=1730199377; 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=VedVTeltUD2hOjhTzgZcTRLZkzOYBwLXkPWLhE+aU3A=; b=Xar12vyE9Xl4NesIyUBiXFmA/nXamCsCz8Hd4uVbc1hPpWG4AKzB0DRf9vFMbqoPbJ jhnpmXUBildrXr8M0Sy1wjHJI2Ym4E0U0slscGty+3V4FjbCwXO3Wwa0veWh8IHzoDxt 6jTDG+26eVhtNiczMaIOUhUTRzwACx4Z9fQ+e/rztlmhHvDkrnHaetaCle2dqdlN/Sm5 4VlpWyO0bKwfBpoVVhe6kiiSmRzJdj0Jg/iHYfnf72OXoqaDR6UfCNlO2K/jjKe3Yj4O xCOmMMI3FqsAHfQvMfEY2q+/351keTmKevfkMaUrlWTSq2jj+mERpyO80P220IrMdYJY gPBw== X-Forwarded-Encrypted: i=1; AJvYcCW+63gqmORZr2Qx4ImgZ9tWvTSW6GwClfAvccNfVrUhM52v/RmwotqIAZ7vPv33TnDcIC4=@vger.kernel.org X-Gm-Message-State: AOJu0YximVftY8uUR0qf+e/JK/4Or+RaFvQaK6wVKDuUcT3PAnvFv51j B+o4/nihikzBD2xRYLSe6OMey+tG0Y0owFZb4pR3a3zK8Z1iuLXb3fplV5UjrIU= X-Google-Smtp-Source: AGHT+IEkxGTtQDWx75WFvqG2eOnkN/ttLbD0g2OlndDgZrl3BuDo9P5GA68WBIt5JhY19RGUOaJdnw== X-Received: by 2002:a5d:424c:0:b0:37d:51b7:5e08 with SMTP id ffacd0b85a97d-37ea21d8fbdmr11273254f8f.18.1729594576819; Tue, 22 Oct 2024 03:56:16 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91572abdsm326459266b.171.2024.10.22.03.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:15 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E69C95F8D7; Tue, 22 Oct 2024 11:56:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 03/20] MAINTAINERS: mention my testing/next tree Date: Tue, 22 Oct 2024 11:55:57 +0100 Message-Id: <20241022105614.839199-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 I put it under my name as there may be other maintainer testing trees as well. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c21d6a2f9e..b84787ae1b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4074,6 +4074,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 Tue Oct 22 10: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: 13845540 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FEA6198838 for ; Tue, 22 Oct 2024 10:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594581; cv=none; b=pPoCdjcPCr/uZNFrTpGiSM1GUt8Lt0GEfjoXWFEo5GbFqqtt1y9EuhNXGOroeeyVazfkx/fctvSxq55gNtEC+mdbfn8C61PLszfNdcAkGwgqd9YjDvvku8XFjx5vyKwrY6R+2Qnqdxw0Gsz1q6Q4RXUo+mN3RJ7hBsVcN9iWjxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594581; c=relaxed/simple; bh=dycqCm1NPayXEmQsWH/9aZ0ifAR2NBSL9Ke2mXMrvic=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=PR5mZyyePEVGv2ZMkcZaRAHoR7RSsncffMBSByaOl618qUkQjxcFUPRvvsYvb01DEijzBLcZyGq5pIYew5ScMh/390CTRZX6erMr0n6jrCDL85JuWE+Vct06DA1y7kmkkAKHW9eyrZPsteB+y+Z9zHnZwDHesy2Mjz/um+UzRD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dWlC8Otx; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dWlC8Otx" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-53b13ea6b78so964003e87.2 for ; Tue, 22 Oct 2024 03:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594577; x=1730199377; darn=vger.kernel.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=/9/+YXB0yFn3lOXE+wDfnOMUk7oakkE6QbrJ6dxZQ+4=; b=dWlC8OtxoLze6ZOa5Wz+GP73CVZah6sLFeEV5ijCAEbcYr5YWUvG6N1dmplG/fQJob bdbr22+NIAZ3VFFJ0ln2ZTHbfhFwf5o0WiD+1WWGKEnsm+Bf2opFKIEF3mKqlR9l4HhY 5DI54wqMUJEsckvBndPwGYAbudrwWH3jpudynGG/cy5tzzrFfB2qbBJpY+BDANTsdYDw DYt5WUUu4MoRBy1MOrblrVupsp31GadoykW1yfTWpFKoju+Gu29uT1ykIoZnr3sCJzKh FhcmcK+M9gj/NWo/CX6mkcyBTTHkvdm8cmQUYUQebdWujdCAei6gekAtHzKlxPm2mChR YCVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594577; x=1730199377; 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=/9/+YXB0yFn3lOXE+wDfnOMUk7oakkE6QbrJ6dxZQ+4=; b=UX6w46OMMYBIgVI6iZ20huDVDaKiO0lFIWLGKAICYjTEFgE5X6I8cuPz8Ev/2+/cya marP/HvEqjLhE+/9kDjRaEInzrj/kDBcCHOJZGc0RJX1rH6lATaJh0tHslTBHvPl8JST GG7yIzZIJgrr0Ctpq7IfzZ32f/xJOOSLLQIVjZ/dY24upRSXecYBaCkuAA4q5+w0ZhDM iznItWcKYCi/V6FLM4i7wCUFnFZxrXvHuR/mGaxiomrpQpv2BnhDRFRD3pcbTeRArsdQ 1hexZQZXVG8sdncXyJH9KSwGGtbibsnzGZFIdt1VVM7f1O6rkUEI57PmuLDiWjhLaWhW O6yQ== X-Forwarded-Encrypted: i=1; AJvYcCX9ILiINj8wtGx1h+LBdTo3Zf8AebNePDrFPVX6urnfbBOJrqRm7h0QeEvosGVb8TMOPJ8=@vger.kernel.org X-Gm-Message-State: AOJu0YyHyyKJYoboKoJvv/x6nBVgmZFPo3iz7w+7ThCnWp3A3lV9dom6 dYVJCY/9/CjnpsVMRJtQm54/2EQf2F96IX70atiQth0Zawqy6JOZzRgcTagQIds= X-Google-Smtp-Source: AGHT+IGyaTZRzVDmFkdPhfv0rvAvIdjH0I+E59F1p2dZtHMO7E+32HML2OhzkPGNPbWtrxG3At+wRA== X-Received: by 2002:a05:6512:2388:b0:539:9767:903d with SMTP id 2adb3069b0e04-53a154eb91emr9004463e87.60.1729594577248; Tue, 22 Oct 2024 03:56:17 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d62e4sm321153666b.7.2024.10.22.03.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:15 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0741C5F913; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 04/20] meson: hide tsan related warnings Date: Tue, 22 Oct 2024 11:55:58 +0100 Message-Id: <20241022105614.839199-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 Tue Oct 22 10: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: 13845548 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3CB919B3EE for ; Tue, 22 Oct 2024 10:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594591; cv=none; b=NjrJeOSWi2VLX5DdcauE549Aq2IT3giM4Jr6vuamvhMN7+/ZfRv+bvE2PzRUS2vz/i8IdqengfeCnhuUtANaBr3haG/f31HkkOrr2tWRXHsZCqpIz4D1esXK2XXJlRrs0cq8o9oKOOIIY9oVTMyth642r31AxkjMRl7uBfV2lrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594591; c=relaxed/simple; bh=rPqdeMZHjsIWZRK4nVVQap0ga9cDd7eG9O38cGJ5E8o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iDxPEczEnqPfSr/+Xx5VnggtlLmdJXv/LBMR/jRRtcxfPCWw+6+Sc8xveN4+Ma8JE28Y44zJ1LFinMo8c3ZpC07zjwvaimU6CQe15i6TPPC3aJTF3bfsk4WahzDHzc+NVvBe5wt+34PQ5k7Hu1BejtCap72I5PMHFZkON/t1aK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SRCPG0kJ; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SRCPG0kJ" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5c99be0a4bbso7348970a12.2 for ; Tue, 22 Oct 2024 03:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594588; x=1730199388; darn=vger.kernel.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=iZZo1oPZPqzjBeoixQ7wpptFRyTvJhgIff9wczeHXgQ=; b=SRCPG0kJ5yUPdkxvlfaBwiQqmM4qKllaw7vxOk7aRpWVt6wrofsfteFuSd9bYpvit7 AESaeJY5p2tYoTpcfzXWUPhdr/LHgU3B7vV6A0TrORwSEbbSzpkn/dzVPnN5O7+cSqOu gHUaeTilGc/VaNgKkPJz3wboK+oG51P4W5T8HdhHKX4PAgDtLx1C39x3nSQ9tXrnO0dZ fLQ76e7P63pulEz9Mgoa6ZGd6eF5TfQeNT2mhz7MeAbsIQwt0zH2XpH22+98tMBV9m4l VhyInp5BM1iA+73qgvQBX1W6ZP8eR3KBE2eC+z6NEKwUbJUFMIOrTzqAL41kv9Qc11Ew ZFxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594588; x=1730199388; 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=iZZo1oPZPqzjBeoixQ7wpptFRyTvJhgIff9wczeHXgQ=; b=dn13UmfwzceV15omYz6P5cz67tVE39i6ezEeay/uqU0CBUSyE89fEauewmN0Z6aXzu E1/5tUxuObTubYPfkxw+XbRoUP4CJM6p3cJbylIDMhH6cNxDPZiW+CigEyPQAHUZeton 2GUp2SlFMFZcTh18QXkc2g+nQeJkhRQXc7ML8snQeJ8S8h0Jy22+wZMYQpDicC6FfzgT NMG4Chd9x7WowMHYLnZ80Cr/LV51E7UQ80teMlwrL9jt22dW5juUtgB6VonuYqsb5puU xO24fRdlLzy0R56+E2r56ePBjXj2I9IphGiYXzWyGZacwuj2PXoBmq4dnnsYvnxrv8sP 4YPQ== X-Forwarded-Encrypted: i=1; AJvYcCVJ1fe7ZHEKhrjiDIINB4wNUrg+78T5TbAkHiO2RGgEIrTi2JNRI6cyw6VXaOuZMjHyIA0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxg0cQWyzYJtDvF6jbt2QCFb7ntSsdLAelR//I/Ft+nPXc6YSsp wS+lbG4CFl3vfr4fdB6de93jFTPLFXwXuYB7oj38q2rk2lN2VTGzeJ2VZjv9pM8= X-Google-Smtp-Source: AGHT+IFRsXwXWWZ+1iUXj/NDdR1zmIgl8xhujNIEkYhFmxY8XSoNScTyD+Rf8wUGR1kAm8G1SujWGA== X-Received: by 2002:a05:6402:3514:b0:5cb:7594:9ece with SMTP id 4fb4d7f45d1cf-5cb782e16e2mr2678552a12.17.1729594588142; Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a657bcsm3124198a12.23.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1AA775F925; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 05/20] docs/devel: update tsan build documentation Date: Tue, 22 Oct 2024 11:55:59 +0100 Message-Id: <20241022105614.839199-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- docs/devel/testing/main.rst | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) 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 Tue Oct 22 10: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: 13845543 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0819319B3EE for ; Tue, 22 Oct 2024 10:56:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; cv=none; b=XDTYUBn2GRwKc6y3WynBjTzW7cat3AqZun5noj/ADj3RgH5lxXeC+khgvnIbHajrNYmxK7SDDT+p7ckCVVabwqka290zbKtkPeiwWmueS3Hkq8xbyqG45cf/p8lJguA0/NNmBsIIAb9mB+3gR7pgoG9Mbdmbl9rJ+bboJW6JPhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594583; c=relaxed/simple; bh=HJ7Z/tpHGMdXyiozbqSlWM/DfmvRMwN6gEUJ22MTOs8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=B+xQqyKbdFzxgfWW5JVqMPjGOYndTkcuX501N/8kh+MQyidWI1bS8olATSKC2cPf54BHnBvo0InowVCKAV+Ha55DrXLz90GK6h4eMZIFYABhP+JKUdkiKOSBeDLlNyCse44gQBZ7+2264XUSZionjYavDPYnnnY9ZVPtsgrT/g4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=s+TNplj+; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="s+TNplj+" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-37d473c4bb6so4950508f8f.3 for ; Tue, 22 Oct 2024 03:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594580; x=1730199380; darn=vger.kernel.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=COTB8IX9EL+KvqwMSRlZ5WoxH3jy7uQtMVM8wKCP4/g=; b=s+TNplj+nPZhX2f/hF1Vu2ZfiCUfiNwRyOaBatBrIvzKtwt8uieJ59Iy8ohHaMI956 qBczgqg2MX04KtKpsYt5msKZw8ZRxxW6gJW9g33t9XkHc9sWLjVIQ/2tUXsuOW5/1ekr zjOPVdwDUyIrF90ZoCyyB/TZvlQsyq4mMXbXArUfVCAP2fNAa1jqZvxJAUfXfiTwu5YT /Bqixm8l2qJgNqO3IT1eGww0+Zj2bG2JSQj9LuvUj/AROAxRlc895RICtOhHgSQ7f1UK uHfoN5e1b+i8g0DqO/xgVPUhQX4ImMF9AKfFRqKZetKoqoAK8H5KdNIkb8pSLzWg38tV CVKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594580; x=1730199380; 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=COTB8IX9EL+KvqwMSRlZ5WoxH3jy7uQtMVM8wKCP4/g=; b=PN/FxLMggK4p5eQLBCn6Njh9D7OnRa+Ruv7kkL3BMPyZBsYcRVwYeyVtZ1x6jVuW8u JB4l+HSH0nw0K4ffpbDIFeLDwZfk8vhJSksWiKPOjqZaxYezYj1kmHdUc9c2WsCJDDEl pTvt3V8ND5wcIWP3Ff3YZ2tFd+Ruewci6BH9MLQoKJIvwl8iNi1B5kDJyKXZHfxX46u1 kRuoZjLd07o6fa+Kzqss4LmMkbllcpgDmkhaSyXpkrQC5kq0M/OZqQu40Lnta9IBWyUn P1fTefNPbzqE+TNVVQlvny3MOeBR7nbBC3Mu8vLa6pZL9m+slCxSRBsUuwmNvUaEYloR W8BA== X-Forwarded-Encrypted: i=1; AJvYcCU+/HrOvisC2uudM7MDLZqlnbvsoz1DmvX9FWrsYUq+hII/DOmB2hYJQWP2L3CV9pQPYBM=@vger.kernel.org X-Gm-Message-State: AOJu0YwUHG4NGJL+BOEMtIbDJTkfl1qwDjwak8q0YeVA2Bs/6AJHVrSH UYMwgygFcjhX/fDBaV+Q5GUXyLYndf4tsFkku5+YLX6jdOBIA9WNcuaj+lJBNyQ= X-Google-Smtp-Source: AGHT+IF8gTYNUNEInBLeGzU/PWN6iK1a20tMenTDraAJtih3b9OaMANLgGCpLzqKTnRdNaK+s8hEig== X-Received: by 2002:a5d:424c:0:b0:37d:51b7:5e08 with SMTP id ffacd0b85a97d-37ea21d8fbdmr11273338f8f.18.1729594580178; Tue, 22 Oct 2024 03:56:20 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91307874sm323980966b.94.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2F1E35F92E; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 06/20] scripts/ci: remove architecture checks for build-environment updates Date: Tue, 22 Oct 2024 11:56:00 +0100 Message-Id: <20241022105614.839199-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- scripts/ci/setup/ubuntu/build-environment.yml | 2 -- 1 file changed, 2 deletions(-) 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 Tue Oct 22 10: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: 13845546 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 785ED19C547 for ; Tue, 22 Oct 2024 10:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; cv=none; b=WcvnxhhmYqClCG/FfQJVu5VPOmVgOO5OMER7HDJtk3r9tmNPAaC1FiWxRHnQBG2DeZzNYWvitGomqBaKh1Lw07VB0oeAmspQTOW0+mrVsC7DQZes4bnqC6WES8vmDuCjBq+wNCif1b2G2+6MThCpEebtYyOOi8xsi5sn2nDb1iE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; c=relaxed/simple; bh=uIQzKypzDYGhleI5zrxAFqDW7he8vjMJscNcMmSUFwQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=I2kHwpDRhX7u04FcvYTGO+Xq96k7j+DYVoSoy1Szlc4oqgh9zLj49bTDnvnJUSlFWcKh4HbO/NBpFMVX5qpfiij1Fa8d2tFEqln3GZ9FeL0DZ2KhtWjupbAClc/7XOnMyVqxYEcXx17qxqPhBJln8bqFvjBVe6cjcCq4r/KAfi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LfHw3Rod; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LfHw3Rod" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a99e3b3a411so1054242766b.0 for ; Tue, 22 Oct 2024 03:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594586; x=1730199386; darn=vger.kernel.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=HOyxXWkbmxyeJp1271bZ6nHrEgwT9agO1ZydqcSHiVY=; b=LfHw3RodAKlgsw4IWpCkt2uZFrhpwcvw2wk4X1kQkBafUmTCb6eISFPhGXSAGZhTqC PH9N39YAWbYDOPPjhscRZmNDNlG54cpoB6l2vW+T0PvlUFEpfrGOBoIM2y/vvjC+Gxbl g8gUrJtxwxvymfD3qO/eY5zzUxAqqPeBEfGIoabd++UkV4R74YVPRieZB7QhyH3uwmis G5RyVz3DYIfOBxRZtBf+NMSxGqLK4dtzFI4ts42Vu383ADRJ4skoW1xv6QJ8zHFRPGSv svGRjA/9jaWvcQLqflJna41Ziy4cO4HnaKvHU5YHMLYLQqAVfYogblMqC262IwZYe56W BR0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594586; x=1730199386; 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=HOyxXWkbmxyeJp1271bZ6nHrEgwT9agO1ZydqcSHiVY=; b=Dwyw0exm4ZMEwXL+fwi2fbfExx9GlZrQEaSrasDVggC2OMpkr+0GTeCagkHesFOuAu UpZduPzaMfG/UkyKNzBrOnlnaY7+UZRYa7c4fz2Yc49xJuxzMg411h3m/IvFbbnJSBzx bNS4mVw9hXK/+oYTyJKOsmnDzFBOBIj2CIY4KyH/80YiBAvybRD057dLSFr8m8pE6HIa SpMq9lpIfyZEsilbrgsvUMy+irLUKSaS5j+opSh+TbArObscljyzWpgy8VrUNt2+7Vhb vr/3YFpdN9BzvXguvS8IhxfX1SnD9DupppueFL3lFwzXpYKlf/tCN3342Yt58wTu7h2L hEHQ== X-Forwarded-Encrypted: i=1; AJvYcCW5aC/NCA5YR5PErDCQJsDsULdADzErfapnW6zR/U8j94TG1oRScU2W4XqorC46Uf8uPkg=@vger.kernel.org X-Gm-Message-State: AOJu0YwdFE/GFBRWntS/lCyGfcWgqufnIpdlvu+R6q8wOLBBAAJR6HA3 sMBqHJ1F7EJjrmV5bplSZWfvjE6X1lQtyBRSbwXUIaYrmMSE7fOWedW4iRcqsd8= X-Google-Smtp-Source: AGHT+IEZjLLtqU09Sx+uo+mrjZmbCZKUxmm4Ab8Z+Gbl4XRa6e9yqIzpm990wPYB5uU0/r5L4B8Jhw== X-Received: by 2002:a17:907:1c85:b0:a9a:597:8cc9 with SMTP id a640c23a62f3a-a9aaa523356mr288374566b.12.1729594585591; Tue, 22 Oct 2024 03:56:25 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91370e91sm320592666b.123.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 465EC5F942; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , Ilya Leoshkevich Subject: [PATCH v2 07/20] tests/tcg/x86_64: Add cross-modifying code test Date: Tue, 22 Oct 2024 11:56:01 +0100 Message-Id: <20241022105614.839199-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Message-Id: <20241001150617.9977-1-iii@linux.ibm.com> Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- tests/tcg/x86_64/cross-modifying-code.c | 80 +++++++++++++++++++++++++ tests/tcg/x86_64/Makefile.target | 4 ++ 2 files changed, 84 insertions(+) create mode 100644 tests/tcg/x86_64/cross-modifying-code.c 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 Tue Oct 22 10: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: 13845547 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8BB419C543 for ; Tue, 22 Oct 2024 10:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; cv=none; b=rd9Dq5L8BtNEXRObyqW9lMaluveQshpddBJHY7t0ekQGmSVLR+DY44gh/q8XvNAAmxJ5jecXDdng/eEOm4jN8VRNIB9LW5FvyqUYMsSQFyRpAtP57i0UzaH6NnHRfhi9HEVCU67J2lI/kRVznn1yzmk7xYmZn56uRtd1nSyfFv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; c=relaxed/simple; bh=k4DUf5ld0t+Rj337VJF2t4M25SBJ9Xw6VHcscakA8eI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=qLhswaFaLwsh5eTsUoG3gUEVpZz6xslsoKNkbkUCHUmmI/MiB6guk5GWVXoyfnWt3agV62rO2cTabFYC+3RxjNQm1KYrw3fysqkbUgz14LceRFgZAx3qrOUIEPY1cPSeVtGDoPpMljRlNv71y0hGrqf9+LE6xULeE1LxqPdQD48= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=p+ENd5Vt; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p+ENd5Vt" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5c9362c26d8so11257442a12.1 for ; Tue, 22 Oct 2024 03:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594586; x=1730199386; darn=vger.kernel.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=CnSO5MY5LW+ONfwtsvf8QoavFQHBZ1D8g95DfEWZbMI=; b=p+ENd5VtXICbWO6JW0bCZ4tbpeq5mAKAsa/ypnza2ffgkBGTD0KPdALhEC8YcvF6fD jyIBW5t2mfd9aPSWtzBrx4GdQOAJltPH/D10aocPDQt4KddOKLXFps2JW6BpBJKZNbNy atNDALJ/+Adw5UHZM5ZkTX0NNLW8gonouF3vFprpylIQDX37zVJfWl4f9+tbxHviOO4f zHapx5OJC1ErhsCu6Hr0PbE7OP6T+liNML+uBhR9BF1C4OLqXTbvDgMOJvpl3FRG//Db 2tb4otUL+SmiuGAOxklV1arM2Zd8pyfslpfwrr25DB/wZW+6HZ8KML8PUMBKPn67N0G2 R7rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594586; x=1730199386; 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=CnSO5MY5LW+ONfwtsvf8QoavFQHBZ1D8g95DfEWZbMI=; b=EpXcCiOh7cT1edyNFiFe5s+s2tTyc9c2xHqhKObjyRqFp83MyOlk8r8eAetXx6gUBw X9Qe7xCB4zHgl8kpkDOWC/7m9vjZ4fz8D+eU5rck4lnyKOoLIv/gRdBmatx9CIlZHrk1 5lTSjT9+jOD9KlFWu6K1SZZeFxBtMHIYxsk6epYw/W/Ba3eO6/FlTZV59TwFSQEKKwrF Hk8Vt1AZ4RpyxkTME9td84miIEbP3XmjB5vE09ttMtQySpQgeTu9U0zGpJew1NO3P9vX pXH8umwVuook7ztKZRxMOVdsa7PRzP9Rrlyz4dUuJIkOTy19mbdpvwn1PygGG9zsul81 hFnQ== X-Forwarded-Encrypted: i=1; AJvYcCWMZkKOuZ8eQN2ttD6NOdxCmpLcziBx1316ACnvLK/5p09TaUORo7shIrfHblpJ3vmKuws=@vger.kernel.org X-Gm-Message-State: AOJu0YzKvHB0KUNhx1uOxJsnigbprh4tmLsauBSZk7uLtzkQkN5Wga7w oRO7O/behx5LlKq2MGc5E2ztDLlLqKNEhG61KPjXnoqBCRD9v5D7bEZny8PjSXk= X-Google-Smtp-Source: AGHT+IE/K5pr2g0U8BMqLhyIWw7NwWY4cgjvbPeZV6ZYZQj/JnrnlV+snPJRyVIL9w1vqQwf5cuM+A== X-Received: by 2002:a17:907:944e:b0:a9a:3f9c:f89d with SMTP id a640c23a62f3a-a9aaa5ee850mr282522466b.34.1729594586066; Tue, 22 Oct 2024 03:56:26 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91559c06sm324381166b.138.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5CB715F9D0; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 08/20] accel/tcg: add tracepoints for cpu_loop_exit_atomic Date: Tue, 22 Oct 2024 11:56:02 +0100 Message-Id: <20241022105614.839199-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- v2 - 0x prefixes for ra as per checkpatch --- accel/tcg/user-exec.c | 2 +- accel/tcg/ldst_atomicity.c.inc | 9 +++++++++ accel/tcg/trace-events | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) 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 Tue Oct 22 10: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: 13845545 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 564AD19B5B8 for ; Tue, 22 Oct 2024 10:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; cv=none; b=AwIMRE348WnyHBIK+AX2jzVqODuW6kTPFZFTB4EEB0thxvr6kj1NPQtXTHL1ubenLvbqSg76Cx/XdlTpwTGTCMtgeFEAE9FQEv4R9ruhquY9jhxvFI4lwgdgXhEya7aeS2yy1IYfeJeOBihyaemCDUrdNk7VRP5+meas1vcV5Jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594590; c=relaxed/simple; bh=od+F5J8tr7tzJhSZj6WjI5rrEwFyDywA1WQXm44ZMVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=YDzV7xwg+bW8rt6MtrrK9a+M0M/WDjVRJyKqpLGfq9mWX2+fZSLMOv3xhl8cnwJmu2PqUgFBepmf91iOvFH8UnBol6Pvf84yUeNSSJil/0K4wvsmwe1bJw8qqb9j8rfDlzelXcGFkHoyKBHU9Zxd1yTwHRBX41r8V1LRYB3yEb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KmY2lg68; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KmY2lg68" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5cb74434bc5so1915033a12.0 for ; Tue, 22 Oct 2024 03:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594586; x=1730199386; darn=vger.kernel.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=dc/d/VIiG49L+/d6qxDj8y/ZsZGo0rIznhJwT5hb3KQ=; b=KmY2lg68xR9hxtlaRvZg+n3Ofg4rH2R40PYnlcxVtxx6Bq7YkANUEHzHEG2t2AirWq aZdZZSz95WS+q8qAmGZ31Lhn6b1/VjXSWv+jbTlKc8LwI3oSkgQj16CujSZejEWH192r 8rsuhrDLkSxOKbiZv9OIcY4UclcGzDL4ahJrrYEL6Q0Dw2az8XzKa9fMBCQU8U64G/Eu dPHoqmZHNJffSUW8M4BT5KIXAfZTu/JZM8IrtawcU9d0kq0shfimWKBMSrQR3xRk+YdM A5sNfp4rg+pgU8oCTvfhz33iiUKzFkz1t9oK8mx8WXJg/uG6wjMxTXJ7A4fHV1oCWxuc MgLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594586; x=1730199386; 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=dc/d/VIiG49L+/d6qxDj8y/ZsZGo0rIznhJwT5hb3KQ=; b=vQieyp75iEiKJrd9BNhYnXxVGflcWksEGVL7jwJSANJqkhGSu9Req9Kve9+tnuAyl2 zjhGfPE3ATS8IvAtPrK6IDB4sscitMfSV3+cmzn8WFIvmHRl6EAy0GyMe1J8rwAGMp5B 3wohak1KAlKhDibWDRcLPwJNvvOKZ6tk1cfq0ZWfHYRKy6NL5y3a2epgkX25iFswUUho Spm3irP5kQQibx6cLIMT3eT+FHX8vbVi91Fvlr8eIvfbtKFCBWRwekHgnUB+TtGV2owk Nc5pbFMLgihA92SZvs1J5C/zs00A1am5Ls7YOcOh02sMWGUvi9w5q6kzuvXVJuZ+L9dW HSuw== X-Forwarded-Encrypted: i=1; AJvYcCUDvLdxvPWSF9lcoDLEsjwXqd0ZEQhXCWFyn4Yg4lKCSLDaIPwA8WWtM37Iwq9xnTgnuK4=@vger.kernel.org X-Gm-Message-State: AOJu0YzBUYMC3z0stolTLQFl/u4Q+3tqREIKU63aoHtYm2InfVa7IkHU lDDdTgcJz15/xn1aLTe/Ax4/uf16XEm7tEuFgz8Yeq6GMU94nhAjbZLXA29dDjo= X-Google-Smtp-Source: AGHT+IGl+hAC7xKg+0Mp16pdpeeXIDIYDU6WjhEFWtxxGSyLoudl/zJKvx6zmb4I/Li5Y9q95p5HIQ== X-Received: by 2002:a05:6402:358a:b0:5c9:85dc:5b9f with SMTP id 4fb4d7f45d1cf-5ca0ac43593mr11802716a12.2.1729594586471; Tue, 22 Oct 2024 03:56:26 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c737c4sm2963632a12.96.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 711A35F9DD; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 09/20] dockerfiles: fix default targets for debian-loongarch-cross Date: Tue, 22 Oct 2024 11:56:03 +0100 Message-Id: <20241022105614.839199-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- tests/docker/dockerfiles/debian-loongarch-cross.docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 Tue Oct 22 10:56:04 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: 13845544 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4B0819C579 for ; Tue, 22 Oct 2024 10:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594585; cv=none; b=QX4DpNrKohe3H6LRgSY5hSHpduZBpmrUC1G+ddSNLGO1rNVDXrzIdYJy6lX3dZ56BLkE2ovAmnL3H1/eqVaS81uL/QflTwv8kVlux4TH2bUkmc7lZ6/VqOUegsAUf3z6FkabsX9ONE7472k3F8lZDGQ3zXT2FkZtkoZuGZe1svQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594585; c=relaxed/simple; bh=mp3Y+13HJt4aLaIDoWu1rAuu6usjzMXR6e+YoqULWZU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Jo9GFTtnim64d9t5mxTGaoPvF9yzIXWyF6k1X2wvNuh+/AHegbX+uV5R2k+ZmDkFBnz6/kT81LVVHPh34tyTwd2+uW0fIo+6yY7inB0ZJQDeHlWY1GiRLkKr8tkohMH7rtS83AZPFeNFTFJZQXb/zGmwc7ediSwpcZXsQE/1HPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ciMtWl7V; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ciMtWl7V" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5c94861ee25so2818020a12.0 for ; Tue, 22 Oct 2024 03:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594582; x=1730199382; darn=vger.kernel.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=/thHQrDD74xWhDO5ZvpNfmAfgwRl7ohsH8B1mB/WTo0=; b=ciMtWl7VOYEF32hagQEPQSWhbEF/72/waY54GT7SBVm0sGRgTrDp34wtWQrh1abXCc hX6fEAveHsQ9r7tZpnjnyuecEZrF6Ye6Cv053gYEXgMeemuPAa8UpC18PfAIYzU8lNoK znxNN9T6szDB7ftjNcbXHHXbkynIhl21osz14QxVpbudbAzvuZ2sMZi+tkaS2dbtHFJ3 YjwocC5ZuMFVa2CPiqkHp/7kp5Jd1vFp76GKfHVcniLSKdZfMNu10KPyiJeZw8jgv8uU W0vzSkwFNS8rCdjy+m2NA4z5SmXHGl1BdB+KTQ6fzFhD/Pl2Pjq7hmHBbMBY2wdWRA2h eNQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594582; x=1730199382; 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=/thHQrDD74xWhDO5ZvpNfmAfgwRl7ohsH8B1mB/WTo0=; b=NmvIdZB/xOot71kxkmj2DFzEdrJMBuiUuiVtDPe/HmTm16dFI+hQwj7BLJ0w+FEoLI FFDDtsOl4z6cog3WB0YsyHGNjD3mB+rBwkmfW5z/tK1QF8BCCqhZdgvAYcWtQVBcOCVs VtQC0lBt5RwaU514aBhJJPjfFV3ESWC+3glsi0hKF4Wp0o49Weyv6DzFRxqoWRW3wWQE /OyaDdXvzrLKVhFFWhkpBRVrlgDIwpE7jQaASAdmYaZxuM6Ew4mUmXDDFWoILwey8gAu 03XMT7iHEJgf3ZCxKRrt32IDZ8k4GI2E94SPZeKbQOSD/14FBjZUJlwvelIChJzFVDXn 9ZQw== X-Forwarded-Encrypted: i=1; AJvYcCWRI40aCeoeCH4rHaS99kt8jHirzHTnsL/1rx8NciuTfT1d7Or/7gpSxrng5LdhlZiucBY=@vger.kernel.org X-Gm-Message-State: AOJu0Yzofb3Z8rEqk3IVvyffOMZfSEvRPpUn06EdyjuCzfEns2d9pq+s 3VWSgKW6XDhZVyOUmdsjrym/cH9gy/ird9j+c8Yy4QeZG5NHpz5CwZAmvPP8IE4= X-Google-Smtp-Source: AGHT+IFBxLhqkcFc083FyPJREjZC/bdX6TenkPZv3cJUb/crfFR4k5TS849WsfGhqyrMbpgpzkF9Rg== X-Received: by 2002:a05:6402:909:b0:5c9:21aa:b145 with SMTP id 4fb4d7f45d1cf-5ca0af87099mr17318763a12.36.1729594582079; Tue, 22 Oct 2024 03:56:22 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c72581sm3010588a12.86.2024.10.22.03.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 86BD95F9EC; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 10/20] gitlab: make check-[dco|patch] a little more verbose Date: Tue, 22 Oct 2024 11:56:04 +0100 Message-Id: <20241022105614.839199-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- .gitlab-ci.d/check-dco.py | 9 +++++---- .gitlab-ci.d/check-patch.py | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.d/check-dco.py b/.gitlab-ci.d/check-dco.py index 632c8bcce8..d29c580d63 100755 --- a/.gitlab-ci.d/check-dco.py +++ b/.gitlab-ci.d/check-dco.py @@ -19,10 +19,11 @@ reponame = os.path.basename(cwd) repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame) -subprocess.check_call(["git", "remote", "add", "check-dco", repourl]) -subprocess.check_call(["git", "fetch", "check-dco", "master"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) +print(f"adding upstream git repo @ {repourl}") +subprocess.run(["git", "remote", "add", "check-dco", repourl], + check=True, capture_output=True) +subprocess.run(["git", "fetch", "check-dco", "master"], + check=True, capture_output=True) 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..94afdce555 100755 --- a/.gitlab-ci.d/check-patch.py +++ b/.gitlab-ci.d/check-patch.py @@ -19,13 +19,14 @@ 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.run(["git", "remote", "add", "check-patch", repourl], + check=True, capture_output=True) +subprocess.run(["git", "fetch", "check-patch", "master"], + check=True, capture_output=True) ancestor = subprocess.check_output(["git", "merge-base", "check-patch/master", "HEAD"], From patchwork Tue Oct 22 10:56:05 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: 13845551 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50AA919C543 for ; Tue, 22 Oct 2024 10:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594594; cv=none; b=aeb/sp9LbIriYi0fVFx2A0SjmC+o7189HDgliOT9NMagjoGxlOc1mz5/QSd9SoYUQaD803JTRB5BxD8PqiNXUuRyWfKl+nkyVqf7pg8oD0CtKUFVKIf9+eFcNw5qzneT0lVq40sNFNS9Q7/UeW+wg8V2i66svb4y8C0PfVwi04M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594594; c=relaxed/simple; bh=W9oqkuoqnG3CzN1HaJ//sVwJsa3g5RCIP1k2aZEBCW4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=HlT3Cb3LoutRfNvKaHg0VpydM6evbvLZrHA5kunvzbRUAE65KrEVocLIwOP+gCU0PZ5Ne6WqZltmJdRuIFHVUxnrgaAe0Joz02jp0NMZeeOCvxC3t8pn0n2wBMdCH5CPUkafsDyhrpsE+MCZ63WmBbq1yrecSq5r9McWoi28Kq8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XvlrOaEQ; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XvlrOaEQ" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5c935d99dc5so5891147a12.1 for ; Tue, 22 Oct 2024 03:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594591; x=1730199391; darn=vger.kernel.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=p2jXJE3FbWlzhHC2JLNXh46hRwsq96dE8ivUr/Ry4PY=; b=XvlrOaEQ8J7uevmXj4FZNv6rc2aos36jBCMn4C7Bet0ZoWrBtA2TrT7ugVO+aIT4VF mNqWkDsP0yk4SyEKkqacmtTUu03OvwerOpSZ2OVHxfKDw/5fu58vdNlWHDUf56+4BcTT FvXKQvEXeYDbkMfKlMln92zAB4/Vjr6Jq38aG7JL1MPsYDYlbSMkDXtr7ABFoc/6Edjy +t97l+jf1kfEnbS652rdyibwQX+vcW3G3L79SpaDYthBCbGFy6YWC0z/GQWINadtKMWC KXot3i6b2UySZ7bw6pZlOeFmKy7uCtnyx2AtyQIuExj5Vgskr/9aT7GtLZW4e8KaHOw/ uQ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594591; x=1730199391; 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=p2jXJE3FbWlzhHC2JLNXh46hRwsq96dE8ivUr/Ry4PY=; b=qsuQa3uKb2K9fHN20hnX9YVH5kWObZiuHoZIo2ltYLcofPOOlQqRmruzCC7KKeQKpd MsAjz5aNjK3sG57w3Egzi7O7msW3XX2Nb5WCbrjnJzFpYpVAnBMfd2TG18UfH8Kx8iqh slDWORXZQBOffuI45/QoH/ZoBTRFB03Ao8XSwjmqRvlqE32rDmZWuDa7V8R2+GxTw2kn JXd9helDkL32J9lLQBx2JOwrCxa/BlpFq46EDxS8oA0qxNK5PUhRq1FsL+ZpEPW5iNTw s1kxkFN/L0xEwHQi+UcJ8+O1shVyJ393/TCXLh/LyYNA1hEP8FXGl7LkMCSA7933umdA tXTg== X-Forwarded-Encrypted: i=1; AJvYcCWe/3x9IVBSMjvDYem9LnGkMfvnhZu8+9/sUB27lXpAcHwXZpmgAvLRH0Pc9HQCubk2QTg=@vger.kernel.org X-Gm-Message-State: AOJu0YwcO8HsCK5mNIW44jqh7CQCP29rlRcdGJ8YF3QXd+gegpNnL8Bo X3tb2dgGh3Z7q4uKvMR+2kiXQNvvqWs6VkuQKSnsm8DuPp4oTp39JDtzC1+dViQ= X-Google-Smtp-Source: AGHT+IGUejPeSVv+t0DCi7SW64a6BptBW33UQRq4rjvBjk+8TQgWaYTlBD5pezBspgvI4FXlscux/w== X-Received: by 2002:a17:907:7da5:b0:a99:4aa7:4d6f with SMTP id a640c23a62f3a-a9a6995d6f8mr1533790966b.12.1729594590554; Tue, 22 Oct 2024 03:56:30 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912edc33sm321455366b.58.2024.10.22.03.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 99FE35FA0B; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 11/20] MAINTAINERS: mention my gdbstub/next tree Date: Tue, 22 Oct 2024 11:56:05 +0100 Message-Id: <20241022105614.839199-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Make it easy for people to see what is already queued. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b84787ae1b..81396c9f15 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2978,6 +2978,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 Tue Oct 22 10:56:06 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: 13845549 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E932F19C547 for ; Tue, 22 Oct 2024 10:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594593; cv=none; b=rOg4yvb/vbqhXbPOZFqkc4BQUhxFNI6NMxp4etcSaGx09Ng6JlFP6fS2tLbAlOXh8vmGyZaEu6PxMGrwKlFEVIIcItiFebe9w/UsFYr+94EfQ3KNDC3c0PqkpjEdKfUGsymIn/987u1yzz03xB51e6Iw3w1IOuHkgyhumdAK1RE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594593; c=relaxed/simple; bh=F1IaLKRSbm9Uapi2UOS+fME09MgEwbeqN+Y21eQizjo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=kcuHCJTkL6Vi9spTUAoSFUKRUFQjhW/hFd2qd+oPhJ7ISiDssoQ2LGgWf5ZySIjRpUgFOAkjt6IRWMZKnkh897MVcDh56LX1q1AACg9hG3YZ4Yhzj/x+TVNo3kKUwI+XQdEQXFVSr9VlM8NzdIxlNPH/n7JKS26BJyayyigFBOA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dNmFWFyh; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dNmFWFyh" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so1438931a12.0 for ; Tue, 22 Oct 2024 03:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594590; x=1730199390; darn=vger.kernel.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=nuVL16OURPo6SfQxD2PzScmfjsPxu4HizBAVk8u7e/E=; b=dNmFWFyhPLs4vQfw1em4h4iTSPWVFo0nOvId2oeCaI9WIDqU5TuWJaQirhDYCn4fB+ dZW03RnCCgO87173O3HMEOuc/s7pPWe/9xD1xt6Iq2qSSbrriV/pu3fLYFe2SoWHhF4C EDA5io6VwGcyN/WeP1JbaXV/n5mJpaMz0aiNdoLcK8MRMi7pIVwYSMTf95lpGdG0VLck kuScnOxpHsWq1S5BzcUpX/m1sIdLjrlNtg2eU+glzYK3LbcUJrOtcKm5NV5y+2II9xcd gudCGgic9irWC+i9fGEjx+PB26wxsW19CnoT54TeojC3eBfNWfxkYGpSTKcsa6ls1EbH OxQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594590; x=1730199390; 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=nuVL16OURPo6SfQxD2PzScmfjsPxu4HizBAVk8u7e/E=; b=aFlTyFrT03LNj9XftjEnydvGcwjkXHs4ktwf3abg+kLfOOIc+LaOYzHvF/Fuhgcue+ wHltZw+e+mJ2T5f1nQPd3Wdd/l++sNMwMfKclXboW88bBGMNXdz73qGikRQo59CpsvSD rPCV+ueg1lG7Hp+8uHAypB9UAEjpy6ANPyy9VUic9dTznfeo1u/noc9e1xSAYG5N2IWM 8ChG2zBPsvUN1MG2BwjIwQjmfuoq0dp4E8umRZrRousoaDAM3l43z2ajGq8BpYaS+oRo uZvRwPrHe0ZXDKev8Ak2aiCLbOtoR2MXYs9pPU3dZiGzumv0luvSvoF0XrqDvxbV5Wo/ Ly4Q== X-Forwarded-Encrypted: i=1; AJvYcCUC9vGaz8edtDk43zmq1g9yZTdZ/Qn+PhNhLi3JgyORM6CIuoPocuQrne9qByPNjgIzUgU=@vger.kernel.org X-Gm-Message-State: AOJu0YwqtpRa44io0BJ/Z0TWDL3sDpdNlZNwKuDmyFH8m3J4UnXwq3pY /jP90B8N/2XlaNp2V+UdFGiywHYQQs66KM5OG3tdk1mzi+5j4SxdEkz4lT6K/PE= X-Google-Smtp-Source: AGHT+IHwi1+vxmbQ3YLA9r6WePtD03FZyJBvumSeivnyntfSu8jv5XX9sGc6cj7ZvugURHt1idsIcQ== X-Received: by 2002:a05:6402:35c2:b0:5c9:3070:701e with SMTP id 4fb4d7f45d1cf-5cb794670eemr2833546a12.9.1729594589755; Tue, 22 Oct 2024 03:56:29 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c7255esm3123937a12.80.2024.10.22.03.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id ADE0A5FABE; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 12/20] config/targets: update aarch64_be-linux-user gdb XML list Date: Tue, 22 Oct 2024 11:56:06 +0100 Message-Id: <20241022105614.839199-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- configs/targets/aarch64_be-linux-user.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 Tue Oct 22 10:56:07 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: 13845552 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F20B019D083 for ; Tue, 22 Oct 2024 10:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594595; cv=none; b=cR0MJbZsJJM+uuF35YSog3fhoHW8vnN9P2fqSlTuW+i1trYRqe0ddtuJT3zmSpLVypm2BUCCb8pBhcpKfckHCkoz521uwUAqfcCxEifxF+vUpSdQZHEco+HdliBuuQoJOYrWQ3lUcr27vV1Z/ooPlp9qUr7mfhLMs9JFtnuLAhI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594595; c=relaxed/simple; bh=1Z5UScpG+BInmbuwnjQb4DYLB0wPDLPR+Hkmew9RU94=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Ipp/SQwi24BMetRO5fWIoyeYjTYNjzMY2YjlOHZxIv5TJ4F3lBl0kUvSbuoBr8HVLup2iMA6L3VPF21rcntrrtflvBOIc1jFtkCTWHsSO1gis2Q/k5ykR6W/hGCSPHNktn2p/R0pWLTM7IjsVxFfsFmCGp4Z14bp/ORdTvzY9DI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DjcUD7/q; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DjcUD7/q" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a99f629a7aaso991509666b.1 for ; Tue, 22 Oct 2024 03:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594592; x=1730199392; darn=vger.kernel.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=pf3uq1o/PXtMWzbvWkPU0TjSlCT93/aG9VyjOMqKoJo=; b=DjcUD7/qP67AIGatD2aSTuhvCc/AoZ7kE/RtqMY+sUQBeV8lCvxnfSVZqx8Yse6gZC I7rhwaXIqYGaz+hM/fEolbfyY/tOM4UzfQbJcI2NCZWKTeBqc/Ys0Gpma3csEO70IxUo krC5p99U2gWc5Qwyo/imziRqSHvmtlORLQs8h4zAA4AkcwHYCqoRPitX0zRB/aWwheIj 5xUevTvTiTdfFm00vC93wghdxm0IKKKAN+hTjVGLxiVcwo447K9UOIjkrj0PTegGYMdw IgSwq6KjVbRhZwYgRB7rhQ99c+9j4q+J//KgKrHuNm3fhKo26J+9E8TXv8LDiPRkvivl f8hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594592; x=1730199392; 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=pf3uq1o/PXtMWzbvWkPU0TjSlCT93/aG9VyjOMqKoJo=; b=M9yIW/OIfqWq8M/yrAo9ywh6s5bJj7yxLqWGS14LhREIEg78olBksfHAaoOTaVdkiY UXaaoo5sWIfA/IU2Hc3IJjvGvvv1Ff0D/ckRvGS/X4WGxkPMj/s+lIyrH7jPBpuiJRMT GspqWOEADnWfWXwQpoObaOGeN7egLJ0o5cHQoC/yMD7TqdqH+NMIlxafJGarEWklowhT PTDP910VaI2pr+8Vqrx3j8wVfv1Io4cJuaWE3Vzai1WUNTLmu2Uz6NOxQxKwymVxSNen +uD+MqvBF3z4iA3lZHrQOHsHgl3Gqhffm58mW2RXFUVuJ919KPdwxiVe6rJr/rQCRz6j gWvA== X-Forwarded-Encrypted: i=1; AJvYcCVPZ41AkUZlJ6CQjOphYZEUG/1tRZV2yWiYQ9DwYFzDhJ586jHWOuE7aA+DctTfl9aFkOs=@vger.kernel.org X-Gm-Message-State: AOJu0YwGG1y2tIEevw5sjtT52WlmabDeC4jUO/vmUVgwDPG9AedRYxmm cF1f9Lw51PqumbLZ7zB0O121yTqOtLzaAL2JQQtK3mY3oupzZmZkZOpUr4OEvps= X-Google-Smtp-Source: AGHT+IFr+0mLMKe2JQJOUJSSxtHXWPXM2EDoaQ4nyTBJKccw5XUwjD1MaeL5ICuPvGV4e9NH5KWjRQ== X-Received: by 2002:a17:906:c116:b0:a9a:1575:23e3 with SMTP id a640c23a62f3a-a9aaa5428e4mr236057266b.19.1729594592209; Tue, 22 Oct 2024 03:56:32 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a9155a1c9sm323018666b.129.2024.10.22.03.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C52CB5FBDC; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 13/20] tests/tcg: enable basic testing for aarch64_be-linux-user Date: Tue, 22 Oct 2024 11:56:07 +0100 Message-Id: <20241022105614.839199-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé --- v2 - fix checkpatch complaints --- configure | 5 ++++ tests/tcg/aarch64_be/hello.c | 35 ++++++++++++++++++++++++++++ tests/tcg/Makefile.target | 7 +++++- tests/tcg/aarch64_be/Makefile.target | 17 ++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/aarch64_be/hello.c create mode 100644 tests/tcg/aarch64_be/Makefile.target 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..297d2cf71c --- /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 +#l ibc 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 Tue Oct 22 10:56:08 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: 13845553 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F69D19D090 for ; Tue, 22 Oct 2024 10:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594595; cv=none; b=Nr3oZb6lomO4vwzkzp/E2EFE6M8kA1TIhyeehqetHkxxYHPG/5WwGR6ussiGpKNDnOh6ulfWCEXZQJhFMjv5a6QGgooM0EXYsDmJyhrDWfXHpyLVLwmtoiQ/ioPfe4qZaLFw/+ttnAoeY4zD8srweJPqDUCimIgtzVSHO8rcspo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594595; c=relaxed/simple; bh=UXQdLtabbiMtGUHNw3CuGAH7Y7y/tqHPMvrpotkPjug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=NbA+VvrZ2BTvFRZRupsDUInzcO9K1iIZJc4BQWuJl9THKxjM5JClKZ3j1Y39Msx11GBwqujlf9c6WCgOEkVpCSF6NLu9rQ0rpXXulikv1qxgVvR13OVJiKFZU6Wng+cjZ7czl/BduytJlB64qD1N4L6TNiVxYh7Os0bHu6UgyNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VYyPx6am; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VYyPx6am" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so751336266b.0 for ; Tue, 22 Oct 2024 03:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594593; x=1730199393; darn=vger.kernel.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=Pgb6ox3Ya7i122uZlocXrETTS1VOKhPW7bSAndX3jjQ=; b=VYyPx6amSMKv5u/ZEpVNJyWbpoZ5ls+G6x341/ynWLqKBv8oT3adprYZ5/Lq46h7OM fVbpfxDK1x2osBTWZMtqFnY4AOI2R8C55xwQHW0DlYoUiw+ciG6Inew2jeoXPvV5vM9X i9NVhQRCjbTS6/ruHl0cqGGY76lxdWbIIB/bFuf3tysdH4JmwiizOhJYdYg5b+AgNXqM mPjasm0pBrlLYGsm6awz7syGZ5OXY4hGZTE5P+RMM7ubf93Nn4k+r9H1+0RCWj81lEIY deimx6jd9JZspDBnvkaJykF+IdifhBMj3+q6eQIZICuu/JG/KKeOzxeePHOLBU2mquGf L7vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594593; x=1730199393; 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=Pgb6ox3Ya7i122uZlocXrETTS1VOKhPW7bSAndX3jjQ=; b=K4j80YI8mkRwbOULt00xiPJJeVitPsnylfXk4rWFDvJO/RqYPcNlEmQVlPEtzoBcFa tHWvzIpu66m8OJNWrLzHCoXWjTm+T82HXH6etPgSa0Tlz4QlnUCP+aTFokYvX5KM98jt SDTQUeDprcSujrDfQfnR1NuzP/3imgV01P8JDqAw7Z7RqPQh3+wRojwDBGUNVPXGMYl6 NI4VRN2jvoICsaEcSnEqPY+p0x0OhrtbeTnnv+QFIxotYzgNizyz/0hj99uUowZG0Av2 O57FP4Y5BPIDPn1z8gzEByy03KvHSS3fv4fkIRztFQq2VcBM+zCny3+UWhBoiPpcLzAe 55ag== X-Forwarded-Encrypted: i=1; AJvYcCXpsLFpMNtPVjS+CnG7yCiFtdYW7I9f7RXb0YPxcBNRgU6hxYlvkilymvv+3wZxs9KziiE=@vger.kernel.org X-Gm-Message-State: AOJu0YyF78PquEgUEZbEguUHdNcuUD0BRxEFX1gOBNQCNuzq5dlo/gMf zeGO34zAFdobNCqzzEjIBRcFVlZwNUaGhfJOn7Kkx2gqxHhFycjMWfBhFaQtiBU= X-Google-Smtp-Source: AGHT+IGPREmWhIG8Sxc2dRJUVUnivk8DPIAg98Rjd0GSZmqkbNvMhBR1OB4OKQK6ufaSF5tJ1fK0uw== X-Received: by 2002:a17:907:97d2:b0:a99:fb56:39cc with SMTP id a640c23a62f3a-a9aace98a17mr198686166b.38.1729594592591; Tue, 22 Oct 2024 03:56:32 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d838csm323114066b.8.2024.10.22.03.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D97B25FC0F; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , Gustavo Romero Subject: [PATCH v2 14/20] tests/tcg/aarch64: Use raw strings for regexes in test-mte.py Date: Tue, 22 Oct 2024 11:56:08 +0100 Message-Id: <20241022105614.839199-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- tests/tcg/aarch64/gdbstub/test-mte.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 Tue Oct 22 10:56:09 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: 13845550 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0A4619AD8D for ; Tue, 22 Oct 2024 10:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594593; cv=none; b=hT0ZSmwSgVnCNC98k0jiJJR5omU8hG4TDTTQakJWCDaf88kXe5vXBKH6Zn7z4ByZME2nWZ/u0Z642pqKb6dCmO5idx0KEn1OhhZgwj2E2zMMtKs7k6R9UxmleHxOBiWtwKMPpCtYT/8GQavvkaDANKemiikyF13O1FJONAkYt9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594593; c=relaxed/simple; bh=lpxl7MPf0Wbio1YTPaq7dXRDfcIsws51Vanz7vypfTA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=QvYKTg45CQp4wNcVTkERkVNY9AYsmOKwgZiR4KYjtBpsW964fe1dzA5AXSRiqAXIeHzipe6VFAWlZAdZk3K0UF5+A2q8q/UzcRpEPc/gVWL6jEsP0GJ3Z7Ci5TIOJRD2h+qp2CZvhJCKFSpB+e2vxGSX0hvdUAFnnYJ64LaI0tI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XGvCGT30; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XGvCGT30" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a9a628b68a7so711067066b.2 for ; Tue, 22 Oct 2024 03:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594590; x=1730199390; darn=vger.kernel.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=rLOsiFp7nSYSKf/se2Emh5FqkyaR/LV5KofnrCQ0C68=; b=XGvCGT30eJniLJsaD6TdeDgajZ0R2yPtywHUkY/xHmMvzNIEHH8YzHNLb72/S9Bl71 KTv/k+ddMPFkVvc/C0K7Bs/AUWklgF1cZUp1oUXgxpq9IocdkgJ89UMV2chWnHPTZ7Gk RwD5+PA/UcH+5rtiGhCYP2qTMvujUL1+C7lbCJt3h3pRaLQ5yEnnh0U8oEp781BsKyQb TfpGj0/LGinkRQUDF4PWZlTk19uildT8Dv+gsiGd4Y80aqCnYiTFacGNxjxiQfiYInOs 9sHNyT7RjxMQ6uKrcv8acFbmVQSvSibhZFXYT69xKt9UryolPJKE1BMYQt1osDVSqBwR prxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594590; x=1730199390; 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=rLOsiFp7nSYSKf/se2Emh5FqkyaR/LV5KofnrCQ0C68=; b=XvMc3rADtUDqgY6dajTUlTAH6KGYSo1b7/VYgdnQOHJXrNvJBjPNgXCPaTvAh9A4TA VnXXW2LypIsMjwYgW1WoZZcQHOLdxEe6eEOIzBG66byNLw9IvFK4bgDrqeIE7Fv1eD6A lWPmvkBrMMIJNfb1qevIs/tPoxO/0VO8ZDScTnxLqSjnUMhMWiJZFYAsq+DrfrDf1TZF oPBSwjZWg3XBInOv9YYUbFMZjeRVFKjLq6mrjOgm/XH9AI5Ks0n6Pm4/8fYrEQBdIdfs JElH2P9X5iTgcCGpxWgF8+O03HFQQRiZu/in/uiV1hL5kENZEoCKQNZyrSf+8HhMZSq/ coww== X-Forwarded-Encrypted: i=1; AJvYcCXLcmnF1zC6Ynh36ha4AzTArQED2urAmrDg8NvQC5ruKok10iGUBZyWLKdmIXHrzSnChIo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2Ldhug8Jre2ldFgBL5ud8ILgpZte+9F1zEUY+zdPb6/oFAhV/ 9QMCkowfbMBsm57Cr5gy9gJsxQH2aaoK7Lc7wsnp5Y9ne4QXW+X36VsSBYeSJoA= X-Google-Smtp-Source: AGHT+IFvlb/CmT8eWULIjRtzdfUNfGcd5+oEeP4MY3wCJkBrE+WrjT0rHQJ8GXb9kTKmNzYQI1ufsA== X-Received: by 2002:a17:907:3182:b0:a9a:a7fd:d840 with SMTP id a640c23a62f3a-a9aa7fdd87bmr350993366b.1.1729594590177; Tue, 22 Oct 2024 03:56:30 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d6355sm324467166b.37.2024.10.22.03.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id ECA855FC11; Tue, 22 Oct 2024 11:56:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , Gustavo Romero Subject: [PATCH v2 15/20] testing: Enhance gdb probe script Date: Tue, 22 Oct 2024 11:56:09 +0100 Message-Id: <20241022105614.839199-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gustavo Romero Use list and set comprehension to simplify code. Also, gently handle invalid gdb filenames. Signed-off-by: Gustavo Romero Message-Id: <20241015145848.387281-1-gustavo.romero@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- scripts/probe-gdb-support.py | 75 +++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 36 deletions(-) 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 Tue Oct 22 10:56:10 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: 13845595 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E28F2198838 for ; Tue, 22 Oct 2024 11:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729595038; cv=none; b=JjMNIg39EYueHQHEttBBy5X0aLe2xiRP0vrQtKmlIQMP5iMMOMTc7PmpAH3HLyglzohMiyxOUnhVwuLxHnEW24IbmhcwWHwuJW57c3omu6p1jjUT6b+w/ViyM789Nnn1H67q45d4zCgN90sOmerqMl425Q7tmGzJaDiUxNmAz4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729595038; c=relaxed/simple; bh=FLg9jPHwuXGr2Nk94kzK8K8ojMtKCSdvSv8p/meBLhs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=eSEMjGmnQpj6rWCm4z6kftNwm4ydpjqd+VZUD/AFGnatIsHVwF7fyDipyQT1JmTL0g/S2wX0x3AV8uCFlVatCfHaHSt0KzaY2iM2FOzXGGKZ6PPceFL7CWvxwOgdsFWjHceTadnlxjPRdx204+s/zgvqrwK0KghlshOi5VXC2uE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VfeL1+KB; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VfeL1+KB" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5c94b0b466cso6248067a12.0 for ; Tue, 22 Oct 2024 04:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729595035; x=1730199835; darn=vger.kernel.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=xhZwhDsyP9u5fu/gLDiAkir8lHLMK7A4MI+ExEvLX/4=; b=VfeL1+KBCg0Wvjcm7pC7sjQfHeDL5c0PQzGnpG56zce6iHKM7yEMb8B04MEBSydRUr zYED5USqWbcznfIzRzPK4U8Wv3/OfUX3OABqtEX4dT2YdZlvZrytjYpl7QpgoCUclQfH Le1iJCVmP1/w3EW3zgm8coCtxmxCn4axjOB+asgWmiNpCXKM5RtUw4TpKHcNxUYZM6UN lyLDNZ/q4/HkBl0UfGG9QIsYFbCZRgIg48iOf7Q/fYzLVJ3Ymbx3VytuFYtUg+L5g1sW DU1gH0faHM3yxJxzIylkvqQFyvYpCPsZPopixVSC4ihOop3FPBiLq2ORH1RpdRhXjhA/ FgEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729595035; x=1730199835; 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=xhZwhDsyP9u5fu/gLDiAkir8lHLMK7A4MI+ExEvLX/4=; b=S3lTT4ESbumr4dM4gBew1J7rwOzyB6s4pfEVkZgeoNQruweFksGFk1vm+rkuzSHGzI 4dEYKWvi6akLEz3nkyiUillrzLNzbzBvv9rPQ6HC+O/hOtbFtv8kAYDibIjtemtaC+m3 WrzlayPlJM7li+qxs61BOHGguhYf0TESVcxJhOQ0pyvnmP2x++PWoyq14AO1CrKmpLW+ ccQo+0s2+S8IptICf2ptK9wVIkdfSviN8lzk/vQrhOLuhd2wEMHp2zscjjIqNtmhWJj1 NePwWgVJjcB4OBKktqIIVeIgpuuP7tl18vKX+MDNho4vHW1gpO4WJi5WQyMRqAzd8d2h EMoQ== X-Forwarded-Encrypted: i=1; AJvYcCWgxkAInd24ANoazaY0EOGt893bMByOXRVQRASKAxzzfxEYjPxqyQ8qyY98uD6X+WV5ML4=@vger.kernel.org X-Gm-Message-State: AOJu0Ywkq+FI8EHwEgAcjd3HTJtfNInzlYUUw2WE/79Ofz6dRW+nADKk HwZ8tiXA41/6oHDGdtyi3s0UnXf6FDUboCQHpctpMeq6gscu/THB6ChO7trhAE0= X-Google-Smtp-Source: AGHT+IGrsXwXm6QQRI2EJsc5NTDWH/8THorwiRLqjS3xUSuBrUIQM0t1N7fBGivyxVye6YEvh9zvEA== X-Received: by 2002:a05:6402:13cf:b0:5cb:7295:49b with SMTP id 4fb4d7f45d1cf-5cb72950e50mr4337266a12.34.1729595035184; Tue, 22 Oct 2024 04:03:55 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a6a6efsm3001448a12.53.2024.10.22.04.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 04:03:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0BE3F5FC19; Tue, 22 Oct 2024 11:56:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 16/20] MAINTAINERS: mention my plugins/next tree Date: Tue, 22 Oct 2024 11:56:10 +0100 Message-Id: <20241022105614.839199-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Make it easier to find where plugin patches are being staged. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 81396c9f15..02b8b2dfd6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3702,6 +3702,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 Tue Oct 22 10:56:11 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: 13845554 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8DD019D8B7 for ; Tue, 22 Oct 2024 10:56:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594598; cv=none; b=DUhHY27CdghowzUa8JpbFyWAN22g05Kxy1ph/Dc7Le0StbkRz4c8T6HKdk6R/rRmF2hC9ye/7SX5xxvKhQI8h8t2NXIJyGjoryDGvLlttLW5AjpMHbwyKI3Wcm9/kdYzifZpaghinxsqJsL+GOyHGPLh+SjXYv3uJvZBLJ7v5R8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594598; c=relaxed/simple; bh=pMmE3lfG5fDHbWyJiM6aMnJ8N8Svupp+uAfMJ0Ot1Hs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=UDmZhw1nPKGloVtqutgra2RQpk2PH8wVtxawgZWr+M+Ia6FpZ7il+KV1xcQMEzBK1e8iGR1ZuABS7pX4MTbBaaJkRYKy37vW95hvAyws0mCsdP3iAhh5E7zM/nQ3C05biH/mhLhGauMiF6WhQ1MfglT2vkPfXsoSXZoh3x9/2Ak= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sRzGTIPJ; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sRzGTIPJ" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c9c28c1e63so6386759a12.0 for ; Tue, 22 Oct 2024 03:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594595; x=1730199395; darn=vger.kernel.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=ncBC08IoBkP10ef5QDpG5SV+FPj/pwrW84Mb8BGJC6M=; b=sRzGTIPJrId/5/91hCEsLrOPVNCmxTyJgcmz1l06Z9IRXsHqK+jN4vorLJ2CTS4tvB rHTPpRgF7qxSirodbYT/qiFsCuAuLKdJavVIRKVaVvgKQ8IsRl0/VAKz8GJ7gVzEm55F 2fzgCnaeC/XTO/wBRntrzkguendQC13jU22wevlmYgXy58FzMRlF0BIP7V/WsU0mNTWx 3AAgl8UkavIXtrs//MXnwZiqC42T9Of06fL/6UzhDylnCKGzVHrLBc3aKxl4v8duNPHE i7mHEfShOMb/b2mVJej2m0FkPXR1mjgQoNvNMPKEr5/PnkJnYFCI0CDZ9eg0rWGUrrft b3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594595; x=1730199395; 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=ncBC08IoBkP10ef5QDpG5SV+FPj/pwrW84Mb8BGJC6M=; b=SDoR1LCSVQy6pYGVHc1M+VwSsEzTjQfj+ad2n1knozLmvxNSG6mfSp/HlvRgfg9TEH XpH9uH0M5RhajPaKm9aWg39HVJul+6jF0BmiUipXb3ib85wPlV5SX/UDtHyA6Squnwf3 nOCfg3TqHPtsXT530O+7f4fVvMg4qSebGutjYFdtSWvq+yfbt2M2EMU4K/sQEt6Dvi2l DbuR1OECkEzEzaBRA7fF8jRszj5a/1QLXSMGLVBWvJXzZlkCn/Jv1A4jyYCy+PHKMc5g u8tD/ktl6RvP6I2yi9B22J2/TEv46qiIzRQtUZQzYC3Y/5TVLxoKhikdC9DciPwilypL dZpw== X-Forwarded-Encrypted: i=1; AJvYcCV053YdR34ax45Ve6U1EVWjGtuJKLgaG9b7HThfzUGvHMwY3lbGo/GEHuAPcYDFKsr4sJo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6/HVf2mMqPSDdJNRleQdyGTJJa57X/0AovLY6MxRETolv2oDc 2qLCCebaT0MHjWVNoT8+ECAZ1Y+RR6Xw/IcHuBwPAj8WqnZBKTBDqZIu5fl2jCI= X-Google-Smtp-Source: AGHT+IHBLyW0mHPJl2GnPpKKp3UGFXSgagg2mGtBM8c3JT2vxTQvXvz98RyNa3XJTjQV1wo5eVGMhQ== X-Received: by 2002:a17:906:c10b:b0:a9a:6bd:95dc with SMTP id a640c23a62f3a-a9aad3715ccmr189373366b.46.1729594594783; Tue, 22 Oct 2024 03:56:34 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91559951sm321731866b.106.2024.10.22.03.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2565B5FC34; Tue, 22 Oct 2024 11:56:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 17/20] plugins: add ability to register a GDB triggered callback Date: Tue, 22 Oct 2024 11:56:11 +0100 Message-Id: <20241022105614.839199-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now gdbstub has gained the ability to extend its command tables we can allow it to trigger plugin callbacks. This is probably most useful for QEMU developers debugging plugins themselves but might be useful for other stuff. Trigger the callback by sending: maintenance packet Qqemu.plugin_cb I've extended the memory plugin to report on the packet. Signed-off-by: Alex Bennée --- include/qemu/plugin-event.h | 1 + include/qemu/qemu-plugin.h | 16 ++++++++++++++++ plugins/plugin.h | 9 +++++++++ plugins/api.c | 18 ++++++++++++++++++ plugins/core.c | 37 ++++++++++++++++++++++++++++++++++++ tests/tcg/plugins/mem.c | 11 +++++++++-- plugins/qemu-plugins.symbols | 1 + 7 files changed, 91 insertions(+), 2 deletions(-) diff --git a/include/qemu/plugin-event.h b/include/qemu/plugin-event.h index 7056d8427b..d9aa56cf4f 100644 --- a/include/qemu/plugin-event.h +++ b/include/qemu/plugin-event.h @@ -20,6 +20,7 @@ enum qemu_plugin_event { QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, QEMU_PLUGIN_EV_FLUSH, QEMU_PLUGIN_EV_ATEXIT, + QEMU_PLUGIN_EV_GDBSTUB, QEMU_PLUGIN_EV_MAX, /* total number of plugin events we support */ }; diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 622c9a0232..99c3b365aa 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -802,6 +802,22 @@ QEMU_PLUGIN_API void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *userdata); + +/** + * qemu_plugin_register_gdb_cb() - register a gdb callback + * @id: plugin ID + * @cb: callback + * @userdata: user data for callback + * + * When using the gdbstub to debug a guest you can send a command that + * will trigger the callback. This is useful if you want the plugin to + * print out collected state at particular points when debugging a + * program. + */ +QEMU_PLUGIN_API +void qemu_plugin_register_gdb_cb(qemu_plugin_id_t id, + qemu_plugin_udata_cb_t cb, void *userdata); + /* returns how many vcpus were started at this point */ int qemu_plugin_num_vcpus(void); diff --git a/plugins/plugin.h b/plugins/plugin.h index 30e2299a54..f37667c9fb 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -118,4 +118,13 @@ struct qemu_plugin_scoreboard *plugin_scoreboard_new(size_t element_size); void plugin_scoreboard_free(struct qemu_plugin_scoreboard *score); +/** + * plugin_register_gdbstub_commands - register gdbstub commands + * + * This should only be called once to register gdbstub commands so we + * can trigger callbacks if needed. + */ +void plugin_register_gdbstub_commands(void); + + #endif /* PLUGIN_H */ diff --git a/plugins/api.c b/plugins/api.c index 24ea64e2de..62141616f4 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -681,3 +681,21 @@ void qemu_plugin_update_ns(const void *handle, int64_t new_time) } #endif } + +/* + * gdbstub hooks + */ + +static bool gdbstub_callbacks; + +void qemu_plugin_register_gdb_cb(qemu_plugin_id_t id, + qemu_plugin_udata_cb_t cb, + void *udata) +{ + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_GDBSTUB, cb, udata); + + if (!gdbstub_callbacks) { + plugin_register_gdbstub_commands(); + gdbstub_callbacks = true; + } +} diff --git a/plugins/core.c b/plugins/core.c index bb105e8e68..e7fce08799 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -23,6 +23,7 @@ #include "qemu/xxhash.h" #include "qemu/rcu.h" #include "hw/core/cpu.h" +#include "gdbstub/commands.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" @@ -147,6 +148,7 @@ static void plugin_cb__udata(enum qemu_plugin_event ev) switch (ev) { case QEMU_PLUGIN_EV_ATEXIT: + case QEMU_PLUGIN_EV_GDBSTUB: QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { qemu_plugin_udata_cb_t func = cb->f.udata; @@ -768,3 +770,38 @@ void plugin_scoreboard_free(struct qemu_plugin_scoreboard *score) g_array_free(score->data, TRUE); g_free(score); } + +/* + * gdbstub integration + */ + +static void handle_plugin_cb(GArray *params, void *user_ctx) +{ + plugin_cb__udata(QEMU_PLUGIN_EV_GDBSTUB); + gdb_put_packet("OK"); +} + +enum Command { + PluginCallback, + NUM_GDB_CMDS +}; + +static const GdbCmdParseEntry cmd_handler_table[NUM_GDB_CMDS] = { + [PluginCallback] = { + .handler = handle_plugin_cb, + .cmd_startswith = true, + .cmd = "qemu.plugin_cb", + .schema = "s?", + }, +}; + +void plugin_register_gdbstub_commands(void) +{ + g_autoptr(GPtrArray) set_table = g_ptr_array_new(); + + for (int i = 0; i < NUM_GDB_CMDS; i++) { + g_ptr_array_add(set_table, (gpointer) &cmd_handler_table[PluginCallback]); + } + + gdb_extend_set_table(set_table); +} diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index b0fa8a9f27..d416d92fc2 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -75,8 +75,7 @@ static gint addr_order(gconstpointer a, gconstpointer b) return na->region_address > nb->region_address ? 1 : -1; } - -static void plugin_exit(qemu_plugin_id_t id, void *p) +static void plugin_report(qemu_plugin_id_t id, void *p) { g_autoptr(GString) out = g_string_new(""); @@ -90,6 +89,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) } qemu_plugin_outs(out->str); + g_mutex_lock(&lock); if (do_region_summary) { GList *counts = g_hash_table_get_values(regions); @@ -114,6 +114,12 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) qemu_plugin_outs(out->str); } + g_mutex_unlock(&lock); +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + plugin_report(id, p); qemu_plugin_scoreboard_free(counts); } @@ -400,6 +406,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, counts, CPUCount, mem_count); io_count = qemu_plugin_scoreboard_u64_in_struct(counts, CPUCount, io_count); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_gdb_cb(id, plugin_report, NULL); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; } diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 032661f9ea..d272e8e0f3 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -25,6 +25,7 @@ qemu_plugin_read_register; qemu_plugin_register_atexit_cb; qemu_plugin_register_flush_cb; + qemu_plugin_register_gdb_cb; qemu_plugin_register_vcpu_exit_cb; qemu_plugin_register_vcpu_idle_cb; qemu_plugin_register_vcpu_init_cb; From patchwork Tue Oct 22 10:56:12 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: 13845556 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D88019D090 for ; Tue, 22 Oct 2024 10:56:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594599; cv=none; b=i5DFYlmpA/T0YmhQ2BUg2CUZ/oDM9bh5jhxFpZkx6jckISQ5pg18t8u0vogUi2g7pSvDwVyUQSmi1MPAVA+WUpdNKIpnlwXXCJnK2++RSjMcRqkvs0Y8rhjE7M2zpO3beR0T/h5bk/VY5n+1EjjHv21mgQEjovYV3q92VgKwQCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594599; c=relaxed/simple; bh=y2yqgDvf+xSMqKWaI5eABRrwqp58kC8YfNhhuIyptUg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ewS+YcO34inh+sKRBBMVNZx5x5HIx5cfpALnUenaTegTH6ptQ3XOKV15dzjwEpid+iSHqONTK30B00HEsQFHrFEy6lZRJe+EcWei5qOvh1+j0ibIKXt03XHTkX2RiYK6/sxdRpIURfsmZJ7W1b4OSxX/JdndxuLjOVhqPQ/Obs4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mcai016h; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mcai016h" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a9a0cee600aso691045466b.1 for ; Tue, 22 Oct 2024 03:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594596; x=1730199396; darn=vger.kernel.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=59EXaptdsAtTsnL7N0QHtzvibi/ktz9wJ6DO/DYK14s=; b=mcai016hu6ljeCX+IX1Teg261Snih2INiTt0UswfqQhWMyl1ByeGrrf2s+VA0uK7hT wkEX9QLjw0nyTnTvYxVU5i2fK4O6M5UmOkfewpOKC1BqqL3W6EM1oMN05CssFHsY1cD1 syxCN8jIs9uX6ogl6Ubu0QolPFnB0DEUySuXH+HNTWTrEKhGviMwtj9EoWPITDm0xmYY KWIM/kETiEgeJy+/rb21R5Q1D4EpYBuskMHmiykBs5MCn1TiMyxa8+81SrpYwPVhHqbP 21aiCx2XO7RfF5fKCNW1eTNkHySO9MfIGBbFsaA78eQMhma7QJJ4J/NLegNvYKJJ6auv ijDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594596; x=1730199396; 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=59EXaptdsAtTsnL7N0QHtzvibi/ktz9wJ6DO/DYK14s=; b=hAg15D0rAYbtjImlFx0ThzSo34wedWQda8xyOBQFADkbYqAsQrw0PwUhGW9b3vKXiN 1qaiZ3OXMYAr+JRBACCG1rPAu0YwrqGVSnlsrq8fqfe5fD+8qpndjOAjpt0KkkzHoF44 s9ri2/stDSVRm3odllqjsfjbs2a5Hf/5dPjqTWcO+JeGEuxC70pL/k62o35iSdSkL7Cw qr4ht4RfirnS8tZBcJl725plkdl2q6Oc874JQe5417ZBXpYuwqlg4djonl2QQh5aEjAb bqjJsVKS4DfoKe4SNgrCdJvyClB+pg5C18eeeuLyOjFDG+B5B4nB7cm8UnAeQJtz/rYW E7pw== X-Forwarded-Encrypted: i=1; AJvYcCWq36IWkOc7JBWsZcn1IPksTCfM3xbYN6AIMJH38l/ET0es3M5aA6ZRnzlqyX9EJiBNzQs=@vger.kernel.org X-Gm-Message-State: AOJu0YxTG2rUXl5LD7KM/RDt5OKEbxbhaWVeUDHBZTlwq65iC0HeBBDG lEctqkttJhJ+Ba1AUrs0IBFaNFfWgR2p1P8IAXw83UqYcij4M7sU2rZFRnT8/34= X-Google-Smtp-Source: AGHT+IESzzC72mFFjVxSlJ9yKckkgejJYGt9NcC+1VBYY14emqGj0/mOgmagBB965bWs6j/k5E+0qQ== X-Received: by 2002:a17:907:d2a:b0:a9a:5e3a:641d with SMTP id a640c23a62f3a-a9aad376421mr153636366b.59.1729594595748; Tue, 22 Oct 2024 03:56:35 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a915a48aesm326490066b.221.2024.10.22.03.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:32 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 394875FC3D; Tue, 22 Oct 2024 11:56:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 18/20] meson: build contrib/plugins with meson Date: Tue, 22 Oct 2024 11:56:12 +0100 Message-Id: <20241022105614.839199-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierrick Bouvier Tried to unify this meson.build with tests/tcg/plugins/meson.build but the resulting modules are not output in the right directory. Originally proposed by Anton Kochkov, thank you! Solves: https://gitlab.com/qemu-project/qemu/-/issues/1710 Signed-off-by: Pierrick Bouvier Message-Id: <20240925204845.390689-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- meson.build | 4 ++++ contrib/plugins/meson.build | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 contrib/plugins/meson.build diff --git a/meson.build b/meson.build index bdd67a2d6d..3ea03c451b 100644 --- a/meson.build +++ b/meson.build @@ -3678,6 +3678,10 @@ subdir('accel') subdir('plugins') subdir('ebpf') +if 'CONFIG_TCG' in config_all_accel + subdir('contrib/plugins') +endif + common_user_inc = [] subdir('common-user') diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build new file mode 100644 index 0000000000..a0e026d25e --- /dev/null +++ b/contrib/plugins/meson.build @@ -0,0 +1,23 @@ +t = [] +if get_option('plugins') + foreach i : ['cache', 'drcov', 'execlog', 'hotblocks', 'hotpages', 'howvec', + 'hwprofile', 'ips', 'lockstep', 'stoptrigger'] + if host_os == 'windows' + t += shared_module(i, files(i + '.c') + 'win32_linker.c', + include_directories: '../../include/qemu', + link_depends: [win32_qemu_plugin_api_lib], + link_args: ['-Lplugins', '-lqemu_plugin_api'], + dependencies: glib) + + else + t += shared_module(i, files(i + '.c'), + include_directories: '../../include/qemu', + dependencies: glib) + endif + endforeach +endif +if t.length() > 0 + alias_target('contrib-plugins', t) +else + run_target('contrib-plugins', command: find_program('true')) +endif From patchwork Tue Oct 22 10:56:13 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: 13845555 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ADAC19D080 for ; Tue, 22 Oct 2024 10:56:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594598; cv=none; b=AzgOZhpp7PB+ywkvLV+Z6brSiv3U3kYAr3K9zJSE6FVWgY/WsvOaoeDzUMW6KJAi6EB/1wDZOvWi2DfNd/UqKjCME4S0GnjaLGjGKv2bEdgd2Payn8XGkWCnXs2DrmdAWJwqGqaYoxeY2ZNERWO6MGDlTdeGy71ugZaJUeKN3eE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729594598; c=relaxed/simple; bh=gx7elASkKACRM34GNEWipezg+FLNYL4fWbpRkWi7xsk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=tW8HxbN8VZ2rHnIqP1rSF18OdsWmBZ4kPV8mH7kww/JjkerM4QqpY+NjhMEcBF9//HYR5Vp9WESOnMICfrX8QryU/Gjvu52Wmllo2f6D+AykhaY/eW6RAN16PYTPkgW4KBt7p6s2rChcNrIOdQJ9VFYlYf5aUgvPC2cPxUYuMM0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=EaLk2+Sy; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EaLk2+Sy" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5cb15b84544so3238027a12.2 for ; Tue, 22 Oct 2024 03:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729594595; x=1730199395; darn=vger.kernel.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=A1RT2huJ5JZoTziBJ4jD+CCwuEKWgio+GHjHj5uuvtc=; b=EaLk2+SyoYx73S57iiWYF9rSx8ubLMYu24E2j+fPy8eGnlG3tuhYo/0Z9kJy2YLBL1 04e6G5xUv0L0glsrIfQPd73PqrLk5tC08vg1v8KXbsz5HKPyEEnfW+Oz/8P41Qf8AiKm 9UyNAarw/GykvPilTIqm/zMfAjk2NwCMFy3pUU5m4tGM+wPWk0bF8el6R/GuJrtT7Xq8 vquTyaG+FvpZB8vSgqJ6x/7xcWLELSJa14Du8ylpX/ZKyn2qbOgZWZbyFjk0FmYiKmOn J211YB+kobX95+5I99hXIP5qxFPi3ckk6C3YOX56cnJL2+NlnzLye+/WPvFJxOiZJM1R wn/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729594595; x=1730199395; 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=A1RT2huJ5JZoTziBJ4jD+CCwuEKWgio+GHjHj5uuvtc=; b=ZB4d82hkkXesJrNPqmQqQx8R3+tUEJcPn4zdQg6kRQfUSrKHXoVDA5kx1mZTRmzRas 3KoGb6/SV/xEIuyjJDyEaQHLds5uGaz3se0jSiPCTdL/ccPbZEWU2YoyVNRlrhUSh0Rl OteWyK9vTAFyG9w9nkntp1litUBiYJOjej3I4f1zNb9S/+geRj+wlsuuxgW0ZXuxkCRC Q21IJQi2eW15M5EUk/kp+Vy/PCnUzlgxCYfUKAJMKU0QO5jIdGHyC0mk4QrZpYF5rOLQ LfT1J7dXzBdD4sxNI2tGmNgCZktBSxF2H3P+DqBGK8QE+hLdb9+PQHSwNvw+As8U20oo gBJw== X-Forwarded-Encrypted: i=1; AJvYcCVNWTmlPxlr0O1sSz7CihQWcweKqW+oObbyTZNQwD/wFAMKewXql9dMT5mS1xeJT3hxqE4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy324e00hzzcRNUaQdPlQRmt1IJPkAvSttZ1LQmHpI58b0fq/0F exdB8L8KzagvH6bhOhux3ZcJfbX4O2MDZTkb37zP4UUQ5j5usB78QTt8fVRGJPY= X-Google-Smtp-Source: AGHT+IH8FwAH1RdgvHht2IWETizlhtV8RNte8pvJdWVu1cT97HP0xl8CflJaCO4tn8KeVgLbDH6oBA== X-Received: by 2002:a17:907:6d0b:b0:a77:c30c:341 with SMTP id a640c23a62f3a-a9a694c71b9mr1507028066b.0.1729594595306; Tue, 22 Oct 2024 03:56:35 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912ee04asm324230166b.61.2024.10.22.03.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 03:56:30 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4FCF95FC47; Tue, 22 Oct 2024 11:56:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini Subject: [PATCH v2 19/20] contrib/plugins: remove Makefile for contrib/plugins Date: Tue, 22 Oct 2024 11:56:13 +0100 Message-Id: <20241022105614.839199-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierrick Bouvier Now replaced by meson build. Signed-off-by: Pierrick Bouvier Message-Id: <20240925204845.390689-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- configure | 18 --------- Makefile | 10 ----- contrib/plugins/Makefile | 87 ---------------------------------------- 3 files changed, 115 deletions(-) delete mode 100644 contrib/plugins/Makefile diff --git a/configure b/configure index 7dd3400ccb..101ca9ace9 100755 --- a/configure +++ b/configure @@ -1073,7 +1073,6 @@ if test "$plugins" != "no" && test $host_bits -eq 64; then plugins="no" else plugins=yes - subdirs="$subdirs contrib/plugins" fi fi @@ -1704,7 +1703,6 @@ LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit LINKS="$LINKS tests/avocado tests/data" LINKS="$LINKS tests/qemu-iotests/check tests/qemu-iotests/Makefile" LINKS="$LINKS python" -LINKS="$LINKS contrib/plugins/Makefile " for f in $LINKS ; do if [ -e "$source_path/$f" ]; then symlink "$source_path/$f" "$f" @@ -1790,22 +1788,6 @@ if test "$default_targets" = "yes"; then echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak fi -# contrib/plugins configuration -echo "# Automatically generated by configure - do not modify" > contrib/plugins/$config_host_mak -echo "SRC_PATH=$source_path/contrib/plugins" >> contrib/plugins/$config_host_mak -echo "PKG_CONFIG=${pkg_config}" >> contrib/plugins/$config_host_mak -echo "CC=$cc $CPU_CFLAGS" >> contrib/plugins/$config_host_mak -echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config_host_mak -if test "$host_os" = windows; then - echo "DLLTOOL=$dlltool" >> contrib/plugins/$config_host_mak -fi -if test "$host_os" = darwin; then - echo "CONFIG_DARWIN=y" >> contrib/plugins/$config_host_mak -fi -if test "$host_os" = windows; then - echo "CONFIG_WIN32=y" >> contrib/plugins/$config_host_mak -fi - # tests/tcg configuration mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > tests/tcg/$config_host_mak diff --git a/Makefile b/Makefile index 917c9a34d1..b65b0bd41a 100644 --- a/Makefile +++ b/Makefile @@ -187,11 +187,6 @@ SUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS))) $(SUBDIR_RULES): $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) -ifneq ($(filter contrib/plugins, $(SUBDIRS)),) -.PHONY: plugins -plugins: contrib/plugins/all -endif - .PHONY: recurse-all recurse-clean recurse-all: $(addsuffix /all, $(SUBDIRS)) recurse-clean: $(addsuffix /clean, $(SUBDIRS)) @@ -307,11 +302,6 @@ help: $(call print-help,cscope,Generate cscope index) $(call print-help,sparse,Run sparse on the QEMU source) @echo '' -ifneq ($(filter contrib/plugins, $(SUBDIRS)),) - @echo 'Plugin targets:' - $(call print-help,plugins,Build the example TCG plugins) - @echo '' -endif @echo 'Cleaning targets:' $(call print-help,clean,Remove most generated files but keep the config) $(call print-help,distclean,Remove all generated files) diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile deleted file mode 100644 index bbddd4800f..0000000000 --- a/contrib/plugins/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -*- Mode: makefile -*- -# -# This Makefile example is fairly independent from the main makefile -# so users can take and adapt it for their build. We only really -# include config-host.mak so we don't have to repeat probing for -# programs that the main configure has already done for us. -# - -include config-host.mak - -TOP_SRC_PATH = $(SRC_PATH)/../.. - -VPATH += $(SRC_PATH) - -NAMES := -NAMES += bbv -NAMES += execlog -NAMES += hotblocks -NAMES += hotpages -NAMES += howvec - -# The lockstep example communicates using unix sockets, -# and can't be easily made to work on windows. -ifneq ($(CONFIG_WIN32),y) -NAMES += lockstep -endif - -NAMES += hwprofile -NAMES += cache -NAMES += drcov -NAMES += ips -NAMES += stoptrigger -NAMES += cflow - -ifeq ($(CONFIG_WIN32),y) -SO_SUFFIX := .dll -LDLIBS += $(shell $(PKG_CONFIG) --libs glib-2.0) -else -SO_SUFFIX := .so -endif - -SONAMES := $(addsuffix $(SO_SUFFIX),$(addprefix lib,$(NAMES))) - -# The main QEMU uses Glib extensively so it is perfectly fine to use it -# in plugins (which many example do). -PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0) -PLUGIN_CFLAGS += -fPIC -Wall -PLUGIN_CFLAGS += -I$(TOP_SRC_PATH)/include/qemu - -# Helper that honours V=1 so we get some output when compiling -quiet-@ = $(if $(V),,@$(if $1,printf " %-7s %s\n" "$(strip $1)" "$(strip $2)" && )) -quiet-command = $(call quiet-@,$2,$3)$1 - -# for including , in command strings -COMMA := , - -all: $(SONAMES) - -%.o: %.c - $(call quiet-command, \ - $(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<, \ - BUILD, plugin $@) - -ifeq ($(CONFIG_WIN32),y) -lib%$(SO_SUFFIX): %.o win32_linker.o ../../plugins/libqemu_plugin_api.a - $(call quiet-command, \ - $(CC) -shared -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -else ifeq ($(CONFIG_DARWIN),y) -lib%$(SO_SUFFIX): %.o - $(call quiet-command, \ - $(CC) -bundle -Wl$(COMMA)-undefined$(COMMA)dynamic_lookup -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -else -lib%$(SO_SUFFIX): %.o - $(call quiet-command, \ - $(CC) -shared -o $@ $^ $(LDLIBS), \ - LINK, plugin $@) -endif - - -clean distclean: - rm -f *.o *$(SO_SUFFIX) *.d - rm -Rf .libs - -.PHONY: all clean -.SECONDARY: From patchwork Tue Oct 22 10:56:14 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: 13845596 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 553BD19538D for ; Tue, 22 Oct 2024 11:03:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729595039; cv=none; b=B8VdohvBxt3AIsPmtzlhURRHIOYm7UdHAflSn+6P/PIi/1BbXH2dCgXh5ogdezSN2Yz1Hd6L2CE9v9oJZ/JR8gOJBtdlJIpIQldG5I9yXp+WCwe6IIkLP+0rW5F6CdM+BKkdzyb5JD7oo0SV3h5RuVPdMWA83bNmXbf6Y65TtbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729595039; c=relaxed/simple; bh=5yTCZimV0gEI7gmCOKCJLILXfJ8kpMTOraKSBNxiVlk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oY1k8NKAuCERNcVaVkIRziaUC9JMueJRrx2ZUxiK66AI7UYuUAzFuM5uC/0tKFW3eQjHhknqkP67bzi9FmUudhYS113Jm4+AKY0h0RlwhW2AiRKHoNWr95Sp3+l4rSt4HhM1+VFT18lyIGfAa/tAGhrTb4DAS3iLBwBHC6vHAnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JltsfjPB; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JltsfjPB" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-539d9fffea1so5223374e87.2 for ; Tue, 22 Oct 2024 04:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729595035; x=1730199835; darn=vger.kernel.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=0yP4SNsaEappmzZc/gnms0PRD/uAmEAQCRgu6RQMiI8=; b=JltsfjPBEY7pYsTjPyFgizxiaTZB4NaAqC63Ip1HBIfaHuiJRRl7L+ZIDrAHNVzJzo wklN2U+BM9yssiRESQSFtD/iZLQYJGdEAuyZ9cERa0+z19rv4zDB3B7jbcFttu30HQIU S26S1MUNykxg1cX8kkAXr4JXSPmNzFTFDyVxlGn9sOr1nlv0Yk0cM198eYS9DCMnQbV2 zJ+cbal1v/sD9vJx8eSF8T7WRfffTolvOgVMmFfJcd0AyiyLJeAHl71CubjjNayZnfL3 wPtVfxDYjQi1HeYvI/+iLCD8vU/0gM4/VrcWi1aQb81wxJOPsStWBHm83U81TAqjML2G wTyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729595035; x=1730199835; 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=0yP4SNsaEappmzZc/gnms0PRD/uAmEAQCRgu6RQMiI8=; b=Xx3a4W3Svtgw8+0Vm8TtnJhcekCWxzzO1Hja9dFVpv8b5Rb85Uz6yu15YtVGcneqWV aGJYlLUVLGJpk9n7PO8QzMOgIiU6orIABAg7kq0RqADn4knkoYhZvOgqSldqIXuuPkBc PYS+YNTDdaQpcKiiLal8aslxEPIqIydfFcW1dHignlvIY/daD6AAsOXGyB6w35rOXw36 6+aeRCSCZqzxxsbiU6jXxybzexbz+TDpkGWUBQ1jVyZbGU6NfOcX2U7NvtnqH1p24Std Qh7npDLJUA6tng7JCVijPhTQJi8RUNT7NL4JSrx8lN60UnEJ6wCpRuxhw4VJPOsojr4X tjTw== X-Forwarded-Encrypted: i=1; AJvYcCUebO25dmJ5/Y9Kc1dXINXrv+uZJxyAi1KnnE+ydR4nMjS/fwkXQan4y0k6A1iDss33BJE=@vger.kernel.org X-Gm-Message-State: AOJu0YwX3JckjvJp+wPK6ZyO2xQoMhHTBCJa+lcRzC6PeLYNF/rSwC5J HdKLSIo82fuJt5Qc7NTOr6XV2gB1a6xSjHFSz9WssPx7pxGp6DvtLrPzcSHMNPE= X-Google-Smtp-Source: AGHT+IEerx6lkR1+H7tItyS3VilRAHodTVWStIRDZTkyjhuKwUz1Vl6o1rNVP7ypMvtICJM1uC4+EA== X-Received: by 2002:a05:6512:3185:b0:539:f65b:3d1 with SMTP id 2adb3069b0e04-53a152198c9mr7757327e87.21.1729595035308; Tue, 22 Oct 2024 04:03:55 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66c6b120sm3010139a12.59.2024.10.22.04.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 04:03:54 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 62F045FC48; Tue, 22 Oct 2024 11:56:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Laurent Vivier , Wainer dos Santos Moschetta , Mahmoud Mandour , Jiaxun Yang , =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Thomas Huth , John Snow , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-arm@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , devel@lists.libvirt.org, Cleber Rosa , kvm@vger.kernel.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alexandre Iooss , Peter Maydell , Richard Henderson , Riku Voipio , Zhao Liu , Marcelo Tosatti , "Edgar E. Iglesias" , Marcel Apfelbaum , Pierrick Bouvier , Paolo Bonzini , Robbin Ehn Subject: [PATCH v2 20/20] plugins: fix qemu_plugin_reset Date: Tue, 22 Oct 2024 11:56:14 +0100 Message-Id: <20241022105614.839199-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241022105614.839199-1-alex.bennee@linaro.org> References: <20241022105614.839199-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- accel/tcg/plugin-gen.c | 4 ++++ 1 file changed, 4 insertions(+) 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; }