From c3776f4de5919f6e5f0e7d38a368634b194a4c4d Mon Sep 17 00:00:00 2001 From: John Arbuckle Date: Sun, 9 Sep 2018 11:32:38 -0400 Subject: [PATCH 01/15] qemu-common.h: update copyright date to 2018 Currently the copyright date is set to 2017. Update the date to say 2018. Signed-off-by: John Arbuckle Reviewed-by: Stefan Weil Signed-off-by: Thomas Huth --- include/qemu-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index 85f4749aef..ed60ba251d 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -17,7 +17,7 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) /* Copyright string for -version arguments, About dialogs, etc */ -#define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ +#define QEMU_COPYRIGHT "Copyright (c) 2003-2018 " \ "Fabrice Bellard and the QEMU Project developers" /* Bug reporting information for --help arguments, About dialogs, etc */ From ba3fa397a1b7b1c43d8cff33f7fdfce52298d287 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 9 Oct 2018 09:40:33 +0200 Subject: [PATCH 02/15] target/cris/translate: Get rid of qemu_log_separate() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gen_BUG() function calls already cpu_abort(), which prints the information to stderr and the log already. So instead of additionally printing the dc->pc via fprintf() and qemu_log here, too, we can simply pass this information to cpu_abort() instead. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- target/cris/translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 4ae1c04daf..11b2c11174 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -137,11 +137,7 @@ typedef struct DisasContext { static void gen_BUG(DisasContext *dc, const char *file, int line) { - fprintf(stderr, "BUG: pc=%x %s %d\n", dc->pc, file, line); - if (qemu_log_separate()) { - qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line); - } - cpu_abort(CPU(dc->cpu), "%s:%d\n", file, line); + cpu_abort(CPU(dc->cpu), "%s:%d pc=%x\n", file, line, dc->pc); } static const char *regnames_v32[] = From 7a6c377f6ba9c86a524965d48849f19a474d5a03 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 11 Oct 2018 09:47:51 -0500 Subject: [PATCH 03/15] tests: Prevent more accidental test disabling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNU make is perfectly happy to use 'check-FOO-y += bar' to initialize check-FOO-y. (GNU Automake strictly insists that you cannot use += until after an initial = per variable, but thankfully we aren't using automake). As we have had more than one instance where copy-and-paste of 'check-FOO-y = bar' from a first test under category FOO into an additional test, which ends up disabling the first (see commits 992159c7 and 4429532b), it's better to just always use the form that survives copy-and-paste, even for categories that don't currently add more than one test. Done with s/^\(check-[a-z]*-y \)=/\1+=/g Signed-off-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/Makefile.include | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 5eadfd52f9..b68cbb3434 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -38,7 +38,7 @@ $(SRC_PATH)/scripts/qapi-gen.py SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) -check-unit-y = tests/check-qdict$(EXESUF) +check-unit-y += tests/check-qdict$(EXESUF) gcov-files-check-qdict-y = qobject/qdict.c check-unit-y += tests/check-block-qdict$(EXESUF) gcov-files-check-block-qdict-y = qobject/block-qdict.c @@ -181,7 +181,7 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh # All QTests for now are POSIX-only, but the dependencies are # really in libqtest, not in the testcases themselves. -check-qtest-generic-y = tests/qmp-test$(EXESUF) +check-qtest-generic-y += tests/qmp-test$(EXESUF) gcov-files-generic-y = monitor.c qapi/qmp-dispatch.c check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF) @@ -324,13 +324,13 @@ check-qtest-x86_64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)) -check-qtest-alpha-y = tests/boot-serial-test$(EXESUF) +check-qtest-alpha-y += tests/boot-serial-test$(EXESUF) -check-qtest-hppa-y = tests/boot-serial-test$(EXESUF) +check-qtest-hppa-y += tests/boot-serial-test$(EXESUF) check-qtest-m68k-y = tests/boot-serial-test$(EXESUF) -check-qtest-microblaze-y = tests/boot-serial-test$(EXESUF) +check-qtest-microblaze-y += tests/boot-serial-test$(EXESUF) check-qtest-mips-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) @@ -338,7 +338,7 @@ check-qtest-mips64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) -check-qtest-moxie-y = tests/boot-serial-test$(EXESUF) +check-qtest-moxie-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-ppc-y += tests/boot-order-test$(EXESUF) @@ -348,7 +348,7 @@ check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-y += tests/m48t59-test$(EXESUF) gcov-files-ppc-y += hw/timer/m48t59.c -check-qtest-ppc64-y = $(check-qtest-ppc-y) +check-qtest-ppc64-y += $(check-qtest-ppc-y) gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y)) check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c @@ -377,7 +377,7 @@ check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) -check-qtest-sparc-y = tests/prom-env-test$(EXESUF) +check-qtest-sparc-y += tests/prom-env-test$(EXESUF) check-qtest-sparc-y += tests/m48t59-test$(EXESUF) gcov-files-sparc-y = hw/timer/m48t59.c check-qtest-sparc-y += tests/boot-serial-test$(EXESUF) @@ -386,7 +386,7 @@ check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-sparc64-y += tests/prom-env-test$(EXESUF) check-qtest-sparc64-y += tests/boot-serial-test$(EXESUF) -check-qtest-arm-y = tests/tmp105-test$(EXESUF) +check-qtest-arm-y += tests/tmp105-test$(EXESUF) check-qtest-arm-y += tests/pca9552-test$(EXESUF) check-qtest-arm-y += tests/ds1338-test$(EXESUF) check-qtest-arm-y += tests/m25p80-test$(EXESUF) @@ -404,9 +404,9 @@ check-qtest-aarch64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF) check-qtest-aarch64-y += tests/migration-test$(EXESUF) -check-qtest-microblazeel-y = $(check-qtest-microblaze-y) +check-qtest-microblazeel-y += $(check-qtest-microblaze-y) -check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) +check-qtest-xtensaeb-y += $(check-qtest-xtensa-y) check-qtest-s390x-y = tests/boot-serial-test$(EXESUF) check-qtest-s390x-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) From 26830e9325d05d537dd9a3765437908771d19475 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 5 Oct 2018 18:17:22 +0200 Subject: [PATCH 04/15] tests: remove gcov-files- variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 31d2dda ("build-system: remove per-test GCOV reporting", 2018-06-20) removed users of the variables, since those uses can be replaced by a simple overall report produced by gcovr. However, the variables were never removed. Do it now. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée [thuth: Fixed up contextual conflicts with the patch from Eric] Signed-off-by: Thomas Huth --- docs/devel/testing.rst | 4 +- tests/Makefile.include | 118 ----------------------------------------- 2 files changed, 1 insertion(+), 121 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 727c4019b5..fcfad87614 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -43,15 +43,13 @@ add a new unit test: 3. Add the test to ``tests/Makefile.include``. First, name the unit test program and add it to ``$(check-unit-y)``; then add a rule to build the - executable. Optionally, you can add a magical variable to support ``gcov``. - For example: + executable. For example: .. code:: check-unit-y += tests/foo-test$(EXESUF) tests/foo-test$(EXESUF): tests/foo-test.o $(test-util-obj-y) ... - gcov-files-foo-test-y = util/foo.c Since unit tests don't require environment variables, the simplest way to debug a unit test failure is often directly invoking it or even running it under diff --git a/tests/Makefile.include b/tests/Makefile.include index b68cbb3434..7fe8578972 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -39,106 +39,61 @@ SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) check-unit-y += tests/check-qdict$(EXESUF) -gcov-files-check-qdict-y = qobject/qdict.c check-unit-y += tests/check-block-qdict$(EXESUF) -gcov-files-check-block-qdict-y = qobject/block-qdict.c check-unit-y += tests/test-char$(EXESUF) -gcov-files-check-qdict-y = chardev/char.c check-unit-y += tests/check-qnum$(EXESUF) -gcov-files-check-qnum-y = qobject/qnum.c check-unit-y += tests/check-qstring$(EXESUF) -gcov-files-check-qstring-y = qobject/qstring.c check-unit-y += tests/check-qlist$(EXESUF) -gcov-files-check-qlist-y = qobject/qlist.c check-unit-y += tests/check-qnull$(EXESUF) -gcov-files-check-qnull-y = qobject/qnull.c check-unit-y += tests/check-qobject$(EXESUF) check-unit-y += tests/check-qjson$(EXESUF) -gcov-files-check-qjson-y = qobject/qjson.c check-unit-y += tests/check-qlit$(EXESUF) -gcov-files-check-qlit-y = qobject/qlit.c check-unit-y += tests/test-qobject-output-visitor$(EXESUF) -gcov-files-test-qobject-output-visitor-y = qapi/qobject-output-visitor.c check-unit-y += tests/test-clone-visitor$(EXESUF) -gcov-files-test-clone-visitor-y = qapi/qapi-clone-visitor.c check-unit-y += tests/test-qobject-input-visitor$(EXESUF) -gcov-files-test-qobject-input-visitor-y = qapi/qobject-input-visitor.c check-unit-y += tests/test-qmp-cmds$(EXESUF) -gcov-files-test-qmp-cmds-y = qapi/qmp-dispatch.c check-unit-y += tests/test-string-input-visitor$(EXESUF) -gcov-files-test-string-input-visitor-y = qapi/string-input-visitor.c check-unit-y += tests/test-string-output-visitor$(EXESUF) -gcov-files-test-string-output-visitor-y = qapi/string-output-visitor.c check-unit-y += tests/test-qmp-event$(EXESUF) -gcov-files-test-qmp-event-y += qapi/qmp-event.c check-unit-y += tests/test-opts-visitor$(EXESUF) -gcov-files-test-opts-visitor-y = qapi/opts-visitor.c check-unit-y += tests/test-coroutine$(EXESUF) -gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c check-unit-y += tests/test-visitor-serialization$(EXESUF) check-unit-y += tests/test-iov$(EXESUF) -gcov-files-test-iov-y = util/iov.c check-unit-y += tests/test-aio$(EXESUF) -gcov-files-test-aio-y = util/async.c util/qemu-timer.o -gcov-files-test-aio-$(CONFIG_WIN32) += util/aio-win32.c -gcov-files-test-aio-$(CONFIG_POSIX) += util/aio-posix.c check-unit-y += tests/test-aio-multithread$(EXESUF) -gcov-files-test-aio-multithread-y = $(gcov-files-test-aio-y) -gcov-files-test-aio-multithread-y += util/qemu-coroutine.c tests/iothread.c check-unit-y += tests/test-throttle$(EXESUF) check-unit-y += tests/test-thread-pool$(EXESUF) -gcov-files-test-thread-pool-y = thread-pool.c -gcov-files-test-hbitmap-y = util/hbitmap.c check-unit-y += tests/test-hbitmap$(EXESUF) -gcov-files-test-hbitmap-y = blockjob.c check-unit-y += tests/test-bdrv-drain$(EXESUF) check-unit-y += tests/test-blockjob$(EXESUF) check-unit-y += tests/test-blockjob-txn$(EXESUF) check-unit-y += tests/test-block-backend$(EXESUF) check-unit-y += tests/test-x86-cpuid$(EXESUF) # all code tested by test-x86-cpuid is inside topology.h -gcov-files-test-x86-cpuid-y = ifeq ($(CONFIG_SOFTMMU),y) check-unit-y += tests/test-xbzrle$(EXESUF) -gcov-files-test-xbzrle-y = migration/xbzrle.c check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF) endif check-unit-y += tests/test-cutils$(EXESUF) -gcov-files-test-cutils-y += util/cutils.c check-unit-y += tests/test-shift128$(EXESUF) -gcov-files-test-shift128-y = util/host-utils.c check-unit-y += tests/test-mul64$(EXESUF) -gcov-files-test-mul64-y = util/host-utils.c check-unit-y += tests/test-int128$(EXESUF) # all code tested by test-int128 is inside int128.h -gcov-files-test-int128-y = check-unit-y += tests/rcutorture$(EXESUF) -gcov-files-rcutorture-y = util/rcu.c check-unit-y += tests/test-rcu-list$(EXESUF) -gcov-files-test-rcu-list-y = util/rcu.c check-unit-y += tests/test-rcu-simpleq$(EXESUF) -gcov-files-test-rcu-simpleq-y = util/rcu.c check-unit-y += tests/test-rcu-tailq$(EXESUF) -gcov-files-test-rcu-tailq-y = util/rcu.c check-unit-y += tests/test-qdist$(EXESUF) -gcov-files-test-qdist-y = util/qdist.c check-unit-y += tests/test-qht$(EXESUF) -gcov-files-test-qht-y = util/qht.c check-unit-y += tests/test-qht-par$(EXESUF) -gcov-files-test-qht-par-y = util/qht.c check-unit-y += tests/test-bitops$(EXESUF) check-unit-y += tests/test-bitcnt$(EXESUF) check-unit-y += tests/test-qdev-global-props$(EXESUF) check-unit-y += tests/check-qom-interface$(EXESUF) -gcov-files-check-qom-interface-y = qom/object.c check-unit-y += tests/check-qom-proplist$(EXESUF) -gcov-files-check-qom-proplist-y = qom/object.c check-unit-y += tests/test-qemu-opts$(EXESUF) -gcov-files-test-qemu-opts-y = util/qemu-option.c check-unit-y += tests/test-keyval$(EXESUF) -gcov-files-test-keyval-y = util/keyval.c check-unit-y += tests/test-write-threshold$(EXESUF) -gcov-files-test-write-threshold-y = block/write-threshold.c check-unit-y += tests/test-crypto-hash$(EXESUF) check-speed-y += tests/benchmark-crypto-hash$(EXESUF) check-unit-y += tests/test-crypto-hmac$(EXESUF) @@ -166,15 +121,11 @@ check-unit-y += tests/test-crypto-afsplit$(EXESUF) check-unit-y += tests/test-crypto-xts$(EXESUF) check-unit-y += tests/test-crypto-block$(EXESUF) check-unit-y += tests/test-logging$(EXESUF) -gcov-files-test-logging-y = util/log.c check-unit-$(CONFIG_REPLICATION) += tests/test-replication$(EXESUF) check-unit-y += tests/test-bufferiszero$(EXESUF) -gcov-files-check-bufferiszero-y = util/bufferiszero.c check-unit-y += tests/test-uuid$(EXESUF) check-unit-y += tests/ptimer-test$(EXESUF) -gcov-files-ptimer-test-y = hw/core/ptimer.c check-unit-y += tests/test-qapi-util$(EXESUF) -gcov-files-test-qapi-util-y = qapi/qapi-util.c check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh @@ -182,87 +133,48 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh # really in libqtest, not in the testcases themselves. check-qtest-generic-y += tests/qmp-test$(EXESUF) -gcov-files-generic-y = monitor.c qapi/qmp-dispatch.c check-qtest-generic-y += tests/qmp-cmd-test$(EXESUF) check-qtest-generic-y += tests/device-introspect-test$(EXESUF) -gcov-files-generic-y = qdev-monitor.c qmp.c check-qtest-generic-y += tests/cdrom-test$(EXESUF) -gcov-files-ipack-y += hw/ipack/ipack.c check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) -gcov-files-ipack-y += hw/char/ipoctal232.c check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF) -gcov-files-virtioserial-y += hw/char/virtio-console.c -gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) -gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) -gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) -gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) -gcov-files-virtio-y += hw/virtio/virtio-rng.c check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) -gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF) -gcov-files-virtio-y += hw/9pfs/virtio-9p.c -gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c endif check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF) -gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c check-qtest-virtio-y += $(check-qtest-virtioserial-y) -gcov-files-virtio-y += $(gcov-files-virtioserial-y) check-qtest-pci-y += tests/e1000-test$(EXESUF) -gcov-files-pci-y += hw/net/e1000.c check-qtest-pci-y += tests/e1000e-test$(EXESUF) -gcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c check-qtest-pci-$(CONFIG_RTL8139_PCI) += tests/rtl8139-test$(EXESUF) -gcov-files-pci-$(CONFIG_RTL8139_PCI) += hw/net/rtl8139.c check-qtest-pci-$(CONFIG_PCNET_PCI) += tests/pcnet-test$(EXESUF) -gcov-files-pci-$(CONFIG_PCNET_PCI) += hw/net/pcnet.c -gcov-files-pci-$(CONFIG_PCNET_PCI) += hw/net/pcnet-pci.c check-qtest-pci-$(CONFIG_EEPRO100_PCI) += tests/eepro100-test$(EXESUF) -gcov-files-pci-$(CONFIG_EEPRO100_PCI) += hw/net/eepro100.c check-qtest-pci-$(CONFIG_NE2000_PCI) += tests/ne2000-test$(EXESUF) -gcov-files-pci-$(CONFIG_NE2000_PCI) += hw/net/ne2000.c check-qtest-pci-$(CONFIG_NVME_PCI) += tests/nvme-test$(EXESUF) -gcov-files-pci-$(CONFIG_NVME_PCI) += hw/block/nvme.c check-qtest-pci-$(CONFIG_AC97) += tests/ac97-test$(EXESUF) -gcov-files-pci-$(CONFIG_AC97) += hw/audio/ac97.c check-qtest-pci-$(CONFIG_ES1370) += tests/es1370-test$(EXESUF) -gcov-files-pci-$(CONFIG_ES1370) += hw/audio/es1370.c check-qtest-pci-y += $(check-qtest-virtio-y) -gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c check-qtest-pci-$(CONFIG_IPACK) += tests/tpci200-test$(EXESUF) -gcov-files-pci-$(CONFIG_IPACK) += hw/ipack/tpci200.c check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y) -gcov-files-pci-$(CONFIG_IPACK) += $(gcov-files-ipack-y) check-qtest-pci-y += tests/display-vga-test$(EXESUF) -gcov-files-pci-y += hw/display/vga.c -gcov-files-pci-y += hw/display/cirrus_vga.c -gcov-files-pci-y += hw/display/vga-pci.c -gcov-files-pci-y += hw/display/virtio-gpu.c -gcov-files-pci-y += hw/display/virtio-gpu-pci.c -gcov-files-pci-$(CONFIG_VIRTIO_VGA) += hw/display/virtio-vga.c check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF) -gcov-files-pci-$(CONFIG_HDA) += hw/audio/intel-hda.c hw/audio/hda-codec.c check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF) -gcov-files-pci-$(CONFIG_IVSHMEM_DEVICE) += hw/misc/ivshmem.c check-qtest-pci-y += tests/megasas-test$(EXESUF) -gcov-files-pci-y += hw/scsi/megasas.c check-qtest-i386-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-i386-y += tests/fdc-test$(EXESUF) -gcov-files-i386-y = hw/block/fdc.c check-qtest-i386-y += tests/ide-test$(EXESUF) check-qtest-i386-y += tests/ahci-test$(EXESUF) check-qtest-i386-y += tests/hd-geo-test$(EXESUF) -gcov-files-i386-y += hw/block/hd-geometry.c check-qtest-i386-y += tests/boot-order-test$(EXESUF) check-qtest-i386-y += tests/bios-tables-test$(EXESUF) check-qtest-i386-$(CONFIG_SGA) += tests/boot-serial-test$(EXESUF) @@ -274,37 +186,21 @@ check-qtest-i386-y += tests/i440fx-test$(EXESUF) check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) check-qtest-i386-y += tests/drive_del-test$(EXESUF) check-qtest-i386-$(CONFIG_WDT_IB700) += tests/wdt_ib700-test$(EXESUF) -gcov-files-i386-$(CONFIG_WDT_IB700) += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c check-qtest-i386-y += tests/tco-test$(EXESUF) check-qtest-i386-y += $(check-qtest-pci-y) -gcov-files-i386-y += $(gcov-files-pci-y) check-qtest-i386-$(CONFIG_VMXNET3_PCI) += tests/vmxnet3-test$(EXESUF) -gcov-files-i386-$(CONFIG_VMXNET3_PCI) += hw/net/vmxnet3.c -gcov-files-i386-y += hw/net/net_rx_pkt.c -gcov-files-i386-y += hw/net/net_tx_pkt.c check-qtest-i386-$(CONFIG_PVPANIC) += tests/pvpanic-test$(EXESUF) -gcov-files-i386-$(CONFIG_PVPANIC) += i386-softmmu/hw/misc/pvpanic.c check-qtest-i386-$(CONFIG_I82801B11) += tests/i82801b11-test$(EXESUF) -gcov-files-i386-$(CONFIG_I82801B11) += hw/pci-bridge/i82801b11.c check-qtest-i386-$(CONFIG_IOH3420) += tests/ioh3420-test$(EXESUF) -gcov-files-i386-$(CONFIG_IOH3420) += hw/pci-bridge/ioh3420.c check-qtest-i386-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) -gcov-files-i386-$(CONFIG_USB_OHCI) += hw/usb/hcd-ohci.c check-qtest-i386-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) -gcov-files-i386-$(CONFIG_USB_UHCI) += hw/usb/hcd-uhci.c ifeq ($(CONFIG_USB_ECHI)$(CONFIG_USB_UHCI),yy) check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF) endif -gcov-files-i386-$(CONFIG_USB_EHCI) += hw/usb/hcd-ehci.c -gcov-files-i386-y += hw/usb/dev-hid.c -gcov-files-i386-y += hw/usb/dev-storage.c check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) -gcov-files-i386-$(CONFIG_USB_XHCI) += hw/usb/hcd-xhci.c -gcov-files-i386-$(CONFIG_USB_XHCI) += hw/usb/hcd-xhci-nec.c check-qtest-i386-y += tests/cpu-plug-test$(EXESUF) check-qtest-i386-y += tests/q35-test$(EXESUF) check-qtest-i386-y += tests/vmgenid-test$(EXESUF) -gcov-files-i386-y += hw/pci-host/q35.c check-qtest-i386-$(CONFIG_VHOST_USER_NET_TEST_i386) += tests/vhost-user-test$(EXESUF) ifeq ($(CONFIG_VHOST_USER_NET_TEST_i386),) check-qtest-x86_64-$(CONFIG_VHOST_USER_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF) @@ -321,8 +217,6 @@ check-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF) check-qtest-i386-y += tests/numa-test$(EXESUF) check-qtest-x86_64-y += $(check-qtest-i386-y) check-qtest-x86_64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) -gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c -gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y)) check-qtest-alpha-y += tests/boot-serial-test$(EXESUF) @@ -346,23 +240,16 @@ check-qtest-ppc-y += tests/prom-env-test$(EXESUF) check-qtest-ppc-y += tests/drive_del-test$(EXESUF) check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) check-qtest-ppc-y += tests/m48t59-test$(EXESUF) -gcov-files-ppc-y += hw/timer/m48t59.c check-qtest-ppc64-y += $(check-qtest-ppc-y) -gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y)) check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) -gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF) check-qtest-ppc64-y += tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) check-qtest-ppc64-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF) -gcov-files-ppc64-$(CONFIG_USB_OHCI) += hw/usb/hcd-ohci.c check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF) -gcov-files-ppc64-$(CONFIG_USB_UHCI) += hw/usb/hcd-uhci.c check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) -gcov-files-ppc64-$(CONFIG_USB_XHCI) += hw/usb/hcd-xhci.c -gcov-files-ppc64-$(CONFIG_USB_XHCI) += hw/usb/hcd-xhci-nec.c check-qtest-ppc64-y += $(check-qtest-virtio-y) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) @@ -370,7 +257,6 @@ check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += tests/test-filter-redirector$(EXESUF) check-qtest-ppc64-y += tests/display-vga-test$(EXESUF) check-qtest-ppc64-y += tests/numa-test$(EXESUF) check-qtest-ppc64-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF) -gcov-files-ppc64-$(CONFIG_IVSHMEM_DEVICE) += hw/misc/ivshmem.c check-qtest-ppc64-y += tests/cpu-plug-test$(EXESUF) check-qtest-sh4-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) @@ -379,7 +265,6 @@ check-qtest-sh4eb-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) check-qtest-sparc-y += tests/prom-env-test$(EXESUF) check-qtest-sparc-y += tests/m48t59-test$(EXESUF) -gcov-files-sparc-y = hw/timer/m48t59.c check-qtest-sparc-y += tests/boot-serial-test$(EXESUF) check-qtest-sparc64-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF) @@ -390,11 +275,8 @@ check-qtest-arm-y += tests/tmp105-test$(EXESUF) check-qtest-arm-y += tests/pca9552-test$(EXESUF) check-qtest-arm-y += tests/ds1338-test$(EXESUF) check-qtest-arm-y += tests/m25p80-test$(EXESUF) -gcov-files-arm-y += hw/misc/tmp105.c check-qtest-arm-y += tests/virtio-blk-test$(EXESUF) -gcov-files-arm-y += arm-softmmu/hw/block/virtio-blk.c check-qtest-arm-y += tests/test-arm-mptimer$(EXESUF) -gcov-files-arm-y += hw/timer/arm_mptimer.c check-qtest-arm-y += tests/boot-serial-test$(EXESUF) check-qtest-arm-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-arm-y += tests/hexloader-test$(EXESUF) From d417eb1d3f34ce26afb1364cce4039d769873e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 12 Oct 2018 02:21:13 +0200 Subject: [PATCH 05/15] gdbstub: Remove unused include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth Signed-off-by: Thomas Huth --- gdbstub.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index c8478de8f5..c4e4f9f082 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -20,7 +20,6 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/cutils.h" -#include "cpu.h" #include "trace-root.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" From 53d593d25bec52bcb91b53a93d47857cb5961da3 Mon Sep 17 00:00:00 2001 From: Liu Yuan Date: Fri, 12 Oct 2018 15:35:10 +0800 Subject: [PATCH 06/15] MAINTAINERS: update block/sheepdog maintainers E-mail to one of block/sheepdog maintainers Mitake Hitoshi bounces : unknown user: "mitake.hitoshi" and no current address is known. So just remove it. Signed-off-by: Liu Yuan Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index fb81b3a8eb..40672c4eba 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2023,7 +2023,6 @@ F: block/rbd.c T: git git://github.com/codyprime/qemu-kvm-jtc.git block Sheepdog -M: Hitoshi Mitake M: Liu Yuan M: Jeff Cody L: qemu-block@nongnu.org From 934821ebae41e59cb2a6c5c7ec99927255117491 Mon Sep 17 00:00:00 2001 From: Mao Zhongyi Date: Mon, 15 Oct 2018 17:17:34 +0800 Subject: [PATCH 07/15] archive-source.sh: Modern shell scripting (use $() instead of ``) Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. Signed-off-by: Mao Zhongyi Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- scripts/archive-source.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 4e63774f9a..62bd22578b 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -18,7 +18,7 @@ if test $# -lt 1; then error "Usage: $0 " fi -tar_file=`realpath "$1"` +tar_file=$(realpath "$1") list_file="${tar_file}.list" vroot_dir="${tar_file}.vroot" @@ -34,7 +34,7 @@ if git diff-index --quiet HEAD -- &>/dev/null then HEAD=HEAD else - HEAD=`git stash create` + HEAD=$(git stash create) fi git clone --shared . "$vroot_dir" test $? -ne 0 && error "failed to clone into '$vroot_dir'" From a436cd882691145673afe3a1a3872650bb760506 Mon Sep 17 00:00:00 2001 From: Mao Zhongyi Date: Mon, 15 Oct 2018 17:17:35 +0800 Subject: [PATCH 08/15] git-submodule.sh: Modern shell scripting (use $() instead of ``) Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. Signed-off-by: Mao Zhongyi Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- scripts/git-submodule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh index 807ca0b4f8..98ca0f2737 100755 --- a/scripts/git-submodule.sh +++ b/scripts/git-submodule.sh @@ -59,8 +59,8 @@ status) fi test -f "$substat" || exit 1 - CURSTATUS=`$GIT submodule status $modules` - OLDSTATUS=`cat $substat` + CURSTATUS=$($GIT submodule status $modules) + OLDSTATUS=$(cat $substat) test "$CURSTATUS" = "$OLDSTATUS" exit $? ;; From aa2192bf14fb18a407782527beebba3a96620d0f Mon Sep 17 00:00:00 2001 From: Mao Zhongyi Date: Mon, 15 Oct 2018 17:17:36 +0800 Subject: [PATCH 09/15] show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``) Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. Signed-off-by: Mao Zhongyi Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- scripts/show-fixed-bugs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/show-fixed-bugs.sh b/scripts/show-fixed-bugs.sh index 36f306898f..a095a4d6ba 100755 --- a/scripts/show-fixed-bugs.sh +++ b/scripts/show-fixed-bugs.sh @@ -23,10 +23,10 @@ while getopts "s:e:cbh" opt; do done if [ "x$start" = "x" ]; then - start=`git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 2 | head -n 1` + start=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 2 | head -n 1) fi if [ "x$end" = "x" ]; then - end=`git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 1` + end=$(git tag -l 'v[0-9]*\.[0-9]*\.0' | tail -n 1) fi if [ "x$start" = "x" ] || [ "x$end" = "x" ]; then @@ -38,9 +38,9 @@ fi echo "Searching git log for bugs in the range $start..$end" urlstr='https://bugs.launchpad.net/\(bugs\|qemu/+bug\)/' -bug_urls=`git log $start..$end \ +bug_urls=$(git log $start..$end \ | sed -n '\,'"$urlstr"', s,\(.*\)\('"$urlstr"'\)\([0-9]*\).*,\2\4,p' \ - | sort -u` + | sort -u) echo Found bug URLs: for i in $bug_urls ; do echo " $i" ; done @@ -68,7 +68,7 @@ elif [ "x$show_in_browser" = "x1" ]; then bugbrowser=xdg-open elif command -v gnome-open >/dev/null 2>&1; then bugbrowser=gnome-open - elif [ "`uname`" = "Darwin" ]; then + elif [ "$(uname)" = "Darwin" ]; then bugbrowser=open elif command -v sensible-browser >/dev/null 2>&1; then bugbrowser=sensible-browser From 957e8b34920a1404a1318b2e1ffa0726d40e0a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 11 Oct 2018 00:29:43 +0200 Subject: [PATCH 10/15] =?UTF-8?q?mailmap:=20Fix=20Reimar=20D=C3=B6ffinger?= =?UTF-8?q?=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This probably happened when interpreting the utf8 name as latin1. Fixes dbbaaff6867 and f4e94dfefb6. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- .mailmap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 2c2b9b1205..6f2ff22a45 100644 --- a/.mailmap +++ b/.mailmap @@ -33,5 +33,6 @@ Justin Terry (VM) Justin Terry (VM) via Qemu-devel +Reimar Döffinger From 97ff87c0ed020c2a4b931146e142d67abe852e22 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 26 Sep 2018 17:48:50 +0200 Subject: [PATCH 11/15] qemu/compiler: Wrap __attribute__((flatten)) in a macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older versions of Clang (before 3.5) and GCC (before 4.1) do not support the "__attribute__((flatten))" yet. We don't care about such old versions of GCC anymore, but since Clang 3.4 is still used in EPEL for RHEL7 / CentOS 7, we should not use this attribute directly but with a wrapper macro instead. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- fpu/softfloat.c | 39 +++++++++++++++------------------------ include/qemu/compiler.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 46ae206172..e1eef954e6 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -726,8 +726,7 @@ static FloatParts addsub_floats(FloatParts a, FloatParts b, bool subtract, * IEC/IEEE Standard for Binary Floating-Point Arithmetic. */ -float16 __attribute__((flatten)) float16_add(float16 a, float16 b, - float_status *status) +float16 QEMU_FLATTEN float16_add(float16 a, float16 b, float_status *status) { FloatParts pa = float16_unpack_canonical(a, status); FloatParts pb = float16_unpack_canonical(b, status); @@ -736,8 +735,7 @@ float16 __attribute__((flatten)) float16_add(float16 a, float16 b, return float16_round_pack_canonical(pr, status); } -float32 __attribute__((flatten)) float32_add(float32 a, float32 b, - float_status *status) +float32 QEMU_FLATTEN float32_add(float32 a, float32 b, float_status *status) { FloatParts pa = float32_unpack_canonical(a, status); FloatParts pb = float32_unpack_canonical(b, status); @@ -746,8 +744,7 @@ float32 __attribute__((flatten)) float32_add(float32 a, float32 b, return float32_round_pack_canonical(pr, status); } -float64 __attribute__((flatten)) float64_add(float64 a, float64 b, - float_status *status) +float64 QEMU_FLATTEN float64_add(float64 a, float64 b, float_status *status) { FloatParts pa = float64_unpack_canonical(a, status); FloatParts pb = float64_unpack_canonical(b, status); @@ -756,8 +753,7 @@ float64 __attribute__((flatten)) float64_add(float64 a, float64 b, return float64_round_pack_canonical(pr, status); } -float16 __attribute__((flatten)) float16_sub(float16 a, float16 b, - float_status *status) +float16 QEMU_FLATTEN float16_sub(float16 a, float16 b, float_status *status) { FloatParts pa = float16_unpack_canonical(a, status); FloatParts pb = float16_unpack_canonical(b, status); @@ -766,8 +762,7 @@ float16 __attribute__((flatten)) float16_sub(float16 a, float16 b, return float16_round_pack_canonical(pr, status); } -float32 __attribute__((flatten)) float32_sub(float32 a, float32 b, - float_status *status) +float32 QEMU_FLATTEN float32_sub(float32 a, float32 b, float_status *status) { FloatParts pa = float32_unpack_canonical(a, status); FloatParts pb = float32_unpack_canonical(b, status); @@ -776,8 +771,7 @@ float32 __attribute__((flatten)) float32_sub(float32 a, float32 b, return float32_round_pack_canonical(pr, status); } -float64 __attribute__((flatten)) float64_sub(float64 a, float64 b, - float_status *status) +float64 QEMU_FLATTEN float64_sub(float64 a, float64 b, float_status *status) { FloatParts pa = float64_unpack_canonical(a, status); FloatParts pb = float64_unpack_canonical(b, status); @@ -835,8 +829,7 @@ static FloatParts mul_floats(FloatParts a, FloatParts b, float_status *s) g_assert_not_reached(); } -float16 __attribute__((flatten)) float16_mul(float16 a, float16 b, - float_status *status) +float16 QEMU_FLATTEN float16_mul(float16 a, float16 b, float_status *status) { FloatParts pa = float16_unpack_canonical(a, status); FloatParts pb = float16_unpack_canonical(b, status); @@ -845,8 +838,7 @@ float16 __attribute__((flatten)) float16_mul(float16 a, float16 b, return float16_round_pack_canonical(pr, status); } -float32 __attribute__((flatten)) float32_mul(float32 a, float32 b, - float_status *status) +float32 QEMU_FLATTEN float32_mul(float32 a, float32 b, float_status *status) { FloatParts pa = float32_unpack_canonical(a, status); FloatParts pb = float32_unpack_canonical(b, status); @@ -855,8 +847,7 @@ float32 __attribute__((flatten)) float32_mul(float32 a, float32 b, return float32_round_pack_canonical(pr, status); } -float64 __attribute__((flatten)) float64_mul(float64 a, float64 b, - float_status *status) +float64 QEMU_FLATTEN float64_mul(float64 a, float64 b, float_status *status) { FloatParts pa = float64_unpack_canonical(a, status); FloatParts pb = float64_unpack_canonical(b, status); @@ -1068,7 +1059,7 @@ static FloatParts muladd_floats(FloatParts a, FloatParts b, FloatParts c, return a; } -float16 __attribute__((flatten)) float16_muladd(float16 a, float16 b, float16 c, +float16 QEMU_FLATTEN float16_muladd(float16 a, float16 b, float16 c, int flags, float_status *status) { FloatParts pa = float16_unpack_canonical(a, status); @@ -1079,7 +1070,7 @@ float16 __attribute__((flatten)) float16_muladd(float16 a, float16 b, float16 c, return float16_round_pack_canonical(pr, status); } -float32 __attribute__((flatten)) float32_muladd(float32 a, float32 b, float32 c, +float32 QEMU_FLATTEN float32_muladd(float32 a, float32 b, float32 c, int flags, float_status *status) { FloatParts pa = float32_unpack_canonical(a, status); @@ -1090,7 +1081,7 @@ float32 __attribute__((flatten)) float32_muladd(float32 a, float32 b, float32 c, return float32_round_pack_canonical(pr, status); } -float64 __attribute__((flatten)) float64_muladd(float64 a, float64 b, float64 c, +float64 QEMU_FLATTEN float64_muladd(float64 a, float64 b, float64 c, int flags, float_status *status) { FloatParts pa = float64_unpack_canonical(a, status); @@ -2414,21 +2405,21 @@ static FloatParts sqrt_float(FloatParts a, float_status *s, const FloatFmt *p) return a; } -float16 __attribute__((flatten)) float16_sqrt(float16 a, float_status *status) +float16 QEMU_FLATTEN float16_sqrt(float16 a, float_status *status) { FloatParts pa = float16_unpack_canonical(a, status); FloatParts pr = sqrt_float(pa, status, &float16_params); return float16_round_pack_canonical(pr, status); } -float32 __attribute__((flatten)) float32_sqrt(float32 a, float_status *status) +float32 QEMU_FLATTEN float32_sqrt(float32 a, float_status *status) { FloatParts pa = float32_unpack_canonical(a, status); FloatParts pr = sqrt_float(pa, status, &float32_params); return float32_round_pack_canonical(pr, status); } -float64 __attribute__((flatten)) float64_sqrt(float64 a, float_status *status) +float64 QEMU_FLATTEN float64_sqrt(float64 a, float_status *status) { FloatParts pa = float64_unpack_canonical(a, status); FloatParts pr = sqrt_float(pa, status, &float64_params); diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index bf47e7bee4..66f8c241dc 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -131,6 +131,21 @@ #define HAS_ASSUME_ALIGNED #endif +#ifndef __has_attribute +#define __has_attribute(x) 0 /* compatibility with older GCC */ +#endif + +/* + * GCC doesn't provide __has_attribute() until GCC 5, but we know all the GCC + * versions we support have the "flatten" attribute. Clang may not have the + * "flatten" attribute but always has __has_attribute() to check for it. + */ +#if __has_attribute(flatten) || !defined(__clang__) +# define QEMU_FLATTEN __attribute__((flatten)) +#else +# define QEMU_FLATTEN +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) From 8c827c53c50c4e6212e41c0582ae0f20d5724aa8 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Oct 2018 11:39:40 +0200 Subject: [PATCH 12/15] hw/core/generic-loader: Set a category for the generic-loader device Each device that is instantiatable by the users should be marked with a category. Since the generic-loader does not fit anywhere else, put it into the MISC category. Reviewed-by: Alistair Francis Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- hw/core/generic-loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index fde32cbda1..be29ae12b8 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -204,6 +204,7 @@ static void generic_loader_class_init(ObjectClass *klass, void *data) dc->unrealize = generic_loader_unrealize; dc->props = generic_loader_props; dc->desc = "Generic Loader"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); } static TypeInfo generic_loader_info = { From c95ac10340ec42d2e8828b5ddab1c9d0c15dbc0e Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Oct 2018 14:46:02 +0200 Subject: [PATCH 13/15] cpu: Provide a proper prototype for target_words_bigendian() in a header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've got three places already that provide a prototype for this function in a .c file - that's ugly. Let's provide a proper prototype in a header instead, with a proper description why this function should not be used in most cases. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laszlo Ersek Signed-off-by: Thomas Huth --- exec.c | 5 ----- hw/virtio/virtio.c | 1 - include/qom/cpu.h | 11 +++++++++++ qom/cpu.c | 1 - 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/exec.c b/exec.c index d0821e69aa..5d99ef5c93 100644 --- a/exec.c +++ b/exec.c @@ -3906,11 +3906,6 @@ int qemu_target_page_bits_min(void) } #endif -/* - * A helper function for the _utterly broken_ virtio device model to find out if - * it's running on a big endian machine. Don't do this at home kids! - */ -bool target_words_bigendian(void); bool target_words_bigendian(void) { #if defined(TARGET_WORDS_BIGENDIAN) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 94f5c8e52a..4e61944f14 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1169,7 +1169,6 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val) return 0; } -bool target_words_bigendian(void); static enum virtio_device_endian virtio_default_endian(void) { if (target_words_bigendian()) { diff --git a/include/qom/cpu.h b/include/qom/cpu.h index dc130cd307..4e238b0d9f 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -1085,6 +1085,17 @@ void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); +/** + * target_words_bigendian: + * Returns true if the (default) endianness of the target is big endian, + * false otherwise. Note that in target-specific code, you can use + * TARGET_WORDS_BIGENDIAN directly instead. On the other hand, common + * code should normally never need to know about the endianness of the + * target, so please do *not* use this function unless you know very well + * what you are doing! + */ +bool target_words_bigendian(void); + #ifdef NEED_CPU_H #ifdef CONFIG_SOFTMMU diff --git a/qom/cpu.c b/qom/cpu.c index 92599f3541..f7746546d0 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -194,7 +194,6 @@ static bool cpu_common_debug_check_watchpoint(CPUState *cpu, CPUWatchpoint *wp) return true; } -bool target_words_bigendian(void); static bool cpu_common_virtio_is_big_endian(CPUState *cpu) { return target_words_bigendian(); From 1a1ff38c55fac562f53ef65cf5022acba2b36676 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Oct 2018 14:53:38 +0200 Subject: [PATCH 14/15] hw/core/generic-loader: Compile only once, not for each target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic-loader is currently compiled target specific due to one single "#ifdef TARGET_WORDS_BIGENDIAN" in the file. We have already a function called target_words_bigendian() for this instead, so we can put the generic-loader into common-obj to save some compilation time. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Laszlo Ersek Reviewed-by: Alistair Francis Signed-off-by: Thomas Huth --- hw/core/Makefile.objs | 2 +- hw/core/generic-loader.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index eb88ca979e..b736ce223a 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -20,6 +20,6 @@ common-obj-$(CONFIG_SOFTMMU) += register.o common-obj-$(CONFIG_SOFTMMU) += or-irq.o common-obj-$(CONFIG_SOFTMMU) += split-irq.o common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o +common-obj-$(CONFIG_SOFTMMU) += generic-loader.o -obj-$(CONFIG_SOFTMMU) += generic-loader.o obj-$(CONFIG_SOFTMMU) += null-machine.o diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index be29ae12b8..fbae05fb3b 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -130,11 +130,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp) s->cpu = first_cpu; } -#ifdef TARGET_WORDS_BIGENDIAN - big_endian = 1; -#else - big_endian = 0; -#endif + big_endian = target_words_bigendian(); if (s->file) { AddressSpace *as = s->cpu ? s->cpu->as : NULL; From 7fc527cdc9cfd139dee1d90e3220a884229a7698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 3 Oct 2018 17:20:41 +0400 Subject: [PATCH 15/15] configure: remove glib_subprocess check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should have been removed as part of commit 692fbdf9f4c6f6bafd0b3a4d4f94973effd3bbae. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- configure | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure b/configure index 8af2be959f..9138af37f8 100755 --- a/configure +++ b/configure @@ -3531,12 +3531,6 @@ if ! compile_prog "$CFLAGS" "$LIBS" ; then "build target" fi -# g_test_trap_subprocess added in 2.38. Used by some tests. -glib_subprocess=yes -if ! $pkg_config --atleast-version=2.38 glib-2.0; then - glib_subprocess=no -fi - # Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage cat > $TMPC << EOF #include