diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbuilds.yml index 03ebfabb3f..bd6473a75a 100644 --- a/.gitlab-ci.d/crossbuilds.yml +++ b/.gitlab-ci.d/crossbuilds.yml @@ -1,5 +1,4 @@ - -.cross_system_build_job_template: &cross_system_build_job_definition +.cross_system_build_job: stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest timeout: 80m @@ -13,7 +12,24 @@ xtensa-softmmu" - make -j$(expr $(nproc) + 1) all check-build -.cross_user_build_job_template: &cross_user_build_job_definition +# Job to cross-build specific accelerators. +# +# Set the $ACCEL variable to select the specific accelerator (default to +# KVM), and set extra options (such disabling other accelerators) via the +# $ACCEL_CONFIGURE_OPTS variable. +.cross_accel_build_job: + stage: build + image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest + timeout: 30m + script: + - mkdir build + - cd build + - PKG_CONFIG_PATH=$PKG_CONFIG_PATH + ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-tools + --enable-${ACCEL:-kvm} $ACCEL_CONFIGURE_OPTS + - make -j$(expr $(nproc) + 1) all check-build + +.cross_user_build_job: stage: build image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest script: @@ -24,91 +40,111 @@ - make -j$(expr $(nproc) + 1) all check-build cross-armel-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-armel-cross cross-armel-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-armel-cross cross-armhf-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-armhf-cross cross-armhf-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-armhf-cross cross-arm64-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-arm64-cross cross-arm64-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-arm64-cross cross-mips-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-mips-cross cross-mips-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-mips-cross cross-mipsel-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-mipsel-cross cross-mipsel-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-mipsel-cross cross-mips64el-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-mips64el-cross cross-mips64el-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-mips64el-cross cross-ppc64el-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-ppc64el-cross cross-ppc64el-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-ppc64el-cross cross-s390x-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: debian-s390x-cross cross-s390x-user: - <<: *cross_user_build_job_definition + extends: .cross_user_build_job variables: IMAGE: debian-s390x-cross +cross-s390x-kvm-only: + extends: .cross_accel_build_job + variables: + IMAGE: debian-s390x-cross + ACCEL_CONFIGURE_OPTS: --disable-tcg + cross-win32-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: fedora-win32-cross cross-win64-system: - <<: *cross_system_build_job_definition + extends: .cross_system_build_job variables: IMAGE: fedora-win64-cross + +cross-amd64-xen-only: + extends: .cross_accel_build_job + variables: + IMAGE: debian-amd64-cross + ACCEL: xen + ACCEL_CONFIGURE_OPTS: --disable-tcg --disable-kvm + +cross-arm64-xen-only: + extends: .cross_accel_build_job + variables: + IMAGE: debian-arm64-cross + ACCEL: xen + ACCEL_CONFIGURE_OPTS: --disable-tcg --disable-kvm diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0173e82b1..873ed19fcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -199,27 +199,84 @@ build-disabled: <<: *native_build_job_definition variables: IMAGE: fedora - CONFIGURE_ARGS: --disable-attr --disable-avx2 --disable-bochs - --disable-brlapi --disable-bzip2 --disable-cap-ng --disable-capstone - --disable-cloop --disable-coroutine-pool --disable-curl --disable-curses - --disable-dmg --disable-docs --disable-glusterfs --disable-gnutls - --disable-gtk --disable-guest-agent --disable-iconv --disable-kvm - --disable-libiscsi --disable-libpmem --disable-libssh --disable-libusb - --disable-libxml2 --disable-linux-aio --disable-live-block-migration - --disable-lzo --disable-malloc-trim --disable-mpath --disable-nettle - --disable-numa --disable-parallels --disable-pie --disable-qcow1 - --disable-qed --disable-qom-cast-debug --disable-rbd --disable-rdma - --disable-replication --disable-sdl --disable-seccomp --disable-sheepdog - --disable-slirp --disable-smartcard --disable-snappy --disable-spice - --disable-strip --disable-tpm --disable-usb-redir --disable-vdi - --disable-vhost-crypto --disable-vhost-net --disable-vhost-scsi - --disable-vhost-user --disable-vhost-vdpa --disable-vhost-vsock - --disable-virglrenderer --disable-vnc --disable-vte --disable-vvfat - --disable-xen --disable-zstd + CONFIGURE_ARGS: + --disable-attr + --disable-auth-pam + --disable-avx2 + --disable-bochs + --disable-brlapi + --disable-bzip2 + --disable-cap-ng + --disable-capstone + --disable-cloop + --disable-coroutine-pool + --disable-curl + --disable-curses + --disable-dmg + --disable-docs + --disable-gcrypt + --disable-glusterfs + --disable-gnutls + --disable-gtk + --disable-guest-agent + --disable-iconv + --disable-keyring + --disable-kvm + --disable-libiscsi + --disable-libpmem + --disable-libssh + --disable-libudev + --disable-libusb + --disable-libxml2 + --disable-linux-aio + --disable-live-block-migration + --disable-lzo + --disable-malloc-trim + --disable-mpath + --disable-nettle + --disable-numa + --disable-opengl + --disable-parallels + --disable-pie + --disable-qcow1 + --disable-qed + --disable-qom-cast-debug + --disable-rbd + --disable-rdma + --disable-replication + --disable-sdl + --disable-seccomp + --disable-sheepdog + --disable-slirp + --disable-smartcard + --disable-snappy + --disable-sparse + --disable-spice + --disable-strip + --disable-tpm + --disable-usb-redir + --disable-vdi + --disable-vhost-crypto + --disable-vhost-net + --disable-vhost-scsi + --disable-vhost-user + --disable-vhost-vdpa + --disable-vhost-vsock + --disable-virglrenderer + --disable-vnc + --disable-vte + --disable-vvfat + --disable-xen + --disable-zstd TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu s390x-softmmu i386-linux-user MAKE_CHECK_ARGS: check-qtest SPEED=slow +# This jobs explicitly disable TCG (--disable-tcg), KVM is detected by +# the configure script. The container doesn't contain Xen headers so +# Xen accelerator is not detected / selected. As result it build the +# i386-softmmu and x86_64-softmmu with KVM being the single accelerator +# available. build-tcg-disabled: <<: *native_build_job_definition variables: @@ -247,6 +304,13 @@ build-user: CONFIGURE_ARGS: --disable-tools --disable-system MAKE_CHECK_ARGS: check-tcg +build-user-static: + <<: *native_build_job_definition + variables: + IMAGE: debian-all-test-cross + CONFIGURE_ARGS: --disable-tools --disable-system --static + MAKE_CHECK_ARGS: check-tcg + # Only build the softmmu targets we have check-tcg tests for build-some-softmmu: <<: *native_build_job_definition @@ -349,6 +413,22 @@ build-tci: - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow +# Alternate coroutines implementations are only really of interest to KVM users +# However we can't test against KVM on Gitlab-CI so we can only run unit tests +build-coroutine-ucontext: + <<: *native_build_job_definition + variables: + IMAGE: ubuntu2004 + CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg + MAKE_CHECK_ARGS: check-unit + +build-coroutine-sigaltstack: + <<: *native_build_job_definition + variables: + IMAGE: ubuntu2004 + CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg + MAKE_CHECK_ARGS: check-unit + # Most jobs test latest gcrypt or nettle builds # # These jobs test old gcrypt and nettle from RHEL7 diff --git a/.travis.yml b/.travis.yml index 1f80bdb624..d01714a5ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,11 +119,6 @@ after_script: jobs: include: - - name: "GCC static (user)" - env: - - CONFIG="--disable-system --static" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" - # Just build tools and run minimal unit and softfloat checks - name: "GCC check-unit and check-softfloat" env: @@ -153,20 +148,6 @@ jobs: - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" - # Alternate coroutines implementations are only really of interest to KVM users - # However we can't test against KVM on Travis so we can only run unit tests - - name: "check-unit coroutine=ucontext" - env: - - CONFIG="--with-coroutine=ucontext --disable-tcg" - - TEST_CMD="make check-unit -j${JOBS} V=1" - - - - name: "check-unit coroutine=sigaltstack" - env: - - CONFIG="--with-coroutine=sigaltstack --disable-tcg" - - TEST_CMD="make check-unit -j${JOBS} V=1" - - # Check we can build docs and tools (out of tree) - name: "tools and docs (bionic)" dist: bionic diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index 51d2e0da1c..92a194dbc4 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -164,6 +164,7 @@ typedef struct { M68kCPU *cpu; MemoryRegion iomem; + qemu_irq *pic; m5206_timer_state *timer[2]; void *uart[2]; uint8_t scr; @@ -588,17 +589,16 @@ static const MemoryRegionOps m5206_mbar_ops = { static void mcf5206_mbar_realize(DeviceState *dev, Error **errp) { m5206_mbar_state *s = MCF5206_MBAR(dev); - qemu_irq *pic; memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s, "mbar", 0x00001000); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - pic = qemu_allocate_irqs(m5206_mbar_set_irq, s, 14); - s->timer[0] = m5206_timer_init(pic[9]); - s->timer[1] = m5206_timer_init(pic[10]); - s->uart[0] = mcf_uart_init(pic[12], serial_hd(0)); - s->uart[1] = mcf_uart_init(pic[13], serial_hd(1)); + s->pic = qemu_allocate_irqs(m5206_mbar_set_irq, s, 14); + s->timer[0] = m5206_timer_init(s->pic[9]); + s->timer[1] = m5206_timer_init(s->pic[10]); + s->uart[0] = mcf_uart_init(s->pic[12], serial_hd(0)); + s->uart[1] = mcf_uart_init(s->pic[13], serial_hd(1)); s->cpu = M68K_CPU(qemu_get_cpu(0)); } diff --git a/tests/qtest/fuzz-test.c b/tests/qtest/fuzz-test.c index 9cb4c42bde..87b72307a5 100644 --- a/tests/qtest/fuzz-test.c +++ b/tests/qtest/fuzz-test.c @@ -45,6 +45,7 @@ static void test_lp1878642_pci_bus_get_irq_level_assert(void) qtest_outl(s, 0xcf8, 0x8400f841); qtest_outl(s, 0xcfc, 0xebed205d); qtest_outl(s, 0x5d02, 0xebed205d); + qtest_quit(s); } int main(int argc, char **argv) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c index 262a963d2e..07ad690683 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -916,6 +916,7 @@ static GString *generic_fuzz_predefined_config_cmdline(FuzzTarget *t) g_assert(t->opaque); config = t->opaque; + setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1); setenv("QEMU_FUZZ_ARGS", config->args, 1); setenv("QEMU_FUZZ_OBJECTS", config->objects, 1); return generic_fuzz_cmdline(t); diff --git a/tests/test-qga.c b/tests/test-qga.c index c1b173b3cb..eb33264e8e 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -111,6 +111,7 @@ fixture_tear_down(TestFixture *fixture, gconstpointer data) g_rmdir(fixture->test_dir); g_free(fixture->test_dir); + close(fixture->fd); } static void qmp_assertion_message_error(const char *domain,