From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46BD8C433EF for ; Thu, 24 Feb 2022 08:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232146AbiBXI71 (ORCPT ); Thu, 24 Feb 2022 03:59:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbiBXI7Q (ORCPT ); Thu, 24 Feb 2022 03:59:16 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6403615C9F2; Thu, 24 Feb 2022 00:58:46 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 21F78D6E; Thu, 24 Feb 2022 00:58:46 -0800 (PST) Received: from [10.57.40.147] (unknown [10.57.40.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 73E543F70D; Thu, 24 Feb 2022 00:58:40 -0800 (PST) Message-ID: <31dc9d19-362d-4c1a-1483-cc7f525c6dd3@arm.com> Date: Thu, 24 Feb 2022 08:58:36 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v6 01/11] iommu: Add dma ownership management interfaces Content-Language: en-GB To: Lu Baolu , Jason Gunthorpe Cc: Greg Kroah-Hartman , Joerg Roedel , Alex Williamson , Bjorn Helgaas , Christoph Hellwig , Kevin Tian , Ashok Raj , 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 References: <20220218005521.172832-1-baolu.lu@linux.intel.com> <20220218005521.172832-2-baolu.lu@linux.intel.com> <20220223180244.GA390403@nvidia.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-02-24 05:29, Lu Baolu wrote: > On 2/24/22 1:16 PM, Lu Baolu wrote: >> Hi Robin and Jason, >> >> On 2/24/22 2:02 AM, Jason Gunthorpe wrote: >>> On Wed, Feb 23, 2022 at 06:00:06PM +0000, Robin Murphy wrote: >>> >>>> ...and equivalently just set owner_cnt directly to 0 here. I don't >>>> see a >>>> realistic use-case for any driver to claim the same group more than >>>> once, >>>> and allowing it in the API just feels like opening up various potential >>>> corners for things to get out of sync. >>> I am Ok if we toss it out to get this merged, as there is no in-kernel >>> user right now. >> >> So we don't need the owner pointer in the API anymore, right? > > Oh, NO. > > The owner token represents that the group has been claimed for user > space access. And the default domain auto-attach policy will be changed > accordingly. > > So we still need this. Sorry for the noise. Exactly. In fact we could almost go the other way, and rename owner_cnt to dma_api_users and make it mutually exclusive with owner being set, but that's really just cosmetic. It's understandable enough as-is that owner_cnt > 0 with owner == NULL represents implicit DMA API ownership. Cheers, Robin.