From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Christian König" <christian.koenig@amd.com>
Cc: Simona Vetter <simona.vetter@ffwll.ch>,
Leon Romanovsky <leon@kernel.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Alex Williamson <alex@shazbot.org>,
Kevin Tian <kevin.tian@intel.com>, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, kvm@vger.kernel.org,
iommu@lists.linux.dev
Subject: Re: [PATCH 0/4] dma-buf: add revoke mechanism to invalidate shared buffers
Date: Mon, 12 Jan 2026 11:35:03 -0400 [thread overview]
Message-ID: <20260112153503.GF745888@ziepe.ca> (raw)
In-Reply-To: <f7f1856a-44fa-44af-b496-eb1267a05d11@amd.com>
On Mon, Jan 12, 2026 at 03:56:32PM +0100, Christian König wrote:
> > The problem revoke is designed to solve is that many importers have
> > hardware that can either be DMA'ing or failing. There is no fault
> > mechanims that can be used to implement the full "move around for no
> > reason" semantics that are implied by move_notify.
>
> In this case just call dma_buf_pin(). We already support that
> approach for RDMA devices which can't do ODP.
That alone isn't good enough - the patch adding the non-ODP support
also contained this:
static void
ib_umem_dmabuf_unsupported_move_notify(struct dma_buf_attachment *attach)
{
struct ib_umem_dmabuf *umem_dmabuf = attach->importer_priv;
ibdev_warn_ratelimited(umem_dmabuf->umem.ibdev,
"Invalidate callback should not be called when memory is pinned\n");
}
static struct dma_buf_attach_ops ib_umem_dmabuf_attach_pinned_ops = {
.allow_peer2peer = true,
.move_notify = ib_umem_dmabuf_unsupported_move_notify,
};
So we can't just allow it to attach to exporters that are going to
start calling move_notify while pinned.
Looking around I don't see anyone else doing something like this, and
reading your remarks I think EFA guys got it wrong. So I'm wondering
if this should not have been allowed. Unfortunately 5 years later I'm
pretty sure it is being used in places where we don't have HW support
to invalidate at all, and it is now well established uAPI that we
can't just break.
Which is why we are coming to negotiation because at least the above
isn't going to work if move_notify is called for revoke reasons, and
we'd like to block attaching exporters that need revoke for the above.
So, would you be happier with this if we documented that move_notify
can be called for pinned importers for revoke purposes and figure out
something to mark the above as special so exporters can fail pin if
they are going to call move_notify?
Then this series would transform into documentation, making VFIO
accept pin and continue to call move_notify as it does right now, and
some logic to reject the RDMA non-ODP importer.
Jason
next prev parent reply other threads:[~2026-01-12 15:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 10:37 [PATCH 0/4] dma-buf: add revoke mechanism to invalidate shared buffers Leon Romanovsky
2026-01-11 10:37 ` [PATCH 1/4] dma-buf: Introduce revoke semantics Leon Romanovsky
2026-01-11 10:37 ` [PATCH 2/4] vfio: Use dma-buf " Leon Romanovsky
2026-01-11 10:37 ` [PATCH 3/4] iommufd: Require DMABUF " Leon Romanovsky
2026-01-11 10:37 ` [PATCH 4/4] iommufd/selftest: Reuse dma-buf " Leon Romanovsky
2026-01-12 10:04 ` [PATCH 0/4] dma-buf: add revoke mechanism to invalidate shared buffers Christian König
2026-01-12 12:19 ` Leon Romanovsky
2026-01-12 12:57 ` Christian König
2026-01-12 14:14 ` Jason Gunthorpe
2026-01-12 14:47 ` Leon Romanovsky
2026-01-12 14:56 ` Christian König
2026-01-12 15:35 ` Jason Gunthorpe [this message]
2026-01-12 16:12 ` Christian König
2026-01-12 17:04 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260112153503.GF745888@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=alex@shazbot.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=simona.vetter@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox