From patchwork Thu Nov 22 16:54:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 10694517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 924F315A7 for ; Thu, 22 Nov 2018 16:54:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18A9B2B650 for ; Thu, 22 Nov 2018 16:54:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BDDB2C767; Thu, 22 Nov 2018 16:54:41 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5C062C767 for ; Thu, 22 Nov 2018 16:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733208AbeKWDev (ORCPT ); Thu, 22 Nov 2018 22:34:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730284AbeKWDev (ORCPT ); Thu, 22 Nov 2018 22:34:51 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2543A7F410; Thu, 22 Nov 2018 16:54:39 +0000 (UTC) Received: from localhost (ovpn-117-71.ams2.redhat.com [10.36.117.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 17147103BAB8; Thu, 22 Nov 2018 16:54:35 +0000 (UTC) From: Cornelia Huck To: Halil Pasic , Eric Farman , Farhan Ali , Pierre Morel Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Alex Williamson , Cornelia Huck Subject: [PATCH 0/3] vfio-ccw: support hsch/csch (kernel part) Date: Thu, 22 Nov 2018 17:54:29 +0100 Message-Id: <20181122165432.4437-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 22 Nov 2018 16:54:39 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP [This is the Linux kernel part, git tree is available at https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git vfio-ccw-caps The companion QEMU patches are available at https://github.com/cohuck/qemu vfio-ccw-caps] Currently, vfio-ccw only relays START SUBCHANNEL requests to the real device. This tends to work well for the most common 'good path' scenarios; however, as we emulate {HALT,CLEAR} SUBCHANNEL in QEMU, things like clearing pending requests at the device is currently not supported. This may be a problem for e.g. error recovery. This patch series introduces capabilities (similar to what vfio-pci uses) and exposes a new async region for handling hsch/csch. Very lightly tested (I can interact with a dasd as before; I have not found a reliable way to trigger hsch/csch in the Linux dasd guest driver.) Cornelia Huck (3): vfio-ccw: add capabilities chain s390/cio: export hsch to modules vfio-ccw: add handling for asnyc channel instructions drivers/s390/cio/Makefile | 3 +- drivers/s390/cio/ioasm.c | 1 + drivers/s390/cio/vfio_ccw_async.c | 88 +++++++++++++ drivers/s390/cio/vfio_ccw_drv.c | 48 +++++-- drivers/s390/cio/vfio_ccw_fsm.c | 158 +++++++++++++++++++++- drivers/s390/cio/vfio_ccw_ops.c | 195 ++++++++++++++++++++++++---- drivers/s390/cio/vfio_ccw_private.h | 44 +++++++ include/uapi/linux/vfio.h | 5 + include/uapi/linux/vfio_ccw.h | 12 ++ 9 files changed, 509 insertions(+), 45 deletions(-) create mode 100644 drivers/s390/cio/vfio_ccw_async.c