]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/irdma: Add support for revocable pinned dmabuf import
authorJacob Moroni <jmoroni@google.com>
Thu, 5 Mar 2026 17:08:26 +0000 (17:08 +0000)
committerLeon Romanovsky <leon@kernel.org>
Sun, 8 Mar 2026 12:37:38 +0000 (08:37 -0400)
commit4707bf5f6c86443bcfa9fcf5826effe46ebd6f21
treed7bb464e6ab3cd6a012500f77712d733a49c6de3
parent3a0b171302eea1732a168e26db3b8461f51cc1f9
RDMA/irdma: Add support for revocable pinned dmabuf import

Use the new API to support importing pinned dmabufs from exporters
that require revocation, such as VFIO. The revoke semantic is
achieved by issuing a HW invalidation command but not freeing
the key. This prevents further accesses to the region (they will
result in an invalid key AE), but also keeps the key reserved
until the region is actually deregistered (i.e., ibv_dereg_mr)
so that a new MR registration cannot acquire the same key.

Tested with lockdep+kasan and a memfd backed dmabuf.

The rereg_mr path is explicitly blocked in libibverbs for dmabuf MRs
(more specifically, any MR not of type IBV_MR_TYPE_MR), so the rereg_mr
path for dmabufs was tested with a modified libibverbs.

Signed-off-by: Jacob Moroni <jmoroni@google.com>
Link: https://patch.msgid.link/20260305170826.3803155-6-jmoroni@google.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/irdma/verbs.c