From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796219719; b=j7iimH9nIUF/kbaxikSDLdoxXEEHBJ+UhcpWliaOZeQF7dKvb0SlooGbtXfy3RkhlY1r kAXmKHiSOraQ/eTe35lQ01qQy+fDx5YnwWikOrdy1tV8sWzhg0mJ8YeNYKKQJp+z5bssy keC+qbP6yF1g9f0jbzfZ8OrPnGj3O7R4eDPl7QvXUiizyQwkUlI++PxZbZadGGSv2dRgU nmvlv5zRFz9NaNPf18UDdIRY3E9OyfxtCDrwWfQrc+CUnWUkxXy+Pnb+EZwewAlS2QzkC /1H56qrU62onOCJzOMpaTV9xjedhq3EvSkqZctzk9wNRtt4lhvHy/C9/pYtm15HpT4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796219719; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=pJeAp1VPeFadO8P6pmmzoViAn+qqZmuD47U4FofTomE=; b=3VqydJrOazj6GT8DLSvC+iAjilL/v+UqnbJKbKuGHFxDGOrml5gLCPgSO9BDC5dZiswa 9oBQlW4Eq363g52zsN+PyNlhqIcfevJ3WBHCMVLm7kxP9Od9AwcUYXlNIYQEDP9bXIbLs 3o74UjaE0QSWltQ/OvoqCeoPnKdXEJ6Jm/rwBYevnhD++cXl8+GkGZdBynetirNg9rDFZ vjQmgYJ4MzbzxDNh+G0kNbkMcR0D/Jqagqo0j2LDH/axAwGIF10LUZOXmZ6ZL5tM5pbx/ d5tBlE73Jn975SOeMivWAsU7TPBe3VmAneyAvTM2I5x5DsQ7Y8yWAfHzJKsFH0oYp+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=jHEA9kGM; arc=none smtp.remote-ip=209.85.160.179 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E1B8606A323 for ; Wed, 2 Dec 2026 13:55:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5E1B8606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=jHEA9kGM Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-55b8cd4e2abso132002331cf.1 for ; Wed, 02 Dec 2026 05:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796219718; x=1796824518; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pJeAp1VPeFadO8P6pmmzoViAn+qqZmuD47U4FofTomE=; b=jHEA9kGM2rfPureWaTl1xYqQfl3hnix+jGo88nS7fk/+eK4IpJvaI54PlHhFY/Qn69 ljgSEnBXdyn23OjbBdv58r7kIijJ7Kt17g5/MVkopx8umijw/X+Zxf5JvCnluGI+gWm+ WW1duuEgLDRbFLa9TKxlkmJdqSqF8JgNybfN6Xp4iYwUajue4VfllilGvoonLsE0QE9y P2e6DWcjJ3gNS85LI2QkHO7CdT/LPMmObttSz8DBCTeohItdbt9z+K0cU8JDl6AeJR70 ba5KrNKZKvXo5599RvkSDK2CDM8BaHcvfmMLAfK4hbfMPg5q6K7aHx4ec4oe6TUxmjil uhaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796219718; x=1796824518; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=pJeAp1VPeFadO8P6pmmzoViAn+qqZmuD47U4FofTomE=; b=2FS1749RTSO16sXeFERC6XeBZRG/ADPRlxCb3nnytYf1/4XtySUUNHdaBQ12HFujhD TPKYKKSE1efcP8OVLBtEvoE2p+XkCwycxMJJDDSECE+NH1jiritWzyMggU3oW5VtZwT0 T2CSWflNkZxrdLPaA8t78LH1HMK3RJQJfPK7SZq9l0uquVSeiUvlMpL1Vw/PGueytSeE mal1zoj674XUNFROUIdAPNz1UJ/Kfeh3cco9bxmxcYXYA6UFhxJ5LDmwz/IB4jHMrnAP o5wUjd6piiYH4qiI0IxyTNITfmmTkFyCMThAN1iKcV4k9dj5tqmG17UCg/LUwUpBMeia iMDg== X-Forwarded-Encrypted: i=1; AL+hErHc6xlmZ5nCKQ1MySQiVX48Dxdcv/feyTSwryBtEMBJbyay4wRPHu4QithYn0AEk7h3H8eBJNLv9LctKKk=@vger.kernel.org X-Gm-Message-State: APuU4Z/7WesWZciCZ8OMFjiuC1m+bYsVFCCrrfyiITkqdsciQORcjtQf P3Cm3NZ5JCQ/QqYMfwm2pvsj+nOCrU/x/CHEgQ1ifOIoUxaaoW1E1pkoNNlSkrxm05I= X-Gm-Gg: AZFdTZeLXQtde9fYlPgW/VvH63OFsj11k/KGlJlb4p1Ks1iEJ+v9QlZI/knOwQmeJNU o7rXZKjDEdKwLk4eMgqHvwXwz/A/gI6FYa0nDJUfsSSStgbo8cqjQTByKQvVTRHQK1ccUU3aFIE Mdo8I4QRIadTpykhXIncSxAsm0PUwb7tAlH5biPj90G+sB5JoknmHQCBXBgw+RkTUamRU8AXw2y 3tVB6yydBSQv15SSJMdvc6MNQQaA9pYyEBtUituBdjZUvDJ+zMZ9kgJdbGjp2f+f+FNIyOFfREP f+XAq1UY0moQ0P69nEWNo8R5CXM8Wt0gaTimJvCtEV4mDZQ182NtBVy69/AKfmYm0OHGSyUQPte P2ioUNribFppnZGRjYCzDOb6OCL8OSoOiLs9khZO+muqAcsUJcxrM/lI3QRLAqB7El0Lt/tMLZB +qepso5nRv3eujZULkd+iNfIYMWiIiH6k4XaoLQJnKGHq8MWyj+hFSb1vvij2TWds1/iwYmN57B IG4L+ewXDTzvWdJysbnYOGWfSQh0ei6lxNHnPL1cc6SPMW2QDuG66s9vcpBeDGQGWg4lLlDw4Lj RiwC X-Received: by 2002:a05:622a:2609:b0:55a:df3b:38d4 with SMTP id d75a77b69052e-55d76b5b9b8mr723301701cf.75.1796219718275; Wed, 02 Dec 2026 05:55:18 -0800 (PST) Received: from ziepe.ca ([142.177.118.84]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7889f8b6sm342462761cf.28.2026.12.02.05.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 05:55:17 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xYknl-00000003faS-0UWv; Wed, 02 Dec 2026 09:55:17 -0400 Date: Wed, 2 Dec 2026 09:55:17 -0400 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Alistair Popple , Dave Airlie , Sumit Semwal , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Simona Vetter , Matthew Brost , Vivek Kasireddy , Dongwon Kim , Kevin Tian , Xu Yilun , Karl Mehltretter , Baolu Lu , Felix Kuehling , Alex Deucher , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Mina Almasry , netdev@vger.kernel.org, Alexey Kardashevskiy , zhipingz@meta.com, treding@nvidia.com, jhubbard@nvidia.com, chaitanyak@nvidia.com, Leon Romanovsky Subject: Re: [PATCH v3 03/24] dma-buf: Add the SGT DMA mapping type Message-ID: <20261202135517.GF351887@ziepe.ca> References: <20f5fb10-b71a-40f9-bbb2-f99b4002bf08@amd.com> <53a32383-4cf6-42ac-bbd5-476e69a3be5f@amd.com> <20261202013043.GC351887@ziepe.ca> <20261202132810.GE351887@ziepe.ca> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Dec 02, 2026 at 02:47:54PM +0100, Christian König wrote: > On 12/2/26 14:28, Jason Gunthorpe wrote: > > On Wed, Dec 02, 2026 at 02:54:07PM +1100, Alistair Popple wrote: > > > >> So what I'm hearing is that the exporter should be unmapping as a defense > >> against bad importers. I can definitely understand why that might be useful, > >> especially as some kind of debug thing, but I don't think we should be basing > >> the whole API design around the concept we can't trust importer to implement the > >> contract correctly. Especially as that defense might not actually exist in a lot > >> of cases anyway (eg. IOMMU disabled), in which case you have no choice but to > >> trust the importer got things right. > > > > +1 > > > >> I also sense there might be a deeper belief that the mapping of a resource > >> (ie. the IOVA) is something owned by the resource rather than the user of that > >> resource. > > > > Well, this would be wrong. The IOVA is owned by the DMA API, the DMA > > API is owned by its bound driver. In the kernel it is *never* owned by > > the memory object being mapped by it. > > Yeah I think that pretty much nailed the disagreement. > > IOMMU was invented in the first place because both HW as well as > it's SW driver is not trustworthy. > > So for system memory the IOVA should be owned by the core memory > management and not the SW driver who wants to use it. > > The same is true for P2P mappings where the exporter who provides > the backing store should handle the lifetime of the IOVA for an > importer. > > Letting the importer manage the lifetime is like putting the fox in > charge of the henhouse and IOMMU pretty much looses its purpose. It is a valid perspective. Obviously it is not what Linux implements, how the iommu subsystem is designed, or how the DMA API works. Nor do I think the difference in a monolithic kernel is as large and important as you are making it out to be. Jason