Blame SOURCES/kvm-s390x-tod-factor-out-TOD-into-separate-device.patch

28c80a
From eb4b0282363c6149a05d6b00b0b7d40535715598 Mon Sep 17 00:00:00 2001
28c80a
From: David Hildenbrand <david@redhat.com>
28c80a
Date: Fri, 21 Dec 2018 15:39:48 +0100
28c80a
Subject: [PATCH 04/14] s390x/tod: factor out TOD into separate device
28c80a
28c80a
RH-Author: David Hildenbrand <david@redhat.com>
28c80a
Message-id: <20181221153957.28183-4-david@redhat.com>
28c80a
Patchwork-id: 83761
28c80a
O-Subject: [RHEL-7.6.z qemu-kvm-ma PATCH 03/12] s390x/tod: factor out TOD into separate device
28c80a
Bugzilla: 1672920
28c80a
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
28c80a
RH-Acked-by: Thomas Huth <thuth@redhat.com>
28c80a
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
28c80a
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
28c80a
28c80a
Conflicts:
28c80a
	hw/s390x/s390-virtio-ccw.c: contextual conflict (console init
28c80a
				    rework)
28c80a
28c80a
Let's treat this like a separate device. TCG will have to store the
28c80a
actual state/time later on.
28c80a
28c80a
Include cpu-qom.h in kvm_s390x.h (due to S390CPU) to compile tod-kvm.c.
28c80a
28c80a
Reviewed-by: Thomas Huth <thuth@redhat.com>
28c80a
Signed-off-by: David Hildenbrand <david@redhat.com>
28c80a
Message-Id: <20180627134410.4901-4-david@redhat.com>
28c80a
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
28c80a
(cherry picked from commit 8046f374a64b81fdf4f71f7a433bf4035d501521)
28c80a
Signed-off-by: David Hildenbrand <david@redhat.com>
28c80a
---
28c80a
 hw/s390x/Makefile.objs     |   3 ++
28c80a
 hw/s390x/s390-virtio-ccw.c |  57 ++--------------------
28c80a
 hw/s390x/tod-kvm.c         |  64 ++++++++++++++++++++++++
28c80a
 hw/s390x/tod-qemu.c        |  49 +++++++++++++++++++
28c80a
 hw/s390x/tod.c             | 119 +++++++++++++++++++++++++++++++++++++++++++++
28c80a
 include/hw/s390x/tod.h     |  46 ++++++++++++++++++
28c80a
 target/s390x/cpu.c         |  32 ------------
28c80a
 target/s390x/cpu.h         |   2 -
28c80a
 target/s390x/kvm_s390x.h   |   2 +
28c80a
 9 files changed, 286 insertions(+), 88 deletions(-)
28c80a
 create mode 100644 hw/s390x/tod-kvm.c
28c80a
 create mode 100644 hw/s390x/tod-qemu.c
28c80a
 create mode 100644 hw/s390x/tod.c
28c80a
 create mode 100644 include/hw/s390x/tod.h
28c80a
28c80a
diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs
28c80a
index dc704b5..93282f7 100644
28c80a
--- a/hw/s390x/Makefile.objs
28c80a
+++ b/hw/s390x/Makefile.objs
28c80a
@@ -14,6 +14,9 @@ obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
28c80a
 obj-$(call lnot,$(CONFIG_PCI)) += s390-pci-stub.o
28c80a
 obj-y += s390-skeys.o
28c80a
 obj-y += s390-stattrib.o
28c80a
+obj-y += tod.o
28c80a
+obj-$(CONFIG_KVM) += tod-kvm.o
28c80a
+obj-$(CONFIG_TCG) += tod-qemu.o
28c80a
 obj-$(CONFIG_KVM) += s390-skeys-kvm.o
28c80a
 obj-$(CONFIG_KVM) += s390-stattrib-kvm.o
28c80a
 obj-y += s390-ccw.o
