From patchwork Thu Jan 12 07:25:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Jia Shi X-Patchwork-Id: 9512319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F9BD601E5 for ; Thu, 12 Jan 2017 07:52:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 116D628522 for ; Thu, 12 Jan 2017 07:52:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03D3028632; Thu, 12 Jan 2017 07:52:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAD9728522 for ; Thu, 12 Jan 2017 07:52:46 +0000 (UTC) Received: from localhost ([::1]:60327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRaBh-0001Sk-BY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 Jan 2017 02:52:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRZlx-0000hu-SC for qemu-devel@nongnu.org; Thu, 12 Jan 2017 02:26:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRZlt-0005YN-5p for qemu-devel@nongnu.org; Thu, 12 Jan 2017 02:26:09 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRZls-0005YB-SB for qemu-devel@nongnu.org; Thu, 12 Jan 2017 02:26:05 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id v0C7Op51113168 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 27x2m3cy36-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 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Jan 2017 00:25:59 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id BF11B1FF0025; Thu, 12 Jan 2017 00:25:37 -0700 (MST) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0C7PwQX15991166; Thu, 12 Jan 2017 00:25:58 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE8F56A041; Thu, 12 Jan 2017 00:25:57 -0700 (MST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id DFB466A03D; Thu, 12 Jan 2017 00:25:55 -0700 (MST) From: Dong Jia Shi To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, qemu-devel@nongnu.org Date: Thu, 12 Jan 2017 08:25:13 +0100 X-Mailer: git-send-email 2.8.4 In-Reply-To: <20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com> References: <20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011207-8235-0000-0000-00000A5887B9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006418; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00806506; UDB=6.00392483; IPR=6.00583837; BA=6.00005049; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013900; XFM=3.00000011; UTC=2017-01-12 07:26:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011207-8236-0000-0000-00003853D256 Message-Id: <20170112072513.98411-13-bjsdjshi@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-12_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701120099 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH RFC v2 12/12] vfio/ccw: update sense data if a unit check is pending X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pasic@linux.vnet.ibm.com, pmorel@linux.vnet.ibm.com, borntraeger@de.ibm.com, alex.williamson@redhat.com, renxiaof@linux.vnet.ibm.com, wkywang@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, bjsdjshi@linux.vnet.ibm.com, agraf@suse.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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); }