Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6387044pxb; Tue, 15 Feb 2022 01:02:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2jP5m6qnqLeQ+tbp4aGc0ziiqNBmQsem69vGYQGZADgscnCDAFOX3eBlgsADEgjBP8g3/ X-Received: by 2002:aa7:d7d4:: with SMTP id e20mr2983836eds.84.1644915772020; Tue, 15 Feb 2022 01:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644915772; cv=none; d=google.com; s=arc-20160816; b=jJ0UM17heBOudvbPxJi5V2NsJ1/xCOU73bC8x1IYmXCoe5TmcLSpOnJox6bCKWa0a/ fIzo0+56JpwzOMWp8FZYB/eahODRNfTI66erhxCBF28LAHj+Pv4IQBT8dMrxXjslNIcC 3sJS+/vW3d9Dw1BnRyF099LQuhBdHK4AXUjBm3XBiGrpylNjrsr0IEfK7MSjaPw/a3O7 4UmlNyiBC3oV1HbffLYSZFmXbiAvm8RA2ZbfP/ih8X6OWINiSfeZlXPhU9svV08kzP/Z qjU/cOxbtkGhb1aboZvAqYDe1TXAt0gIfpAy0k0ZOjwAUzZsoJM3OiO4kR09cdXr44E1 olSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8iGQfPM14BCf1Xx1yrR3UUeZQ1xCh95Oy0FrcL4skwU=; b=vpSBdgzsrgxIh8eVauqzMtAvcXDCPa09Qaek7L5hv56RLimmb1TPPmH6xe1siX5Yfn ouXIEvNTMszgxmFLcfW1ljjHaA+Rfn1YqOmUtKjJGFqquTc779dRzuo3AqYUBxPPew5i hLESwhLYvRWw1dbDJu3IQbfO3LFfiB1EXmPczugL/FMyvJW9fvsmYm9PJchbvNOmlXt4 PsHZt7/kzIU280FZHMBdqTxjylV7BmtOUNcV0eRkewv8np+zxPuq+6PeMwweDA1dYc3U m/HRNNDA25HmOb2SwtEdmN4OKqirthC15RgAkhE6L+C/2+T7erhipqv7q3622ydLPN6o L8WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw1si26553219ejc.281.2022.02.15.01.02.28; Tue, 15 Feb 2022 01:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234685AbiBOI6b (ORCPT + 99 others); Tue, 15 Feb 2022 03:58:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiBOI6a (ORCPT ); Tue, 15 Feb 2022 03:58:30 -0500 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586B41133F5; Tue, 15 Feb 2022 00:58:20 -0800 (PST) Received: by theia.8bytes.org (Postfix, from userid 1000) id 8935936D; Tue, 15 Feb 2022 09:58:18 +0100 (CET) Date: Tue, 15 Feb 2022 09:58:13 +0100 From: Joerg Roedel To: Jason Gunthorpe Cc: Robin Murphy , Stuart Yoder , rafael@kernel.org, David Airlie , linux-pci@vger.kernel.org, Thierry Reding , Diana Craciun , Dmitry Osipenko , Will Deacon , Ashok Raj , Jonathan Hunter , Christoph Hellwig , Kevin Tian , Chaitanya Kulkarni , Alex Williamson , kvm@vger.kernel.org, Bjorn Helgaas , Dan Williams , Greg Kroah-Hartman , Cornelia Huck , linux-kernel@vger.kernel.org, Li Yang , iommu@lists.linux-foundation.org, Jacob jun Pan , Daniel Vetter Subject: Re: [PATCH v1 3/8] iommu: Extend iommu_at[de]tach_device() for multi-device groups Message-ID: References: <20220106022053.2406748-1-baolu.lu@linux.intel.com> <20220106022053.2406748-4-baolu.lu@linux.intel.com> <20220214130313.GV4160@nvidia.com> <08e90a61-8491-acf1-ab0f-f93f97366d24@arm.com> <20220214154626.GF4160@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214154626.GF4160@nvidia.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 14, 2022 at 11:46:26AM -0400, Jason Gunthorpe wrote: > On Mon, Feb 14, 2022 at 03:18:31PM +0000, Robin Murphy wrote: > > > Arguably, iommu_attach_device() could be renamed something like > > iommu_attach_group_for_dev(), since that's effectively the semantic that all > > the existing API users want anyway (even VFIO at the high level - the group > > is the means for the user to assign their GPU/NIC/whatever device to their > > process, not the end in itself). That's just a lot more churn. > > Right Okay, good point. I can live with an iommu_attach_group_for_dev() interface, it is still better than making iommu_attach_device() silently operate on whole groups. > VFIO needs them because its uAPI is tied, but even so we keep talking > about ways to narrow the amount of group API it consumes. > > We should not set the recommended/good kAPI based on VFIOs uAPI > design. Agree here too. The current way groups are implemented can be turned into a VFIO specific interface to keep its semantics and kABI. But the IOMMU core code still needs the concept of alias groups. Regards, Joerg