Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4073753pxj; Tue, 15 Jun 2021 14:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfsGJdvINTedvwYMjYu3rtE+jmLBcZElq1SvotpA2K/5LEydQZ7Xu48ZyJ4dD6q0sK5t30 X-Received: by 2002:a5e:dd03:: with SMTP id t3mr1074350iop.51.1623794394569; Tue, 15 Jun 2021 14:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623794394; cv=none; d=google.com; s=arc-20160816; b=Dn25gSdpJsoXqGzw+pLUuWmWRwdqMVBtj96stOsWvQLRnN+4X5Flu4L/lvXM82/tuF GlaR9MfK69oig4toDndx/o3kww/GLCeSwlJQcdWhU+j++bRl9oBEDxLd36n5mpM3O3TQ xA2pXx9qhPyoZfBfXebCBkXTB2/Q0wKYlavGocrBg2TWdnff+craqmaBW+mlb+0TIu44 pRAfAkQgrKyWOBuLnexR9T+/7Kr9qZaBOKUNXNNdMpkBJNj1WQr/sSwGofLPQbHkYbIB IWE+00UJxwVIeMlq/p32nLOUWCKZsLiryExaYjS3JB8G3PtlA0VDyHUg63hJHcNJ530P 3JPQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=W7cgHmI/gY2s/cNCLnCs84lkX84ZA7FhfJX6tc1qG9M=; b=L/ZSUYlKKfLDuhZwT9jw5OCRyvRymDsPX/K2gLEivihtROpLCKdZQFa0cew6pTDf15 fpl+qn3TQQtNpryfD8Sm0xQSf+dEH8BAuXEUYItmujBGSSfykKtYdW6jYRDuKM4UteBJ Lvh7zHooI0BFeRNe/KeerFgNON67ic0MGjOEebvXDmBKUUwxRRSvCfxelkEKP6VTTpr9 pBvENUE9hZ70lvW4+Cs6W80DtEab96GRFiqSctm7OEK5CYY7joBhrcF6azYMgfOn0H5M kUy/ZfBF2A+7QpeWVQTQH94fS35AjSbFGnkerELM0K7Z3g/Qy04C2p9K9fGv3OI0MjZJ lQEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hoorowNG; 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 t1si61598ile.141.2021.06.15.14.59.41; Tue, 15 Jun 2021 14:59:54 -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=hoorowNG; 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 S230486AbhFOWBK (ORCPT + 99 others); Tue, 15 Jun 2021 18:01:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22853 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhFOWBJ (ORCPT ); Tue, 15 Jun 2021 18:01:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623794344; 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=W7cgHmI/gY2s/cNCLnCs84lkX84ZA7FhfJX6tc1qG9M=; b=hoorowNG4iE9Flpu++CFnonczrb5NRbpca3+9WFQ6KZvs/JMQn4Ow1V87AuAVuRIphCkhM +4oh7XTZ4bdG0vqUE8hbWI75NyTyOnVhtixZFE7GA9JZpHKhbLjXW/dAt9rCrJARdxi6nE nLLsyNvSTFpqo+PlFMLUYVkEqnrwcdg= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-hoAN_zusP0O0c3JQ6jqU4A-1; Tue, 15 Jun 2021 17:59:03 -0400 X-MC-Unique: hoAN_zusP0O0c3JQ6jqU4A-1 Received: by mail-ot1-f70.google.com with SMTP id 108-20020a9d0bf50000b02903d55be6ada3so167218oth.22 for ; Tue, 15 Jun 2021 14:59:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=W7cgHmI/gY2s/cNCLnCs84lkX84ZA7FhfJX6tc1qG9M=; b=C69cPV6/gi9OxcawGNFbZY+rGlgTGY2KGb7BZxevh6G3PT563bL36ffpHPMXNg0Qs4 HiKI1If2nG4G8bK7bE7uOuEYXwkN0swIUpsqXV2YJyejY1wUdqgDGQYnjGcG3IEINIgi ahEj5bbg5E+1CQUFubo9OIpEllDr9OjRdaTijkB+R9MyW+1B2TSYEoHBp2FniPN76Lmi qt+cDOV/qLAEiUeb31iunMMQ6bhPCgpXRvYDqEBfJLFZxOgO1JUILi9ALw0BAK6fSgs7 kqOj4Tmv3gFwvkEpBfyu6sFo3DA0uJSK6MjpL0Sk7X+ARuQo+3HbsoV023mEvu+aC0Eq mJWg== X-Gm-Message-State: AOAM531ESGvE7J/BZYIS8R7N+Rag+G3BA5xT7K7jggMN+m2oMa67xy0U dauhwOoYmEuHHvazA/jqvc+DKv+VV445uHfujInEYi+3CHKsUGuscpM2F1K8kKXUUBgKqWxYnwe 79N8FssjApMqoE83R/wb3MO9o X-Received: by 2002:a54:448f:: with SMTP id v15mr4802897oiv.18.1623794342552; Tue, 15 Jun 2021 14:59:02 -0700 (PDT) X-Received: by 2002:a54:448f:: with SMTP id v15mr4802866oiv.18.1623794342194; Tue, 15 Jun 2021 14:59:02 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id v14sm58471ote.15.2021.06.15.14.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 14:59:01 -0700 (PDT) Date: Tue, 15 Jun 2021 15:59:00 -0600 From: Alex Williamson To: Jason Gunthorpe Cc: Max Gurtovoy , cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, aviadye@nvidia.com, oren@nvidia.com, shahafs@nvidia.com, parav@nvidia.com, artemp@nvidia.com, kwankhede@nvidia.com, ACurrid@nvidia.com, cjia@nvidia.com, yishaih@nvidia.com, kevin.tian@intel.com, hch@infradead.org, targupta@nvidia.com, shameerali.kolothum.thodi@huawei.com, liulongfang@huawei.com, yan.y.zhao@intel.com Subject: Re: [PATCH 09/11] PCI: add matching checks for driver_override binding Message-ID: <20210615155900.51f09c15.alex.williamson@redhat.com> In-Reply-To: <20210615204216.GY1002214@nvidia.com> References: <20210603160809.15845-10-mgurtovoy@nvidia.com> <20210608152643.2d3400c1.alex.williamson@redhat.com> <20210608224517.GQ1002214@nvidia.com> <20210608192711.4956cda2.alex.williamson@redhat.com> <117a5e68-d16e-c146-6d37-fcbfe49cb4f8@nvidia.com> <20210614124250.0d32537c.alex.williamson@redhat.com> <70a1b23f-764d-8b3e-91a4-bf5d67ac9f1f@nvidia.com> <20210615090029.41849d7a.alex.williamson@redhat.com> <20210615150458.GR1002214@nvidia.com> <20210615102049.71a3c125.alex.williamson@redhat.com> <20210615204216.GY1002214@nvidia.com> Organization: Red Hat X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Jun 2021 17:42:16 -0300 Jason Gunthorpe wrote: > On Tue, Jun 15, 2021 at 10:20:49AM -0600, Alex Williamson wrote: > > On Tue, 15 Jun 2021 12:04:58 -0300 > > Jason Gunthorpe wrote: > > > > > On Tue, Jun 15, 2021 at 09:00:29AM -0600, Alex Williamson wrote: > > > > > > > "vfio" override in PCI-core plays out for other override types. Also I > > > > don't think dynamic IDs should be handled uniquely, new_id_store() > > > > should gain support for flags and userspace should be able to add new > > > > dynamic ID with override-only matches to the table. Thanks, > > > > > > Why? Once all the enforcement is stripped out the only purpose of the > > > new flag is to signal a different prepration of modules.alias - which > > > won't happen for the new_id path anyhow > > > > Because new_id allows the admin to insert a new pci_device_id which has > > been extended to include a flags field and intentionally handling > > dynamic IDs differently from static IDs seems like generally a bad > > thing. > > I'd agree with you if there was a functional difference at runtime, > but since that was all removed, I don't think we should touch new_id. > > This ends up effectively being only a kbuild related patch that > changes how modules.alias is built. But it wasn't all removed. The proposal had: a) Short circuit the dynamic ID match b) Fail a driver-override-only match without a driver_override c) Fail a non-driver-override-only match with a driver_override Max is only proposing removing c). b) alone is a functional, runtime difference. As per my previous example, think about using it as effectively an anti-match. Userspace can create dynamic entries that will be matched before static entries that can demote a driver to not be able to bind to a device automatically. That's functional and useful, I can't think of any other way we have to effectively remove a static match entry from a driver. Thanks, Alex