Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1596562pxf; Fri, 19 Mar 2021 10:38:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl2MbuZ/izZ3rsNIjVLa/mQZqHmrd0ROD0cW9LQejmgZSp6YpmhbdONbrIbMZ1jxB7HeTb X-Received: by 2002:aa7:d642:: with SMTP id v2mr11020472edr.257.1616175503860; Fri, 19 Mar 2021 10:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616175503; cv=none; d=google.com; s=arc-20160816; b=JZH+FfFOwfkJiJUdLx9n0hysoQklFZk8wj5+t0QD+qMQIQDdpTMLWo/T1zXGcBqlhZ QmT3JxjhaXjwPKcOHtBq4j1WNr4bQYowEp4p0i+6KMJJ6z4WhIT4DaLyarRUXX8r+JjJ TnqmY7PRjBbEMXlD4Z55rws0n9R2wE1OjGK9HHTdKLgs31Q9LQ1OUm+Wk3aJuvOgzxLf FBAW6hn0VZKJYXPsWbWgE+6ivZIY5T3anFW69yGvonNJW3u+bY14hpgua0KHixe4m+lu bqCfrIaC41ROlDfTlsXug8yiIuq8qSdgbDBdNlWkQmi9KGq71iAUPNezqgEXc73OmXEa 8p4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XvK0V0qzHhIii8GbFFuNd+vQ7faSsEtxcOA7tbbvbKQ=; b=RVFDRYJ52HBthnVycYmiWkv5INSp4KCVUCuQoTKy7ERPTt7Ylm+kO5HXv57fR9dWbn VeliisKSnjwaHeGEdDfNi0k1OzH5UME/l0TBrKS1ao7orLadkmujedVFl0yqqV64xk0a chJxLe0d217g6dSGuDvBn4LFzo3YHxB7nOkvy94KNfjzqjH1ETfgNl3+nWsRIhY1oIYh LUcHI0Mv4WKNQg1xDzUyqtAzGBf4dmFOniwZmchLKuOQDNtOPLobd/IS/3a0dEivWO9Y BZe7LwKjK9CGfKbRUQQAWPKcj6rd9z+0WgfSVQJ2Ayh7yIT+pSOT4BlaRNgSyZqw/6FB zLeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jGdAhyB4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx25si4646524ejc.382.2021.03.19.10.38.00; Fri, 19 Mar 2021 10:38:23 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jGdAhyB4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbhCSRhJ (ORCPT + 99 others); Fri, 19 Mar 2021 13:37:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51846 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbhCSRgw (ORCPT ); Fri, 19 Mar 2021 13:36:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616175411; 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=XvK0V0qzHhIii8GbFFuNd+vQ7faSsEtxcOA7tbbvbKQ=; b=jGdAhyB4T3ZzsoTw1s2bxaePEuo96qHdWz6ltD7J8astTT9z1H4Ix7zzutxfMWuBd/d2Qe LYS7wvticANZ8Lnbo2deuGSOSGAO3szBbrOTtzOfoNoj0TeoGa9NYAYhdY2RYY6BZXnNhc GtG8ogDrO8IfZVTmQXCuZBX7CtlrqJk= 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-4-_igWD4-vM_2pE7XfVsgbcw-1; Fri, 19 Mar 2021 13:36:47 -0400 X-MC-Unique: _igWD4-vM_2pE7XfVsgbcw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B74B2800D53; Fri, 19 Mar 2021 17:36:44 +0000 (UTC) Received: from omen.home.shazbot.org (ovpn-112-120.phx2.redhat.com [10.3.112.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E0611C936; Fri, 19 Mar 2021 17:36:43 +0000 (UTC) Date: Fri, 19 Mar 2021 11:36:42 -0600 From: Alex Williamson To: Christoph Hellwig Cc: Jason Gunthorpe , 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 Subject: Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers Message-ID: <20210319113642.4a9b0be1@omen.home.shazbot.org> In-Reply-To: <20210319163449.GA19186@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> <20210319162033.GA18218@lst.de> <20210319162848.GZ2356281@nvidia.com> <20210319163449.GA19186@lst.de> 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.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Mar 2021 17:34:49 +0100 Christoph Hellwig wrote: > On Fri, Mar 19, 2021 at 01:28:48PM -0300, Jason Gunthorpe wrote: > > The wrinkle I don't yet have an easy answer to is how to load vfio_pci > > as a universal "default" within the driver core lazy bind scheme and > > still have working module autoloading... I'm hoping to get some > > research into this.. What about using MODULE_SOFTDEP("pre: ...") in the vfio-pci base driver, which would load all the known variants in order to influence the match, and therefore probe ordering? If we coupled that with wildcard support in driver_override, ex. "vfio_pci*", and used consistent module naming, I think we'd only need to teach userspace about this wildcard and binding to a specific module would come for free. This assumes we drop the per-variant id_table and use the probe function to skip devices without the necessary requirements, either wrong device or missing the tables we expect to expose. > Should we even load it by default? One answer would be that the sysfs > file to switch to vfio mode goes into the core PCI layer, and that core > PCI code would contain a hack^H^H^H^Hhook to first load and bind vfio_pci > for that device. Generally we don't want to be the default driver for anything (I think mdev devices are the exception). Assignment to userspace or VM is a niche use case. Thanks, Alex