yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-tcg-SET-CLOCK-COMPARATOR-can-clear-CKC-interru.patch

ae23c9
From 91995f02cd4c100d26edd6df3dae0813b8685c02 Mon Sep 17 00:00:00 2001
ae23c9
From: David Hildenbrand <david@redhat.com>
ae23c9
Date: Fri, 21 Dec 2018 15:36:08 +0000
ae23c9
Subject: [PATCH 06/22] s390x/tcg: SET CLOCK COMPARATOR can clear CKC
ae23c9
 interrupts
ae23c9
ae23c9
RH-Author: David Hildenbrand <david@redhat.com>
ae23c9
Message-id: <20181221153614.27961-7-david@redhat.com>
ae23c9
Patchwork-id: 83750
ae23c9
O-Subject: [RHEL-8.0 qemu-kvm v2 PATCH 06/12] s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts
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
Let's stop the timer and delete any pending CKC IRQ before doing
ae23c9
anything else.
ae23c9
ae23c9
While at it, add a comment why the check for ckc == -1ULL is needed.
ae23c9
ae23c9
Reviewed-by: Thomas Huth <thuth@redhat.com>
ae23c9
Signed-off-by: David Hildenbrand <david@redhat.com>
ae23c9
Message-Id: <20180627134410.4901-7-david@redhat.com>
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
(cherry picked from commit 345f1ab96e8279a537f32ae7447296d23308c7d1)
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/misc_helper.c | 7 +++++++
ae23c9
 1 file changed, 7 insertions(+)
ae23c9
ae23c9
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
ae23c9
index 4f675c7..cada7af 100644
ae23c9
--- a/target/s390x/misc_helper.c
ae23c9
+++ b/target/s390x/misc_helper.c
ae23c9
@@ -155,6 +155,13 @@ void HELPER(sckc)(CPUS390XState *env, uint64_t time)
ae23c9
 {
ae23c9
     S390TODState *td = s390_get_todstate();
ae23c9
 
ae23c9
+    /* stop the timer and remove pending CKC IRQs */
ae23c9
+    timer_del(env->tod_timer);
ae23c9
+    qemu_mutex_lock_iothread();
ae23c9
+    env->pending_int &= ~INTERRUPT_EXT_CLOCK_COMPARATOR;
ae23c9
+    qemu_mutex_unlock_iothread();
ae23c9
+
ae23c9
+    /* the tod has to exceed the ckc, this can never happen if ckc is all 1's */
ae23c9
     if (time == -1ULL) {
ae23c9
         return;
ae23c9
     }
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9