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

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