Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5755603pxb; Mon, 14 Feb 2022 06:58:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyILQm91DlY/sEDj0pF7hvVmgqlFU7MfEJmAcHxnvrimzqdK3AJ3z6UjRjAwmlzT1Khu6eO X-Received: by 2002:a05:6402:51cd:: with SMTP id r13mr15801541edd.381.1644850718632; Mon, 14 Feb 2022 06:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644850718; cv=none; d=google.com; s=arc-20160816; b=zawiKOsgEsoyx2W/uSd0+g+IpaV7p9+mqz2eXVU6C2+Qphdl6AF6ClWrr4czAK2PVp JKRq7yoUq65xNF0Eu3QVuaPgxSS3ILRzRuj5p4UIGgJgEsfyuoL/5n0q4QCqrK89PwHp ds2Qgb1IiwOUZgpc+4RZWwarunOzVvCQzbnCrZurjM5IfNfPloFkmi2uq694cxw5i4mf U15AnAhKjiE4TtVGJbZCFkZOcWGYiHD5CJKqc9cEpTLj1sd4tI1Ir7vok/HlaWNyTK0M hK26+hBNfAejwKtuGiJi+MIRrQfE0wHCdRs5aDyheNTf0GQtJjFBeiE7G9UEfqGUw2aH w19g== 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=gKqSSMVp9fnpREJPNyTzwTKdkQhpPrDl9TPwUzxyMWw=; b=qccVVqogm6HNO0pgLgDabNeBxb02eUTFOD8038Fw5Vc6BBhFJsVPJ5x5AqESYr0QOq ILBjY+CU54t/qcMhkOLrgaVBC7umUJLWhF97ciyb8t5jNwF1jdShzbenE1nP24Ztr3fl tATHXCaCkkFgCOR45IO/UgvP4ssNGkrpTpavlR2zybLQ94ixG5kMlDMQvS7HZ6iWAMDy ucrsGKTczd1AUq0zo/fEoLJqI7taGWWUcxRvMuLtAnlj6rvrxiaVQ6FTkFNdsKSNhe9e OHBeDrrKj5y1IwRmwm1aPzwrt95rEO47rSv5OOKbPA/5PYri4O7+l/OqJWlNVz73FH+u xnnA== 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 hg5si19587873ejc.6.2022.02.14.06.58.14; Mon, 14 Feb 2022 06:58:38 -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 S1355243AbiBNOkG (ORCPT + 99 others); Mon, 14 Feb 2022 09:40:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237294AbiBNOkF (ORCPT ); Mon, 14 Feb 2022 09:40:05 -0500 X-Greylist: delayed 11567 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 14 Feb 2022 06:39:56 PST Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC20488AB; Mon, 14 Feb 2022 06:39:56 -0800 (PST) Received: by theia.8bytes.org (Postfix, from userid 1000) id 2F194374; Mon, 14 Feb 2022 15:39:54 +0100 (CET) Date: Mon, 14 Feb 2022 15:39:53 +0100 From: Joerg Roedel To: Jason Gunthorpe Cc: Lu Baolu , Alex Williamson , Robin Murphy , Christoph Hellwig , Kevin Tian , Ashok Raj , Greg Kroah-Hartman , Bjorn Helgaas , Will Deacon , Dan Williams , rafael@kernel.org, Diana Craciun , Cornelia Huck , Eric Auger , Liu Yi L , Jacob jun Pan , Chaitanya Kulkarni , Stuart Yoder , Laurentiu Tudor , Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , Li Yang , Dmitry Osipenko , iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214130313.GV4160@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 09:03:13AM -0400, Jason Gunthorpe wrote: > Groups should disappear into an internal implementation detail, not be > so prominent in the API. Not going to happen, IOMMU groups are ABI and todays device assignment code, including user-space, relies on them. Groups implement and important aspect of hardware IOMMUs that the API can not abstract away: That there are devices which share the same request-id. This is not an issue for devices concerned by iommufd, but for legacy device assignment it is. The IOMMU-API needs to handle both in a clean API, even if it means that drivers need to lookup the sub-group of a device first. And I don't see how a per-device API can handle both in a device-centric way. For sure it is not making it 'device centric but operate on groups under the hood'. Regards, Joerg