aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-02 17:17:09 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-02 17:17:10 +0100
commitf62d632f4328fab02682335ba1ccfdbd9893d33d (patch)
treecca49d78c7df6ac7ab137c7139f812b3ec6ef101
parent8482ff2eb3bb95020eb2f370a9b3ea26511e41df (diff)
parentaff39be0ed9753c9c323f64a14f5533dd5c43525 (diff)
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-05-02' into staging
- Move qtest accel code to accel/qtest.c, get rid of AccelClass->available - Test TCG interpreter in gitlab-ci - Small improvements to the configure script - Use object_initialize_child in hw/pci-host # gpg: Signature made Thu 02 May 2019 17:07:34 BST # gpg: using RSA key 2ED9D774FE702DB5 # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth-gitlab/tags/pull-request-2019-05-02: hw/pci-host: Use object_initialize_child for correct reference counting configure: Relax check for libseccomp configure: Remove old *-config-devices.mak.d files when running configure configure: Add -Wno-typedef-redefinition to CFLAGS (for Clang) accel: Remove unused AccelClass::available field qtest: Don't compile qtest accel on non-POSIX systems qtest: Move accel code to accel/qtest.c gitlab-ci.yml: Test the TCG interpreter in a CI pipeline Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--.gitlab-ci.yml15
-rw-r--r--MAINTAINERS1
-rw-r--r--accel/Makefile.objs1
-rw-r--r--accel/accel.c5
-rw-r--r--accel/qtest.c54
-rwxr-xr-xconfigure33
-rw-r--r--hw/pci-host/designware.c4
-rw-r--r--hw/pci-host/gpex.c5
-rw-r--r--hw/pci-host/q35.c4
-rw-r--r--hw/pci-host/xilinx-pcie.c4
-rw-r--r--include/sysemu/accel.h1
-rw-r--r--include/sysemu/qtest.h9
-rw-r--r--qtest.c34
13 files changed, 88 insertions, 82 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 79d02cf740..c63bf2f822 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -71,3 +71,18 @@ build-clang:
ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
- make -j2
- make -j2 check
+
+build-tci:
+ script:
+ - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
+ - ./configure --enable-tcg-interpreter
+ --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
+ - make -j2
+ - make tests/boot-serial-test tests/cdrom-test tests/pxe-test
+ - for tg in $TARGETS ; do
+ export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
+ ./tests/boot-serial-test || exit 1 ;
+ ./tests/cdrom-test || exit 1 ;
+ done
+ - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/pxe-test
+ - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x" ./tests/pxe-test -m slow
diff --git a/MAINTAINERS b/MAINTAINERS
index 7dd71e0a2d..66ddbda9c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2035,6 +2035,7 @@ M: Laurent Vivier <lvivier@redhat.com>
R: Paolo Bonzini <pbonzini@redhat.com>
S: Maintained
F: qtest.c
+F: accel/qtest.c
F: tests/libqtest.*
F: tests/libqos/
F: tests/*-test.c
diff --git a/accel/Makefile.objs b/accel/Makefile.objs
index c3718a10c5..8b498d39d8 100644
--- a/accel/Makefile.objs
+++ b/accel/Makefile.objs
@@ -1,4 +1,5 @@
obj-$(CONFIG_SOFTMMU) += accel.o
+obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o
obj-$(CONFIG_KVM) += kvm/
obj-$(CONFIG_TCG) += tcg/
obj-y += stubs/
diff --git a/accel/accel.c b/accel/accel.c
index 454fef9d92..5fa31717b4 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -107,11 +107,6 @@ void configure_accelerator(MachineState *ms, const char *progname)
if (!acc) {
continue;
}
- if (acc->available && !acc->available()) {
- printf("%s not supported for this target\n",
- acc->name);
- continue;
- }
ret = accel_init_machine(acc, ms);
if (ret < 0) {
init_failed = true;
diff --git a/accel/qtest.c b/accel/qtest.c
new file mode 100644
index 0000000000..5b88f55921
--- /dev/null
+++ b/accel/qtest.c
@@ -0,0 +1,54 @@
+/*
+ * QTest accelerator code
+ *
+ * Copyright IBM, Corp. 2011
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qemu/module.h"
+#include "qemu/option.h"
+#include "qemu/config-file.h"
+#include "sysemu/accel.h"
+#include "sysemu/qtest.h"
+#include "sysemu/cpus.h"
+
+static int qtest_init_accel(MachineState *ms)
+{
+ QemuOpts *opts = qemu_opts_create(qemu_find_opts("icount"), NULL, 0,
+ &error_abort);
+ qemu_opt_set(opts, "shift", "0", &error_abort);
+ configure_icount(opts, &error_abort);
+ qemu_opts_del(opts);
+ return 0;
+}
+
+static void qtest_accel_class_init(ObjectClass *oc, void *data)
+{
+ AccelClass *ac = ACCEL_CLASS(oc);
+ ac->name = "QTest";
+ ac->init_machine = qtest_init_accel;
+ ac->allowed = &qtest_allowed;
+}
+
+#define TYPE_QTEST_ACCEL ACCEL_CLASS_NAME("qtest")
+
+static const TypeInfo qtest_accel_type = {
+ .name = TYPE_QTEST_ACCEL,
+ .parent = TYPE_ACCEL,
+ .class_init = qtest_accel_class_init,
+};
+
+static void qtest_type_init(void)
+{
+ type_register_static(&qtest_accel_type);
+}
+
+type_init(qtest_type_init);
diff --git a/configure b/configure
index 60719ddcc5..3a9bee2621 100755
--- a/configure
+++ b/configure
@@ -1818,6 +1818,9 @@ EOF
exit 0
fi
+# Remove old dependency files to make sure that they get properly regenerated
+rm -f *-config-devices.mak.d
+
if ! has $python; then
error_exit "Python not found. Use --python=/path/to/python"
fi
@@ -1908,7 +1911,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_
gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
-gcc_flags="-Wno-string-plus-int $gcc_flags"
+gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
# enable it for all configure tests. If a configure test failed due
# to -Werror this would just silently disable some features,
@@ -2371,36 +2374,16 @@ fi
##########################################
# libseccomp check
-libseccomp_minver="2.2.0"
if test "$seccomp" != "no" ; then
- case "$cpu" in
- i386|x86_64|mips)
- ;;
- arm|aarch64)
- libseccomp_minver="2.2.3"
- ;;
- ppc|ppc64|s390x)
- libseccomp_minver="2.3.0"
- ;;
- *)
- libseccomp_minver=""
- ;;
- esac
-
- if test "$libseccomp_minver" != "" &&
- $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
+ libseccomp_minver="2.3.0"
+ if $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
seccomp_cflags="$($pkg_config --cflags libseccomp)"
seccomp_libs="$($pkg_config --libs libseccomp)"
seccomp="yes"
else
if test "$seccomp" = "yes" ; then
- if test "$libseccomp_minver" != "" ; then
- feature_not_found "libseccomp" \
- "Install libseccomp devel >= $libseccomp_minver"
- else
- feature_not_found "libseccomp" \
- "libseccomp is not supported for host cpu $cpu"
- fi
+ feature_not_found "libseccomp" \
+ "Install libseccomp devel >= $libseccomp_minver"
fi
seccomp="no"
fi
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 29ea313798..64ad21d295 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -721,8 +721,8 @@ static void designware_pcie_host_init(Object *obj)
DesignwarePCIEHost *s = DESIGNWARE_PCIE_HOST(obj);
DesignwarePCIERoot *root = &s->root;
- object_initialize(root, sizeof(*root), TYPE_DESIGNWARE_PCIE_ROOT);
- object_property_add_child(obj, "root", OBJECT(root), NULL);
+ object_initialize_child(obj, "root", root, sizeof(*root),
+ TYPE_DESIGNWARE_PCIE_ROOT, &error_abort, NULL);
qdev_prop_set_int32(DEVICE(root), "addr", PCI_DEVFN(0, 0));
qdev_prop_set_bit(DEVICE(root), "multifunction", false);
}
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index 2583b151a4..1bafffcc34 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -29,6 +29,7 @@
* http://www.firmware.org/1275/practice/imap/imap0_9d.pdf
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/hw.h"
#include "hw/pci-host/gpex.h"
@@ -120,8 +121,8 @@ static void gpex_host_initfn(Object *obj)
GPEXHost *s = GPEX_HOST(obj);
GPEXRootState *root = &s->gpex_root;
- object_initialize(root, sizeof(*root), TYPE_GPEX_ROOT_DEVICE);
- object_property_add_child(obj, "gpex_root", OBJECT(root), NULL);
+ object_initialize_child(obj, "gpex_root", root, sizeof(*root),
+ TYPE_GPEX_ROOT_DEVICE, &error_abort, NULL);
qdev_prop_set_int32(DEVICE(root), "addr", PCI_DEVFN(0, 0));
qdev_prop_set_bit(DEVICE(root), "multifunction", false);
}
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 7b871b5734..960939f5ed 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -216,8 +216,8 @@ static void q35_host_initfn(Object *obj)
memory_region_init_io(&phb->data_mem, obj, &pci_host_data_le_ops, phb,
"pci-conf-data", 4);
- object_initialize(&s->mch, sizeof(s->mch), TYPE_MCH_PCI_DEVICE);
- object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL);
+ object_initialize_child(OBJECT(s), "mch", &s->mch, sizeof(s->mch),
+ TYPE_MCH_PCI_DEVICE, &error_abort, NULL);
qdev_prop_set_int32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0));
qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false);
/* mch's object_initialize resets the default value, set it again */
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index 60309afe9e..ceb00e23e6 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -149,8 +149,8 @@ static void xilinx_pcie_host_init(Object *obj)
XilinxPCIEHost *s = XILINX_PCIE_HOST(obj);
XilinxPCIERoot *root = &s->root;
- object_initialize(root, sizeof(*root), TYPE_XILINX_PCIE_ROOT);
- object_property_add_child(obj, "root", OBJECT(root), NULL);
+ object_initialize_child(obj, "root", root, sizeof(*root),
+ TYPE_XILINX_PCIE_ROOT, &error_abort, NULL);
qdev_prop_set_int32(DEVICE(root), "addr", PCI_DEVFN(0, 0));
qdev_prop_set_bit(DEVICE(root), "multifunction", false);
}
diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
index 5565e00a96..70e9e2f2a1 100644
--- a/include/sysemu/accel.h
+++ b/include/sysemu/accel.h
@@ -38,7 +38,6 @@ typedef struct AccelClass {
const char *opt_name;
const char *name;
- int (*available)(void);
int (*init_machine)(MachineState *ms);
void (*setup_post)(MachineState *ms, AccelState *accel);
bool *allowed;
diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h
index 70aa40aa72..096ddfc20c 100644
--- a/include/sysemu/qtest.h
+++ b/include/sysemu/qtest.h
@@ -27,13 +27,4 @@ bool qtest_driver(void);
void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
-static inline int qtest_available(void)
-{
-#ifdef CONFIG_POSIX
- return 1;
-#else
- return 0;
-#endif
-}
-
#endif
diff --git a/qtest.c b/qtest.c
index 527141785f..f2e2f27778 100644
--- a/qtest.c
+++ b/qtest.c
@@ -749,16 +749,6 @@ static void qtest_event(void *opaque, int event)
}
}
-static int qtest_init_accel(MachineState *ms)
-{
- QemuOpts *opts = qemu_opts_create(qemu_find_opts("icount"), NULL, 0,
- &error_abort);
- qemu_opt_set(opts, "shift", "0", &error_abort);
- configure_icount(opts, &error_abort);
- qemu_opts_del(opts);
- return 0;
-}
-
void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
{
Chardev *chr;
@@ -791,27 +781,3 @@ bool qtest_driver(void)
{
return qtest_chr.chr != NULL;
}
-
-static void qtest_accel_class_init(ObjectClass *oc, void *data)
-{
- AccelClass *ac = ACCEL_CLASS(oc);
- ac->name = "QTest";
- ac->available = qtest_available;
- ac->init_machine = qtest_init_accel;
- ac->allowed = &qtest_allowed;
-}
-
-#define TYPE_QTEST_ACCEL ACCEL_CLASS_NAME("qtest")
-
-static const TypeInfo qtest_accel_type = {
- .name = TYPE_QTEST_ACCEL,
- .parent = TYPE_ACCEL,
- .class_init = qtest_accel_class_init,
-};
-
-static void qtest_type_init(void)
-{
- type_register_static(&qtest_accel_type);
-}
-
-type_init(qtest_type_init);