From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796219719; b=45QbzhszPRi7qjm3r//uPIi6trB8YHe3ZwWdFvxVFF90awjUEQ8uYQYEaWxNIidQxUAL Cenn/VknijjD3TXOhlwl9wchEKO55C5IG01lKw89D3p3+hte/fnOqWuJG/0yyBSAHT420 JsTKjAB6e1QTcUNp2x91+FEMbnuFIVoETXw6MaE6nAhqY8q6O0ur42zP0/ifE4x8zLH4c Iw0uehxnL16Bj7JjqXIlvf6Y6u+vKMHCm/h/j2ui/477QHEnTl1LEAMCl7bkqZ5Ad/gxq WTU5KTXXu/0ERCXt8LbbVL48QN4qyougP5J/YUOR7OlMqc4uicVbI4l1pIFfE1f1IWw== 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=sDBsZvLbG8scrQlS0/EJpU6LMlng/cKH2JLpcPnZ50ieT20+g/3t6EV7kYGzakxluGRs IPSF/chbfhwYKRuCnLPYcA7x/3zIwd7Yngn4yuadrEzpeBpVAuwXDmzac/bVNU4ghCfIC WWwW6cSt7taOcJw13iT6dmw1edNScSsJug0ACWBi382XUgrEUHigz7CQo0ANv80www84D FWyfRLrNbMHYhv75UWBnU3AqrYUf0SIElO0vLMlLLQSGT0ELHpQP/LwX0/7l5cctZ/g10 /4ldOq2s+tv5YtCVaCJVYNGegozqTdyb4Cm+7wmQovb+dTMbkA3gdILzv6Gi2wrABBA== 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.175 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 6522D606A327 for ; Wed, 2 Dec 2026 13:55:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6522D606A327 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-f175.google.com with SMTP id d75a77b69052e-55ade1de0b4so146250321cf.3 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=cAbNSV5nTeNGPfrGNPpDe2drHeGRNfSo0q7INtR9m2SPJ1K/qubJzNMggWSZ0/v5k8 p9XC+Ouae59zTZe1UjCgH+ayIF0srp9Kbxu9utjfYRdg/jH+yQ6UxYhIqe294qd69Bd0 EEHR6Ff+ROPm3Bi/FUe+MMbm6xfuPlWbxWwL9+/8O7YbJe6p3sEIp+LeWdjvRATqun4r QpBltCZ3vgoqZZvyD1ndI6IK/Hp/qWM7PasOnk/HGwdN85c7IEqFTJvD8A4CPyxIfdLt vs9IXMf4yBK+QLvsrmeKwNE4UvWr2hA9BbDucuNiqzpnQKDv3w1bqGkNv6qWHISDmKgJ DdHw== X-Forwarded-Encrypted: i=1; AL+hErEzN6wVdQFH/D+CbkGiutoQu3LEa01rc57xoqlM5aHbQ6ALF6ugac9jEahmwJk0lb163WpgomI=@vger.kernel.org X-Gm-Message-State: APuU4Z+PGJXjNNTKwvk/MBUuojnDQBYpWN2gWYZwS0DJIa2UrPRCA1aP ssVoJCWxsEavwJzHRLuL9YNwEb20eXI3mm4KhD9twZbvzrrnVDiiulpSM42pvsakTHA= X-Gm-Gg: AZFdTZd1x6Eo3r9oKPZVen0Bzywp5MQDsOZlJlxHndSIHCDvpc57AO2aGS8RV6MrFC6 lwuG9sHgFSTD7HtM5r5WRmzzUMRGgWxPOUx7iIE7S6GS01nV3zuwciyRWbdJYLVRie1yuCmHqna d7p4g9IeKkBKmk+wZI7FCBpt/yYx/9yilleON5Xboz79rNnczk+ZSD5BsIpQBqus1Md/PZ/p5sU +ZUGSEA1T+0JEiNdbwBHrC9v6P8euBXkDp1XihKmodIa5qWaXAMj4dJqCgRxGNnE9YXfaosPxCM gobHx9tQobKpTZ1GjGwiX/6CK93TU5X0WIlUrQVnuUkCIfw55SLLOjlrR6ffM+IXJHceu3cq41z ZXE4F33RMlujbCLzpFwWtdtuz+BoX/YhnCQYCpLV8nD55y+9MGwokcigVR8x6lSv6KLLcpDMthW nT95ZkEd0whouamSVpSZvBN9yJHp2GmB6HzLUy8yGajhoaFYsfN6m9fJ4i05EM8n62uSjvyt8+R p5F5KjHz/ksYO0rMB1hb403tw6climvjzd1MfVKCJFIYDTrA7h7cHaRKBszweTS3ciZFrtTwgyY Y7Xc 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: netdev@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