From patchwork Fri Mar 1 09:39:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 10834861 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 8D1B81805 for ; Fri, 1 Mar 2019 09:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B5082F0A7 for ; Fri, 1 Mar 2019 09:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F4E52F0E3; Fri, 1 Mar 2019 09:39:58 +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 1D1872F0A7 for ; Fri, 1 Mar 2019 09:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733251AbfCAJj5 (ORCPT ); Fri, 1 Mar 2019 04:39:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733133AbfCAJj5 (ORCPT ); Fri, 1 Mar 2019 04:39:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14F0030718E9; Fri, 1 Mar 2019 09:39:57 +0000 (UTC) Received: from localhost (ovpn-117-66.ams2.redhat.com [10.36.117.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08D9D60FAB; Fri, 1 Mar 2019 09:39:53 +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-devel@nongnu.org, qemu-s390x@nongnu.org, Alex Williamson , Cornelia Huck Subject: [PATCH v3 0/2] vfio-ccw: support hsch/csch (QEMU part) Date: Fri, 1 Mar 2019 10:39:47 +0100 Message-Id: <20190301093949.27955-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 01 Mar 2019 09:39:57 +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 QEMU part, git tree is available at https://github.com/cohuck/qemu vfio-ccw-caps The companion Linux kernel patches are available at https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.git vfio-ccw-eagain-caps-v4] 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 makes use of the newly introduced async command region to issue hsch/csch; if it is not present, continue to emulate hsch/csch, as before. Note that the kernel side now returns -EAGAIN to trigger a retry in more cases; QEMU should already be fine with that. [I'm not quite happy with how this async processing hooks up in css.c; ideas welcome.] Lightly tested (I can interact with a dasd as before, and reserve/release seems to work well.) Not sure if there is a better way to test this, ideas welcome. Changes v2->v3: - update kernel header to v4 of kernel patches - rebased on master Changes v1->v2: - update kernel header to v2 of kernel patches - rebased on master Cornelia Huck (2): vfio-ccw: new capability chain support vfio-ccw: support async command subregion hw/s390x/css.c | 27 ++++++-- hw/vfio/ccw.c | 109 ++++++++++++++++++++++++++++++++- include/hw/s390x/s390-ccw.h | 3 + linux-headers/linux/vfio.h | 4 ++ linux-headers/linux/vfio_ccw.h | 12 ++++ 5 files changed, 149 insertions(+), 6 deletions(-)