From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796219719; b=og/b4F8/n5KFsnh760N+eQ2HgtssdwKX0FKAo/p4UjKODV4JWl6PXmREV3Z6OvbjcIgb YgtNt96hs6PLjdvW8XDknEMgouliUwUFjoPcaFoKLG2vMsABVf0PABl7lqHIXoH/UP+N0 7vqNSINvb9+LmlLyAlu1KoFvxxDhWJ3aP2XKE1QM0YQMrk5V25c4PIYL+31lzS9bj9d/o fYrVEUjj/tHXMNGDQZGCDWjAOaNqJFC0uKqyVwbn2qLRG8fTKs1s1i5rs8w21YQfI/ylK ZA7kznZ8gXpI1LGnp2AEU1jEsHVVs0eHf0vwnn+dbd0YYB/DRm3ehu66ywGLJIa5dyA== 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=gWKoOcIClnhwfQbWHq5Ahvw9hzuSwCfc0WaetFrr9Yr1lMZ3RKvgmegWloq6z2zJvuKt JT+2VjMJug0gJ3p1k1gwTcvWYgCoHmfwZAmJ7M5TCkRoWcyLZMRrPBkcSrNI+9waH8ZP3 yE2pFV3ZdWGv+EvZWMOKMFsAMiwTTEZAglmOtas+BZ8DiN/qx7CenlgiB2Rl7G89uILlw nfaDmY9Mjf8umlBqUtw6frT3yEp9wZIEY8RbI0jxirZqnAgRyUBYRDgvalIo/UpcEIsZb WyZ1Nb/xeD7uPhuLVVOyHPX8pTSvvJNw/sr1ZCj/++6mBdR5Bq5v4rNHaZUdJxXIdCg== 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.178 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 5C29F606A322 for ; Wed, 2 Dec 2026 13:55:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C29F606A322 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-f178.google.com with SMTP id d75a77b69052e-55b8cd4e2abso132002271cf.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=utPK2fXi0/SekvF5HMhGriTSiP8yu+PbfPLplg86/iHfLcgV5G/fmBcJjvP91IRqyu VnxigBXSyevG0DYQ2EEMExbEWWRT69Qo7Mi8vmoevpRgQqMY5Xe3H8dfZSOJhCVtyoj6 Dx94bE7josyec3ZNvOAD6W5N2CpUPalG0SDLKugd1f6d/MN1xYd/MKiffoPCE8BeeZhT EdB5X1q2U3wSCT06CaqnaKRppXQLkpx77JZR06zpnKvc6dYmp7QuTIiFEljgDZUCfsev mQBvctEosTYBo4fCYwc2U9cm2BFxhJJAnkWC4AwKrUI/QTxvwqwgFzyZQaZcZGtjOPV4 Df6g== X-Forwarded-Encrypted: i=1; AL+hErGyc9FcKqU4o3CqsmgsmAozvvRhcsZVJ6pqGMG2G2Z5XsHQj32B77d/sjww7S+cpzxz94EFSHkiIxxWSw==@vger.kernel.org X-Gm-Message-State: APuU4Z+/HKgHPaiEwyB+mojxT0qPUhqhfU0R8U0qyiX5vSFUPhJwmeHc 9C/G1EqXu11+Az8XwuxD/l4vcxyULCyf7wo9vbd/y9w5VlY/MOOdMoGfbKqI9JlOwEM= X-Gm-Gg: AZFdTZfOJg7x87Nxdd9Nbr+kUb6k0zokEaw3iW75cbTZ42+tHlWfg0tpyUEDhRQ6YjH lSvpHUC7UbWk4IwmRIjzOOXR0EjRFH5uQ/7ajdZ+TomRCG/GCABrgwUC2XCEXfqsCCJukxTVDUA 4TEEeKoBG5Fij6vvUdeiJvcaO4dE3pQebAiCjVU7GcrXC65SVQJw5sEa+A/PrTMf644EdyAE9QV TdhNsLHAh/m3evXM+q+lJYq4249SRi1i5UexrOYkHEwk8PWTetyXvJ2i+vDzbAhiRoyrhhyHlSH 0bmRgZVMEpH7YV6LqZ3oJpCpTThachCJYnId1ZTylX5CijClCYUeMJLt1poZ2SduglFLdiht4fq Ccbjmrea4Nj45gHHY+du+QUELr8dRj5z5rshB8af9IANqTOEh7w8ZCcPtTXogkE0FxGwjI2IdHS b65EcZGobhnYWUki8/L33dqfcOS9VfsG3dtoq7DkTRBPbO5IzNucoWmE0yhJ+NjYjypZ8XsLf8d 16Lambs96v89QyFV/Bb0ftF8QMupXq+Ngzw0DQ5FBZly7m4CKY3D1rVYmRmEmuK6BztZFMj/nYM xBjB 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-media@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