From patchwork Wed Dec 12 14:11:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 1011996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43FJjz3f3nz9s4s for ; Thu, 13 Dec 2018 01:15:19 +1100 (AEDT) Received: from localhost ([::1]:45265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX5IB-0006G8-Vs for incoming@patchwork.ozlabs.org; Wed, 12 Dec 2018 09:15:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX5Ex-0003eB-VU for qemu-devel@nongnu.org; Wed, 12 Dec 2018 09:11:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX5Et-0007J1-Qn for qemu-devel@nongnu.org; Wed, 12 Dec 2018 09:11:55 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gX5Et-0007Et-Ay for qemu-devel@nongnu.org; Wed, 12 Dec 2018 09:11:51 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBCE9MKN127401 for ; Wed, 12 Dec 2018 09:11:45 -0500 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pb2d7vjwm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Dec 2018 09:11:45 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Dec 2018 14:11:44 -0000 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 12 Dec 2018 14:11:42 -0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBCEBcZA25428194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Dec 2018 14:11:38 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C5778C6055; Wed, 12 Dec 2018 14:11:38 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4158AC6057; Wed, 12 Dec 2018 14:11:38 +0000 (GMT) Received: from jason-laptop.endicott.ibm.com (unknown [9.60.75.251]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 12 Dec 2018 14:11:38 +0000 (GMT) From: "Jason J. Herne" To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, pasic@linux.ibm.com, bjsdjshi@linux.ibm.com, borntraeger@de.ibm.com Date: Wed, 12 Dec 2018 09:11:15 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544623878-11248-1-git-send-email-jjherne@linux.ibm.com> References: <1544623878-11248-1-git-send-email-jjherne@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18121214-0004-0000-0000-000014C1183C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010214; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01130711; UDB=6.00587570; IPR=6.00910844; MB=3.00024669; MTD=3.00000008; XFM=3.00000015; UTC=2018-12-12 14:11:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18121214-0005-0000-0000-000089D39142 Message-Id: <1544623878-11248-13-git-send-email-jjherne@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-12-12_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812120124 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 12/15] s390-bios: Refactor virtio to run channel programs via cio 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that we have a Channel I/O library let's modify virtio boot code to make use of it for running channel programs. Signed-off-by: Jason J. Herne --- pc-bios/s390-ccw/virtio.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index aa9da72..5fb49e2 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -92,30 +92,13 @@ int drain_irqs(SubChannelId schid) static int run_ccw(VDev *vdev, int cmd, void *ptr, int len) { Ccw1 ccw = {}; - CmdOrb orb = {}; - int r; - - enable_subchannel(vdev->schid); - - /* start subchannel command */ - orb.fmt = 1; - orb.cpa = (u32)(long)&ccw; - orb.lpm = 0x80; ccw.cmd_code = cmd; ccw.cda = (long)ptr; ccw.count = len; - r = ssch(vdev->schid, &orb); - /* - * XXX Wait until device is done processing the CCW. For now we can - * assume that a simple tsch will have finished the CCW processing, - * but the architecture allows for asynchronous operation - */ - if (!r) { - r = drain_irqs(vdev->schid); - } - return r; + enable_subchannel(vdev->schid); + return do_cio(vdev->schid, ptr2u32(&ccw), CCW_FMT1); } static void vring_init(VRing *vr, VqInfo *info)