Received: by 10.223.185.116 with SMTP id b49csp6486735wrg; Wed, 28 Feb 2018 10:11:35 -0800 (PST) X-Google-Smtp-Source: AH8x225Uf1QtYelvUfzMfXQPObZnvqN+QQ7ykl/iWB6Mctpnlvn5IwI1COBO65GXVbXSbJojr0vi X-Received: by 2002:a17:902:7b90:: with SMTP id w16-v6mr17324203pll.26.1519841495479; Wed, 28 Feb 2018 10:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519841495; cv=none; d=google.com; s=arc-20160816; b=BnyvPRebvibKhWTD76CmZtg+pU7Fh8utmM8Vc1A19SItGdcRfvtpIDlgrvJYhYjHRk f1z9xfttiZ5HrKAZnKr/+HbErBSr+85HOCLMB41QRXyppB1v2PzdU6DK9Gp9XvACbM2Z +IKodOO1SzRgrhQfPi/AQUF02ngjf0QqgBpZ+r+Ok0qxQcZLsptn7dG4pWqI5U7MAw+C iAargT/A14/QX82RwC53QAO9B5ajmnJXON3CHbsGDucI0u/xyHcC4BynDykLby53QUVO 5oq+ipw8XjtvLB8mz2pKWV6S6JZSK7q8XmJRFxtt4nkuYXLG2qRNjwoeg2aImSY1w5YF QBvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=oSqhikF+3gRBjTk0mHtIcBx6VJhKM/aALyGQAtB2oZg=; b=KPEJ1xmfrz0is+Vgq5R/0juKuCZ2qPxq21kE4rSXWuxE3YZyOOHHhEOmBUESDUrb+k 67o7Y9oHx+V0URCwIoyGcOSofieaoskuWTOFSJd6Bgn654+tFJITD18RTdmOFub2WOZS fNGmHl1YKIxmBus9DWHI4uhvj7mf9+hPiX180HgGLyiIF1yjQC1zt0pA0f1c8Lf4eWoJ sq/yfw2Ew2BCMsRBzOu6R2+02affi0jXGJsteO58XjJjfJymRA9QptYQvm7ZTDxGnEIL r49Q6WD2S1zrMOCjOwy1ct5enRnbOmx0QTHKUC6s5IHLnzcrlF/gPBgELplzFsdyIW0L am8w== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s125si1220900pgc.468.2018.02.28.10.11.19; Wed, 28 Feb 2018 10:11:35 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbeB1SKa (ORCPT + 99 others); Wed, 28 Feb 2018 13:10:30 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751803AbeB1SK3 (ORCPT ); Wed, 28 Feb 2018 13:10:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83449EAE80; Wed, 28 Feb 2018 18:10:28 +0000 (UTC) Received: from gondolin (ovpn-117-87.ams2.redhat.com [10.36.117.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97A9110B0F53; Wed, 28 Feb 2018 18:10:22 +0000 (UTC) Date: Wed, 28 Feb 2018 19:10:19 +0100 From: Cornelia Huck To: Tony Krowiak Cc: Pierre Morel , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.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, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com Subject: Re: [PATCH v2 05/15] s390: vfio-ap: base implementation of VFIO AP device driver Message-ID: <20180228191019.20507888.cohuck@redhat.com> In-Reply-To: References: <1519741693-17440-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1519741693-17440-6-git-send-email-akrowiak@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 28 Feb 2018 18:10:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 28 Feb 2018 18:10:28 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Feb 2018 11:43:37 -0500 Tony Krowiak wrote: > On 02/28/2018 10:33 AM, Pierre Morel wrote: > > On 27/02/2018 15:28, Tony Krowiak wrote: (...) > >> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > >> index cbe1d97..9f23caf 100644 > >> --- a/arch/s390/Kconfig > >> +++ b/arch/s390/Kconfig > >> @@ -771,6 +771,14 @@ 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 Any reason you default to m instead of n here? > >> + prompt "Support for virtual Adjunct Processor device interface" > > > > The VFIO AP devices are not virtual. > > What about > > "VFIO support for AP devices" > Sounds good. +1 > > > >> + depends on ZCRYPT && VFIO_MDEV_DEVICE > >> + help > >> + driver grants access to Adjunct Processor (AP) devices s/driver/This driver/ > >> + via the VFIO mediated device interface. You also might want to add "To compile this driver as a module, choose M here: the module will be called..." > >> + > >> endmenu It's a tad confusing to find this in the I/O submenu, but I don't really have a better idea. > >> > >> menu "Dump support" > >> diff --git a/arch/s390/configs/default_defconfig > >> b/arch/s390/configs/default_defconfig > >> index 5af8458..40fa3f6 100644 > >> --- a/arch/s390/configs/default_defconfig > >> +++ b/arch/s390/configs/default_defconfig > > > > Not sure that this file belongs to this patch > Neither am I, but at the time I inserted this here - well before August > of last year - I was using vfio-ccw as a model. > If someone can verify this does not belong here, I'd be more than happy > to remove it. I don't see any entry for VFIO_CCW in there? > > > > > >> @@ -719,3 +719,6 @@ CONFIG_APPLDATA_BASE=y > >> CONFIG_KVM=m > >> CONFIG_KVM_S390_UCONTROL=y > >> CONFIG_VHOST_NET=m > >> +VFIO_MDEV=m > >> +VFIO_MDEV_DEVICE=m > >> +CONFIG_VFIO_AP=m > > > > What is your goal when modifying this three files? > > Could you add a comment in the commit message? > As stated above, this was originally based on the vfio-ccw model and has > been in the > patch series since its inception. I'd be happy to remove it if it is not > necessary. I'd vote for removing it. (...) > >> +static int vfio_ap_matrix_dev_create(void) > >> +{ > >> + int ret; > >> + > >> + vfio_ap_root_device = root_device_register(VFIO_AP_ROOT_NAME); > >> + > >> + ret = PTR_ERR_OR_ZERO(vfio_ap_root_device); > > > > IS_ERR() is enough, root_device_register() never return NULL. > I searched the kernel code to look at other places the > root_device_register() > function is called to see how the return value is handled. I've seen all > of the > following used: > if (IS_ERR()) > ret = PTR_ERR() > PTR_ERR() > PTR_ERR_OR_ZERO() > > I'm not sure why this is a concern, but I'll use the first option above > since PTR_ERR_OR_ZERO() also embeds the first option. PTR_ERR_OR_ZERO() seems like the best choice for the way the return code is processed here. (It's just unfortunate that its name conjures up connotations of NULL-pointer handling.) > >> + if (ret) > >> + goto done;