From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dong Jia Shi Subject: [PATCH RFC v2 12/12] vfio/ccw: update sense data if a unit check is pending Date: Thu, 12 Jan 2017 08:25:13 +0100 Message-ID: <20170112072513.98411-13-bjsdjshi@linux.vnet.ibm.com> References: <20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com> Cc: bjsdjshi@linux.vnet.ibm.com, renxiaof@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, agraf@suse.com, alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com, wkywang@linux.vnet.ibm.com To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, qemu-devel@nongnu.org Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37132 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbdALH0D (ORCPT ); Thu, 12 Jan 2017 02:26:03 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id v0C7O2NN030261 for ; Thu, 12 Jan 2017 02:26:03 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 27wyp9tp8y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 12 Jan 2017 02:26:03 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Jan 2017 00:26:02 -0700 In-Reply-To: <20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Concurrent-sense data is currently not delivered. This patch stores the concurrent-sense data to the subchannel if a unit check is pending and the concurrent-sense bit is enabled. Then a TSCH can retreive the right IRB data back to the guest. Signed-off-by: Dong Jia Shi --- hw/vfio/ccw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 34c719a..cc745b0 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -94,6 +94,7 @@ static void vfio_ccw_io_notifier_handler(void *opaque) CcwDevice *ccw_dev = CCW_DEVICE(cdev); SubchDev *sch = ccw_dev->sch; SCSW *s = &sch->curr_status.scsw; + PMCW *p = &sch->curr_status.pmcw; IRB irb; if (!event_notifier_test_and_clear(&vcdev->io_notifier)) { @@ -133,6 +134,12 @@ static void vfio_ccw_io_notifier_handler(void *opaque) /* Update control block via irb. */ copy_scsw_to_guest(s, &irb.scsw); + /* If a uint check is pending, copy sense data. */ + if ((s->dstat & SCSW_DSTAT_UNIT_CHECK) && + (p->chars & PMCW_CHARS_MASK_CSENSE)) { + memcpy(sch->sense_data, irb.ecw, sizeof(irb.ecw)); + } + read_err: css_inject_io_interrupt(sch); } -- 2.8.4