Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1543452pxf; Fri, 19 Mar 2021 09:22:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQg6EwPl70JS89Y+bv1UJcONjaxrSgF/By9cK7x6A9gA2KuznEGPdTkOj2uTJU+YFG3nJ+ X-Received: by 2002:a05:6402:cb8:: with SMTP id cn24mr10694214edb.105.1616170934533; Fri, 19 Mar 2021 09:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170934; cv=none; d=google.com; s=arc-20160816; b=kF7nPgafq1xijX339zSP4oNo/nAJ1xQ1L1MamevRwBz/czLvf0gY4QtPnL50sn38EE JEQBsmL6UjVbnjRISCy/qb9ylkLs7XsodP7gt98wSbKQBguxyWRispU2e8EnJUokZVWW /Ba2ygX2aSdTvswchXno4GfrkTnWJyEJ5K+1y3a7XXNIf9L145dvyXV7O9IKojvH5EYE 9Xe7JR1ujjglxCh6k/knIBMsgRw0ATjE6elqldpOlSlF4w+oJbZkDW7HSyPBKZFilegz DkAH7dxzsudFC4T68Au7QpylOxp/0vGaBjWQHJWONtLFvZ0rRLR97IogJKD8T0RcdoG6 4BLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UodcJcqQsXrhUqft41EsqhFvQ1D+k/QtJisWS2QpaiQ=; b=We7chsNWzZPXIGLWGmTnW+VX2re+XI0HockI6NR3mj9ceUyC4weX+RDx+PUBbWo/Jx sI8ygFzkeO22Z4X7aeVm4grLyjP/HNPCS53y+IaZNZPJJ96/TB7W3k6Dpi4uHY+YmbIW oIqb4uwWowFEul4Tv0KRRdjcHZA1iOk9hpqRvdwBWctDIyeQ5vVvtbHSLJJxW+2UwflK Kwr8T8WBCa16szivBLsvtPQAbAlvNFmtfhPDtNuyRLxZmSu7wSq8zyvu3a7GFJnbMZiC /NHpuwwFdfQjcKCi5oqtNySi+fr7F1ZNeNYZT5nmoeTjDTxa4GQTQVQjzw9ISXs0VfZL +8Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si4520880edq.224.2021.03.19.09.21.52; Fri, 19 Mar 2021 09:22:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbhCSQUu (ORCPT + 99 others); Fri, 19 Mar 2021 12:20:50 -0400 Received: from verein.lst.de ([213.95.11.211]:46871 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhCSQUi (ORCPT ); Fri, 19 Mar 2021 12:20:38 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 49CB268BFE; Fri, 19 Mar 2021 17:20:34 +0100 (CET) Date: Fri, 19 Mar 2021 17:20:33 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Alex Williamson , Max Gurtovoy , Alexey Kardashevskiy , cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, liranl@nvidia.com, oren@nvidia.com, tzahio@nvidia.com, leonro@nvidia.com, yarong@nvidia.com, aviadye@nvidia.com, shahafs@nvidia.com, artemp@nvidia.com, kwankhede@nvidia.com, ACurrid@nvidia.com, cjia@nvidia.com, yishaih@nvidia.com, mjrosato@linux.ibm.com, hch@lst.de Subject: Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers Message-ID: <20210319162033.GA18218@lst.de> References: <20210309083357.65467-1-mgurtovoy@nvidia.com> <20210309083357.65467-9-mgurtovoy@nvidia.com> <19e73e58-c7a9-03ce-65a7-50f37d52ca15@ozlabs.ru> <8941cf42-0c40-776e-6c02-9227146d3d66@nvidia.com> <20210319092341.14bb179a@omen.home.shazbot.org> <20210319161722.GY2356281@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319161722.GY2356281@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 01:17:22PM -0300, Jason Gunthorpe wrote: > I think we talked about this.. We still need a better way to control > binding of VFIO modules - now that we have device-specific modules we > must have these match tables to control what devices they connect > to. > > Previously things used the binding of vfio_pci as the "switch" and > hardcoded all the matches inside it. > > I'm still keen to try the "driver flavour" idea I outlined earlier, > but it is hard to say what will resonate with Greg. IMHO the only model that really works and makes sense is to turn the whole model around and make vfio a library called by the actual driver for the device. That is any device that needs device specific funtionality simply needs a proper in-kernel driver, which then can be switched to a vfio mode where all the normal subsystems are unbound from the device, and VFIO functionality is found to it all while _the_ driver that controls the PCI ID is still in charge of it. vfio_pci remains a separate driver not binding to any ID by default and not having any device specific functionality.