From ca49625616d61554725257a98d7fd131f9ccc4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:52 +0000 Subject: [PATCH 01/14] gitlab: drop --disable-pie from aarch64-all-linux-static build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we have upgraded to 24.04 with its new libc we no longer need this workaround. Link: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1987438 Suggested-by: Michael Tokarev Reviewed-by: Thomas Huth Message-ID: <20251204194902.1340008-2-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml b/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml index 98d9919345..b4c0faab15 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml @@ -41,9 +41,7 @@ ubuntu-24.04-aarch64-all-linux-static: extends: .ubuntu_aarch64_template variables: - # Disable -static-pie due to build error with system libc: - # https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1987438 - CONFIGURE_ARGS: --enable-debug --static --disable-system --disable-pie + CONFIGURE_ARGS: --enable-debug --static --disable-system MAKE_CHECK_ARGS: check-tcg ubuntu-24.04-aarch64-all: From 56a4ba5f88ce0d691847462749a38ade7cc0f374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:53 +0000 Subject: [PATCH 02/14] gitlab: drop explicit pxe-test from the build-tci job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This needs libslirp to run and as debian-all-test-cross will soon be based on qemu-minimal we won't have it in a few commits. Reviewed-by: Thomas Huth Message-ID: <20251204194902.1340008-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 44df116139..dfe954fe3c 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -656,14 +656,12 @@ build-tci: --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; } - make -j"$JOBS" - - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test + - make tests/qtest/boot-serial-test tests/qtest/cdrom-test - for tg in $TARGETS ; do export QTEST_QEMU_BINARY="./qemu-system-${tg}" ; ./tests/qtest/boot-serial-test || exit 1 ; ./tests/qtest/cdrom-test || exit 1 ; done - - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test - - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow - make check-tcg # Check our reduced build configurations From 7e71b8e7f2f658999fd6d0871cab3acad53150e7 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Thu, 4 Dec 2025 23:50:23 +0300 Subject: [PATCH 03/14] gitlab-ci.d/cirrus: Update the FreeBSD job to v14.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The FreeBSD 14.2 job fails since the image disappeared from the cloud. We already bumped FreeBSD image to 14.3 in tests/vm in c8958b7eb4 (part of v10.1.0). Signed-off-by: Michael Tokarev Reviewed-by: Alex Bennée Tested-by: Alex Bennée Reviewed-by: Thomas Huth Message-ID: <20251204205025.2423326-1-mjt@tls.msk.ru> Signed-off-by: Alex Bennée --- .gitlab-ci.d/cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml index 13a0bf5bb9..0d66a14186 100644 --- a/.gitlab-ci.d/cirrus.yml +++ b/.gitlab-ci.d/cirrus.yml @@ -37,7 +37,7 @@ x64-freebsd-14-build: NAME: freebsd-14 CIRRUS_VM_INSTANCE_TYPE: freebsd_instance CIRRUS_VM_IMAGE_SELECTOR: image_family - CIRRUS_VM_IMAGE_NAME: freebsd-14-2 + CIRRUS_VM_IMAGE_NAME: freebsd-14-3 CIRRUS_VM_CPUS: 8 CIRRUS_VM_RAM: 8G UPDATE_COMMAND: pkg update; pkg upgrade -y From 7242e51517cbc2df9121d6674ea53d3aebac1d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:54 +0000 Subject: [PATCH 04/14] tests/tcg: honour the available QEMU binaries when running check-tcg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently configure can identify all the targets that have cross-compilers available from the supplied target-list. By default this is the default_target_list which is all possible targets we can build. At the same time the target list passed to meson is filtered down depending on various factors including not building 64 bit targets on 32 bit hosts. As a result make check-tcg will erroneously attempt to run tests for which we haven't built a QEMU. Solve this by filtering the final list of TCG_TEST_TARGETS based on what actually was configured by meson. Rename the variable that configure spits out to TCG_TESTS_WITH_COMPILERS for clarity and to avoid larger churn in the Makefile. Message-ID: <20251204194902.1340008-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- configure | 6 +++--- tests/Makefile.include | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/configure b/configure index a2f66f7ff9..82cace1bc9 100755 --- a/configure +++ b/configure @@ -1801,7 +1801,7 @@ if test "$plugins" = "yes" ; then fi echo "PYTHON=$python" >> tests/tcg/$config_host_mak -tcg_tests_targets= +tcg_tests_with_compilers= for target in $target_list; do arch=${target%%-*} @@ -1852,12 +1852,12 @@ for target in $target_list; do fi echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs - tcg_tests_targets="$tcg_tests_targets $target" + tcg_tests_with_compilers="$tcg_tests_with_compilers $target" fi done if test "$tcg" = "enabled"; then - echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> $config_host_mak + echo "TCG_TESTS_WITH_COMPILERS=$tcg_tests_with_compilers" >> $config_host_mak fi if test "$skip_meson" = no; then diff --git a/tests/Makefile.include b/tests/Makefile.include index d4dfbf3716..7728098981 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -37,6 +37,15 @@ export SRC_PATH SPEED = quick + +# TCG_TESTS_WITH_COMPILERS represents the test targets we have cross compiler +# support for, CONFIGURED_TEST_TARGETS it what meson has finally +# configured having rejected stuff we can't build. +CONFIGURED_TCG_TARGETS=$(patsubst %-config-target.h, %, $(wildcard *-config-target.h)) + +# This is the intersection of what tests we can build and is configured +TCG_TESTS_TARGETS=$(filter $(CONFIGURED_TCG_TARGETS), $(TCG_TESTS_WITH_COMPILERS)) + # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TCG_TESTS_TARGETS)) CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TCG_TESTS_TARGETS)) From a55d610bac73bd3a0f222b6d851565375d822085 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Dec 2025 14:00:14 +0100 Subject: [PATCH 05/14] tests/qemu-iotests: Check for a functional "secret" object before using it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QEMU iotests 049, 134 and 158 are currently failing if you compiled QEMU without the crypto libraries. Thus make sure that the "secret" object is really usable and skip the tests otherwise. Reported-by: Alex Bennée Signed-off-by: Thomas Huth Message-ID: <20251205130014.693799-1-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/qemu-iotests/049 | 2 ++ tests/qemu-iotests/134 | 1 + tests/qemu-iotests/158 | 1 + tests/qemu-iotests/common.rc | 14 ++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049 index ed12fa49d7..a1b922060d 100755 --- a/tests/qemu-iotests/049 +++ b/tests/qemu-iotests/049 @@ -39,6 +39,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file +_require_secret + filter_test_dir() { diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134 index b2c3c03f08..cc1e35eb16 100755 --- a/tests/qemu-iotests/134 +++ b/tests/qemu-iotests/134 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow qcow2 _supported_proto file +_require_secret size=128M diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158 index 3a9ad7eed0..8fc4e98653 100755 --- a/tests/qemu-iotests/158 +++ b/tests/qemu-iotests/158 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow qcow2 _supported_proto file +_require_secret size=128M diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index e977cb4eb6..10d83d8361 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -1053,6 +1053,20 @@ _require_one_device_of() _notrun "$* not available" } +_require_secret() +{ + if [ -e "$TEST_IMG" ]; then + echo "unwilling to overwrite existing file" + exit 1 + fi + if $QEMU_IMG create -f $IMGFMT --object secret,id=sec0,data=123 \ + -o encryption=on,encrypt.key-secret=sec0 "$TEST_IMG" 1M 2>&1 \ + | grep "Unsupported cipher" ; then + _notrun "missing cipher support" + fi + rm -f "$TEST_IMG" +} + _qcow2_dump_header() { if [[ "$1" == "--no-filter-compression" ]]; then From 7cffc861620fb1a15d3dd2e6dfd41eb688aa2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:55 +0000 Subject: [PATCH 06/14] tests/lcitool: add bzip2 to the minimal dependency list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You cannot build any softmmu targets without it by default unless you build with --disable-install-blobs. Reviewed-by: Thomas Huth Message-ID: <20251204194902.1340008-5-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- tests/lcitool/projects/qemu-minimal.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lcitool/projects/qemu-minimal.yml b/tests/lcitool/projects/qemu-minimal.yml index 6bc232a1c3..2a1ac51d40 100644 --- a/tests/lcitool/projects/qemu-minimal.yml +++ b/tests/lcitool/projects/qemu-minimal.yml @@ -4,6 +4,7 @@ packages: - bash - bc - bison + - bzip2 - ccache - findutils - flex From 2addcefd69e32ed23199272dadb689b84634f51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:57 +0000 Subject: [PATCH 07/14] tests/docker: transition debian-all-test-cross to lcitool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While we are at it bump up to debian-13. As we use this container in the CI runs this also has the benefit of ensuring our qemu-minimal dependencies project really has just what we need to build a basic QEMU. We add a few extra packages so we can build with clang as well as what we need to probe for the available cross-compilers in the image. Message-ID: <20251204194902.1340008-7-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .../dockerfiles/debian-all-test-cross.docker | 128 ++++++++++-------- tests/lcitool/refresh | 49 +++++++ 2 files changed, 123 insertions(+), 54 deletions(-) diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker index 420a4e33e6..079942a1c5 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -1,77 +1,97 @@ +# THIS FILE WAS AUTO-GENERATED # -# Docker all cross-compiler target (tests only) +# $ lcitool dockerfile --layers all debian-13 qemu-minimal # -# While the normal cross builds take care to setup proper multiarch -# build environments which can cross build QEMU this just installs the -# basic compilers for as many targets as possible. We shall use this -# to build and run linux-user tests on GitLab -# -FROM docker.io/library/debian:12-slim +# https://gitlab.com/libvirt/libvirt-ci -# Duplicate deb line as deb-src -RUN sed -in "s/Types: deb/Types: deb deb-src/g" /etc/apt/sources.list.d/debian.sources +FROM docker.io/library/debian:13-slim RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y eatmydata && \ eatmydata apt-get dist-upgrade -y && \ - apt build-dep -yy --arch-only qemu + eatmydata apt-get install --no-install-recommends -y \ + bash \ + bc \ + bison \ + bzip2 \ + ca-certificates \ + ccache \ + findutils \ + flex \ + gcc \ + git \ + libc6-dev \ + libfdt-dev \ + libffi-dev \ + libglib2.0-dev \ + libpixman-1-dev \ + locales \ + make \ + ninja-build \ + pkgconf \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-venv \ + python3-wheel \ + sed \ + tar && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc -# Add extra build tools and as many cross compilers as we can for testing +RUN /usr/bin/pip3 install meson==1.8.1 + +ENV CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers" +ENV LANG="en_US.UTF-8" +ENV MAKE="/usr/bin/make" +ENV NINJA="/usr/bin/ninja" +ENV PYTHON="/usr/bin/python3" +# extras for cross and alternate toolchains RUN DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - bison \ - ccache \ - clang \ - dpkg-dev \ - flex \ - gcc \ - git \ - libclang-rt-dev \ - ninja-build \ - python3-pip \ - python3-setuptools \ - python3-tomli \ - python3-venv \ - python3-wheel - -# All the generally available compilers + apt install -y --no-install-recommends \ + clang\ + dpkg-dev\ + libclang-rt-dev ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \ - libc6-dev-arm64-cross \ - gcc-arm-linux-gnueabihf \ - libc6-dev-armhf-cross \ - gcc-mips-linux-gnu \ - libc6-dev-mips-cross \ - gcc-mips64-linux-gnuabi64 \ - libc6-dev-mips64-cross \ - gcc-mips64el-linux-gnuabi64 \ - libc6-dev-mips64el-cross \ - gcc-mipsel-linux-gnu \ - libc6-dev-mipsel-cross \ - gcc-powerpc64le-linux-gnu \ - libc6-dev-ppc64el-cross \ - gcc-riscv64-linux-gnu \ - libc6-dev-riscv64-cross \ - gcc-s390x-linux-gnu \ - libc6-dev-s390x-cross - + libc6-dev-arm64-cross \ + gcc-arm-linux-gnueabihf \ + libc6-dev-armhf-cross \ + gcc-mips-linux-gnu \ + libc6-dev-mips-cross \ + gcc-mips64-linux-gnuabi64 \ + libc6-dev-mips64-cross \ + gcc-mips64el-linux-gnuabi64 \ + libc6-dev-mips64el-cross \ + gcc-mipsel-linux-gnu \ + libc6-dev-mipsel-cross \ + gcc-powerpc64le-linux-gnu \ + libc6-dev-ppc64el-cross \ + gcc-riscv64-linux-gnu \ + libc6-dev-riscv64-cross \ + gcc-s390x-linux-gnu \ + libc6-dev-s390x-cross RUN if dpkg-architecture -e amd64; then \ export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross"; \ export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross"; \ export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; \ export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; \ export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; \ - fi && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt install -y --no-install-recommends \ - ${AVAILABLE_COMPILERS} && \ - dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt - - +fi && \ +DEBIAN_FRONTEND=noninteractive eatmydata \ +apt install -y --no-install-recommends \ +${AVAILABLE_COMPILERS} && \ +dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user # As a final step configure the user (if env is defined) -ENV MAKE /usr/bin/make ARG USER ARG UID RUN if [ "${USER}" ]; then \ diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 3a31fcfee9..c5e936112c 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -161,6 +161,46 @@ ubuntu2204_rust_extras = [ 'RUN cargo install bindgen-cli\n', ] +debian_all_test_cross_compilers = [ + "# extras for cross and alternate toolchains\n", + "RUN DEBIAN_FRONTEND=noninteractive eatmydata \\\n", + " apt install -y --no-install-recommends \\\n", + " clang\\\n", + " dpkg-dev\\\n", + " libclang-rt-dev\n", + "ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \\\n", + " libc6-dev-arm64-cross \\\n", + " gcc-arm-linux-gnueabihf \\\n", + " libc6-dev-armhf-cross \\\n", + " gcc-mips-linux-gnu \\\n", + " libc6-dev-mips-cross \\\n", + " gcc-mips64-linux-gnuabi64 \\\n", + " libc6-dev-mips64-cross \\\n", + " gcc-mips64el-linux-gnuabi64 \\\n", + " libc6-dev-mips64el-cross \\\n", + " gcc-mipsel-linux-gnu \\\n", + " libc6-dev-mipsel-cross \\\n", + " gcc-powerpc64le-linux-gnu \\\n", + " libc6-dev-ppc64el-cross \\\n", + " gcc-riscv64-linux-gnu \\\n", + " libc6-dev-riscv64-cross \\\n", + " gcc-s390x-linux-gnu \\\n", + " libc6-dev-s390x-cross\n", + "RUN if dpkg-architecture -e amd64; then \\\n", + " export AVAILABLE_COMPILERS=\"${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross\"; \\\n", + " export AVAILABLE_COMPILERS=\"${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross\"; \\\n", + " export AVAILABLE_COMPILERS=\"${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross\"; \\\n", + " export AVAILABLE_COMPILERS=\"${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross\"; \\\n", + " export AVAILABLE_COMPILERS=\"${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross\"; \\\n", + "fi && \\\n", + "DEBIAN_FRONTEND=noninteractive eatmydata \\\n", + "apt install -y --no-install-recommends \\\n", + "${AVAILABLE_COMPILERS} && \\\n", + "dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt\n", + "ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools\n", + "ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user\n", +] + def cross_build(prefix, targets): conf = "ENV QEMU_CONFIGURE_OPTS=--cross-prefix=%s\n" % (prefix) targets = "ENV DEF_TARGET_LIST=%s\n" % (targets) @@ -256,6 +296,15 @@ try: # https://github.com/mesonbuild/meson/pull/14991 enable_rust=False) + # We also generate some docker files with minimal dependencies and + # as many cross-compilers as Debian will package for building TCG + # tests. + + generate_dockerfile("debian-all-test-cross", "debian-13", + project="qemu-minimal", + enable_rust=False, + trailer="".join(debian_all_test_cross_compilers)) + # # Cirrus packages lists for GitLab # From 0b50ff0c0a1df21aa85596690b54033fdde38e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:58 +0000 Subject: [PATCH 08/14] tests/docker: drop --disable-[tools|system] from all-test-cross MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use this container to build system images in CI which do not honour QEMU_CONFIGURE_OPTS. Drop the --disables from the container so developers don not need to jump through hoops trying to replicate that on their workstations. Reviewed-by: Thomas Huth Message-ID: <20251204194902.1340008-8-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/debian-all-test-cross.docker | 2 +- tests/lcitool/refresh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker index 079942a1c5..1823233438 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -89,7 +89,7 @@ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ ${AVAILABLE_COMPILERS} && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt -ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools +ENV QEMU_CONFIGURE_OPTS --disable-docs ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user # As a final step configure the user (if env is defined) ARG USER diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index c5e936112c..9df607a55f 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -197,7 +197,7 @@ debian_all_test_cross_compilers = [ "apt install -y --no-install-recommends \\\n", "${AVAILABLE_COMPILERS} && \\\n", "dpkg-query --showformat '${Package}_${Version}_${Architecture}' --show > /packages.txt\n", - "ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools\n", + "ENV QEMU_CONFIGURE_OPTS --disable-docs\n", "ENV DEF_TARGET_LIST aarch64-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sparc64-linux-user\n", ] From 6f365f185a4ac618dae8d2bc5ddcce16bd8ed7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:48:59 +0000 Subject: [PATCH 09/14] docs/devel: update build environment setup documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring `libvirt-ci` front and centre when discussing dependencies for QEMU. While we are at it: - drop links to additional instructions (libvirt is more upto date) - compress pkg installs into a table - call out distro/upstream dep difference in a proper note Message-ID: <20251204194902.1340008-9-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/build-environment.rst | 121 +++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 37 deletions(-) diff --git a/docs/devel/build-environment.rst b/docs/devel/build-environment.rst index 661f6ea850..61b2dc0d1b 100644 --- a/docs/devel/build-environment.rst +++ b/docs/devel/build-environment.rst @@ -4,55 +4,103 @@ Setup build environment ======================= -QEMU uses a lot of dependencies on the host system. glib2 is used everywhere in -the code base, and most of the other dependencies are optional. +QEMU uses a lot of dependencies on the host system a large number of +which are optional. At a minimum we expect to have a system C library +(usually glibc but others can work), the glib2 library (used heavily +in the code base) and a few other core libraries for interfacing with +code modules and system build descriptions. -We present here simple instructions to enable native builds on most popular -systems. +We use the ``libvirt-ci`` project to handle the mapping of +dependencies to a wide variety output formats including system install +scripts. For example: -You can find additional instructions on `QEMU wiki `_: +.. code-block:: bash -- `Linux `_ -- `MacOS `_ -- `Windows `_ -- `BSD `_ + # THIS FILE WAS AUTO-GENERATED + # + # $ lcitool buildenvscript debian-13 ./tests/lcitool/projects/qemu-minimal.yml + # + # https://gitlab.com/libvirt/libvirt-ci -Note: Installing dependencies using your package manager build dependencies may -miss out on deps that have been newly introduced in qemu.git. In more, it misses -deps the distribution has decided to exclude. + function install_buildenv() { + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get dist-upgrade -y + apt-get install --no-install-recommends -y \ + bash \ + bc \ + bison \ + bzip2 \ + ca-certificates \ + ccache \ + findutils \ + flex \ + gcc \ + git \ + libc6-dev \ + libfdt-dev \ + libffi-dev \ + libglib2.0-dev \ + libpixman-1-dev \ + locales \ + make \ + meson \ + ninja-build \ + pkgconf \ + python3 \ + python3-venv \ + sed \ + tar + sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen + dpkg-reconfigure locales + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt + mkdir -p /usr/libexec/ccache-wrappers + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc + } -Linux ------ + export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers" + export LANG="en_US.UTF-8" + export MAKE="/usr/bin/make" + export NINJA="/usr/bin/ninja" + export PYTHON="/usr/bin/python3" -Fedora -++++++ +If you instead select the ``qemu.yml`` project file you will get all +the dependencies that the project can use. -:: +Using you system package manager +-------------------------------- - sudo dnf update && sudo dnf builddep qemu +.. note:: -Debian/Ubuntu -+++++++++++++ + Installing dependencies using your package manager build dependencies may + miss out on deps that have been newly introduced in qemu.git. It + also misses deps the distribution has decided to exclude. -You first need to enable `Sources List `_. -Then, use apt to install dependencies: +Systems with Package Managers ++++++++++++++++++++++++++++++ -:: +.. list-table:: Package Manager Commands + :widths: 10 50 40 + :header-rows: 1 - sudo apt update && sudo apt build-dep qemu - -MacOS ------ - -You first need to install `Homebrew `_. Then, use it to -install dependencies: - -:: - - brew update && brew install $(brew deps --include-build qemu) + * - System + - Command + - Notes + * - Fedora + - ``sudo dnf update && sudo dnf builddep qemu`` + - + * - Debian/Ubuntu + - ``sudo apt update && sudo apt build-dep qemu`` + - Must enable `Sources List + `_ first + * - MacOS + - ``brew update && brew install $(brew deps --include-build qemu)`` + - Using `Homebrew `_. Windows -------- ++++++++ You first need to install `MSYS2 `_. MSYS2 offers `different environments `_. @@ -104,7 +152,7 @@ build QEMU in MSYS2 itself. makepkg --syncdeps --nobuild PKGBUILD || true Build on windows-aarch64 -++++++++++++++++++++++++ +~~~~~~~~~~~~~~~~~~~~~~~~ When trying to cross compile meson for x86_64 using UCRT64 or MINGW64 env, configure will run into an error because the cpu detected is not correct. @@ -115,4 +163,3 @@ and force a cross compilation (with empty prefix). :: ./configure --cpu=x86_64 --cross-prefix= - From 23a5e2584ea9738510ce5d34f267c2525c3fa2c4 Mon Sep 17 00:00:00 2001 From: Alano Song Date: Thu, 4 Dec 2025 19:49:00 +0000 Subject: [PATCH 10/14] docs/devel: Correct typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct typo in atomics.rst Signed-off-by: Alano Song Reviewed-by: Christian Schoenebeck Reviewed-by: Thomas Huth [AJB: fixed author entry] Message-ID: <20251204194902.1340008-10-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/atomics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/atomics.rst b/docs/devel/atomics.rst index 95c7b77c01..ea4ede4b8c 100644 --- a/docs/devel/atomics.rst +++ b/docs/devel/atomics.rst @@ -266,7 +266,7 @@ Splitting a loop can also be useful to reduce the number of barriers: | n = 0; | smp_mb_release(); | | for (i = 0; i < 10; i++) { | for (i = 0; i < 10; i++) | | qatomic_store_release(&a[i], false); | qatomic_set(&a[i], false); | - | smp_mb(); | smb_mb(); | + | smp_mb(); | smp_mb(); | | n += qatomic_read(&b[i]); | n = 0; | | } | for (i = 0; i < 10; i++) | | | n += qatomic_read(&b[i]); | @@ -283,7 +283,7 @@ as well) ``smp_wmb()``: | | smp_mb_release(); | | for (i = 0; i < 10; i++) { | for (i = 0; i < 10; i++) | | qatomic_store_release(&a[i], false); | qatomic_set(&a[i], false); | - | qatomic_store_release(&b[i], false); | smb_wmb(); | + | qatomic_store_release(&b[i], false); | smp_wmb(); | | } | for (i = 0; i < 10; i++) | | | qatomic_set(&b[i], false); | +------------------------------------------+----------------------------------+ From ee6a482e9c060b028ee6634efecc22beb080b381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:49:01 +0000 Subject: [PATCH 11/14] MAINTAINERS: update the custom runner entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a number of issues: - update the ubuntu references to 24.0 - add the s390x and ppc64le yml files - replace Works on Arm with Linaro - Also mention IBM (s390x) and OSUL (ppc64le) as HW hosts Reviewed-by: Thomas Huth Message-ID: <20251204194902.1340008-11-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- MAINTAINERS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index d007584b47..63e9ba521b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4444,12 +4444,13 @@ R: Philippe Mathieu-Daudé S: Maintained F: tests/tcg/Makefile.target -GitLab custom runner (Works On Arm Sponsored) +GitLab custom runners (HW sponsored by Linaro, OSOUL and IBM) M: Alex Bennée M: Philippe Mathieu-Daudé S: Maintained -F: .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml -F: .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml +F: .gitlab-ci.d/custom-runners/ubuntu-24.04-aarch64.yml +F: .gitlab-ci.d/custom-runners/ubuntu-24.04-s390x.yml +F: .gitlab-ci.d/custom-runners/debian-13-ppc64le.yml Documentation ------------- From 81c5a3f8673403de315441991ff1566c4828f288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 4 Dec 2025 19:49:02 +0000 Subject: [PATCH 12/14] plugins/core: allow reading of registers during discon events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have protections that prevent callbacks that didn't declare themselves as wanting to access registers. However for discontinuities the system state is fully rectified so they should always be able to read the register values. a1688bc86ce (plugins: add hooks for new discontinuity related callbacks) Reviewed-by: Pierrick Bouvier Cc: Julian Ganz Reviewed-by: Julian Ganz Message-ID: <20251204194902.1340008-12-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- plugins/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/core.c b/plugins/core.c index 8f8bc7219c..b4b783008f 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -119,6 +119,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu, struct qemu_plugin_cb *cb, *next; uint64_t to = cpu->cc->get_pc(cpu); + qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_RW_REGS); if (cpu->cpu_index < plugin.num_vcpus) { /* iterate safely; plugins might uninstall themselves at any time */ QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { @@ -127,6 +128,7 @@ static void plugin_vcpu_cb__discon(CPUState *cpu, func(cb->ctx->id, cpu->cpu_index, type, from, to); } } + qemu_plugin_set_cb_flags(cpu, QEMU_PLUGIN_CB_NO_REGS); } /* From fa2580f5741da3e80e523910faf20914d572be1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Holz?= Date: Fri, 5 Dec 2025 11:56:14 +0100 Subject: [PATCH 13/14] contrib/plugins/uftrace_symbols.py: unbreak --no-prefix-symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 8a545a336d, `name` is unbound if --no-prefix-symbols is passed, causing this script to break when that option is set. Signed-off-by: Sönke Holz Reviewed-by: Pierrick Bouvier Message-ID: <20251205105614.13673-1-sholz8530@gmail.com> Signed-off-by: Alex Bennée --- contrib/plugins/uftrace_symbols.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/plugins/uftrace_symbols.py b/contrib/plugins/uftrace_symbols.py index 45fb79c7a5..21704541a6 100755 --- a/contrib/plugins/uftrace_symbols.py +++ b/contrib/plugins/uftrace_symbols.py @@ -98,6 +98,8 @@ class BinaryFile: size = f'{s.size:{addrx}}' if prefix_symbols: name = f'{binary_name}:{s.name}' + else: + name = s.name print(addr, size, 'T', name, file=sym_file) def generate_debug_file(self): From 704db3e250f5c646b3f51bfc7975b66b0f47d767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 26 Nov 2025 11:24:24 +0100 Subject: [PATCH 14/14] aspeed: Deprecate the fby35 machine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are no functional tests for the 'fby35' machine which makes harder to determine when something becomes deprecated or unused. The 'fby35' machine was originally added as an example of a multi-SoC system, with the expectation the models would evolve over time in an heterogeneous system. This hasn't happened and no public firmware is available to boot it. It can be replaced by the 'ast2700fc', another multi-SoC machine based on the newer AST2700 SoCs which are excepted to receive better support in the future. Cc: Peter Delevoryas Signed-off-by: Cédric Le Goater Message-ID: <20251126102424.927527-1-clg@redhat.com> Signed-off-by: Alex Bennée --- docs/about/deprecated.rst | 13 ++++++++++++- hw/arm/fby35.c | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 9386cffba2..ac31a2bce4 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -308,13 +308,24 @@ I2C devices connected to the board can be defined via the QEMU command line. Arm ``fp5280g2-bmc`` machine (since 10.2) -''''''''''''''''''''''''''''''''''''''''''' +''''''''''''''''''''''''''''''''''''''''' The ``fp5280g2-bmc`` machine does not rely on any specific device models, it can be replaced by the ``ast2500-evb`` machine using the ``fmc-model`` option to specify the flash type. The I2C devices connected to the board can be defined via the QEMU command line. +Arm ``fby35`` machine (since 10.2) +'''''''''''''''''''''''''''''''''' + +The ``fby35`` machine was originally added as an example of a +multi-SoC system, with the expectation the models would evolve over +time in an heterogeneous system. This hasn't happened and no public +firmware is available to boot it. It can be replaced by the +``ast2700fc``, another multi-SoC machine based on the newer AST2700 +SoCs which are excepted to receive better support in the future. + + RISC-V default machine option (since 10.0) '''''''''''''''''''''''''''''''''''''''''' diff --git a/hw/arm/fby35.c b/hw/arm/fby35.c index 70d3a99d79..e61a6438fe 100644 --- a/hw/arm/fby35.c +++ b/hw/arm/fby35.c @@ -175,6 +175,7 @@ static void fby35_class_init(ObjectClass *oc, const void *data) MachineClass *mc = MACHINE_CLASS(oc); mc->desc = "Meta Platforms fby35"; + mc->deprecation_reason = "For a multi-soc machine, use 'ast2700fc' instead"; mc->init = fby35_init; mc->no_floppy = 1; mc->no_cdrom = 1;