28c80a
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
28c80a
index bf039a1..3429e55 100644
28c80a
--- a/hw/s390x/s390-virtio-ccw.c
28c80a
+++ b/hw/s390x/s390-virtio-ccw.c
28c80a
@@ -35,6 +35,7 @@
28c80a
 #include "migration/register.h"
28c80a
 #include "cpu_models.h"
28c80a
 #include "hw/nmi.h"
28c80a
+#include "hw/s390x/tod.h"
28c80a
 
28c80a
 S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)
28c80a
 {
28c80a
@@ -187,58 +188,6 @@ static void s390_memory_init(ram_addr_t mem_size)
28c80a
     s390_stattrib_init();
28c80a
 }
28c80a
 
28c80a
-#define S390_TOD_CLOCK_VALUE_MISSING    0x00
28c80a
-#define S390_TOD_CLOCK_VALUE_PRESENT    0x01
28c80a
-
28c80a
-static void gtod_save(QEMUFile *f, void *opaque)
28c80a
-{
28c80a
-    uint64_t tod_low;
28c80a
-    uint8_t tod_high;
28c80a
-    int r;
28c80a
-
28c80a
-    r = s390_get_clock(&tod_high, &tod_low);
28c80a
-    if (r) {
28c80a
-        warn_report("Unable to get guest clock for migration: %s",
28c80a
-                    strerror(-r));
28c80a
-        error_printf("Guest clock will not be migrated "
28c80a
-                     "which could cause the guest to hang.");
28c80a
-        qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING);
28c80a
-        return;
28c80a
-    }
28c80a
-
28c80a
-    qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT);
28c80a
-    qemu_put_byte(f, tod_high);
28c80a
-    qemu_put_be64(f, tod_low);
28c80a
-}
28c80a
-
28c80a
-static int gtod_load(QEMUFile *f, void *opaque, int version_id)
28c80a
-{
28c80a
-    uint64_t tod_low;
28c80a
-    uint8_t tod_high;
28c80a
-    int r;
28c80a
-
28c80a
-    if (qemu_get_byte(f) == S390_TOD_CLOCK_VALUE_MISSING) {
28c80a
-        warn_report("Guest clock was not migrated. This could "
28c80a
-                    "cause the guest to hang.");
28c80a
-        return 0;
28c80a
-    }
28c80a
-
28c80a
-    tod_high = qemu_get_byte(f);
28c80a
-    tod_low = qemu_get_be64(f);
28c80a
-
28c80a
-    r = s390_set_clock(&tod_high, &tod_low);
28c80a
-    if (r) {
28c80a
-        error_report("Unable to set KVM guest TOD clock: %s", strerror(-r));
28c80a
-    }
28c80a
-
28c80a
-    return r;
28c80a
-}
28c80a
-
28c80a
-static SaveVMHandlers savevm_gtod = {
28c80a
-    .save_state = gtod_save,
28c80a
-    .load_state = gtod_load,
28c80a
-};
28c80a
-
28c80a
 static void s390_init_ipl_dev(const char *kernel_filename,
28c80a
                               const char *kernel_cmdline,
28c80a
                               const char *initrd_filename, const char *firmware,
28c80a
@@ -346,8 +295,8 @@ static void ccw_init(MachineState *machine)
28c80a
     /* Create VirtIO network adapters */
28c80a
     s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
28c80a
 
28c80a
-    /* Register savevm handler for guest TOD clock */
28c80a
-    register_savevm_live(NULL, "todclock", 0, 1, &savevm_gtod, NULL);
28c80a
+    /* init the TOD clock */
28c80a
+    s390_init_tod();
28c80a
 }
28c80a
 
