From 74a1b256d775591e57d0c6866a846172241c14a5 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 31 Jan 2023 19:02:39 +0100 Subject: [PATCH 01/22] configure: Bump minimum Clang version to 10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anthony Perard recently reported some problems with Clang v6.0 from Ubuntu Bionic (with regards to the -Wmissing-braces configure test). Since we're not officially supporting that version of Ubuntu anymore, we should better bump our minimum version check in the configure script instead of using our time to fix problems of unsupported compilers. According to repology.org, our supported distros ship these versions of Clang (looking at the highest version only): Fedora 36: 14.0.5 CentOS 8 (RHEL-8): 12.0.1 Debian 11: 13.0.1 OpenSUSE Leap 15.4: 13.0.1 Ubuntu LTS 20.04: 12.0.0 FreeBSD Ports: 15.0.7 NetBSD pkgsrc: 15.0.7 Homebrew: 15.0.7 MSYS2 mingw: 15.0.7 Haiku ports: 12.0.1 While it seems like we could update to v12.0.0 from that point of view, the default version on Ubuntu 20.04 is still v10.0, and we use that for our CI tests based via the tests/docker/dockerfiles/ubuntu2004.docker file. Thus let's make v10.0 our minimum version now (which corresponds to Apple Clang version v12.0). The -Wmissing-braces check can then be removed, too, since both our minimum GCC and our minimum Clang version now handle this correctly. Message-Id: <20230131180239.1582302-1-thuth@redhat.com> Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- configure | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 64960c6000..00415f0b48 100755 --- a/configure +++ b/configure @@ -1018,7 +1018,7 @@ cat << EOF debug-tcg TCG debugging (default is disabled) debug-info debugging information safe-stack SafeStack Stack Smash Protection. Depends on - clang/llvm >= 3.7 and requires coroutine backend ucontext. + clang/llvm and requires coroutine backend ucontext. NOTE: The object files are built at the place where configure is launched EOF @@ -1138,12 +1138,12 @@ fi cat > $TMPC << EOF #if defined(__clang_major__) && defined(__clang_minor__) # ifdef __apple_build_version__ -# if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0) -# error You need at least XCode Clang v10.0 to compile QEMU +# if __clang_major__ < 12 || (__clang_major__ == 12 && __clang_minor__ < 0) +# error You need at least XCode Clang v12.0 to compile QEMU # endif # else -# if __clang_major__ < 6 || (__clang_major__ == 6 && __clang_minor__ < 0) -# error You need at least Clang v6.0 to compile QEMU +# if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0) +# error You need at least Clang v10.0 to compile QEMU # endif # endif #elif defined(__GNUC__) && defined(__GNUC_MINOR__) @@ -1156,7 +1156,7 @@ cat > $TMPC << EOF int main (void) { return 0; } EOF if ! compile_prog "" "" ; then - error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)" + error_exit "You need at least GCC v7.4 or Clang v10.0 (or XCode Clang v12.0)" fi # Accumulate -Wfoo and -Wno-bar separately. @@ -1261,19 +1261,6 @@ EOF fi fi -# Disable -Wmissing-braces on older compilers that warn even for -# the "universal" C zero initializer {0}. -cat > $TMPC << EOF -struct { - int a[2]; -} x = {0}; -EOF -if compile_object "-Werror" "" ; then - : -else - QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces" -fi - # Our module code doesn't support Windows if test "$modules" = "yes" && test "$mingw32" = "yes" ; then error_exit "Modules are not available for Windows" From bc71d58fd7f149081f89fb3a414ceb79691049db Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Fri, 10 Feb 2023 01:52:07 +0100 Subject: [PATCH 02/22] meson: Add missing libdw knobs Add the missing meson infrastructure bits for the new libdw dependency. Model them after the existing capstone knobs. Fixes: 7c10cb38ccb8 ("accel/tcg: Add debuginfo support") Reported-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Reviewed-by: Thomas Huth Message-Id: <20230210005208.438142-1-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- meson.build | 11 +++++++---- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index c626ccfa82..50eb670511 100644 --- a/meson.build +++ b/meson.build @@ -1649,10 +1649,13 @@ if libbpf.found() and not cc.links(''' endif # libdw -libdw = dependency('libdw', - method: 'pkg-config', - kwargs: static_kwargs, - required: false) +libdw = not_found +if not get_option('libdw').auto() or have_system or have_user + libdw = dependency('libdw', + method: 'pkg-config', + kwargs: static_kwargs, + required: get_option('libdw')) +endif ################# # config-host.h # diff --git a/meson_options.txt b/meson_options.txt index e5f199119e..56415c5c23 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -131,6 +131,8 @@ option('gio', type : 'feature', value : 'auto', description: 'use libgio for D-Bus support') option('glusterfs', type : 'feature', value : 'auto', description: 'Glusterfs block device driver') +option('libdw', type : 'feature', value : 'auto', + description: 'debuginfo support') option('libiscsi', type : 'feature', value : 'auto', description: 'libiscsi userspace initiator') option('libnfs', type : 'feature', value : 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index c2982ea087..180c11665a 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -109,6 +109,7 @@ meson_options_help() { printf "%s\n" ' kvm KVM acceleration support' printf "%s\n" ' l2tpv3 l2tpv3 network backend support' printf "%s\n" ' libdaxctl libdaxctl support' + printf "%s\n" ' libdw debuginfo support' printf "%s\n" ' libiscsi libiscsi userspace initiator' printf "%s\n" ' libnfs libnfs block device driver' printf "%s\n" ' libpmem libpmem support' @@ -312,6 +313,8 @@ _meson_option_parse() { --enable-libdaxctl) printf "%s" -Dlibdaxctl=enabled ;; --disable-libdaxctl) printf "%s" -Dlibdaxctl=disabled ;; --libdir=*) quote_sh "-Dlibdir=$2" ;; + --enable-libdw) printf "%s" -Dlibdw=enabled ;; + --disable-libdw) printf "%s" -Dlibdw=disabled ;; --libexecdir=*) quote_sh "-Dlibexecdir=$2" ;; --enable-libiscsi) printf "%s" -Dlibiscsi=enabled ;; --disable-libiscsi) printf "%s" -Dlibiscsi=disabled ;; From 550c6d97ded04f5dc2da7b34d7a95284271304a5 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Fri, 10 Feb 2023 01:52:08 +0100 Subject: [PATCH 03/22] meson: Disable libdw for static builds by default Static QEMU build fails on Debian Bullseye: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdw.a(debuginfod-client.o): in function `__libdwfl_debuginfod_init': (.text.startup+0x17): undefined reference to `dlopen' The reason is that pkg-config does not suggest -ldl for libdw, and adding --extra-ldflags="-ldl" resolves the issue. However, static linking with libdw is an unclear topic: * Linux perf does it. * Debian's libdw-dev description says: Only link to the static version for special cases and when you don't need anything from the ebl backends. * As the error message above indicates, -ldl is also needed for debuginfod support. The functionality provided by libdw is needed for analyzing performance of JITed code, which is mostly useful to developers and researchers. Therefore, in order to avoid unpleasant surprises for people who don't need this, simply disable libdw for static builds by default. It can still be enabled explicitly if needed. Reported-by: John Paul Adrian Glaubitz Signed-off-by: Ilya Leoshkevich Message-Id: <20230210005208.438142-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 50eb670511..0026bba0ce 100644 --- a/meson.build +++ b/meson.build @@ -1650,7 +1650,8 @@ endif # libdw libdw = not_found -if not get_option('libdw').auto() or have_system or have_user +if not get_option('libdw').auto() or \ + (not enable_static and (have_system or have_user)) libdw = dependency('libdw', method: 'pkg-config', kwargs: static_kwargs, From bb9ecae70bbd1ab1daf94d893b02c78dfe1314f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 31 Jan 2023 09:42:23 +0000 Subject: [PATCH 04/22] build: deprecate --enable-gprof builds and remove from CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As gprof relies on instrumentation you rarely get useful data compared to a real optimised build. Lets deprecate the build option and simplify the CI configuration as a result. Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1338 Signed-off-by: Alex Bennée Message-Id: <20230131094224.861621-1-alex.bennee@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 19 ++++--------------- docs/about/deprecated.rst | 14 ++++++++++++++ meson.build | 7 ++++++- meson_options.txt | 3 ++- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 0aa149a352..8f332fc36f 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -467,27 +467,16 @@ tsan-build: TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user MAKE_CHECK_ARGS: bench V=1 -# gprof/gcov are GCC features -build-gprof-gcov: +# gcov is a GCC features +gcov: extends: .native_build_job_template needs: job: amd64-ubuntu2004-container + timeout: 80m variables: IMAGE: ubuntu2004 - CONFIGURE_ARGS: --enable-gprof --enable-gcov + CONFIGURE_ARGS: --enable-gcov TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu - artifacts: - expire_in: 1 days - paths: - - build - -check-gprof-gcov: - extends: .native_test_job_template - needs: - - job: build-gprof-gcov - artifacts: true - variables: - IMAGE: ubuntu2004 MAKE_CHECK_ARGS: check after_script: - cd build diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index da2e6fe63d..9317046177 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -20,6 +20,20 @@ they were first deprecated in the 2.10.0 release. What follows is a list of all features currently marked as deprecated. +Build options +------------- + +``gprof`` builds (since 8.0) +'''''''''''''''''''''''''''' + +The ``--enable-gprof`` configure setting relies on compiler +instrumentation to gather its data which can distort the generated +profile. As other non-instrumenting tools are available that give a +more holistic view of the system with non-instrumented binaries we are +deprecating the build option and no longer defend it in CI. The +``--enable-gcov`` build option remains for analysis test case +coverage. + System emulator command line arguments -------------------------------------- diff --git a/meson.build b/meson.build index 0026bba0ce..a76c855312 100644 --- a/meson.build +++ b/meson.build @@ -3805,7 +3805,12 @@ summary_info += {'memory allocator': get_option('malloc')} summary_info += {'avx2 optimization': config_host_data.get('CONFIG_AVX2_OPT')} summary_info += {'avx512bw optimization': config_host_data.get('CONFIG_AVX512BW_OPT')} summary_info += {'avx512f optimization': config_host_data.get('CONFIG_AVX512F_OPT')} -summary_info += {'gprof enabled': get_option('gprof')} +if get_option('gprof') + gprof_info = 'YES (deprecated)' +else + gprof_info = get_option('gprof') +endif +summary_info += {'gprof': gprof_info} summary_info += {'gcov': get_option('b_coverage')} summary_info += {'thread sanitizer': config_host.has_key('CONFIG_TSAN')} summary_info += {'CFI support': get_option('cfi')} diff --git a/meson_options.txt b/meson_options.txt index 56415c5c23..7e5801db90 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -320,7 +320,8 @@ option('debug_stack_usage', type: 'boolean', value: false, option('qom_cast_debug', type: 'boolean', value: false, description: 'cast debugging support') option('gprof', type: 'boolean', value: false, - description: 'QEMU profiling with gprof') + description: 'QEMU profiling with gprof', + deprecated: true) option('profiler', type: 'boolean', value: false, description: 'profiler support') option('slirp_smbd', type : 'feature', value : 'auto', From 77034bbc120281a981f7371ab642762a33cceaea Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 9 Feb 2023 13:50:47 +0000 Subject: [PATCH 05/22] tests/qtest/npcm7xx_pwm-test: Be less verbose unless V=2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The npcm7xx_pwm-test produces a lot of output at V=1, which means that on our CI tests the log files exceed the gitlab 500KB limit. Suppress the messages about exactly what is being tested unless at V=2 and above. This follows the pattern we use with qom-test. Signed-off-by: Peter Maydell Message-Id: <20230209135047.1753081-1-peter.maydell@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/qtest/npcm7xx_pwm-test.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/qtest/npcm7xx_pwm-test.c b/tests/qtest/npcm7xx_pwm-test.c index e320a625c4..ea4ca1d106 100644 --- a/tests/qtest/npcm7xx_pwm-test.c +++ b/tests/qtest/npcm7xx_pwm-test.c @@ -20,6 +20,8 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qnum.h" +static int verbosity_level; + #define REF_HZ 25000000 /* Register field definitions. */ @@ -221,7 +223,9 @@ static uint64_t pwm_qom_get(QTestState *qts, const char *path, const char *name) QDict *response; uint64_t val; - g_test_message("Getting properties %s from %s", name, path); + if (verbosity_level >= 2) { + g_test_message("Getting properties %s from %s", name, path); + } response = qtest_qmp(qts, "{ 'execute': 'qom-get'," " 'arguments': { 'path': %s, 'property': %s}}", path, name); @@ -260,8 +264,10 @@ static void mft_qom_set(QTestState *qts, int index, const char *name, QDict *response; char *path = g_strdup_printf("/machine/soc/mft[%d]", index); - g_test_message("Setting properties %s of mft[%d] with value %u", - name, index, value); + if (verbosity_level >= 2) { + g_test_message("Setting properties %s of mft[%d] with value %u", + name, index, value); + } response = qtest_qmp(qts, "{ 'execute': 'qom-set'," " 'arguments': { 'path': %s, " " 'property': %s, 'value': %u}}", @@ -506,9 +512,12 @@ static void mft_verify_rpm(QTestState *qts, const TestData *td, uint64_t duty) int32_t expected_cnt = mft_compute_cnt(rpm, clk); qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic"); - g_test_message( - "verifying rpm for mft[%d]: clk: %" PRIu64 ", duty: %" PRIu64 ", rpm: %u, cnt: %d", - index, clk, duty, rpm, expected_cnt); + if (verbosity_level >= 2) { + g_test_message( + "verifying rpm for mft[%d]: clk: %" PRIu64 ", duty: %" PRIu64 + ", rpm: %u, cnt: %d", + index, clk, duty, rpm, expected_cnt); + } /* Verify rpm for fan A */ /* Stop capture */ @@ -670,6 +679,12 @@ int main(int argc, char **argv) { TestData test_data_list[ARRAY_SIZE(pwm_module_list) * ARRAY_SIZE(pwm_list)]; + char *v_env = getenv("V"); + + if (v_env) { + verbosity_level = atoi(v_env); + } + g_test_init(&argc, &argv, NULL); for (int i = 0; i < ARRAY_SIZE(pwm_module_list); ++i) { From b482fb43deb3fa9f5c44fd3da3dde04acec7750f Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 9 Feb 2023 17:15:40 +0100 Subject: [PATCH 06/22] hw/misc/sga: Remove the deprecated "sga" device It's been deprecated since QEMU v6.2, so it should be OK to finally remove this now. Message-Id: <20230209161540.1054669-1-thuth@redhat.com> Reviewed-by: Juan Quintela Acked-by: Gerd Hoffmann Signed-off-by: Thomas Huth --- .gitmodules | 3 -- MAINTAINERS | 1 - docs/about/deprecated.rst | 9 ---- docs/about/removed-features.rst | 10 ++++ hw/i386/Kconfig | 1 - hw/misc/Kconfig | 4 -- hw/misc/meson.build | 1 - hw/misc/sga.c | 71 ---------------------------- pc-bios/README | 6 --- pc-bios/meson.build | 1 - pc-bios/sgabios.bin | Bin 4096 -> 0 bytes roms/Makefile | 9 +--- roms/sgabios | 1 - tests/migration/guestperf/engine.py | 2 +- 14 files changed, 12 insertions(+), 107 deletions(-) delete mode 100644 hw/misc/sga.c delete mode 100644 pc-bios/sgabios.bin delete mode 160000 roms/sgabios diff --git a/.gitmodules b/.gitmodules index 24cffa87d4..6ce5bf49c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "roms/qemu-palcode"] path = roms/qemu-palcode url = https://gitlab.com/qemu-project/qemu-palcode.git -[submodule "roms/sgabios"] - path = roms/sgabios - url = https://gitlab.com/qemu-project/sgabios.git [submodule "dtc"] path = dtc url = https://gitlab.com/qemu-project/dtc.git diff --git a/MAINTAINERS b/MAINTAINERS index 96e25f62ac..fd54c1f140 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1676,7 +1676,6 @@ F: hw/acpi/piix4.c F: hw/acpi/ich9*.c F: include/hw/acpi/ich9*.h F: include/hw/southbridge/piix.h -F: hw/misc/sga.c F: hw/isa/apm.c F: include/hw/isa/apm.h F: tests/unit/test-x86-cpuid.c diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 9317046177..cb1ec72347 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -260,15 +260,6 @@ full SCSI support. Use virtio-scsi instead when SCSI passthrough is required. Note this also applies to ``-device virtio-blk-pci,scsi=on|off``, which is an alias. -``-device sga`` (since 6.2) -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The ``sga`` device loads an option ROM for x86 targets which enables -SeaBIOS to send messages to the serial console. SeaBIOS 1.11.0 onwards -contains native support for this feature and thus use of the option -ROM approach is obsolete. The native SeaBIOS support can be activated -by using ``-machine graphics=off``. - ``-device nvme-ns,eui64-default=on|off`` (since 7.1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index a17d0554d6..4a84e6174f 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -789,6 +789,16 @@ The 'ide-drive' device has been removed. Users should use 'ide-hd' or The 'scsi-disk' device has been removed. Users should use 'scsi-hd' or 'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed. +``sga`` (removed in 8.0) +'''''''''''''''''''''''' + +The ``sga`` device loaded an option ROM for x86 targets which enabled +SeaBIOS to send messages to the serial console. SeaBIOS 1.11.0 onwards +contains native support for this feature and thus use of the option +ROM approach was obsolete. The native SeaBIOS support can be activated +by using ``-machine graphics=off``. + + Related binaries ---------------- diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 1bf47b0b0b..9fbfe748b5 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -26,7 +26,6 @@ config PC imply QXL imply SEV imply SGX - imply SGA imply TEST_DEVICES imply TPM_CRB imply TPM_TIS_ISA diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index eaeddca277..2ef5781ef8 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -15,10 +15,6 @@ config ISA_DEBUG bool depends on ISA_BUS -config SGA - bool - depends on ISA_BUS - config ISA_TESTDEV bool default y if TEST_DEVICES diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 448e14b531..fe869b98ca 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -5,7 +5,6 @@ softmmu_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugexit.c')) softmmu_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c')) softmmu_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c')) softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c')) -softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c')) softmmu_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c')) softmmu_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c')) softmmu_ss.add(when: 'CONFIG_LED', if_true: files('led.c')) diff --git a/hw/misc/sga.c b/hw/misc/sga.c deleted file mode 100644 index 1d04672b01..0000000000 --- a/hw/misc/sga.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * QEMU dummy ISA device for loading sgabios option rom. - * - * Copyright (c) 2011 Glauber Costa, Red Hat Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * sgabios code originally available at code.google.com/p/sgabios - * - */ - -#include "qemu/osdep.h" -#include "hw/isa/isa.h" -#include "hw/loader.h" -#include "qemu/module.h" -#include "qom/object.h" -#include "qemu/error-report.h" - -#define SGABIOS_FILENAME "sgabios.bin" - -#define TYPE_SGA "sga" -OBJECT_DECLARE_SIMPLE_TYPE(ISASGAState, SGA) - -struct ISASGAState { - ISADevice parent_obj; -}; - -static void sga_realizefn(DeviceState *dev, Error **errp) -{ - warn_report("-device sga is deprecated, use -machine graphics=off"); - rom_add_vga(SGABIOS_FILENAME); -} - -static void sga_class_initfn(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - - set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); - dc->realize = sga_realizefn; - dc->desc = "Serial Graphics Adapter"; -} - -static const TypeInfo sga_info = { - .name = TYPE_SGA, - .parent = TYPE_ISA_DEVICE, - .instance_size = sizeof(ISASGAState), - .class_init = sga_class_initfn, -}; - -static void sga_register_types(void) -{ - type_register_static(&sga_info); -} - -type_init(sga_register_types) diff --git a/pc-bios/README b/pc-bios/README index b94f3fb081..3702ed485c 100644 --- a/pc-bios/README +++ b/pc-bios/README @@ -20,12 +20,6 @@ -machine pseries,x-vof=on. When enabled, the firmware acts as a slim shim and QEMU implements parts of the IEEE 1275 Open Firmware interface. -- sgabios (the Serial Graphics Adapter option ROM) provides a means for - legacy x86 software to communicate with an attached serial console as - if a video card were attached. The master sources reside in a subversion - repository at http://sgabios.googlecode.com/svn/trunk. A git mirror is - available at https://gitlab.com/qemu-project/sgabios.git. - - The PXE roms come from the iPXE project. Built with BANNER_TIME 0. Sources available at http://ipxe.org. Vendor:Device ID -> ROM mapping: diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 388e0db6e4..a7224ef469 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -28,7 +28,6 @@ blobs = [ 'bios-256k.bin', 'bios-microvm.bin', 'qboot.rom', - 'sgabios.bin', 'vgabios.bin', 'vgabios-cirrus.bin', 'vgabios-stdvga.bin', diff --git a/pc-bios/sgabios.bin b/pc-bios/sgabios.bin deleted file mode 100644 index 6308f2e2d7064b52ff3c2e207b71018710866c05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeHJYj6|S6+T+YT3ay^1p*W&k_e7su)Rpan3r(;;AI|>ECIE(;9|fcW)hp&yG)XC zjT`~pwGxIlX&!Cb@<VM?hJDpa$QYM6@}ETh^4R$)P8@z z!nMi-3!9oYJW*d@u54V#fTzB>q3#Lu!sfb7k2kDqF_*2c+r-s3o2^At?K7s@W`Jj5 zS$U}7*@ni3()CS^4bRqdT*GAZhK44yeTKPiQ?uD_waq9nTW2!U zika!iRxGao*Z3UPHpf1_xH*T#Sz(KE*y2W5Uf=xWY%|O+pI3(P)r~>iOnRF24;Yfa z9bmLF=1~(L(vQo1*z$mF{Pzu`O=HGR{a)ey1*-gY;LqqF@uKEsxs8{ zZFTzb;9*EAO2tPI}3h$TkK;tS5t zV0?QgP_(Hof}Vz5_k6`3#usEJP)rc*0@3??Sy#C-OYp(=1o&HKI!16sj!d4;I>!|( ziJ5)xg9^e1yU*ow`)sFuA~9ISq4fgo^ZKd{)(VUGU?582Y}lJ=J$7s(4cTykB?yfU@0L8Qj=( zO?`T>y)mWv~cqb~($zg~e8~n7)cFZi8jc3Rs5qg3Ik;f@8;1fo_#G zJQ(PvLN5-c6^B(IoE;Qym){Ws-RjV2TvvtE_Y_n}HOP9aBX|8XzIMnFw})JlIZLOC zdnm2`y3@~J6}pXj)8QfLHRWy*jtVCoTX-szxh>3kBUQFzm#>nKWIr-g*A*3j=n!66OY_!zBnxOrE43k!QwqwTBo1W=59H> zQ`PG*w`dM;QuUhHh=b+~j!f=8hmNE1R;kGuIYJ6kw;3((#y9>WNX-)6DF#2cVf|IuNAe%ltXjK2a<4-yeXs7-QKNIkxO!D5$Tk$cmDn@My<=^-dIZOO_te4A8-zTg61>O zF;*y?KRl8W`f}-BpH}Mjp5bs(^P0Isgy%ck`hw>CL3jM^+4`z+;Fku?%L*6I1&gK34)`iT| zJdN$#nX;bq%PQnLvNdIu{Rx@V`4bYK9m*svDV!P=i-clfCTr8yGOr_kDO5&0=zuS7 zHF-(8^YrlvV_x1AnXEw6NwS7h-suLC%Pi)=`d{8Y$8 zW+c6}5!dz$L`-eJpybFp#*gvKG;bjDltAN@K%t$X&Fje*^Da759KdD9>K-3}@p`PZc*j|4!6UCdT z&O$6k)FDno)Fb8~8W6h>M z6;g^srw|vCiwdbmVgO52n+MO(mgn_T6kY(W3TG5v3M318xx!trMbWzzUJbnp_X6n~ zCIxXm(RC0ApV(N6ZKwa_0AM!V?VZ`d@Rb4K4Yi zxd!3KM`>tS+KyAIB%quQnT zwcexk0sZ_(QSAo&j@#P+7;@KEkiyKK5GZGz5iAFQJa~(IaI5PCki~Ikx0%}BN1lq~ sdHWIm-;fP)vNNuH6aD$#=ivVszx^`*j(yjG?>g{*?7(A{OXX?*0eG=(c>n+a diff --git a/roms/Makefile b/roms/Makefile index 5e44d97890..955f92286d 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -57,7 +57,6 @@ default help: @echo "available build targets:" @echo " bios -- update bios.bin (seabios)" @echo " vgabios -- update vgabios binaries (seabios)" - @echo " sgabios -- update sgabios binaries" @echo " pxerom -- update nic roms (bios only)" @echo " efirom -- update nic roms (bios+efi)" @echo " slof -- update slof.bin" @@ -102,11 +101,7 @@ build-seabios-config-%: config.% OUT=$(CURDIR)/seabios/builds/$*/ all -.PHONY: sgabios skiboot qboot -sgabios: - $(MAKE) -C sgabios - cp sgabios/sgabios.bin ../pc-bios - +.PHONY: skiboot qboot pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants)) @@ -199,8 +194,6 @@ npcm7xx_bootrom: clean: rm -rf seabios/.config seabios/out seabios/builds - $(MAKE) -C sgabios clean - rm -f sgabios/.depend $(MAKE) -C ipxe/src veryclean $(MAKE) -C edk2/BaseTools clean $(MAKE) -C SLOF clean diff --git a/roms/sgabios b/roms/sgabios deleted file mode 160000 index cbaee52287..0000000000 --- a/roms/sgabios +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cbaee52287e5f32373181cff50a00b6c4ac9015a diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py index cc06fac592..e69d16a62c 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -337,7 +337,7 @@ class Engine(object): argv.extend(self._get_qemu_serial_args()) if self._debug: - argv.extend(["-device", "sga"]) + argv.extend(["-machine", "graphics=off"]) if hardware._prealloc_pages: argv_source += ["-mem-path", "/dev/shm", From 8c6631e66e323bc92e0ea5d235e7059b30fb86ee Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 10 Feb 2023 12:23:15 +0100 Subject: [PATCH 07/22] include/hw: Do not include "hw/registerfields.h" in headers that don't need it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include "hw/registerfields.h" in the .c files instead (if needed). Message-Id: <20230210112315.1116966-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- hw/char/ibex_uart.c | 1 + hw/ssi/ibex_spi_host.c | 1 + include/hw/arm/smmuv3.h | 1 - include/hw/char/ibex_uart.h | 1 - include/hw/ssi/ibex_spi_host.h | 1 - 5 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c index e58181fcf4..f70adb5308 100644 --- a/hw/char/ibex_uart.c +++ b/hw/char/ibex_uart.c @@ -31,6 +31,7 @@ #include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" +#include "hw/registerfields.h" #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" diff --git a/hw/ssi/ibex_spi_host.c b/hw/ssi/ibex_spi_host.c index 57df462e3c..1ee7d88c22 100644 --- a/hw/ssi/ibex_spi_host.c +++ b/hw/ssi/ibex_spi_host.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qemu/module.h" +#include "hw/registerfields.h" #include "hw/ssi/ibex_spi_host.h" #include "hw/irq.h" #include "hw/qdev-properties.h" diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h index f1921fdf9e..b6dd087526 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -20,7 +20,6 @@ #define HW_ARM_SMMUV3_H #include "hw/arm/smmu-common.h" -#include "hw/registerfields.h" #include "qom/object.h" #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region" diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h index a39985516a..9deadf223b 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -26,7 +26,6 @@ #define HW_IBEX_UART_H #include "hw/sysbus.h" -#include "hw/registerfields.h" #include "chardev/char-fe.h" #include "qemu/timer.h" #include "qom/object.h" diff --git a/include/hw/ssi/ibex_spi_host.h b/include/hw/ssi/ibex_spi_host.h index 1f6d077766..8089cc1c31 100644 --- a/include/hw/ssi/ibex_spi_host.h +++ b/include/hw/ssi/ibex_spi_host.h @@ -32,7 +32,6 @@ #include "hw/ssi/ssi.h" #include "qemu/fifo8.h" #include "qom/object.h" -#include "hw/registerfields.h" #include "qemu/timer.h" #define TYPE_IBEX_SPI_HOST "ibex-spi" From 5feed38c2139a2cea46b4b540303ef255d4cafc7 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 10 Feb 2023 12:19:31 +0100 Subject: [PATCH 08/22] Do not include "qemu/error-report.h" in headers that do not need it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include it in the .c files instead that use the error reporting functions. Message-Id: <20230210111931.1115489-1-thuth@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- hw/display/vhost-user-gpu.c | 1 + hw/display/virtio-gpu-udmabuf.c | 1 + hw/display/virtio-gpu-virgl.c | 1 + hw/misc/applesmc.c | 1 + include/hw/arm/allwinner-a10.h | 1 - include/qemu/vhost-user-server.h | 1 - include/ui/console.h | 1 - ui/console.c | 1 + ui/dbus-clipboard.c | 1 + ui/dbus-console.c | 1 + ui/dbus-listener.c | 1 + ui/dbus.c | 1 + ui/egl-headless.c | 1 + ui/gtk.c | 1 + ui/spice-app.c | 1 + ui/spice-display.c | 1 + ui/udmabuf.c | 1 + ui/vdagent.c | 1 + util/vhost-user-server.c | 1 + 19 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 4380a5e672..71dfd956b8 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include "hw/qdev-properties.h" #include "hw/virtio/virtio-gpu.h" diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf.c index 847fa4c0cc..69e2cf0bd6 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/units.h" #include "qemu/iov.h" #include "ui/console.h" diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 73cb92c8d5..1c47603d40 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/iov.h" #include "trace.h" #include "hw/virtio/virtio.h" diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 5f9c742e50..72300d0cbc 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -34,6 +34,7 @@ #include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "ui/console.h" +#include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/timer.h" #include "qom/object.h" diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index e0f2f7ab19..79e0c80568 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -1,7 +1,6 @@ #ifndef HW_ARM_ALLWINNER_A10_H #define HW_ARM_ALLWINNER_A10_H -#include "qemu/error-report.h" #include "hw/char/serial.h" #include "hw/arm/boot.h" #include "hw/pci/pci_device.h" diff --git a/include/qemu/vhost-user-server.h b/include/qemu/vhost-user-server.h index cd43193b80..25c72433ca 100644 --- a/include/qemu/vhost-user-server.h +++ b/include/qemu/vhost-user-server.h @@ -15,7 +15,6 @@ #include "io/channel-socket.h" #include "io/channel-file.h" #include "io/net-listener.h" -#include "qemu/error-report.h" #include "qapi/error.h" #include "standard-headers/linux/virtio_blk.h" diff --git a/include/ui/console.h b/include/ui/console.h index 8e6cf782a1..1cb53acc33 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -4,7 +4,6 @@ #include "ui/qemu-pixman.h" #include "qom/object.h" #include "qemu/notify.h" -#include "qemu/error-report.h" #include "qapi/qapi-types-ui.h" #ifdef CONFIG_OPENGL diff --git a/ui/console.c b/ui/console.c index ab43561fe1..98b701f5a3 100644 --- a/ui/console.c +++ b/ui/console.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "qemu/coroutine.h" +#include "qemu/error-report.h" #include "qemu/fifo8.h" #include "qemu/main-loop.h" #include "qemu/module.h" diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c index 5843d26cd2..df9a754a8d 100644 --- a/ui/dbus-clipboard.c +++ b/ui/dbus-clipboard.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" #include "qemu/dbus.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qom/object_interfaces.h" #include "sysemu/sysemu.h" diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 898a4ac8a5..0bfaa2298d 100644 --- a/ui/dbus-console.c +++ b/ui/dbus-console.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "ui/input.h" #include "ui/kbd-state.h" diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index f9fc8eda51..57d4e401db 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "sysemu/sysemu.h" #include "dbus.h" #include diff --git a/ui/dbus.c b/ui/dbus.c index 32d88dc94a..f2dcba03d0 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #include "qemu/dbus.h" #include "qemu/main-loop.h" #include "qemu/option.h" diff --git a/ui/egl-headless.c b/ui/egl-headless.c index 7a30fd9777..ae07e91302 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/module.h" #include "sysemu/sysemu.h" #include "ui/console.h" diff --git a/ui/gtk.c b/ui/gtk.c index 7f752d8b7d..fd82e9b1ca 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -36,6 +36,7 @@ #include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "ui/console.h" diff --git a/ui/spice-app.c b/ui/spice-app.c index 7e71e18da9..ad7f0551ad 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -29,6 +29,7 @@ #include "ui/console.h" #include "ui/spice-display.h" #include "qemu/config-file.h" +#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/cutils.h" #include "qemu/module.h" diff --git a/ui/spice-display.c b/ui/spice-display.c index 0616a6982f..16802f99cb 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -17,6 +17,7 @@ #include "qemu/osdep.h" #include "ui/qemu-spice.h" +#include "qemu/error-report.h" #include "qemu/timer.h" #include "qemu/lockable.h" #include "qemu/main-loop.h" diff --git a/ui/udmabuf.c b/ui/udmabuf.c index cbf4357bb1..6a0a11a85d 100644 --- a/ui/udmabuf.c +++ b/ui/udmabuf.c @@ -7,6 +7,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "ui/console.h" +#include "qemu/error-report.h" #include diff --git a/ui/vdagent.c b/ui/vdagent.c index 1f51a78da1..8a651492f0 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -2,6 +2,7 @@ #include "qapi/error.h" #include "chardev/char.h" #include "qemu/buffer.h" +#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/units.h" #include "hw/qdev-core.h" diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index 145eb17c08..40f36ea214 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -8,6 +8,7 @@ * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/vhost-user-server.h" #include "block/aio-wait.h" From 8f75703462e389b55755b98c250b5aa62685c0d3 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:49 -0300 Subject: [PATCH 09/22] tests/qtest: Skip PXE tests for missing devices Check if the devices we're trying to add are present in the QEMU binary. They could have been removed from the build via Kconfig or the --without-default-devices option. Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-2-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/pxe-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c index 52f0b5c67c..62b6eef464 100644 --- a/tests/qtest/pxe-test.c +++ b/tests/qtest/pxe-test.c @@ -108,6 +108,10 @@ static void test_batch(const testdef_t *tests, bool ipv6) const testdef_t *test = &tests[i]; char *testname; + if (!qtest_has_device(test->model)) { + continue; + } + testname = g_strdup_printf("pxe/ipv4/%s/%s", test->machine, test->model); qtest_add_data_func(testname, test, test_pxe_ipv4); From dee66bc9691a0d5e8337c24b5cf303f46293df76 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:50 -0300 Subject: [PATCH 10/22] tests/qtest: Do not run lsi53c895a test if device is not present The tests are built once for all the targets, so as long as one QEMU binary is built with CONFIG_LSI_SCSI_PCI=y, this test will run. However some binaries might not include the device. So check this again in runtime. Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-3-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/fuzz-lsi53c895a-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c index 392a7ae7ed..a9254b455d 100644 --- a/tests/qtest/fuzz-lsi53c895a-test.c +++ b/tests/qtest/fuzz-lsi53c895a-test.c @@ -112,6 +112,10 @@ static void test_lsi_do_dma_empty_queue(void) int main(int argc, char **argv) { + if (!qtest_has_device("lsi53c895a")) { + return 0; + } + g_test_init(&argc, &argv, NULL); qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue", From 56f7c6b15669a8bcf3236c7dffba0fa388a2dd6d Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:51 -0300 Subject: [PATCH 11/22] tests/qtest: Add dependence on PCIE_PORT for virtio-net-failover.c This test depends on the presence of the pcie-root-port device. Add a build time dependency. Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-4-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e97616d327..5c8b031ce0 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -73,7 +73,8 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ (config_host.has_key('CONFIG_POSIX') and \ config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ - (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ + (config_all_devices.has_key('CONFIG_PCIE_PORT') and \ + config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ From a2da5e2f306c1120dad66c4f2b8bb4084a225ac2 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:53 -0300 Subject: [PATCH 12/22] tests/qtest: hd-geo-test: Check for missing devices Don't include tests that require devices not available in the QEMU binary. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth Message-Id: <20230208194700.11035-6-farosas@suse.de> Signed-off-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 4a7628077b..5aa258a2b3 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -1090,30 +1090,42 @@ int main(int argc, char **argv) qtest_add_func("hd-geo/override/ide", test_override_ide); if (qtest_has_device("lsi53c895a")) { qtest_add_func("hd-geo/override/scsi", test_override_scsi); - qtest_add_func("hd-geo/override/scsi_2_controllers", - test_override_scsi_2_controllers); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_2_controllers", + test_override_scsi_2_controllers); + } } - qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_blk); qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs); - qtest_add_func("hd-geo/override/scsi_hot_unplug", - test_override_scsi_hot_unplug); - qtest_add_func("hd-geo/override/virtio_hot_unplug", - test_override_virtio_hot_unplug); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_hot_unplug", + test_override_scsi_hot_unplug); + } + if (qtest_has_device("virtio-blk-pci")) { + qtest_add_func("hd-geo/override/virtio_hot_unplug", + test_override_virtio_hot_unplug); + qtest_add_func("hd-geo/override/virtio_blk", + test_override_virtio_blk); + } if (qtest_has_machine("q35")) { qtest_add_func("hd-geo/override/sata", test_override_sata); - qtest_add_func("hd-geo/override/virtio_blk_q35", - test_override_virtio_blk_q35); qtest_add_func("hd-geo/override/zero_chs_q35", test_override_zero_chs_q35); if (qtest_has_device("lsi53c895a")) { qtest_add_func("hd-geo/override/scsi_q35", test_override_scsi_q35); } - qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", - test_override_scsi_hot_unplug_q35); - qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", - test_override_virtio_hot_unplug_q35); + if (qtest_has_device("virtio-scsi-pci")) { + qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", + test_override_scsi_hot_unplug_q35); + } + if (qtest_has_device("virtio-blk-pci")) { + qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", + test_override_virtio_hot_unplug_q35); + qtest_add_func("hd-geo/override/virtio_blk_q35", + test_override_virtio_blk_q35); + } + } } else { g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; " From ca7d9f5f28770af787e11a0300d6ecb3883cbfaa Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:54 -0300 Subject: [PATCH 13/22] test/qtest: Fix coding style in device-plug-test.c We should not mix declarations and statements in QEMU code. Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-7-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/device-plug-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 5a6afa2b57..4f92617335 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -64,6 +64,7 @@ static void process_device_remove(QTestState *qtest, const char *id) static void test_pci_unplug_request(void) { + QTestState *qtest; const char *arch = qtest_get_arch(); const char *machine_addition = ""; @@ -71,8 +72,8 @@ static void test_pci_unplug_request(void) machine_addition = "-machine pc"; } - QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0", - machine_addition); + qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0", + machine_addition); process_device_remove(qtest, "dev0"); @@ -94,6 +95,7 @@ static void test_q35_pci_unplug_request(void) static void test_pci_unplug_json_request(void) { + QTestState *qtest; const char *arch = qtest_get_arch(); const char *machine_addition = ""; @@ -101,7 +103,7 @@ static void test_pci_unplug_json_request(void) machine_addition = "-machine pc"; } - QTestState *qtest = qtest_initf( + qtest = qtest_initf( "%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"", machine_addition); From 45ec78befbd3aa632d51d4efb52f07d26f1eaa15 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:55 -0300 Subject: [PATCH 14/22] tests/qtest: Skip unplug tests that use missing devices Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-8-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/device-plug-test.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 4f92617335..01cecd6e20 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -68,6 +68,11 @@ static void test_pci_unplug_request(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -82,11 +87,17 @@ static void test_pci_unplug_request(void) static void test_q35_pci_unplug_request(void) { + QTestState *qtest; - QTestState *qtest = qtest_initf("-machine q35 " - "-device pcie-root-port,id=p1 " - "-device pcie-pci-bridge,bus=p1,id=b1 " - "-device virtio-mouse-pci,bus=b1,id=dev0"); + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + + qtest = qtest_initf("-machine q35 " + "-device pcie-root-port,id=p1 " + "-device pcie-pci-bridge,bus=p1,id=b1 " + "-device virtio-mouse-pci,bus=b1,id=dev0"); process_device_remove(qtest, "dev0"); @@ -99,6 +110,11 @@ static void test_pci_unplug_json_request(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -114,6 +130,7 @@ static void test_pci_unplug_json_request(void) static void test_q35_pci_unplug_json_request(void) { + QTestState *qtest; const char *port = "-device \"{'driver': 'pcie-root-port', " "'id': 'p1'}\""; @@ -125,8 +142,12 @@ static void test_q35_pci_unplug_json_request(void) "'bus': 'b1', " "'id': 'dev0'}\""; - QTestState *qtest = qtest_initf("-machine q35 %s %s %s", - port, bridge, device); + if (!qtest_has_device("virtio-mouse-pci")) { + g_test_skip("Device virtio-mouse-pci not available"); + return; + } + + qtest = qtest_initf("-machine q35 %s %s %s", port, bridge, device); process_device_remove(qtest, "dev0"); From 184c16d1acd4e04392e5a97654212b71a1551638 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:56 -0300 Subject: [PATCH 15/22] tests/qtest: drive_del-test: Skip tests that require missing devices Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-9-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/drive_del-test.c | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 9a750395a9..8a6f3ac963 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -16,6 +16,8 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" +static const char *qvirtio_get_dev_type(void); + static bool look_for_drive0(QTestState *qts, const char *command, const char *key) { QDict *response; @@ -40,6 +42,19 @@ static bool look_for_drive0(QTestState *qts, const char *command, const char *ke return found; } +/* + * This covers the possible absence of a device due to QEMU build + * options. + */ +static bool has_device_builtin(const char *dev) +{ + gchar *device = g_strdup_printf("%s-%s", dev, qvirtio_get_dev_type()); + bool rc = qtest_has_device(device); + + g_free(device); + return rc; +} + static bool has_drive(QTestState *qts) { return look_for_drive0(qts, "query-block", "device"); @@ -208,6 +223,11 @@ static void test_drive_del_device_del(void) { QTestState *qts; + if (!has_device_builtin("virtio-scsi")) { + g_test_skip("Device virtio-scsi is not available"); + return; + } + /* Start with a drive used by a device that unplugs instantaneously */ qts = qtest_initf("-drive if=none,id=drive0,file=null-co://," "file.read-zeroes=on,format=raw" @@ -232,6 +252,11 @@ static void test_cli_device_del(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -256,6 +281,11 @@ static void test_cli_device_del_q35(void) { QTestState *qts; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + /* * -drive/-device and device_del. Start with a drive used by a * device that unplugs after reset. @@ -277,6 +307,11 @@ static void test_empty_device_del(void) { QTestState *qts; + if (!has_device_builtin("virtio-scsi")) { + g_test_skip("Device virtio-scsi is not available"); + return; + } + /* device_del with no drive plugged. */ qts = qtest_initf("-device virtio-scsi-%s -device scsi-cd,id=dev0", qvirtio_get_dev_type()); @@ -291,6 +326,11 @@ static void test_device_add_and_del(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -330,6 +370,11 @@ static void test_device_add_and_del_q35(void) { QTestState *qts; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + /* * -drive/device_add and device_del. Start with a drive used by a * device that unplugs after reset. @@ -352,6 +397,11 @@ static void test_drive_add_device_add_and_del(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -374,6 +424,11 @@ static void test_drive_add_device_add_and_del_q35(void) { QTestState *qts; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 " "-device pcie-pci-bridge,bus=p1,id=b1"); @@ -395,6 +450,11 @@ static void test_blockdev_add_device_add_and_del(void) const char *arch = qtest_get_arch(); const char *machine_addition = ""; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { machine_addition = "-machine pc"; } @@ -417,6 +477,11 @@ static void test_blockdev_add_device_add_and_del_q35(void) { QTestState *qts; + if (!has_device_builtin("virtio-blk")) { + g_test_skip("Device virtio-blk is not available"); + return; + } + qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 " "-device pcie-pci-bridge,bus=p1,id=b1"); From c471eb4f40445908c1be7bb11a37ac676a0edae7 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:57 -0300 Subject: [PATCH 16/22] tests/qtest: Check for devices in bios-tables-test Do not include tests that require devices that are not available in the QEMU build. Signed-off-by: Fabiano Rosas Acked-by: Michael S. Tsirkin Message-Id: <20230208194700.11035-10-farosas@suse.de> Signed-off-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 75 ++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d8c8cda58e..d29a4e47af 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1008,6 +1008,12 @@ static void test_acpi_q35_multif_bridge(void) .machine = MACHINE_Q35, .variant = ".multi-bridge", }; + + if (!qtest_has_device("pcie-root-port")) { + g_test_skip("Device pcie-root-port is not available"); + goto out; + } + test_vm_prepare("-S" " -device virtio-balloon,id=balloon0,addr=0x4.0x2" " -device pcie-root-port,id=rp0,multifunction=on," @@ -1043,6 +1049,7 @@ static void test_acpi_q35_multif_bridge(void) /* check that reboot/reset doesn't change any ACPI tables */ qtest_qmp_send(data.qts, "{'execute':'system_reset' }"); process_acpi_tables(&data); +out: free_test_data(&data); } @@ -1396,6 +1403,11 @@ static void test_acpi_tcg_dimm_pxm(const char *machine) { test_data data; + if (!qtest_has_device("nvdimm")) { + g_test_skip("Device nvdimm is not available"); + return; + } + memset(&data, 0, sizeof(data)); data.machine = machine; data.variant = ".dimmpxm"; @@ -1444,6 +1456,11 @@ static void test_acpi_virt_tcg_memhp(void) .scan_len = 256ULL * 1024 * 1024, }; + if (!qtest_has_device("nvdimm")) { + g_test_skip("Device nvdimm is not available"); + goto out; + } + data.variant = ".memhp"; test_acpi_one(" -machine nvdimm=on" " -cpu cortex-a57" @@ -1457,7 +1474,7 @@ static void test_acpi_virt_tcg_memhp(void) " -device pc-dimm,id=dimm0,memdev=ram2,node=0" " -device nvdimm,id=dimm1,memdev=nvm0,node=1", &data); - +out: free_test_data(&data); } @@ -1475,6 +1492,11 @@ static void test_acpi_microvm_tcg(void) { test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off", &data); @@ -1485,6 +1507,11 @@ static void test_acpi_microvm_usb_tcg(void) { test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant = ".usb"; test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,usb=on,rtc=off", @@ -1496,6 +1523,11 @@ static void test_acpi_microvm_rtc_tcg(void) { test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant = ".rtc"; test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=on", @@ -1507,6 +1539,11 @@ static void test_acpi_microvm_pcie_tcg(void) { test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant = ".pcie"; data.tcg_only = true; /* need constant host-phys-bits */ @@ -1519,6 +1556,11 @@ static void test_acpi_microvm_ioapic2_tcg(void) { test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); data.variant = ".ioapic2"; test_acpi_one(" -machine microvm,acpi=on,ioapic2=on,rtc=off", @@ -1558,6 +1600,12 @@ static void test_acpi_virt_tcg_pxb(void) .ram_start = 0x40000000ULL, .scan_len = 128ULL * 1024 * 1024, }; + + if (!qtest_has_device("pcie-root-port")) { + g_test_skip("Device pcie-root-port is not available"); + goto out; + } + /* * While using -cdrom, the cdrom would auto plugged into pxb-pcie, * the reason is the bus of pxb-pcie is also root bus, it would lead @@ -1576,7 +1624,7 @@ static void test_acpi_virt_tcg_pxb(void) " -cpu cortex-a57" " -device pxb-pcie,bus_nr=128", &data); - +out: free_test_data(&data); } @@ -1764,6 +1812,12 @@ static void test_acpi_microvm_acpi_erst(void) gchar *params; test_data data; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + g_free(tmp_path); + return; + } + test_acpi_microvm_prepare(&data); data.variant = ".pcie"; data.tcg_only = true; /* need constant host-phys-bits */ @@ -1824,6 +1878,11 @@ static void test_acpi_q35_viot(void) .variant = ".viot", }; + if (!qtest_has_device("virtio-iommu")) { + g_test_skip("Device virtio-iommu is not available"); + goto out; + } + /* * To keep things interesting, two buses bypass the IOMMU. * VIOT should only describes the other two buses. @@ -1834,6 +1893,7 @@ static void test_acpi_q35_viot(void) "-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on " "-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0", &data); +out: free_test_data(&data); } @@ -1894,8 +1954,10 @@ static void test_acpi_virt_viot(void) .scan_len = 128ULL * 1024 * 1024, }; - test_acpi_one("-cpu cortex-a57 " - "-device virtio-iommu-pci", &data); + if (qtest_has_device("virtio-iommu")) { + test_acpi_one("-cpu cortex-a57 " + "-device virtio-iommu-pci", &data); + } free_test_data(&data); } @@ -2004,6 +2066,11 @@ static void test_acpi_microvm_oem_fields(void) test_data data; char *args; + if (!qtest_has_device("virtio-blk-device")) { + g_test_skip("Device virtio-blk-device is not available"); + return; + } + test_acpi_microvm_prepare(&data); args = test_acpi_create_args(&data, From 628f900883ffae94337ef3ca1c9b70bae267290d Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:58 -0300 Subject: [PATCH 17/22] tests/qtest: Do not include hexloader-test if loader device is not present Signed-off-by: Fabiano Rosas Message-Id: <20230208194700.11035-11-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 5c8b031ce0..e87cb18d8e 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -197,11 +197,11 @@ qtests_arm = \ (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \ (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \ + (config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'] : []) + \ ['arm-cpu-features', 'microbit-test', 'test-arm-mptimer', - 'boot-serial-test', - 'hexloader-test'] + 'boot-serial-test'] # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional qtests_aarch64 = \ From d043f461b3690a70973e0c30a19b9653683deb8e Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:46:59 -0300 Subject: [PATCH 18/22] tests/qemu-iotests: Require virtio-scsi-pci Check that virtio-scsi-pci is present in the QEMU build before running the tests. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth Message-Id: <20230208194700.11035-12-farosas@suse.de> Signed-off-by: Thomas Huth --- tests/qemu-iotests/186 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index 072e54e62b..eaf13c7a33 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse _require_drivers null-co +_require_devices virtio-scsi-pci if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then _notrun "Requires a PC machine" From 2e0def6d37b624c68875800a3092352d11bd0a91 Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Wed, 8 Feb 2023 16:47:00 -0300 Subject: [PATCH 19/22] tests/qtest: bios-tables-test: Skip if missing configs If we build with --without-default-devices, CONFIG_HPET and CONFIG_PARALLEL are set to N, which makes the respective devices go missing from acpi tables. Signed-off-by: Fabiano Rosas Reviewed-by: Thomas Huth Message-Id: <20230208194700.11035-13-farosas@suse.de> Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e87cb18d8e..4110f8afc2 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -78,7 +78,9 @@ qtests_i386 = \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ - (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ + (unpack_edk2_blobs and \ + config_all_devices.has_key('CONFIG_HPET') and \ + config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \ qtests_pci + \ qtests_cxl + \ ['fdc-test', From b8a310a2970aeebea605cdc1ec94b2da035b6e3c Mon Sep 17 00:00:00 2001 From: Fabiano Rosas Date: Mon, 13 Feb 2023 18:07:30 -0300 Subject: [PATCH 20/22] tests/qtest: Don't build virtio-serial-test.c if device not present The virtconsole device might not be present in the QEMU build that is being tested. Signed-off-by: Fabiano Rosas Message-Id: <20230213210738.9719-5-farosas@suse.de> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 4110f8afc2..222e1892fb 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -257,10 +257,14 @@ qos_test_ss.add( 'virtio-net-test.c', 'virtio-rng-test.c', 'virtio-scsi-test.c', - 'virtio-serial-test.c', 'virtio-iommu-test.c', 'vmxnet3-test.c', ) + +if config_all_devices.has_key('CONFIG_VIRTIO_SERIAL') + qos_test_ss.add(files('virtio-serial-test.c')) +endif + if config_host.has_key('CONFIG_POSIX') qos_test_ss.add(files('e1000e-test.c')) endif From 1b0e9b9be18210406c9296055cc7f38c6efc26fd Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Tue, 31 Jan 2023 19:20:57 +0100 Subject: [PATCH 21/22] tests/tcg/s390x: Use -nostdlib for softmmu tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails. Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well). Fixes: 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore") Signed-off-by: Ilya Leoshkevich Message-Id: <20230131182057.2261614-1-iii@linux.ibm.com> Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target index a34fa68473..50c1b88065 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -3,7 +3,7 @@ VPATH+=$(S390X_SRC) QEMU_OPTS=-action panic=exit-failure -kernel %: %.S - $(CC) -march=z13 -m64 -nostartfiles -static -Wl,-Ttext=0 \ + $(CC) -march=z13 -m64 -nostdlib -static -Wl,-Ttext=0 \ -Wl,--build-id=none $< -o $@ TESTS += unaligned-lowcore From b1d1d468cabfa800950e1ecb6006df619687c269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 12 Feb 2023 23:51:40 +0100 Subject: [PATCH 22/22] hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the SCLP_EVENT() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230212225144.58660-16-philmd@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/event-facility.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index faa51aa4c7..6891e3cd73 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -64,8 +64,7 @@ static bool event_pending(SCLPEventFacility *ef) SCLPEventClass *event_class; QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) { - DeviceState *qdev = kid->child; - event = DO_UPCAST(SCLPEvent, qdev, qdev); + event = SCLP_EVENT(kid->child); event_class = SCLP_EVENT_GET_CLASS(event); if (event->event_pending && event_class->get_send_mask() & ef->receive_mask) {