Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3302942imm; Fri, 25 May 2018 03:25:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpdzq2l2nKDmi2ywOYvyYIWTznxXBp911w4OlEB2aUOXM4lphTraz7iySXJn6peJUreqRyF X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr1561490plj.253.1527243925031; Fri, 25 May 2018 03:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527243925; cv=none; d=google.com; s=arc-20160816; b=PcUReED35iEX7j/5A/zGoe4b/HL8mF2NH5tuqyGW14T2WZGd0JabOAi4wvNb1PzFf7 gn6LhbrO2JOSzAo4qZkYbK9UCh0h/5rXz4zteMpSDIfYBPxbZdQ33oa3Ms9lDfP/DS40 Pqr7QgWpXemKN5fjNKbs2x7BQKu+p68jO8q4FTxaNnd0eg3Dy5Q+DpRRpK6tSuMyEIKc xwsajiZ6eMd1+AszlZExLSQ9TPJfPRS0nwpH+6fKORgdrzdp6SzwodIa+zlLV7f6xfv0 XV7dwnzjVvP2z+uM4ZwdkqA8VMR0+jpUL0/bDiIzl5nI4YPgKhX0lU5N0Kbm8Tu6E4KB /cDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NZfPhd+381AkESw6rB4dnwYkfh5iQYh8oW9fkv6CRm0=; b=TpW1uFAoNk9zaBAqusCdboJD2V2/0EggerSGZ6kmKaW1qoR5JRlDEaEHy082qhk5Wf bFNrg0eVfQdoLtC8xlwuwOfzXS4M2wDKRB13ECZ582RmevclJCVLasYkm3CaLJ+fhu8K 0YXE1SUm9ar71REf+ypHbMbcpbHUrXx5N6LnGlVN9C+LhNmTeW1PLc+swOLX/abVsEUf bzQHcrdUNBbWUjcii0HwXstV6eV7zvLlrY7Lkyv0l4Y4HE3hSGLHtsYmPJc9KZ8ve7Mn kipjLHfMgqdNatbwdwqI/7fIDTHya6f7I+5hSvTh+HCXqWKe4ZmgsvMVvCMBvqhIALgx AxZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si22842876pld.218.2018.05.25.03.25.10; Fri, 25 May 2018 03:25:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965886AbeEYKVa (ORCPT + 99 others); Fri, 25 May 2018 06:21:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35072 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965724AbeEYKV0 (ORCPT ); Fri, 25 May 2018 06:21:26 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4P9sGEZ001598 for ; Fri, 25 May 2018 06:21:25 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j6e5kq28e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 25 May 2018 06:21:25 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 May 2018 11:21:23 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 25 May 2018 11:21:20 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4PALJZu6095316; Fri, 25 May 2018 10:21:19 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25B32A4069; Fri, 25 May 2018 11:12:37 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5C62A404D; Fri, 25 May 2018 11:12:36 +0100 (BST) Received: from morel-ThinkPad-W530.boeblingen.de.ibm.com (unknown [9.152.224.33]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 25 May 2018 11:12:36 +0100 (BST) From: Pierre Morel To: pasic@linux.vnet.ibm.com, bjsdjshi@linux.vnet.ibm.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, cohuck@redhat.com Subject: [PATCH v2 00/10] vfio: ccw: Refactoring the VFIO CCW state machine Date: Fri, 25 May 2018 12:21:08 +0200 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18052510-0020-0000-0000-000004212A89 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052510-0021-0000-0000-000042B67248 Message-Id: <1527243678-3140-1-git-send-email-pmorel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-25_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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805250113 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The goal of the patch serie is to enhance the state machine by: - centralizing all state changes inside the state machine wrapper - make the state change atomic using mutexes - change user busy waiting for a passive wait on completion - refactoring the initialization to avoid using a subchannel without a guest This series introduces new states and events and suppressed others. - VFIO_CCW_STATE_NOT_OPER : when the Sub-Channel is KO - VFIO_CCW_STATE_STANDBY : when it is offline - VFIO_CCW_STATE_IDLE : when it is ready for I/O - VFIO_CCW_STATE_BUSY : when it is busy doing I/O - VFIO_CCW_STATE_QUIESCING: when it is busy going offline - VFIO_CCW_EVENT_INIT : the channel setup (admin) - VFIO_CCW_EVENT_NOT_OPER : something really wrong happened - VFIO_CCW_EVENT_SSCH_REQ : Starting an I/O request (UAPI) - VFIO_CCW_EVENT_INTERRUPT: Receiving an interrupt (callback) - VFIO_CCW_EVENT_SCHIB_CHANGED: Receiving a channel event (callback) - VFIO_CCW_EVENT_ONLINE : Channel is set online (admin) - VFIO_CCW_EVENT_OFFLINE : Channel is set offline (admin) The ABI did not change a lot beside letting the user sleep when the driver is busy doing a SSCH, so a standard QEMU devel branch can be used. Pierre Morel (10): vfio: ccw: Moving state change out of IRQ context vfio: ccw: Transform FSM functions to return state vfio: ccw: new SCH_EVENT event vfio: ccw: replace IO_REQ event with SSCH_REQ event vfio: ccw: Suppress unused event parameter vfio: ccw: Make FSM functions atomic vfio: ccw: FSM and mediated device initialization vfio: ccw: Handling reset and shutdown with states vfio: ccw: Suppressing the BOXED state vfio: ccw: Let user wait when busy on IO drivers/s390/cio/vfio_ccw_drv.c | 112 +++++------------- drivers/s390/cio/vfio_ccw_fsm.c | 218 ++++++++++++++++++++++++------------ drivers/s390/cio/vfio_ccw_ops.c | 62 +++++----- drivers/s390/cio/vfio_ccw_private.h | 18 ++- 4 files changed, 219 insertions(+), 191 deletions(-) -- 2.7.4 Changelog: - rebased on current Linux branch - change the name of VFIO_CCW_EVENT_SCH_EVENT to VFIO_CCW_EVENT_SCHIB_CHANGED - refactoring the initialization (mdev create/open and driver probe) - return -EAGAIN to let the low level retry the sending of events - make wait_for_completion interruptible