]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/umem: Add pinned revocable dmabuf import interface
authorJacob Moroni <jmoroni@google.com>
Thu, 5 Mar 2026 17:08:24 +0000 (17:08 +0000)
committerLeon Romanovsky <leon@kernel.org>
Sun, 8 Mar 2026 12:37:38 +0000 (08:37 -0400)
commitff85a2ebacbdaec9f28c4660c991295ace93cd1c
tree1407b46b97eb0cb430c78ce936cdc20e9ae7fb19
parent797291a66ce346c96114b72222fc290d402da005
RDMA/umem: Add pinned revocable dmabuf import interface

Added an interface for importing a pinned but revocable dmabuf.
This interface can be used by drivers that are capable of revocation
so that they can import dmabufs from exporters that may require it,
such as VFIO.

This interface implements a two step process, where drivers will first
call ib_umem_dmabuf_get_pinned_revocable_and_lock() which will pin and
map the dmabuf (and provide a functional move_notify/invalidate_mappings
callback), but will return with the lock still held so that the
driver can then populate the callback via
ib_umem_dmabuf_set_revoke_locked() without races from concurrent
revocations. This scheme also allows for easier integration with drivers
that may not have actually allocated their internal MR objects at the time
of the get_pinned_revocable* call.

Signed-off-by: Jacob Moroni <jmoroni@google.com>
Link: https://patch.msgid.link/20260305170826.3803155-4-jmoroni@google.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/umem_dmabuf.c
include/rdma/ib_umem.h