Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8068704ybl; Thu, 16 Jan 2020 10:05:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxzPSH7Of85Z2NS/zzGGMJPzJZFoRyOCzozAdYmkX9JvaE2jK72JxbkSgnyjtup8iuRGNEB X-Received: by 2002:a9d:69ce:: with SMTP id v14mr3180447oto.248.1579197940727; Thu, 16 Jan 2020 10:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579197940; cv=none; d=google.com; s=arc-20160816; b=T5uBrbfqrMo2iPaLv+TdqGKeDEY4H4vFmsKUNFa0AuPMO6kmnjy0LgefFLbAbdZj5/ OoqJuHDV70uLd9H1iXJNS2ci6quhvRhTRfVLKg67jD+JPWxUaP4TrfJW28TmD/zk3i2r xhrU9fxyEMew8pE2yg9n62pBt/6diUW0dS6b0oYT/a4eo3oh2HC68/ChJeHpe+cMP+eK K46vAlbJrDoSbTRFMrAhnrU54uRLAdPXymQFuc+Tkyyev0XiHx9NFbDYscheffLujtuX gW+i/fs5DlzoEF/FheNFTn39IMKWfxBOJnuchGf9UU0lSkMHOnV+MbIsXlhOxjDJZ1Cc nN6g== 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:dkim-signature; bh=h8Hp5LsVsY8iyzznMU6rRN7uhlbtTR0PHM4cQMPZpIY=; b=yC8obvrnZEwZIxhZJ5GYnvlHclteUQdVpYcTvOFx1FA95HQzgTUrcyZGY1VggPkV8g wJFeaijZri+Rw/WmbSxNQEWhkNyobP3qh5vGDhoZkOMXMfm0CMt3hGFcxcTXSwGdap78 R0/FNNLNpLsTba5AmK/A1zFeABqUYXQp9iYK4ETN/YzOriLBiceBqVsp7br/2iOEgQzt voepRozOCwt3PzBExF3ls8BA3zZPwYrSL2RKNWvcFdO00nx1nksyiPRb2C6zrdyekPN0 B19KqLqepf9FUErFTKwNdse+2o8geKj6ZaM1MVofrhhjK/BCJh/NjGyfaFGp+55p2Bi4 oI6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OWnDyCMx; 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=pass (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 k84si11731297oib.46.2020.01.16.10.05.28; Thu, 16 Jan 2020 10:05:40 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OWnDyCMx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390724AbgAPSDx (ORCPT + 99 others); Thu, 16 Jan 2020 13:03:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30052 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2393664AbgAPRko (ORCPT ); Thu, 16 Jan 2020 12:40:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579196443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h8Hp5LsVsY8iyzznMU6rRN7uhlbtTR0PHM4cQMPZpIY=; b=OWnDyCMxa6Zj4lgiYt7jqiYLvOnRaX3KaAf9y+PMJZozAAPBGUVJVyUXuRbS8VQhYxbvDm ECrBBmuw7Y3daEAb7gPL8oZ24I5vXHjrnpoLTxJ/cdT8zPlXOHOO6lX4tNxAU21l2SyXvW o9pw3LokQsD2oHDopqyP4Yju9OKROp8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-MDoAMc0ONGSci6jpwrEnvg-1; Thu, 16 Jan 2020 12:40:39 -0500 X-MC-Unique: MDoAMc0ONGSci6jpwrEnvg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AA36DB33; Thu, 16 Jan 2020 17:40:38 +0000 (UTC) Received: from gondolin (unknown [10.36.117.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0F12101F942; Thu, 16 Jan 2020 17:40:30 +0000 (UTC) Date: Thu, 16 Jan 2020 18:40:27 +0100 From: Cornelia Huck To: "Liu, Yi L" Cc: "alex.williamson@redhat.com" , "kwankhede@nvidia.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "Tian, Kevin" , "joro@8bytes.org" , "peterx@redhat.com" , "baolu.lu@linux.intel.com" , Masahiro Yamada Subject: Re: [PATCH v4 11/12] samples: add vfio-mdev-pci driver Message-ID: <20200116184027.2954c3f5.cohuck@redhat.com> In-Reply-To: References: <1578398509-26453-1-git-send-email-yi.l.liu@intel.com> <1578398509-26453-12-git-send-email-yi.l.liu@intel.com> <20200115133027.228452fd.cohuck@redhat.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.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Jan 2020 13:23:28 +0000 "Liu, Yi L" wrote: > > From: Cornelia Huck [mailto:cohuck@redhat.com] > > Sent: Wednesday, January 15, 2020 8:30 PM > > To: Liu, Yi L > > Subject: Re: [PATCH v4 11/12] samples: add vfio-mdev-pci driver > > > > On Tue, 7 Jan 2020 20:01:48 +0800 > > Liu Yi L wrote: > > > diff --git a/samples/Kconfig b/samples/Kconfig > > > index 9d236c3..50d207c 100644 > > > --- a/samples/Kconfig > > > +++ b/samples/Kconfig > > > @@ -190,5 +190,15 @@ config SAMPLE_INTEL_MEI > > > help > > > Build a sample program to work with mei device. > > > > > > +config SAMPLE_VFIO_MDEV_PCI > > > + tristate "Sample driver for wrapping PCI device as a mdev" > > > + select VFIO_PCI_COMMON > > > + select VFIO_PCI > > > > Why does this still need to select VFIO_PCI? Shouldn't all needed > > infrastructure rather be covered by VFIO_PCI_COMMON already? > > VFIO_PCI_COMMON is supposed to be the dependency of both VFIO_PCI and > SAMPLE_VFIO_MDEV_PCI. However, the source code of VFIO_PCI_COMMON are > under drivers/vfio/pci which is compiled per the configuration of VFIO_PCI. > Besides of letting SAMPLE_VFIO_MDEV_PCI select VFIO_PCI, I can also add > a line in drivers/vfio/Makefile to make the source code under drivers/vfio/pci > to be compiled when either VFIO_PCI or VFIO_PCI_COMMON are configed. But > I'm afraid it is a bit ugly. So I choose to let SAMPLE_VFIO_MDEV_PCI select > VFIO_PCI. If you have other idea, I would be pleased to > know it. :-) Shouldn't building drivers/vfio/pci/ for CONFIG_VFIO_PCI_COMMON already be enough (the Makefile changes look fine to me)? Or am I missing something obvious? > > > > > > + depends on VFIO_MDEV && VFIO_MDEV_DEVICE > > > > VFIO_MDEV_DEVICE already depends on VFIO_MDEV. But maybe also make this > > depend on PCI? > > > > > + help > > > + Sample driver for wrapping a PCI device as a mdev. Once bound to > > > + this driver, device passthru should through mdev path. > > > > "A PCI device bound to this driver will be assigned through the > > mediated device framework." > > > > ? > > Maybe I should have mentioned it as "A PCI device bound to this > sample driver should follow the passthru steps for mdevs as showed > in Documentation/driver-api/vfio-mediated-device.rst." > > Does it make more sense? Yes, it does :)