Received: from eggs.gnu.org ([2001:4830:134:3::10]:41761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBfaH-0005MD-0G for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBfaD-0000E6-TA for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dBfaD-0000De-KA for qemu-devel@nongnu.org; Fri, 19 May 2017 06:56:33 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4JAmxvk009778 for ; Fri, 19 May 2017 06:56:32 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ahvrs7gxe-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 May 2017 06:56:32 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 11:56:30 +0100 From: Cornelia Huck Date: Fri, 19 May 2017 12:55:58 +0200 In-Reply-To: <20170519105600.11589-1-cornelia.huck@de.ibm.com> References: <20170519105600.11589-1-cornelia.huck@de.ibm.com> Message-Id: <20170519105600.11589-20-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 19/21] vfio/ccw: update sense data if a unit check is pending List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: borntraeger@de.ibm.com, agraf@suse.de, Dong Jia Shi , Cornelia Huck From: Dong Jia Shi 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. Acked-by: Alex Williamson Signed-off-by: Dong Jia Shi Message-Id: <20170517004813.58227-13-bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck --- hw/vfio/ccw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 007ce435f1..12d0262336 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; int size; @@ -143,6 +144,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.13.0