Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F21B7C432C3 for ; Fri, 15 Nov 2019 03:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D088A20706 for ; Fri, 15 Nov 2019 03:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbfKOD20 (ORCPT ); Thu, 14 Nov 2019 22:28:26 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57796 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727053AbfKOD2Z (ORCPT ); Thu, 14 Nov 2019 22:28:25 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAF39WGJ057895 for ; Thu, 14 Nov 2019 22:28:24 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w9jtv6bre-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Nov 2019 22:28:20 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Nov 2019 02:56:24 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 15 Nov 2019 02:56:22 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAF2uKrB53805276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2019 02:56:20 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA5D211C050; Fri, 15 Nov 2019 02:56:20 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6D8111C04A; Fri, 15 Nov 2019 02:56:20 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 15 Nov 2019 02:56:20 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 4CF01E01C5; Fri, 15 Nov 2019 03:56:20 +0100 (CET) From: Eric Farman To: kvm@vger.kernel.org, linux-s390@vger.kernel.org Cc: Cornelia Huck , Jason Herne , Jared Rossi , Eric Farman Subject: [RFC PATCH v1 00/10] s390/vfio-ccw: Channel Path Handling Date: Fri, 15 Nov 2019 03:56:10 +0100 X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 x-cbid: 19111502-0028-0000-0000-000003B7024B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19111502-0029-0000-0000-0000247A11BC Message-Id: <20191115025620.19593-1-farman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-14_07:2019-11-14,2019-11-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=2 adultscore=0 clxscore=1015 impostorscore=0 bulkscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=629 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911150027 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Here is a first pass at the channel-path handling code for vfio-ccw. This was initially developed by Farhan Ali this past summer, and picked up by me. For my own benefit/sanity, I made a small changelog in the commit message for each patch, describing the changes I've made to his original code beyond just rebasing to master. I did split a couple of his patches, to (hopefully) make them a little more understandable. The entire series is based on top of the trace rework patches from a few weeks ago, which are currently pending. But really, the only cause for overlap is the trace patch here. The bulk of it is really self-contained. With this, and the corresponding QEMU series (to be posted momentarily), applied I am able to configure off/on a CHPID (for example, by issuing "chchp -c 0/1 xx" on the host), and the guest is able to see both the events and reflect the updated path masks in its structures. For reasons that are hopefully obvious, issuing chchp within the guest only works for the logical vary. Configuring it off/on does not work, which I think is fine. Eric Farman (4): vfio-ccw: Refactor the unregister of the async regions vfio-ccw: Refactor IRQ handlers vfio-ccw: Add trace for CRW event vfio-ccw: Remove inline get_schid() routine Farhan Ali (6): vfio-ccw: Introduce new helper functions to free/destroy regions vfio-ccw: Register a chp_event callback for vfio-ccw vfio-ccw: Use subchannel lpm in the orb vfio-ccw: Introduce a new schib region vfio-ccw: Introduce a new CRW region vfio-ccw: Wire up the CRW irq and CRW region drivers/s390/cio/Makefile | 2 +- drivers/s390/cio/vfio_ccw_chp.c | 128 +++++++++++++++++++++++++ drivers/s390/cio/vfio_ccw_cp.c | 4 +- drivers/s390/cio/vfio_ccw_drv.c | 140 ++++++++++++++++++++++++++-- drivers/s390/cio/vfio_ccw_fsm.c | 8 +- drivers/s390/cio/vfio_ccw_ops.c | 65 +++++++++---- drivers/s390/cio/vfio_ccw_private.h | 11 +++ drivers/s390/cio/vfio_ccw_trace.c | 1 + drivers/s390/cio/vfio_ccw_trace.h | 30 ++++++ include/uapi/linux/vfio.h | 3 + include/uapi/linux/vfio_ccw.h | 10 ++ 11 files changed, 366 insertions(+), 36 deletions(-) create mode 100644 drivers/s390/cio/vfio_ccw_chp.c -- 2.17.1