yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-tcg-rearm-the-CKC-timer-during-migration.patch

ae23c9
From 2c2a89b2c366969ef32d9ede7ff0af92d22eee10 Mon Sep 17 00:00:00 2001
ae23c9
From: David Hildenbrand <david@redhat.com>
ae23c9
Date: Fri, 21 Dec 2018 15:36:10 +0000
ae23c9
Subject: [PATCH 08/22] s390x/tcg: rearm the CKC timer during migration
ae23c9
ae23c9
RH-Author: David Hildenbrand <david@redhat.com>
ae23c9
Message-id: <20181221153614.27961-9-david@redhat.com>
ae23c9
Patchwork-id: 83752
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm v2 PATCH 08/12] s390x/tcg: rearm the CKC timer during migration
ae23c9
Bugzilla: 1653569
ae23c9
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
ae23c9
If the CPU data is migrated after the TOD clock, the CKC timer of a CPU
ae23c9
is not rearmed. Let's rearm it when loading the CPU state.
ae23c9
ae23c9
Introduce tcg-stub.c just like kvm-stub.c for tcg specific stubs.
ae23c9
ae23c9
Reviewed-by: Thomas Huth <thuth@redhat.com>
ae23c9
Signed-off-by: David Hildenbrand <david@redhat.com>
ae23c9
Message-Id: <20180627134410.4901-9-david@redhat.com>
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
(cherry picked from commit 7c12f710bad60dc7e509da4e80c77e952ef0490c)
ae23c9
Signed-off-by: David Hildenbrand <david@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 target/s390x/Makefile.objs |  1 +
ae23c9
 target/s390x/machine.c     |  6 ++++++
ae23c9
 target/s390x/tcg-stub.c    | 20 ++++++++++++++++++++
ae23c9
 3 files changed, 27 insertions(+)
ae23c9
 create mode 100644 target/s390x/tcg-stub.c
ae23c9
ae23c9
diff --git a/target/s390x/Makefile.objs b/target/s390x/Makefile.objs
ae23c9
index 31932de..22a9a99 100644
ae23c9
--- a/target/s390x/Makefile.objs
ae23c9
+++ b/target/s390x/Makefile.objs
ae23c9
@@ -5,6 +5,7 @@ obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o diag.o
ae23c9
 obj-$(CONFIG_SOFTMMU) += sigp.o
ae23c9
 obj-$(CONFIG_KVM) += kvm.o
ae23c9
 obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
ae23c9
+obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o
ae23c9
 
ae23c9
 # build and run feature list generator
ae23c9
 feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
ae23c9
diff --git a/target/s390x/machine.c b/target/s390x/machine.c
ae23c9
index 8421deb..cb792aa 100644
ae23c9
--- a/target/s390x/machine.c
ae23c9
+++ b/target/s390x/machine.c
ae23c9
@@ -19,6 +19,7 @@
ae23c9
 #include "cpu.h"
ae23c9
 #include "internal.h"
ae23c9
 #include "kvm_s390x.h"
ae23c9
+#include "tcg_s390x.h"
ae23c9
 #include "sysemu/kvm.h"
ae23c9
 
ae23c9
 static int cpu_post_load(void *opaque, int version_id)
ae23c9
@@ -34,6 +35,11 @@ static int cpu_post_load(void *opaque, int version_id)
ae23c9
         return kvm_s390_vcpu_interrupt_post_load(cpu);
ae23c9
     }
ae23c9
 
ae23c9
+    if (tcg_enabled()) {
ae23c9
+        /* Rearm the CKC timer if necessary */
ae23c9
+        tcg_s390_tod_updated(CPU(cpu), RUN_ON_CPU_NULL);
ae23c9
+    }
ae23c9
+
ae23c9
     return 0;
ae23c9
 }
ae23c9
 
ae23c9
diff --git a/target/s390x/tcg-stub.c b/target/s390x/tcg-stub.c
ae23c9
new file mode 100644
ae23c9
index 0000000..c93501d
ae23c9
--- /dev/null
ae23c9
+++ b/target/s390x/tcg-stub.c
ae23c9
@@ -0,0 +1,20 @@
ae23c9
+/*
ae23c9
+ * QEMU TCG support -- s390x specific function stubs.
ae23c9
+ *
ae23c9
+ * Copyright (C) 2018 Red Hat Inc
ae23c9
+ *
ae23c9
+ * Authors:
ae23c9
+ *   David Hildenbrand <david@redhat.com>
ae23c9
+ *
ae23c9
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
ae23c9
+ * See the COPYING file in the top-level directory.
ae23c9
+ */
ae23c9
+
ae23c9
+#include "qemu/osdep.h"
ae23c9
+#include "qemu-common.h"
ae23c9
+#include "cpu.h"
ae23c9
+#include "tcg_s390x.h"
ae23c9
+
ae23c9
+void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque)
ae23c9
+{
ae23c9
+}
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9