]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
s390x: fix generation of event information crw
authorSong Shan Gong <gongss@linux.vnet.ibm.com>
Tue, 19 Jan 2016 01:55:00 +0000 (02:55 +0100)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 27 Jan 2016 14:34:47 +0000 (15:34 +0100)
Only one channel report word (crw) may be pending if there is
event-information pending.

This patch introduces a bool-type field 'sei_pending' for the
channel subsystem, which indicates whether there are pending events.
It is set when event information is made pending and the crw
generated, and cleared after the guest has collected all pending
event information. A crw is not generated if this flag had already
been set.

Signed-off-by: Song Shan Gong <gongss@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css.c
hw/s390x/css.h
target-s390x/ioinst.c

index 343c3520dee1048f209296c5fb2f012f5d7b3a4b..533357ad971aa063d3e7ef0781b517f4672786ed 100644 (file)
@@ -49,6 +49,7 @@ typedef struct IoAdapter {
 
 typedef struct ChannelSubSys {
     QTAILQ_HEAD(, CrwContainer) pending_crws;
+    bool sei_pending;
     bool do_crw_mchk;
     bool crws_lost;
     uint8_t max_cssid;
@@ -1359,7 +1360,15 @@ void css_generate_chp_crws(uint8_t cssid, uint8_t chpid)
 
 void css_generate_css_crws(uint8_t cssid)
 {
-    css_queue_crw(CRW_RSC_CSS, 0, 0, cssid);
+    if (!channel_subsys->sei_pending) {
+        css_queue_crw(CRW_RSC_CSS, 0, 0, cssid);
+    }
+    channel_subsys->sei_pending = true;
+}
+
+void css_clear_sei_pending(void)
+{
+    channel_subsys->sei_pending = false;
 }
 
 int css_enable_mcsse(void)
@@ -1509,6 +1518,7 @@ static void css_init(void)
 {
     channel_subsys = g_malloc0(sizeof(*channel_subsys));
     QTAILQ_INIT(&channel_subsys->pending_crws);
+    channel_subsys->sei_pending = false;
     channel_subsys->do_crw_mchk = true;
     channel_subsys->crws_lost = false;
     channel_subsys->chnmon_active = false;
@@ -1561,6 +1571,7 @@ void css_reset(void)
         QTAILQ_REMOVE(&channel_subsys->pending_crws, crw_cont, sibling);
         g_free(crw_cont);
     }
+    channel_subsys->sei_pending = false;
     channel_subsys->do_crw_mchk = true;
     channel_subsys->crws_lost = false;
 
index a09bb1f87c180da61166f53324ff1090ed405656..a47937dee54955b1a20046622a9933065d5b90bb 100644 (file)
@@ -103,6 +103,7 @@ void css_generate_sch_crws(uint8_t cssid, uint8_t ssid, uint16_t schid,
                            int hotplugged, int add);
 void css_generate_chp_crws(uint8_t cssid, uint8_t chpid);
 void css_generate_css_crws(uint8_t cssid);
+void css_clear_sei_pending(void);
 void css_adapter_interrupt(uint8_t isc);
 
 #define CSS_IO_ADAPTER_VIRTIO 1
index 57c2d8b226d52eebc97acbe3816bd04ab08ad328..9a8de6d12200c1ec385216c742e688f95efbe4a4 100644 (file)
@@ -614,6 +614,7 @@ static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res)
             (*res_flags) |= 0x80;
         } else {
             (*res_flags) &= ~0x80;
+            css_clear_sei_pending();
         }
     } else {
         res->code = cpu_to_be16(0x0005);