Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4118290pxj; Tue, 15 Jun 2021 16:03:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJDvkKcQfH+/ZFGJslDDmFOzGT79+UplOUJFECW+bLQWWWGtxRGpxF1TMkPyCcx2KiSG9J X-Received: by 2002:a17:907:62a5:: with SMTP id nd37mr1970078ejc.148.1623798224508; Tue, 15 Jun 2021 16:03:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623798224; cv=pass; d=google.com; s=arc-20160816; b=NeYTGS07kyFYuLHaofSmQvwvZ71tPXqM/6b05RnEVIz/WY1wIHA4oaBlRWzH43JM+Y lNb+PayqA7lmY/mkDKGBPqEI/x8sC8kR0gOA5fKztMVBT/2fkMP8v4CrCNL/1Zjf5kbg j2YtUdw6dR8Deg9Uw8FNmGQUg82lqW4LAG/SWeDi5gJOeeoDlXY6h4U8OF23yic93XWp 9VBSH7u6a2esLK6zNFwGggdrlWrgyUMBK3puzriuI9eXv4NpTGRa+3L4e5Zu7mh1ZIoV rZYURu070AMzR0a3iMzo3RXGugziKrpLfYYNmQ4ilq1BSdDiJ/7wDt19X04jVoJ4vNp2 /HJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k1+7GZx9jsvllj7uZxCuI3ZppqER0B1GuBjH/FdeLBc=; b=E+AVKzCxqWEq39gpkByejloP8c9BGkq5mgEKD1jlziXDSxKY1zj4YyZJCBpZwoRLzy srnvSKj6YArBPY2PLjWHArt+P8LisoX+pJQPhwqbhYjbevLm2gRPkhd4CctEz+bGmoF3 Nn9TPRtFR+J5mukO1V6U/5ljfD3feqV0XG8zzRv2+9RJJWfWKxyeBJd5DV7mQygdNUwQ PlFEkc0PlUSY6j95g9diCFtmIIrcP6LOHxZW3pcp/qYakUU+RFAOMLKfhTGhqPtE9qLK xvhdepWnfbfM4PQKViGL2KmdYYEVOGQXeNhl1iV65pZCl4zZe6NdxY8yelFbm45fA3GK xy4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=LBIM+b5D; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si173512edr.379.2021.06.15.16.03.06; Tue, 15 Jun 2021 16:03:44 -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=@Nvidia.com header.s=selector2 header.b=LBIM+b5D; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbhFOXC0 (ORCPT + 99 others); Tue, 15 Jun 2021 19:02:26 -0400 Received: from mail-dm6nam12on2073.outbound.protection.outlook.com ([40.107.243.73]:43073 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230186AbhFOXCZ (ORCPT ); Tue, 15 Jun 2021 19:02:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hyu4J3SFVrXe6xlwuraDs9dESj91HPrXn7tt78VuEulyGjDAsCAvI4uSKrczlS5HrybWNEOnwPC58NQ7PxfDdQFzh8z9/BRrnq7O5mY/SNNq4uY9u6x1oBzkw6F7KZiGwYifqd+cKI8JsYmFZmNPx0D2DQZpw+o3Px/XJ5YSPoKMpcHXzpySOAfC7g2jhW985GG462/EBN7lHxCJAZhXySlYaWXwv3KHByXf91N5lFM9eGSS/VlUiIDjL5+RKxoC31/aPzHZrFeHlB5ie6ooHgWvUIpB4LAimTxRK5uTVIaLVW4/aS7l3xHS/tK1UCJow1+U6i1VjSx2m2pLvjdz7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k1+7GZx9jsvllj7uZxCuI3ZppqER0B1GuBjH/FdeLBc=; b=OgX6kxQZqRt8uRq63s6eyrldXhrfhXKOBzyDt7oHIZhCArY/nzBm+UuIsxednEO+2Ojpt24Fy/ILwDSlKBe/c1mU3U7C6do2dkpq3yfm+2BUwnCLQX5v3oEPs/KQ7cS1D7cXwsc/KQN9zx5GKLaNPHaZFfEAKnXijkfLl+Ng8tiyWOyog3FToH7jMgTCjITzL6fxAOGEMYKFWtw00P4XtqemQLHn7iKOnPkj/5ifcSg2SuyLbdQWssqGCUzZT8b/YtN4YF0rhMmvColF2xAR40X2IEC8YHeNkGmsBuY6nfEA6cdFlpu28pUaw/L4G/LQ0l0gj5BboaPnVeRiUxNDbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k1+7GZx9jsvllj7uZxCuI3ZppqER0B1GuBjH/FdeLBc=; b=LBIM+b5DJC8IERtsj5pzDKvdgDmT1WwrvV+jhMHoIYDAka8CI/IAtdJzKtuqabn1Jz186GXRCBMGIJ/nDQxwGQ7B3pF6MzxG6P0vQ6nmEjwweuduZ5p1OfruxBSP5OdHHexEt9v26LJ0dhcLmKw1pjg5y4APzvFLTTtCVO381+KimPMYekm4hMQxuTpVTaeho2jZTqQyhIYE7ITbOXGXZgSRRfIOy+SdsXRWO5PAUFauP9tVMCTMo+cWlJBfAi767k4VFArHfvxMCa21OJNC0z+KC5of8pb1Ga8R0XykiaxsaLmvnBg58lFiLiRRijrRvyQ4EEyJ3bWL+oLAGEOS6Q== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5080.namprd12.prod.outlook.com (2603:10b6:208:30a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15; Tue, 15 Jun 2021 23:00:19 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%8]) with mapi id 15.20.4242.016; Tue, 15 Jun 2021 23:00:19 +0000 Date: Tue, 15 Jun 2021 20:00:17 -0300 From: Jason Gunthorpe To: Alex Williamson 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: <20210615230017.GZ1002214@nvidia.com> References: <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> <20210615155900.51f09c15.alex.williamson@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210615155900.51f09c15.alex.williamson@redhat.com> X-Originating-IP: [206.223.160.26] X-ClientProxiedBy: CH2PR11CA0020.namprd11.prod.outlook.com (2603:10b6:610:54::30) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (206.223.160.26) by CH2PR11CA0020.namprd11.prod.outlook.com (2603:10b6:610:54::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 23:00:19 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1ltI2b-007G6J-Ra; Tue, 15 Jun 2021 20:00:17 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 432a3b44-71c6-4d05-eadf-08d9305158e8 X-MS-TrafficTypeDiagnostic: BL1PR12MB5080: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:285; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eewi7wC4Ghqiqs+15Pn5c42JnEjhBH3iN4XbunbeDRUzBYhoHts2tYeVDPh703WKOSQVKf0l5ev1cOBizaFSP1L/0I5ryvQTkq94Z7HXC+eg2ILDdi55Ugxaxx0FG6Mi9jBXFuz/iEiotpM81siCOlb53JVa3XClBh0krr5pqHazBULRAX0lr6PsvwtXpStsJngQ8CtbZIjK+VNCOh4BV6MrNm7Q6McBzdnrlJuwVVZkIcrRaaNk5FSZa9SUG4hzmR3lZ8hBbcaGaNoXHYw1CgukkeN6VYnWOvIFCfWHpkGlNIbHWV7oB03AXgT3X7PU+R3qy74zaOPv3RAyx+/KA/jjPu3eRTfBfx8ljyVoGG1CXaF7E8w+n+bNz72DM78QezCoUtdZ/bRw6QSiLV1ARxeJcPO0pdv4fRfYU+bBYxrEbhkgLhW4tWywRMWocSE9IxQkVGGLgOXrPAMGJJkQcgOrNkE1CLIqPjQgWQRtE4mUKpnj8+eULok/21Pjn57BL7V8TvEOje2GQ2qraQK/KmH8GEeZre86jfk/+nNCz8eM4c0QA+p/bE7HOas3qe6Yhk/NgGoKMFRyBD3gn2n+3A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39860400002)(376002)(396003)(366004)(346002)(66476007)(26005)(2906002)(66556008)(426003)(86362001)(33656002)(36756003)(66946007)(4326008)(2616005)(9746002)(8936002)(8676002)(6916009)(186003)(316002)(478600001)(9786002)(83380400001)(1076003)(38100700002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mHT1a0yVdiPLDZ7BeW3zr0jM74Ug28aFVT5QzHA7iG0Tyr+fJl79hJenR+8v?= =?us-ascii?Q?qSOhEUJAnSEXEvvK+Oxxk++WRoFaq+W3nmmwdYclsVKnsiDojtxW89wYmTj8?= =?us-ascii?Q?ZuM9bZAFBA0nWhnfOs4AGC852oJJ9y9h1c5Q/xu6y7rmhnIo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VDZ65AaIlVeoxejZMCeNoMPWgtU8Gp?= =?us-ascii?Q?cy7AaUKBNri7v+3gN2HBVDCc7NFApj89ipWkBNxSaZZiBx0k23BAgFSMZkb5?= =?us-ascii?Q?8HwJkQ5Bgj9uPwiyft4cZN33rXR2HLQXLXqJWxwn3gHobLlBlY8Pg2WLyF/4?= =?us-ascii?Q?e5RDyu3SKpkU/zQyb9KOLDc8YjyCzxUTqIP/xpe0ct2RNryGZaOp+JsZRGDg?= =?us-ascii?Q?1hTbtK+6oNyOsxAmi8TyfA6KhH7BYqCkJZBHfe7RBGALwftlD0B/Qfj4r16g?= =?us-ascii?Q?YznE8KSzUd0xPE8q5gJFH4tJ?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 432a3b44-71c6-4d05-eadf-08d9305158e8 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 23:00:19.4597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6f2ICIEzxtMc5J2TlaROpdqW5Cq+ojoQ6m3l9iD3iqoHUesdtQt3DZ/5nL/4Ho7p X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5080 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 03:59:00PM -0600, Alex Williamson wrote: > 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. I would state b) differently: b) Ignore the driver-override-only match entries in the ID table. As if we look at new_id, I can't think of any reason for userspace to add an entry to the ID table and then tell the kernel to ignore it. If you want the kernel to ignore it then just don't add it in the first place. Do you have some other scenario in mind? Jason