28c80a
 static void s390_cpu_plug(HotplugHandler *hotplug_dev,
28c80a
diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c
28c80a
new file mode 100644
28c80a
index 0000000..df564ab
28c80a
--- /dev/null
28c80a
+++ b/hw/s390x/tod-kvm.c
28c80a
@@ -0,0 +1,64 @@
28c80a
+/*
28c80a
+ * TOD (Time Of Day) clock - KVM implementation
28c80a
+ *
28c80a
+ * Copyright 2018 Red Hat, Inc.
28c80a
+ * Author(s): David Hildenbrand <david@redhat.com>
28c80a
+ *
28c80a
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
28c80a
+ * See the COPYING file in the top-level directory.
28c80a
+ */
28c80a
+
28c80a
+#include "qemu/osdep.h"
28c80a
+#include "qapi/error.h"
28c80a
+#include "hw/s390x/tod.h"
28c80a
+#include "kvm_s390x.h"
28c80a
+
28c80a
+static void kvm_s390_tod_get(const S390TODState *td, S390TOD *tod, Error **errp)
28c80a
+{
28c80a
+    int r;
28c80a
+
28c80a
+    r = kvm_s390_get_clock_ext(&tod->high, &tod->low);
28c80a
+    if (r == -ENXIO) {
28c80a
+        r = kvm_s390_get_clock(&tod->high, &tod->low);
28c80a
+    }
28c80a
+    if (r) {
28c80a
+        error_setg(errp, "Unable to get KVM guest TOD clock: %s",
28c80a
+                   strerror(-r));
28c80a
+    }
28c80a
+}
28c80a
+
28c80a
+static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp)
28c80a
+{
28c80a
+    int r;
28c80a
+
28c80a
+    r = kvm_s390_set_clock_ext(tod->high, tod->low);
28c80a
+    if (r == -ENXIO) {
28c80a
+        r = kvm_s390_set_clock(tod->high, tod->low);
28c80a
+    }
28c80a
+    if (r) {
28c80a
+        error_setg(errp, "Unable to set KVM guest TOD clock: %s",
28c80a
+                   strerror(-r));
28c80a
+    }
28c80a
+}
28c80a
+
28c80a
+static void kvm_s390_tod_class_init(ObjectClass *oc, void *data)
28c80a
+{
28c80a
+    S390TODClass *tdc = S390_TOD_CLASS(oc);
28c80a
+
28c80a
+    tdc->get = kvm_s390_tod_get;
28c80a
+    tdc->set = kvm_s390_tod_set;
28c80a
+}
28c80a
+
28c80a
+static TypeInfo kvm_s390_tod_info = {
28c80a
+    .name = TYPE_KVM_S390_TOD,
28c80a
+    .parent = TYPE_S390_TOD,
28c80a
+    .instance_size = sizeof(S390TODState),
28c80a
+    .class_init = kvm_s390_tod_class_init,
28c80a
+    .class_size = sizeof(S390TODClass),
28c80a
+};
28c80a
+
28c80a
+static void register_types(void)
28c80a
+{
28c80a
+    type_register_static(&kvm_s390_tod_info);
28c80a
+}
28c80a
+type_init(register_types);
28c80a
diff --git a/hw/s390x/tod-qemu.c b/hw/s390x/tod-qemu.c
28c80a
new file mode 100644
28c80a
index 0000000..03ea1ce
28c80a
--- /dev/null
28c80a
+++ b/hw/s390x/tod-qemu.c
28c80a
@@ -0,0 +1,49 @@
28c80a
+/*
28c80a
+ * TOD (Time Of Day) clock - QEMU implementation
28c80a
+ *
28c80a
+ * Copyright 2018 Red Hat, Inc.
28c80a
+ * Author(s): David Hildenbrand <david@redhat.com>
28c80a
+ *
28c80a
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
28c80a
+ * See the COPYING file in the top-level directory.
28c80a
+ */
28c80a
+
28c80a
+#include "qemu/osdep.h"
28c80a
+#include "qapi/error.h"
28c80a
+#include "hw/s390x/tod.h"
28c80a
+
28c80a
+static void qemu_s390_tod_get(const S390TODState *td, S390TOD *tod,
28c80a
+                              Error **errp)
28c80a
+{
28c80a
+    /* FIXME */
28c80a
+    tod->high = 0;
28c80a
+    tod->low = 0;
28c80a
+}
28c80a
+
28c80a
+static void qemu_s390_tod_set(S390TODState *td, const S390TOD *tod,
28c80a
+                              Error **errp)
28c80a
+{
28c80a
+    /* FIXME */
28c80a
+}
28c80a
+
28c80a
+static void qemu_s390_tod_class_init(ObjectClass *oc, void *data)
28c80a
+{
28c80a
+    S390TODClass *tdc = S390_TOD_CLASS(oc);
28c80a
+
28c80a
+    tdc->get = qemu_s390_tod_get;
28c80a
+    tdc->set = qemu_s390_tod_set;
28c80a
+}
28c80a
+
28c80a
+static TypeInfo qemu_s390_tod_info = {
28c80a
+    .name = TYPE_QEMU_S390_TOD,
28c80a
+    .parent = TYPE_S390_TOD,
28c80a
+    .instance_size = sizeof(S390TODState),
28c80a
+    .class_init = qemu_s390_tod_class_init,
28c80a
+    .class_size = sizeof(S390TODClass),
28c80a
+};
28c80a
+
28c80a
+static void register_types(void)
28c80a
+{
28c80a
+    type_register_static(&qemu_s390_tod_info);
28c80a
+}
28c80a
+type_init(register_types);
28c80a
diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c
28c80a
new file mode 100644
28c80a
index 0000000..0501aff
28c80a
--- /dev/null
28c80a
+++ b/hw/s390x/tod.c
28c80a
@@ -0,0 +1,119 @@
28c80a
+/*
28c80a
+ * TOD (Time Of Day) clock
28c80a
+ *
28c80a
+ * Copyright 2018 Red Hat, Inc.
28c80a
+ * Author(s): David Hildenbrand <david@redhat.com>
28c80a
+ *
28c80a
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
28c80a
+ * See the COPYING file in the top-level directory.
28c80a
+ */
28c80a
+
28c80a
+#include "qemu/osdep.h"
28c80a
+#include "hw/s390x/tod.h"
28c80a
+#include "qapi/error.h"
28c80a
+#include "qemu/error-report.h"
28c80a
+#include "sysemu/kvm.h"
28c80a
+#include "migration/register.h"
28c80a
+
28c80a
+void s390_init_tod(void)
28c80a
+{
28c80a
+    Object *obj;
28c80a
+
28c80a
+    if (kvm_enabled()) {
28c80a
+        obj = object_new(TYPE_KVM_S390_TOD);
28c80a
+    } else {
28c80a
+        obj = object_new(TYPE_QEMU_S390_TOD);
28c80a
+    }
28c80a
+    object_property_add_child(qdev_get_machine(), TYPE_S390_TOD, obj, NULL);
28c80a
+    object_unref(obj);
28c80a
+
28c80a
+    qdev_init_nofail(DEVICE(obj));
28c80a
+}
28c80a
+
28c80a
+#define S390_TOD_CLOCK_VALUE_MISSING    0x00
28c80a
+#define S390_TOD_CLOCK_VALUE_PRESENT    0x01
28c80a
+
28c80a
+static void s390_tod_save(QEMUFile *f, void *opaque)
28c80a
+{
28c80a
+    S390TODState *td = opaque;
28c80a
+    S390TODClass *tdc = S390_TOD_GET_CLASS(td);
28c80a
+    Error *err = NULL;
28c80a
+    S390TOD tod;
28c80a
+
28c80a
+    tdc->get(td, &tod, &err;;
28c80a
+    if (err) {
28c80a
+        warn_report_err(err);
28c80a
+        error_printf("Guest clock will not be migrated "
28c80a
+                     "which could cause the guest to hang.");
28c80a
+        qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING);
28c80a
+        return;
28c80a
+    }
28c80a
+
28c80a
+    qemu_put_byte(f, S390_TOD_CLOCK_VALUE_PRESENT);
28c80a
+    qemu_put_byte(f, tod.high);
28c80a
+    qemu_put_be64(f, tod.low);
28c80a
+}
28c80a
+
28c80a
+static int s390_tod_load(QEMUFile *f, void *opaque, int version_id)
28c80a
+{
28c80a
+    S390TODState *td = opaque;
28c80a
+    S390TODClass *tdc = S390_TOD_GET_CLASS(td);
28c80a
+    Error *err = NULL;
28c80a
+    S390TOD tod;
28c80a
+
28c80a
+    if (qemu_get_byte(f) == S390_TOD_CLOCK_VALUE_MISSING) {
28c80a
+        warn_report("Guest clock was not migrated. This could "
28c80a
+                    "cause the guest to hang.");
28c80a
+        return 0;
28c80a
+    }
28c80a
+
28c80a
+    tod.high = qemu_get_byte(f);
28c80a
+    tod.low = qemu_get_be64(f);
28c80a
+
28c80a
+    tdc->set(td, &tod, &err;;
28c80a
+    if (err) {
28c80a
+        error_report_err(err);
28c80a
+        return -1;
28c80a
+    }
28c80a
+    return 0;
28c80a
+}
28c80a
+
28c80a
+static SaveVMHandlers savevm_tod = {
28c80a
+    .save_state = s390_tod_save,
28c80a
+    .load_state = s390_tod_load,
28c80a
+};
28c80a
+
28c80a
+static void s390_tod_realize(DeviceState *dev, Error **errp)
28c80a
+{
28c80a
+    S390TODState *td = S390_TOD(dev);
28c80a
+
28c80a
+    /* Legacy migration interface */
28c80a
+    register_savevm_live(NULL, "todclock", 0, 1, &savevm_tod, td);
28c80a
+}
28c80a
+
28c80a
+static void s390_tod_class_init(ObjectClass *oc, void *data)
28c80a
+{
28c80a
+    DeviceClass *dc = DEVICE_CLASS(oc);
28c80a
+
28c80a
+    dc->desc = "TOD (Time Of Day) Clock";
28c80a
+    dc->realize = s390_tod_realize;
28c80a
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
28c80a
+
28c80a
+    /* We only have one TOD clock in the system attached to the machine */
28c80a
+    dc->user_creatable = false;
28c80a
+}
28c80a
+
28c80a
+static TypeInfo s390_tod_info = {
28c80a
+    .name = TYPE_S390_TOD,
28c80a
+    .parent = TYPE_DEVICE,
28c80a
+    .instance_size = sizeof(S390TODState),
28c80a
+    .class_init = s390_tod_class_init,
28c80a
+    .class_size = sizeof(S390TODClass),
28c80a
+    .abstract = true,
28c80a
+};
28c80a
+
28c80a
+static void register_types(void)
28c80a
+{
28c80a
+    type_register_static(&s390_tod_info);
28c80a
+}
28c80a
+type_init(register_types);
28c80a
diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h
28c80a
new file mode 100644
28c80a
index 0000000..7096b57
28c80a
--- /dev/null
28c80a
+++ b/include/hw/s390x/tod.h
28c80a
@@ -0,0 +1,46 @@
28c80a
+/*
28c80a
+ * TOD (Time Of Day) clock
28c80a
+ *
28c80a
+ * Copyright 2018 Red Hat, Inc.
28c80a
+ * Author(s): David Hildenbrand <david@redhat.com>
28c80a
+ *
28c80a
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
28c80a
+ * See the COPYING file in the top-level directory.
28c80a
+ */
28c80a
+
28c80a
+#ifndef HW_S390_TOD_H
28c80a
+#define HW_S390_TOD_H
28c80a
+
28c80a
+#include "hw/qdev.h"
28c80a
+
28c80a
+typedef struct S390TOD {
28c80a
+    uint8_t high;
28c80a
+    uint64_t low;
28c80a
+} S390TOD;
28c80a
+
28c80a
+#define TYPE_S390_TOD "s390-tod"
28c80a
+#define S390_TOD(obj) OBJECT_CHECK(S390TODState, (obj), TYPE_S390_TOD)
28c80a
+#define S390_TOD_CLASS(oc) OBJECT_CLASS_CHECK(S390TODClass, (oc), \
28c80a
+                                              TYPE_S390_TOD)
28c80a
+#define S390_TOD_GET_CLASS(obj) OBJECT_GET_CLASS(S390TODClass, (obj), \
28c80a
+                                                 TYPE_S390_TOD)
28c80a
+#define TYPE_KVM_S390_TOD TYPE_S390_TOD "-kvm"
28c80a
+#define TYPE_QEMU_S390_TOD TYPE_S390_TOD "-qemu"
28c80a
+
28c80a
+typedef struct S390TODState {
28c80a
+    /* private */
28c80a
+    DeviceState parent_obj;
28c80a
+} S390TODState;
28c80a
+
28c80a
+typedef struct S390TODClass {
28c80a
+    /* private */
28c80a
+    DeviceClass parent_class;
28c80a
+
28c80a
+    /* public */
28c80a
+    void (*get)(const S390TODState *td, S390TOD *tod, Error **errp);
28c80a
+    void (*set)(S390TODState *td, const S390TOD *tod, Error **errp);
28c80a
+} S390TODClass;
28c80a
+
28c80a
+void s390_init_tod(void);
28c80a
+
28c80a
+#endif
28c80a
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
28c80a
index 1f590d1..167d089 100644
28c80a
--- a/target/s390x/cpu.c
28c80a
+++ b/target/s390x/cpu.c
28c80a
@@ -391,38 +391,6 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
28c80a
     return s390_count_running_cpus();
