Blame SOURCES/0036-s390x-css-disabled-subchannels-cannot-be-status-pend.patch

ae23c9
From db20a3f422ca948784aa74375d1977b7d0a1c7ed Mon Sep 17 00:00:00 2001
ae23c9
From: Cornelia Huck <cohuck@redhat.com>
ae23c9
Date: Tue, 15 May 2018 07:33:45 +0000
ae23c9
Subject: s390x/css: disabled subchannels cannot be status pending
ae23c9
ae23c9
The 3270 code will try to post an attention interrupt when the
ae23c9
3270 emulator (e.g. x3270) attaches. If the guest has not yet
ae23c9
enabled the subchannel for the 3270 device, we will present a spurious
ae23c9
cc 1 (status pending) when it uses msch on it later on, e.g. when
ae23c9
trying to enable the subchannel.
ae23c9
ae23c9
To fix this, just don't do anything in css_conditional_io_interrupt()
ae23c9
if the subchannel is not enabled. The 3270 code will work fine with
ae23c9
that, and the other user of this function (virtio-ccw) never
ae23c9
attempts to post an interrupt for a disabled device to begin with.
ae23c9
ae23c9
CC: qemu-stable@nongnu.org
ae23c9
Reported-by: Thomas Huth <thuth@redhat.com>
ae23c9
Tested-by: Thomas Huth <thuth@redhat.com>
ae23c9
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
ae23c9
Acked-by: Halil Pasic <pasic@linux.ibm.com>
ae23c9
Reviewed-by: David Hildenbrand <david@redhat.com>
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
(cherry picked from commit 6e9c893ecd00afd5344c35d0d0ded50eaa0938f6)
ae23c9
---
ae23c9
 hw/s390x/css.c | 8 ++++++++
ae23c9
 1 file changed, 8 insertions(+)
ae23c9
ae23c9
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
ae23c9
index 301bf17..56c3fa8 100644
ae23c9
--- a/hw/s390x/css.c
ae23c9
+++ b/hw/s390x/css.c
ae23c9
@@ -617,6 +617,14 @@ void css_inject_io_interrupt(SubchDev *sch)
ae23c9
 void css_conditional_io_interrupt(SubchDev *sch)
ae23c9
 {
ae23c9
     /*
ae23c9
+     * If the subchannel is not enabled, it is not made status pending
ae23c9
+     * (see PoP p. 16-17, "Status Control").
ae23c9
+     */
ae23c9
+    if (!(sch->curr_status.pmcw.flags & PMCW_FLAGS_MASK_ENA)) {
ae23c9
+        return;
ae23c9
+    }
ae23c9
+
ae23c9
+    /*
ae23c9
      * If the subchannel is not currently status pending, make it pending
ae23c9
      * with alert status.
ae23c9
      */
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9