* [PATCH 01/10] testing: bump mips64el cross to bookworm and allow to fail
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 02/10] tests/docker: Fix microblaze atomics Alex Bennée
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal, Michael Tokarev
The mips64el cross setup is very broken for bullseye which has now
entered LTS support so is unlikely to be fixed. While we still can't
build the container for bookworm due to a single missing dependency
that will hopefully get fixed in due course. For the sake of keeping
the CI green we mark it as allow_fail for the time being.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>
---
.gitlab-ci.d/container-cross.yml | 3 +++
tests/docker/dockerfiles/debian-mips64el-cross.docker | 10 ++++------
tests/lcitool/refresh | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/.gitlab-ci.d/container-cross.yml b/.gitlab-ci.d/container-cross.yml
index 34c0e729ad..c567926182 100644
--- a/.gitlab-ci.d/container-cross.yml
+++ b/.gitlab-ci.d/container-cross.yml
@@ -49,6 +49,9 @@ i686-debian-cross-container:
mips64el-debian-cross-container:
extends: .container_job_template
stage: containers
+ # Currently waiting for Debian to fix:
+ # libgl1-mesa-dri:mips64el : Depends: libllvm15:mips64el but it is not going to be installed
+ allow_failure: true
variables:
NAME: debian-mips64el-cross
diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker
index 2862785692..69d6e8cd11 100644
--- a/tests/docker/dockerfiles/debian-mips64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker
@@ -1,10 +1,10 @@
# THIS FILE WAS AUTO-GENERATED
#
-# $ lcitool dockerfile --layers all --cross-arch mips64el debian-11 qemu
+# $ lcitool dockerfile --layers all --cross-arch mips64el debian-12 qemu
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:11-slim
+FROM docker.io/library/debian:12-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -48,16 +48,15 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-opencv \
python3-pillow \
python3-pip \
- python3-setuptools \
python3-sphinx \
python3-sphinx-rtd-theme \
python3-venv \
- python3-wheel \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
+ swtpm \
tar \
tesseract-ocr \
tesseract-ocr-eng \
@@ -69,8 +68,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
-RUN /usr/bin/pip3 install tomli
-
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
@@ -143,6 +140,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libvdeplug-dev:mips64el \
libvirglrenderer-dev:mips64el \
libvte-2.91-dev:mips64el \
+ libxdp-dev:mips64el \
libzstd-dev:mips64el \
nettle-dev:mips64el \
systemtap-sdt-dev:mips64el \
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 92381f3c46..a78219f7bc 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -166,7 +166,7 @@ try:
"x86_64-linux-user,"
"i386-softmmu,i386-linux-user"))
- generate_dockerfile("debian-mips64el-cross", "debian-11",
+ generate_dockerfile("debian-mips64el-cross", "debian-12",
cross="mips64el",
trailer=cross_build("mips64el-linux-gnuabi64-",
"mips64el-softmmu,mips64el-linux-user"))
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 02/10] tests/docker: Fix microblaze atomics
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
2024-09-25 17:11 ` [PATCH 01/10] testing: bump mips64el cross to bookworm and allow to fail Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 03/10] tests/docker: add NOFETCH env variable for testing Alex Bennée
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal, Ilya Leoshkevich
From: Ilya Leoshkevich <iii@linux.ibm.com>
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 <peter.maydell@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20240919152308.10440-1-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
.../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 >/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
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 03/10] tests/docker: add NOFETCH env variable for testing
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
2024-09-25 17:11 ` [PATCH 01/10] testing: bump mips64el cross to bookworm and allow to fail Alex Bennée
2024-09-25 17:11 ` [PATCH 02/10] tests/docker: Fix microblaze atomics Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 04/10] MAINTAINERS: mention my testing/next tree Alex Bennée
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
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 <alex.bennee@linaro.org>
---
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=<path> Include executable in image.'
@echo ' EXTRA_FILES="<path> [... <path>]"'
@echo ' Include extra files in image.'
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 04/10] MAINTAINERS: mention my testing/next tree
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (2 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 03/10] tests/docker: add NOFETCH env variable for testing Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 05/10] meson: hide tsan related warnings Alex Bennée
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
I put it under my name as there may be other maintainer testing trees
as well.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index ffacd60f40..7ac2252303 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4114,6 +4114,7 @@ Build and test automation
-------------------------
Build and test automation, general continuous integration
M: Alex Bennée <alex.bennee@linaro.org>
+T: git https://gitlab.com/stsquad/qemu testing/next
M: Philippe Mathieu-Daudé <philmd@linaro.org>
M: Thomas Huth <thuth@redhat.com>
R: Wainer dos Santos Moschetta <wainersm@redhat.com>
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 05/10] meson: hide tsan related warnings
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (3 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 04/10] MAINTAINERS: mention my testing/next tree Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 06/10] target/i386: fix build warning (gcc-12 -fsanitize=thread) Alex Bennée
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
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 <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240910174013.1433331-2-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
meson.build | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 10464466ff..ceee6b22c8 100644
--- a/meson.build
+++ b/meson.build
@@ -518,7 +518,15 @@ if get_option('tsan')
prefix: '#include <sanitizer/tsan_interface.h>')
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
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 06/10] target/i386: fix build warning (gcc-12 -fsanitize=thread)
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (4 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 05/10] meson: hide tsan related warnings Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 07/10] docs/devel: update tsan build documentation Alex Bennée
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Found on debian stable.
../target/i386/kvm/kvm.c: In function ‘kvm_handle_rdmsr’:
../target/i386/kvm/kvm.c:5345:1: error: control reaches end of non-void function [-Werror=return-type]
5345 | }
| ^
../target/i386/kvm/kvm.c: In function ‘kvm_handle_wrmsr’:
../target/i386/kvm/kvm.c:5364:1: error: control reaches end of non-void function [-Werror=return-type]
5364 | }
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240910174013.1433331-3-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/i386/kvm/kvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index ada581c5d6..c8056ef83d 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -5771,7 +5771,7 @@ static int kvm_handle_rdmsr(X86CPU *cpu, struct kvm_run *run)
}
}
- assert(false);
+ g_assert_not_reached();
}
static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run)
@@ -5790,7 +5790,7 @@ static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run)
}
}
- assert(false);
+ g_assert_not_reached();
}
static bool has_sgx_provisioning;
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 07/10] docs/devel: update tsan build documentation
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (5 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 06/10] target/i386: fix build warning (gcc-12 -fsanitize=thread) Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 08/10] MAINTAINERS: mention my gdbstub/next tree Alex Bennée
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
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 <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240910174013.1433331-4-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
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.
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 08/10] MAINTAINERS: mention my gdbstub/next tree
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (6 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 07/10] docs/devel: update tsan build documentation Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 09/10] config/targets: update aarch64_be-linux-user gdb XML list Alex Bennée
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
Make it easy for people to see what is already queued.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7ac2252303..f34b8843e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3028,6 +3028,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 <pbonzini@redhat.com>
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 09/10] config/targets: update aarch64_be-linux-user gdb XML list
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (7 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 08/10] MAINTAINERS: mention my gdbstub/next tree Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:11 ` [PATCH 10/10] tests/tcg: enable basic testing for aarch64_be-linux-user Alex Bennée
2024-09-25 17:22 ` [PATCH 00/10] maintainer updates (testing, gdbstub) Pierrick Bouvier
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
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 <alex.bennee@linaro.org>
---
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 acb5620cdb..14623ac076 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
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 10/10] tests/tcg: enable basic testing for aarch64_be-linux-user
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (8 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 09/10] config/targets: update aarch64_be-linux-user gdb XML list Alex Bennée
@ 2024-09-25 17:11 ` Alex Bennée
2024-09-25 17:22 ` [PATCH 00/10] maintainer updates (testing, gdbstub) Pierrick Bouvier
10 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2024-09-25 17:11 UTC (permalink / raw)
To: qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Pierrick Bouvier, Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Alex Bennée, Marcelo Tosatti, Laurent Vivier, Yanan Wang,
Thomas Huth, Beraldo Leal
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 <alex.bennee@linaro.org>
---
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 aa7aae70fa..1aebf8ece0 100755
--- a/configure
+++ b/configure
@@ -1274,6 +1274,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 ;;
@@ -1303,6 +1304,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..93c6074db1
--- /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)
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 00/10] maintainer updates (testing, gdbstub)
2024-09-25 17:11 [PATCH 00/10] maintainer updates (testing, gdbstub) Alex Bennée
` (9 preceding siblings ...)
2024-09-25 17:11 ` [PATCH 10/10] tests/tcg: enable basic testing for aarch64_be-linux-user Alex Bennée
@ 2024-09-25 17:22 ` Pierrick Bouvier
10 siblings, 0 replies; 12+ messages in thread
From: Pierrick Bouvier @ 2024-09-25 17:22 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Zhao Liu, Edgar E. Iglesias, Marcel Apfelbaum, Alexandre Iooss,
Marc-André Lureau, Mahmoud Mandour, Daniel P. Berrangé,
Richard Henderson, Paolo Bonzini, Eduardo Habkost,
Wainer dos Santos Moschetta, kvm, Jiaxun Yang,
Philippe Mathieu-Daudé, qemu-arm, Peter Maydell, devel,
Marcelo Tosatti, Laurent Vivier, Yanan Wang, Thomas Huth,
Beraldo Leal
On 9/25/24 10:11, Alex Bennée wrote:
> Welcome to the first post KVM forum series. We have:
>
> - fix from Ilya for microblaze atomics
> - Pierrick's tsan updates
> - I've added my testing and gdbstub trees to MAINTAINERS
> - enabled a very basic aarch64_be-linux-user test
> - fixed the missing gdb XML fails that cause aarch64_be-linux-user to assert
> - finally I've made the mips64el cross compiler bookworm and allow_fail
>
> Alex Bennée (6):
> testing: bump mips64el cross to bookworm and allow to fail
> tests/docker: add NOFETCH env variable for testing
> MAINTAINERS: mention my testing/next tree
> MAINTAINERS: mention my gdbstub/next tree
> config/targets: update aarch64_be-linux-user gdb XML list
> tests/tcg: enable basic testing for aarch64_be-linux-user
>
> Ilya Leoshkevich (1):
> tests/docker: Fix microblaze atomics
>
> Pierrick Bouvier (3):
> meson: hide tsan related warnings
> target/i386: fix build warning (gcc-12 -fsanitize=thread)
> docs/devel: update tsan build documentation
>
> MAINTAINERS | 2 ++
> docs/devel/testing/main.rst | 26 +++++++++++---
> configure | 5 +++
> configs/targets/aarch64_be-linux-user.mak | 2 +-
> meson.build | 10 +++++-
> target/i386/kvm/kvm.c | 4 +--
> tests/tcg/aarch64_be/hello.c | 35 +++++++++++++++++++
> .gitlab-ci.d/container-cross.yml | 3 ++
> tests/docker/Makefile.include | 5 +--
> .../build-toolchain.sh | 8 +++++
> .../dockerfiles/debian-mips64el-cross.docker | 10 +++---
> .../dockerfiles/debian-toolchain.docker | 7 ++++
> tests/lcitool/refresh | 2 +-
> tests/tcg/Makefile.target | 7 +++-
> tests/tcg/aarch64_be/Makefile.target | 17 +++++++++
> 15 files changed, 125 insertions(+), 18 deletions(-)
> create mode 100644 tests/tcg/aarch64_be/hello.c
> create mode 100644 tests/tcg/aarch64_be/Makefile.target
>
Thanks for pulling tsan changes as part of this series.
^ permalink raw reply [flat|nested] 12+ messages in thread