thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
26ba25
From 76dfca00588aeb71d85bac7ee0e2cf89df0d5b15 Mon Sep 17 00:00:00 2001
26ba25
From: David Hildenbrand <david@redhat.com>
26ba25
Date: Fri, 21 Dec 2018 15:36:06 +0000
26ba25
Subject: [PATCH 04/22] s390x/tcg: drop tod_basetime
26ba25
26ba25
RH-Author: David Hildenbrand <david@redhat.com>
26ba25
Message-id: <20181221153614.27961-5-david@redhat.com>
26ba25
Patchwork-id: 83747
26ba25
O-Subject: [RHEL-8.0 qemu-kvm v2 PATCH 04/12] s390x/tcg: drop tod_basetime
26ba25
Bugzilla: 1653569
26ba25
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
26ba25
RH-Acked-by: Thomas Huth <thuth@redhat.com>
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
26ba25
Never set to anything but 0.
26ba25
26ba25
Reviewed-by: Thomas Huth <thuth@redhat.com>
26ba25
Signed-off-by: David Hildenbrand <david@redhat.com>
26ba25
Message-Id: <20180627134410.4901-5-david@redhat.com>
26ba25
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
26ba25
(cherry picked from commit f777b20544fe5db3de179a83374cbf9f1e454427)
26ba25
Signed-off-by: David Hildenbrand <david@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 target/s390x/cpu.c         | 1 -
26ba25
 target/s390x/cpu.h         | 1 -
26ba25
 target/s390x/misc_helper.c | 4 ++--
26ba25
 3 files changed, 2 insertions(+), 4 deletions(-)
26ba25
26ba25
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
26ba25
index 167d089..5570741 100644
26ba25
--- a/target/s390x/cpu.c
26ba25
+++ b/target/s390x/cpu.c
26ba25
@@ -290,7 +290,6 @@ static void s390_cpu_initfn(Object *obj)
26ba25
     qemu_get_timedate(&tm, 0);
26ba25
     env->tod_offset = TOD_UNIX_EPOCH +
26ba25
                       (time2tod(mktimegm(&tm)) * 1000000000ULL);
26ba25
-    env->tod_basetime = 0;
26ba25
     env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
26ba25
     env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
26ba25
     s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
26ba25
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
26ba25
index 67118c8..04f9adf 100644
26ba25
--- a/target/s390x/cpu.h
26ba25
+++ b/target/s390x/cpu.h
26ba25
@@ -134,7 +134,6 @@ struct CPUS390XState {
26ba25
 #endif
26ba25
 
26ba25
     uint64_t tod_offset;
26ba25
-    uint64_t tod_basetime;
26ba25
     QEMUTimer *tod_timer;
26ba25
 
26ba25
     QEMUTimer *cpu_timer;
26ba25
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
26ba25
index e0b23c1..8b3b040 100644
26ba25
--- a/target/s390x/misc_helper.c
26ba25
+++ b/target/s390x/misc_helper.c
26ba25
@@ -142,7 +142,7 @@ uint64_t HELPER(stck)(CPUS390XState *env)
26ba25
     uint64_t time;
26ba25
 
26ba25
     time = env->tod_offset +
26ba25
-        time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - env->tod_basetime);
26ba25
+        time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
26ba25
 
26ba25
     return time;
26ba25
 }
26ba25
@@ -162,7 +162,7 @@ void HELPER(sckc)(CPUS390XState *env, uint64_t time)
26ba25
     /* nanoseconds */
26ba25
     time = tod2time(time);
26ba25
 
26ba25
-    timer_mod(env->tod_timer, env->tod_basetime + time);
26ba25
+    timer_mod(env->tod_timer, time);
26ba25
 }
26ba25
 
26ba25
 /* Set Tod Programmable Field */
26ba25
-- 
26ba25
1.8.3.1
26ba25