Received: by 10.213.65.68 with SMTP id h4csp1670515imn; Thu, 15 Mar 2018 06:27:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELvjDoMrHkVMDDNY3Ety62o2kHmtBdA9xI5sA3A1Pe5gwg7E12sJIvZwTBqdIYZ1LpoYtxpX X-Received: by 10.98.205.140 with SMTP id o134mr7806470pfg.34.1521120477080; Thu, 15 Mar 2018 06:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521120477; cv=none; d=google.com; s=arc-20160816; b=Q4WAUeqrSfyraUytSPmf6SIg6mWuAKm3FtM+elTK5dwWuGq4L+ossz/HCShb/92GyO HIUtvV8XSf43dvjj596taNIbhiTm1YODhknUhOHpzAU/8maMucz5VzoaXFhiV7e1AF7f /c+XKN5wU0nyLGPti82XDKbPFxIx6K0RxvZoq79i6jzdWy1ABS2h01acjje8H+Y03WOO 5z7ZOwcB2p9vfgv91cwovWZv38etuaHSrkk8zVq88tinChrTLUpjYB9yhAloius7RErg tFAtf4ZJ5RE3z05h9lE+zGLw95w0QzIlbf3DAlwF/wbE9ZoEVcU3ClIjH7urHZVL6AaD DoUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=+fR0ZuLkKJWTzJQRrIvBneBMGyQ0w0kwtrbeGNi4fDc=; b=B0DvNLfyNIb5lGijXvg+1YcRGOwPYsWpeImRkS69bQDyEvQTi0Gm0wcCiKq0yJ6lZN PjwD1criy6DCx8TBq35taJXmlcfIVZOHaM3GyEqSDzCtjVe4RjNFaoUleeKR29J7dPWw L24uoGWa1ryklFHCODYNNTYIM/xxGh/0sCj0GNt576YTiYlrY2GAwBI/HuZZr43zPZcb gzW7gfzbOJsyBroSVUw3ze+eaxveosbrUO67k2GTza0UXccf0WytRRm2rKjhLALOo/B0 sccIDndINGpD8ZUR/uLSQZy8ynXjFFVmA30PX7hNmZXHJPXqkHOaD98WXO8eA/bTmAt6 7vMw== 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 r22si3772357pfj.140.2018.03.15.06.27.42; Thu, 15 Mar 2018 06:27:57 -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 S1752392AbeCON0R (ORCPT + 99 others); Thu, 15 Mar 2018 09:26:17 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48622 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbeCON0Q (ORCPT ); Thu, 15 Mar 2018 09:26:16 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FDPqGJ055820 for ; Thu, 15 Mar 2018 09:26:15 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqqjafhwj-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 09:26:02 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 13:25:34 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 13:25:31 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FDPUFR54329566; Thu, 15 Mar 2018 13:25:30 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04A694204F; Thu, 15 Mar 2018 13:17:44 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E20842042; Thu, 15 Mar 2018 13:17:43 +0000 (GMT) Received: from [9.152.224.146] (unknown [9.152.224.146]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 15 Mar 2018 13:17:43 +0000 (GMT) Subject: Re: [PATCH v3 05/14] s390: vfio-ap: base implementation of VFIO AP device driver To: Tony Krowiak , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com, berrange@redhat.com, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com References: <1521051954-25715-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1521051954-25715-6-git-send-email-akrowiak@linux.vnet.ibm.com> From: Pierre Morel Date: Thu, 15 Mar 2018 14:25:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521051954-25715-6-git-send-email-akrowiak@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18031513-0008-0000-0000-000004DE2EA4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031513-0009-0000-0000-00001E713897 Message-Id: <1d5a5e18-1886-dd73-a17e-9bec617507ba@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_07:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803150150 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/2018 19:25, Tony Krowiak wrote: > Introduces a new AP device driver. This device driver > is built on the VFIO mediated device framework. The framework > provides sysfs interfaces that facilitate passthrough > access by guests to devices installed on the linux host. > > The VFIO AP device driver will serve two purposes: > > 1. Provide the interfaces to reserve AP devices for exclusive > use by KVM guests. This is accomplished by unbinding the > devices to be reserved for guest usage from the default AP > device driver and binding them to the VFIO AP device driver. > > 2. Implements the functions, callbacks and sysfs attribute > interfaces required to create one or more VFIO mediated > devices each of which will be used to configure the AP > matrix for a guest and serve as a file descriptor > for facilitating communication between QEMU and the > VFIO AP device driver. > > When the VFIO AP device driver is initialized: > > * It registers with the AP bus for control of type 10 (CEX4 > and newer) AP queue devices. The probe and remove callbacks > will be provided to support the binding/unbinding of > AP queue devices to/from the VFIO AP device driver. > > * Creates a /sys/devices/vfio-ap/matrix device to hold > the APQNs of the AP devices bound to the VFIO > AP device driver and serves as the parent of the > mediated devices created for each guest. > > Signed-off-by: Tony Krowiak > --- > MAINTAINERS | 2 + > arch/s390/Kconfig | 11 +++ > drivers/s390/crypto/Makefile | 4 + > drivers/s390/crypto/vfio_ap_drv.c | 135 +++++++++++++++++++++++++++++++++ > drivers/s390/crypto/vfio_ap_private.h | 22 ++++++ > include/uapi/linux/vfio.h | 2 + > 6 files changed, 176 insertions(+), 0 deletions(-) > create mode 100644 drivers/s390/crypto/vfio_ap_drv.c > create mode 100644 drivers/s390/crypto/vfio_ap_private.h > > diff --git a/MAINTAINERS b/MAINTAINERS > index 72742d5..f129253 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -11884,6 +11884,8 @@ W: http://www.ibm.com/developerworks/linux/linux390/ > S: Supported > F: arch/s390/include/asm/kvm/kvm-ap.h > F: arch/s390/kvm/kvm-ap.c > +F: drivers/s390/crypto/vfio_ap_drv.c > +F: drivers/s390/crypto/vfio_ap_private.h > > S390 ZFCP DRIVER > M: Steffen Maier > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > index cbe1d97..58509db 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -771,6 +771,17 @@ config VFIO_CCW > To compile this driver as a module, choose M here: the > module will be called vfio_ccw. > > +config VFIO_AP > + def_tristate m not sure it must be module by default. I would not set it by default. > + prompt "VFIO support for AP devices" > + depends on ZCRYPT && VFIO_MDEV_DEVICE VFIO_MDEV_DEVICE is a general feature *needed* by VFIO_AP and has no use case by its own. If it is set it is obviously because some mediated device drivers needs it. while ZCRYPT is a Z feature which may be set without VFIO_AP. So you need: config VFIO_AP     def_tristate n     prompt "VFIO support for AP devices"     depends on ZCRYPT     select VFIO_MDEV     select VFIO_MDEV_DEVICE ... Pierre -- Pierre Morel Linux/KVM/QEMU in Böblingen - Germany