🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25818

Re: [PATCH v3 03/24] dma-buf: Add the SGT DMA mapping type

#25818
From: Jason Gunthorpe
Date: Wed, 02 Dec 2026 13:55
47 lines
14365 bytes
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
Technical Details
Message-ID: <20261202135517.GF351887@ziepe.ca>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375826-linux-kernel-netdev=dewy.ru
References: <aw5yDFk2u_bzMZD8@nvdebian.thelocal> <20f5fb10-b71a-40f9-bbb2-f99b4002bf08@amd.com> <aw6MunWRlt-_MIke@nvdebian.thelocal> <53a32383-4cf6-42ac-bbd5-476e69a3be5f@amd.com> <CAPM=9txYvRT=bdSk5D56W9Wu5+UnfcGz-8Msj+wOns-XNXw1Ww@mail.gmail.com> <20261202013043.GC351887@ziepe.ca> <CAPM=9tzBhoM0cdGVZ-d1T8Dgxtmh6K-zXGLqz9JcswXtQ66EDQ@mail.gmail.com> <aw-FM7FiJvl3R0El@nvdebian.thelocal> <20261202132810.GE351887@ziepe.ca> <bc502015-2ed3-4093-b52f-d16973cd53fa@amd.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375826-linux-kernel-netdev=dewy.ru
From: jgg@ziepe.ca (Jason Gunthorpe)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v3 03/24] dma-buf: Add the SGT DMA mapping type
Date: Wed, 2 Dec 2026 09:55:17 -0400
Organization: Usenet Network
Message-ID: <20261202135517.GF351887@ziepe.ca>
References: <aw5yDFk2u_bzMZD8@nvdebian.thelocal> <20f5fb10-b71a-40f9-bbb2-f99b4002bf08@amd.com> <aw6MunWRlt-_MIke@nvdebian.thelocal> <53a32383-4cf6-42ac-bbd5-476e69a3be5f@amd.com> <CAPM=9txYvRT=bdSk5D56W9Wu5+UnfcGz-8Msj+wOns-XNXw1Ww@mail.gmail.com> <20261202013043.GC351887@ziepe.ca> <CAPM=9tzBhoM0cdGVZ-d1T8Dgxtmh6K-zXGLqz9JcswXtQ66EDQ@mail.gmail.com> <aw-FM7FiJvl3R0El@nvdebian.thelocal> <20261202132810.GE351887@ziepe.ca> <bc502015-2ed3-4093-b52f-d16973cd53fa@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1984151"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wr2I0iAy4NU9mLhC2b/Ux+TGz5U= sha256:F5/3fpVMsw4GmOPHe1TP1VLhrBaXWulM0WvNsfSFXHU= sha1:pK0teX4mIplsXLaAPIlnALLABlY= sha256:wVDflJA1sN+guHjlxKC2J59re7hWqjkrxexRItBSXDI=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 44B1F11765C; Wed,  2 Dec 2026 16:55:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.051
X-Spam-Status: No, score=-2.051 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=ziepe.ca
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sXE6OJXQ5UHB; Wed,  2 Dec 2026 16:55:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375826-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=ziepe.ca
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 56D6411763C; Wed,  2 Dec 2026 16:55:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 4375B2B4D0; Wed,  2 Dec 2026 13:55:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796219725; b=Uujb1VZVeyBCA5c2QhWqOShS+JpRQttAGw/mkmXK/rgh8kTRn30lSDwCQJLsqPS9GsSW 5Oi6UlIX/1+scfmtIl1Uf1BAps4mbjP369YCsHa9d6cuYtUea1eYFrSRd6M8fL8PuXEBN F0lKDw196JB9QFXPUVAkGDOwAtL599EvvMCkDA8wffrGBeZQoaIEx1MrNdq9lj5KUSm68 BrU73dHadt3SsBK1ruFbq70aeTQnIUsCi6x4FE5EFpvNaYn60fm4g5DExBsVKThT/IrIL GcSgqFHEpOw/m+l6ujyxDV4DzlP2sWsxUzAOYsrnzmkIYHIMbuKQ0fvr2RkKhBncrLg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796219725; h=X-Original-To:Received: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:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=pJeAp1VPeFadO8P6pmmzoViAn+qqZmuD47U4FofTomE=; b=h9OGSj2sbj8Gkmo/SL9vX06q/ukv8eyfhap4lm481yDipJEM1XnA36zO5FR3CHNS1oQu fPb30psjG2VQCgzFJxS+sCYnMr24GdxbbZlZf/HXROdUZM5SwOxJP0nUrS9FxnUspUKCI 5749PKlTVg28mx0xnvJL5M67cX70WyuKDIU27Xl928kD8pXAjoaZcNvwTZu+Cr7wRGydt IAT5NGvYFyjLYo8tLm0x/9YqNxsMhlDqvdvLvLteKHDuHXAYnNAeMDiWtYpfoNrzDaI1j JYgTUoAJsC8G7JMoY0R0AYDyapn+sYwRWdeo7tcmkWas0KOV2U+rjsP1cspEO+cajow==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=jHEA9kGM; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2ABD606A33B; Wed,  2 Dec 2026 13:55:25 +0000 (UTC)
X-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
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.175
X-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==
X-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==
X-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
X-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 <netdev@vger.kernel.org>; Wed,  2 Dec 2026 13:55:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6522D606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca
X-Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-55ade1de0b4so146250321cf.3 for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 05:55:19 -0800 (PST)
X-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)
X-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)
X-Received: from jgg by wakko with local (Exim 4.97) (envelope-from <jgg@ziepe.ca>) id 1xYknl-00000003faS-0UWv; Wed, 02 Dec 2026 09:55:17 -0400
X-Cc: Alistair Popple <apopple@nvidia.com>, Dave Airlie <airlied@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>, Thomas Hellström <thomas.hellstrom@linux.intel.com>, Simona Vetter <simona.vetter@ffwll.ch>, Matthew Brost <matthew.brost@intel.com>, Vivek Kasireddy <vivek.kasireddy@intel.com>, Dongwon Kim <dongwon.kim@intel.com>, Kevin Tian <kevin.tian@intel.com>, Xu Yilun <yilun.xu@linux.intel.com>, Karl Mehltretter <kmehltretter@gmail.com>, Baolu Lu <baolu.lu@linux.intel.com>, Felix Kuehling <felix.kuehling@amd.com>, Alex Deucher <alexander.deucher@amd.com>, 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 <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, linux-nvme@lists.infradead.org, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Mina Almasry <almasrymina@google.com>, netdev@vger.kernel.org, Alexey Kardashevskiy <aik@amd.com>, zhipingz@meta.com, treding@nvidia.com, jhubbard@nvidia.com, chaitanyak@nvidia.com, Leon Romanovsky <leon@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <bc502015-2ed3-4093-b52f-d16973cd53fa@amd.com>