From a932eec49d9ec106c7952314ad1adc28f0986076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 21 May 2020 14:57:48 +0100 Subject: [PATCH 1/7] linux-user: limit check to HOST_LONG_BITS < TARGET_ABI_BITS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer clangs rightly spot that you can never exceed the full address space of 64 bit hosts with: linux-user/elfload.c:2076:41: error: result of comparison 'unsigned long' > 18446744073709551615 is always false [-Werror,-Wtautological-type-limit-compare] 4685 if ((guest_hiaddr - guest_base) > ~(uintptr_t)0) { 4686 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~ 4687 1 error generated. So lets limit the check to 32 bit hosts only. Fixes: ee94743034bf Reported-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20200525131823.715-8-thuth@redhat.com> [thuth: Use HOST_LONG_BITS < TARGET_ABI_BITS instead of HOST_LONG_BITS == 32] Signed-off-by: Thomas Huth --- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 01a9323a6377..ebc663ea0b35 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2073,12 +2073,14 @@ static void pgb_have_guest_base(const char *image_name, abi_ulong guest_loaddr, exit(EXIT_FAILURE); } } else { +#if HOST_LONG_BITS < TARGET_ABI_BITS if ((guest_hiaddr - guest_base) > ~(uintptr_t)0) { error_report("%s: requires more virtual address space " "than the host can provide (0x%" PRIx64 ")", image_name, (uint64_t)guest_hiaddr - guest_base); exit(EXIT_FAILURE); } +#endif } /* From d1d3ba2b23c06aab2f7e0511f08f450a3b96ca61 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 10 Feb 2020 16:41:04 +0100 Subject: [PATCH 2/7] MAINTAINERS: Add Philippe, Alex and Wainer to the Gitlab-CI section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initially, I was the only one who was using Gitlab while most developers had their git trees still on other systems, but that has changed nowadays. There is now much more interest in the Gitlab-CI today, so it would be good to have more than only one maintainer / reviewer for the gitlab-ci.yml file. Alex, Wainer and Philippe kindly offered their help here, so let's add them to the corresponding section in the MAINTAINERS file now. Message-Id: <20200210155115.9371-1-thuth@redhat.com> Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Thomas Huth --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a209b5d8cef0..71a043884376 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2901,6 +2901,9 @@ W: https://cirrus-ci.com/github/qemu/qemu GitLab Continuous Integration M: Thomas Huth +M: Philippe Mathieu-Daudé +M: Alex Bennée +R: Wainer dos Santos Moschetta S: Maintained F: .gitlab-ci.yml From f3ea07c70debad6b8f6c084ad0e0c9ff27b3e73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 15 May 2020 18:30:27 +0200 Subject: [PATCH 3/7] gitlab-ci: Remove flex/bison packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QEMU does not use flex/bison packages. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200515163029.12917-4-philmd@redhat.com> Message-Id: <20200525131823.715-3-thuth@redhat.com> Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b889fb96b632..994774250fe7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: before_script: - apt-get update -qq - - apt-get install -y -qq flex bison libglib2.0-dev libpixman-1-dev genisoimage + - apt-get install -y -qq libglib2.0-dev libpixman-1-dev genisoimage build-system1: script: From 65ea4e65df15682f058b3ef61c8d8fc278ddc0d3 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Thu, 12 Mar 2020 15:36:14 -0400 Subject: [PATCH 4/7] GitLab CI: avoid calling before_scripts on unintended jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At this point it seems that all jobs depend on those steps, with maybe the EDK2 jobs as exceptions. The jobs that will be added later will not want those scripts to be run, so let's move these steps to the appropriate jobs, while still trying to avoid repetition. Signed-off-by: Cleber Rosa Message-Id: <20200525131823.715-4-thuth@redhat.com> Reviewed-by: Alex Bennée [thuth: Rebased to current master branch, use separate template] Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 994774250fe7..bc6aee6aba6a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,11 +2,13 @@ include: - local: '/.gitlab-ci-edk2.yml' - local: '/.gitlab-ci-opensbi.yml' -before_script: - - apt-get update -qq - - apt-get install -y -qq libglib2.0-dev libpixman-1-dev genisoimage +.update_apt_template: &before_script_apt + before_script: + - apt-get update -qq + - apt-get install -y -qq libglib2.0-dev libpixman-1-dev genisoimage build-system1: + <<: *before_script_apt script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev @@ -19,6 +21,7 @@ build-system1: - make -j2 check build-system2: + <<: *before_script_apt script: - apt-get install -y -qq libsdl2-dev libgcrypt-dev libbrlapi-dev libaio-dev libfdt-dev liblzo2-dev librdmacm-dev libibverbs-dev libibumad-dev @@ -32,6 +35,7 @@ build-system2: - make -j2 check build-disabled: + <<: *before_script_apt script: - mkdir build - cd build @@ -46,6 +50,7 @@ build-disabled: - make -j2 check-qtest SPEED=slow build-tcg-disabled: + <<: *before_script_apt script: - apt-get install -y -qq clang libgtk-3-dev libusb-dev - mkdir build @@ -64,6 +69,7 @@ build-tcg-disabled: 260 261 262 263 264 270 272 273 277 279 build-user: + <<: *before_script_apt script: - mkdir build - cd build @@ -73,6 +79,7 @@ build-user: - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user build-clang: + <<: *before_script_apt script: - apt-get install -y -qq clang libsdl2-dev libattr1-dev libcap-ng-dev xfslibs-dev libiscsi-dev libnfs-dev libseccomp-dev gnutls-dev librbd-dev @@ -85,6 +92,7 @@ build-clang: - make -j2 check build-tci: + <<: *before_script_apt script: - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64" - mkdir build From 922febe2af0a636636d3b0fd4309f26072cfd2cc Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 20 May 2020 09:45:58 +0200 Subject: [PATCH 5/7] gitlab-ci: Move edk2 and opensbi YAML files to .gitlab-ci.d folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a dedicated folder for the gitlab-ci - so there is no need to clutter the top directory with these .yml files. Message-Id: <20200525131823.715-5-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth --- .gitlab-ci-edk2.yml => .gitlab-ci.d/edk2.yml | 0 .gitlab-ci-opensbi.yml => .gitlab-ci.d/opensbi.yml | 0 .gitlab-ci.yml | 4 ++-- MAINTAINERS | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename .gitlab-ci-edk2.yml => .gitlab-ci.d/edk2.yml (100%) rename .gitlab-ci-opensbi.yml => .gitlab-ci.d/opensbi.yml (100%) diff --git a/.gitlab-ci-edk2.yml b/.gitlab-ci.d/edk2.yml similarity index 100% rename from .gitlab-ci-edk2.yml rename to .gitlab-ci.d/edk2.yml diff --git a/.gitlab-ci-opensbi.yml b/.gitlab-ci.d/opensbi.yml similarity index 100% rename from .gitlab-ci-opensbi.yml rename to .gitlab-ci.d/opensbi.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc6aee6aba6a..5208d93ff804 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ include: - - local: '/.gitlab-ci-edk2.yml' - - local: '/.gitlab-ci-opensbi.yml' + - local: '/.gitlab-ci.d/edk2.yml' + - local: '/.gitlab-ci.d/opensbi.yml' .update_apt_template: &before_script_apt before_script: diff --git a/MAINTAINERS b/MAINTAINERS index 71a043884376..0944d9c73154 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2542,7 +2542,7 @@ F: roms/edk2 F: roms/edk2-* F: tests/data/uefi-boot-images/ F: tests/uefi-test-tools/ -F: .gitlab-ci-edk2.yml +F: .gitlab-ci.d/edk2.yml F: .gitlab-ci.d/edk2/ Usermode Emulation From b5d621ff4a7d86e82a58104d5706bda2b4238626 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 20 May 2020 10:38:37 +0200 Subject: [PATCH 6/7] gitlab-ci: Do not use the standard container images from gitlab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently all pipelines of the gitlab CI are failing, except for the "build-user" pipeline. There is an issue with the default container image (likely Debian stable) where they imported something bad in one of the system headers: /usr/include/linux/swab.h: In function '__swab': /builds/huth/qemu/include/qemu/bitops.h:20:34: error: "sizeof" is not defined, evaluates to 0 [-Werror=undef] #define BITS_PER_LONG (sizeof (unsigned long) * BITS_PER_BYTE) We could maybe work-around this issue or wait for the default containers to get fixed, but considering that we use Ubuntu (and thus Debian-style) CI in Travis already to a very large extent, we should consider to use some RPM-based distros in our gitlab CI instead. Thus let's change the failing pipelines to use Fedora and CentOS (and also one Ubuntu 19.10, since 20.04 is broken, too) now. Message-Id: <20200525131823.715-6-thuth@redhat.com> Acked-by: Alex Bennée Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5208d93ff804..559ec2ab4d62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,17 @@ include: .update_apt_template: &before_script_apt before_script: - apt-get update -qq - - apt-get install -y -qq libglib2.0-dev libpixman-1-dev genisoimage + - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make + genisoimage + +.update_dnf_template: &before_script_dnf + before_script: + - dnf update -y + - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel + make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel build-system1: + image: ubuntu:19.10 <<: *before_script_apt script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev @@ -21,11 +29,12 @@ build-system1: - make -j2 check build-system2: - <<: *before_script_apt + image: fedora:latest + <<: *before_script_dnf script: - - apt-get install -y -qq libsdl2-dev libgcrypt-dev libbrlapi-dev libaio-dev - libfdt-dev liblzo2-dev librdmacm-dev libibverbs-dev libibumad-dev - libzstd-dev + - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel + libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel + libzstd-devel - mkdir build - cd build - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu @@ -35,7 +44,8 @@ build-system2: - make -j2 check build-disabled: - <<: *before_script_apt + image: fedora:latest + <<: *before_script_dnf script: - mkdir build - cd build @@ -50,9 +60,10 @@ build-disabled: - make -j2 check-qtest SPEED=slow build-tcg-disabled: - <<: *before_script_apt + image: centos:8 + <<: *before_script_dnf script: - - apt-get install -y -qq clang libgtk-3-dev libusb-dev + - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel - mkdir build - cd build - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list="" @@ -79,10 +90,11 @@ build-user: - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user build-clang: - <<: *before_script_apt + image: fedora:latest + <<: *before_script_dnf script: - - apt-get install -y -qq clang libsdl2-dev libattr1-dev libcap-ng-dev - xfslibs-dev libiscsi-dev libnfs-dev libseccomp-dev gnutls-dev librbd-dev + - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel + libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel - mkdir build - cd build - ../configure --cc=clang --cxx=clang++ --enable-werror @@ -92,7 +104,8 @@ build-clang: - make -j2 check build-tci: - <<: *before_script_apt + image: centos:8 + <<: *before_script_dnf script: - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64" - mkdir build From 0016afa250d251a1b3fbc90c6d618e7f00e02f14 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 21 May 2020 06:50:10 +0200 Subject: [PATCH 7/7] gitlab-ci: Determine the number of jobs dynamically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some people might want to run the gitlab CI pipelines in an environment where multiple CPUs are available to the runners, so let's rather get the number for "-j" from the "nproc" program (increased by 1 to compensate for jobs that wait for I/O) instead of hard-coding it. Message-Id: <20200525131823.715-7-thuth@redhat.com> Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth --- .gitlab-ci.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 559ec2ab4d62..349c77aa580e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,12 +7,14 @@ include: - apt-get update -qq - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make genisoimage + - JOBS=$(expr $(nproc) + 1) .update_dnf_template: &before_script_dnf before_script: - dnf update -y - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel + - JOBS=$(expr $(nproc) + 1) build-system1: image: ubuntu:19.10 @@ -25,8 +27,8 @@ build-system1: - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu" - - make -j2 - - make -j2 check + - make -j"$JOBS" + - make -j"$JOBS" check build-system2: image: fedora:latest @@ -40,8 +42,8 @@ build-system2: - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu" - - make -j2 - - make -j2 check + - make -j"$JOBS" + - make -j"$JOBS" check build-disabled: image: fedora:latest @@ -56,8 +58,8 @@ build-disabled: --disable-qom-cast-debug --disable-spice --disable-vhost-vsock --disable-vhost-net --disable-vhost-crypto --disable-vhost-user --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user" - - make -j2 - - make -j2 check-qtest SPEED=slow + - make -j"$JOBS" + - make -j"$JOBS" check-qtest SPEED=slow build-tcg-disabled: image: centos:8 @@ -67,7 +69,7 @@ build-tcg-disabled: - mkdir build - cd build - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list="" - - make -j2 + - make -j"$JOBS" - make check-unit - make check-qapi-schema - cd tests/qemu-iotests/ @@ -86,7 +88,7 @@ build-user: - cd build - ../configure --enable-werror --disable-system --disable-guest-agent --disable-capstone --disable-slirp --disable-fdt - - make -j2 + - make -j"$JOBS" - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user build-clang: @@ -100,8 +102,8 @@ build-clang: - ../configure --cc=clang --cxx=clang++ --enable-werror --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user" - - make -j2 - - make -j2 check + - make -j"$JOBS" + - make -j"$JOBS" check build-tci: image: centos:8 @@ -112,7 +114,7 @@ build-tci: - cd build - ../configure --enable-tcg-interpreter --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" - - make -j2 + - make -j"$JOBS" - make run-tcg-tests-x86_64-softmmu - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test - for tg in $TARGETS ; do