From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D82547E0 for ; Wed, 30 Nov 2022 01:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669771734; x=1701307734; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=FiqAFQXIvz60hbT0xq79nRbGcPgH1YTtz35ZXjIbxDA=; b=XFrEWzILez8jbBrfp5zZWFyH7r5c8GaAWOxgH2gs/PXQfq/G4gvD48Mz wG6V5yBHY6NRDtXvIboBbLi28YU3Dzm2cufxSGdpNCfV8mSkUD4OAb6tM gBPLz39xa43T3FSXSpUwt+7Dg9Ll/eSTsoe5L5VKeg+GT9Qpaf10dfL3F jc5p8kJVwbq6xkZcQARwUHH4S3RChNLNT6nttGsP58h624i4LLrpiZrLi SaBb43up+c/IYfqldU+EvTxipd/NXOoZ6451AUasKCIotb+xd0naPMPae zX7TrHYbGcUmTwIFpHjFLaLPOiakaxoau+0UphBc21YRVoa1h35jVREEq g==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="377434704" X-IronPort-AV: E=Sophos;i="5.96,204,1665471600"; d="scan'208";a="377434704" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 17:28:54 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="768645885" X-IronPort-AV: E=Sophos;i="5.96,204,1665471600"; d="scan'208";a="768645885" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.210.199]) ([10.254.210.199]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 17:28:49 -0800 Message-ID: Date: Wed, 30 Nov 2022 09:28:47 +0800 Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Cc: baolu.lu@linux.intel.com, Niklas Schnelle , Matthew Rosato , Gerd Bayer , iommu@lists.linux.dev, Joerg Roedel , Will Deacon , Wenjia Zhang , Pierre Morel , linux-s390@vger.kernel.org, borntraeger@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, linux-kernel@vger.kernel.org, Julian Ruess Subject: Re: [PATCH v2 4/7] iommu: Let iommu.strict override ops->def_domain_type Content-Language: en-US To: Jason Gunthorpe , Robin Murphy References: <20221116171656.4128212-1-schnelle@linux.ibm.com> <20221116171656.4128212-5-schnelle@linux.ibm.com> <33eea9bd-e101-4836-19e8-d4b191b78b00@linux.intel.com> <9163440eb6a47fe02730638bbdf72fda5ee5ad2c.camel@linux.ibm.com> <52fe7769ca5b66523c2c93c7d46ebc17dc144aca.camel@linux.ibm.com> <6c4c3a3e-1d8d-7994-3c03-388ef63dddb3@arm.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2022/11/30 4:09, Jason Gunthorpe wrote: > On Tue, Nov 29, 2022 at 06:41:22PM +0000, Robin Murphy wrote: >> On 2022-11-29 17:33, Jason Gunthorpe wrote: >>> On Mon, Nov 28, 2022 at 09:01:43PM +0000, Robin Murphy wrote: >>> >>>> I'm hardly an advocate for trying to save users from themselves, but I >>>> honestly can't see any justifiable reason for not having sysfs respect >>>> iommu_get_def_domain_type(). >>> >>> We really need to rename this value if it is not actually just an >>> advisory "default" but a functional requirement .. >> >> It represents a required default domain type. As in, the type for the >> device's default domain. Not the default type for a domain. It's the >> iommu_def_domain_type variable that holds the *default* default domain type >> ;) > > I find the name "default domain" incredibly confusing at this point in > time. > > I would like to call that the "dma-api domain" - its primary purpose > is to be the domain that the DMA API uses to operate the IOMMU, there > is little "default" about it. This meshes better with our apis talking > about ownership and so forth. > > So, if the op was called > get_dma_api_domain_type() > > It is pretty clear that it is the exact type of domain that should be > created to support the DMA API, which is what I think you have been > describing it is supposed to do? > > And with Lu's series we have the set_platform_dma() (Lu perhaps you > should call this set_platform_dma_api() to re-enforce it is about the > DMA API, not some nebulous DMA thing) Sure thing. It's more specific. > > Which is basically the other way to configure the DMA API for > operation. > > And encapsulating more of the logic to setup and manage the DMA API's > domain into dma-iommu.c would also be helpful to understanding. > >> Which reminds me I should finish that patch undoing my terrible >> ops->default_domain_ops idea, not least because they are misleadingly >> unrelated to default domains... > > :) > >>> It is close to being clear, once we get the last touches of dma-iommu >>> stuff out of the drivers it should be quite clear >> >> Cool, some upheaval of .domain_alloc is next on my hitlist anyway, so that >> might be a good excuse to upheave it a bit more and streamline the type >> stuff along the way. > > Yes, I think so. I want to tidy things a bit so adding this "user > space" domain concept is a little nicer > > Jason > -- Best regards, baolu