From patchwork Wed Apr 12 05:21:14 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: 749741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2sqH5gsZz9sNH for ; Wed, 12 Apr 2017 15:26:51 +1000 (AEST) Received: from localhost ([::1]:42254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyAnp-0003Zw-6v for incoming@patchwork.ozlabs.org; Wed, 12 Apr 2017 01:26:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyAjD-0008RO-Ko for qemu-devel@nongnu.org; Wed, 12 Apr 2017 01:22:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyAj9-0000Ie-NC for qemu-devel@nongnu.org; Wed, 12 Apr 2017 01:22:03 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51994 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cyAj9-0000Hw-HV for qemu-devel@nongnu.org; Wed, 12 Apr 2017 01:21:59 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3C5IoTg074791 for ; Wed, 12 Apr 2017 01:21:59 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 29s7pa4gsc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Apr 2017 01:21:58 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Apr 2017 23:21:58 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 11 Apr 2017 23:21:54 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3C5LqbO11993422; Tue, 11 Apr 2017 22:21:52 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92B02C603E; Tue, 11 Apr 2017 23:21:52 -0600 (MDT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id F26DAC603C; Tue, 11 Apr 2017 23:21:50 -0600 (MDT) From: Dong Jia Shi To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, qemu-devel@nongnu.org Date: Wed, 12 Apr 2017 07:21:14 +0200 X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170412052115.101657-1-bjsdjshi@linux.vnet.ibm.com> References: <20170412052115.101657-1-bjsdjshi@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17041205-0028-0000-0000-00000764103E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006921; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00846358; UDB=6.00417460; IPR=6.00624795; BA=6.00005284; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015014; XFM=3.00000013; UTC=2017-04-12 05:21:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041205-0029-0000-0000-000035081381 Message-Id: <20170412052115.101657-13-bjsdjshi@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-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-1702020001 definitions=main-1704120046 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v5 12/13] 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: borntraeger@de.ibm.com, alex.williamson@redhat.com, renxiaof@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, bjsdjshi@linux.vnet.ibm.com, agraf@suse.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 ed17d6e..fd174c1 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); }