28c80a
 }
28c80a
 
28c80a
-int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
28c80a
-{
28c80a
-    int r = 0;
28c80a
-
28c80a
-    if (kvm_enabled()) {
28c80a
-        r = kvm_s390_get_clock_ext(tod_high, tod_low);
28c80a
-        if (r == -ENXIO) {
28c80a
-            return kvm_s390_get_clock(tod_high, tod_low);
28c80a
-        }
28c80a
-    } else {
28c80a
-        /* Fixme TCG */
28c80a
-        *tod_high = 0;
28c80a
-        *tod_low = 0;
28c80a
-    }
28c80a
-
28c80a
-    return r;
28c80a
-}
28c80a
-
28c80a
-int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
28c80a
-{
28c80a
-    int r = 0;
28c80a
-
28c80a
-    if (kvm_enabled()) {
28c80a
-        r = kvm_s390_set_clock_ext(*tod_high, *tod_low);
28c80a
-        if (r == -ENXIO) {
28c80a
-            return kvm_s390_set_clock(*tod_high, *tod_low);
28c80a
-        }
28c80a
-    }
28c80a
-    /* Fixme TCG */
28c80a
-    return r;
28c80a
-}
28c80a
-
28c80a
 int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
28c80a
 {
28c80a
     if (kvm_enabled()) {
28c80a
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
28c80a
index 86d08fa..67118c8 100644
28c80a
--- a/target/s390x/cpu.h
28c80a
+++ b/target/s390x/cpu.h
28c80a
@@ -691,8 +691,6 @@ static inline uint64_t s390_build_validity_mcic(void)
28c80a
 
28c80a
 
28c80a
 /* cpu.c */
28c80a
-int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low);
28c80a
-int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low);
28c80a
 void s390_crypto_reset(void);
28c80a
 bool s390_get_squash_mcss(void);
28c80a
 int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit);
28c80a
diff --git a/target/s390x/kvm_s390x.h b/target/s390x/kvm_s390x.h
28c80a
index 36eb34b..6e52287 100644
28c80a
--- a/target/s390x/kvm_s390x.h
28c80a
+++ b/target/s390x/kvm_s390x.h
28c80a
@@ -10,6 +10,8 @@
28c80a
 #ifndef KVM_S390X_H
28c80a
 #define KVM_S390X_H
28c80a
 
28c80a
+#include "cpu-qom.h"
28c80a
+
28c80a
 struct kvm_s390_irq;
28c80a
 
28c80a
 void kvm_s390_floating_interrupt_legacy(struct kvm_s390_irq *irq);
28c80a
-- 
28c80a
1.8.3.1
28c80a