Received: by 10.213.65.68 with SMTP id h4csp91934imn; Thu, 15 Mar 2018 10:28:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELuM6/OIHWIlwsdQyw7lxAjP6n+ZPQTz2BkWEB4TeU5oGB7/QzBzPVsHDfHt0kSlPVmRugQf X-Received: by 2002:a17:902:bd09:: with SMTP id p9-v6mr3387850pls.68.1521134932404; Thu, 15 Mar 2018 10:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521134932; cv=none; d=google.com; s=arc-20160816; b=G+Zyhgqfuko1YJRvm3uAgIO8I2H7kLYtnFsYkl/YkysyEI/jU+9xUNmdM93QO3VsBS h1cBXslF4X7zaR9pxdVVcj+YgaELVQSE+BROSbOx0oukYaa1WM38IKIrf3Sdw2DCZQuW /AOYMq3kKOt5DqQltYiQ51NLD7J/xNWSV+101CWxGJRhmlNyl17enlng/wqF4Y2L6q9V 0yIzrrQhRi1PSEba+EgDcbZowTondUktgpBk5QSs+mApA9DvOVb3iwWxfA5KO+0TWzF8 TSkH7eeN0fuqGBpIUyvZAyeO+m1711M/I5jBxxZR8S8p8Wrx2f08GyaiGlxLoxp6aw4s L12w== 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=ErjIWF2CmxhtYig74D65bqifcP8WdiqEPOi65WRC9JM=; b=UXRbcZ4HVKGSPemoBnttkvSwD/WY+Fp/PFkb2LbFbaH3k/SDK5ygyLg5W7kQ9+UBUv +qFtN2iTkRT1MeJ5NqzXF8q6O1QPnfF9jqGyxV7S0ZzPmoVvIiArJ3/Rv1mPV7Cs5tNH ONYpUgV8vlq+HmnRuL09C+kTAkSavqWI81wkGIVtEoxyqjdE+001KFS/EQ0I5oGHN6VA 06UPgrLSeVYOn6bByjwRZDX7zs4P3AQ1i3nn5dt2OUMW8/IqWIuEUlDgXAdp4HAnKqHH 13Q9vf/ls3zo6EYulOqTlgEN/9kO8Fdc44ScjG+Asrj3JKc9B/eurQM9EJTpSUJHCTcJ hByQ== 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 q24-v6si4266542pls.600.2018.03.15.10.28.38; Thu, 15 Mar 2018 10:28:52 -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 S1751929AbeCOR0C (ORCPT + 99 others); Thu, 15 Mar 2018 13:26:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40924 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbeCOR0B (ORCPT ); Thu, 15 Mar 2018 13:26:01 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FHPuoN143128 for ; Thu, 15 Mar 2018 13:26:01 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqvg822tj-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 13:25:58 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 11:25:34 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 11:25:30 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FHPSwP9568752; Thu, 15 Mar 2018 10:25:28 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6572136044; Thu, 15 Mar 2018 11:25:28 -0600 (MDT) Received: from oc8043147753.ibm.com (unknown [9.80.217.151]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id 1450313603A; Thu, 15 Mar 2018 11:25:25 -0600 (MDT) Subject: Re: [PATCH v3 05/14] s390: vfio-ap: base implementation of VFIO AP device driver To: Pierre Morel , 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> <1d5a5e18-1886-dd73-a17e-9bec617507ba@linux.vnet.ibm.com> From: Tony Krowiak Date: Thu, 15 Mar 2018 13:25:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1d5a5e18-1886-dd73-a17e-9bec617507ba@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18031517-0020-0000-0000-00000D988921 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008680; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01003485; UDB=6.00510699; IPR=6.00782811; MB=3.00020054; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-15 17:25:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031517-0021-0000-0000-00006081F19D Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_09:,, 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-1803150190 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/15/2018 09:25 AM, Pierre Morel wrote: > 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. Connie also asked about this in the last review, so I will go ahead and change it. > >> + 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 > ... I was thinking the same just yesterday and I agree, this makes sense. > > > > Pierre >