From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752400AbeCON0R (ORCPT ); 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 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 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