All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: Song Shan Gong <gongss@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com,
	jfrei@linux.vnet.ibm.com,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL 05/10] s390x: fix generation of event information crw
Date: Thu, 28 Jan 2016 12:09:06 +0100	[thread overview]
Message-ID: <1453979351-13089-6-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1453979351-13089-1-git-send-email-cornelia.huck@de.ibm.com>

From: Song Shan Gong <gongss@linux.vnet.ibm.com>

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        | 13 ++++++++++++-
 hw/s390x/css.h        |  1 +
 target-s390x/ioinst.c |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 343c352..533357a 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -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;
 
diff --git a/hw/s390x/css.h b/hw/s390x/css.h
index a09bb1f..a47937d 100644
--- a/hw/s390x/css.h
+++ b/hw/s390x/css.h
@@ -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
diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 57c2d8b..9a8de6d 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -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);
-- 
2.7.0

  parent reply	other threads:[~2016-01-28 11:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 02/10] s390x/machine: make addon register fields static Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 03/10] s390x/sclp: add device to the sysbus in sclp_realize Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 04/10] s390x/ioinst: set type and len for SEI response Cornelia Huck
2016-01-28 11:09 ` Cornelia Huck [this message]
2016-01-28 11:09 ` [Qemu-devel] [PULL 06/10] watchdog: introduction of get_watchdog_action Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 07/10] watchdog/diag288: don't reset for action=none|debug|pause Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 08/10] s390x/css: fix control flags during csch Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 09/10] gdb: provide the name of the architecture in the target.xml Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1 Cornelia Huck
2016-01-28 13:41 ` [Qemu-devel] [PULL 00/10] next round of s390x patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453979351-13089-6-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=gongss@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.