From: Leon Romanovsky <leon@kernel.org>
To: Jacob Moroni <jmoroni@google.com>
Cc: tatyana.e.nikolova@intel.com, krzysztof.czurylo@intel.com,
jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next 4/4] RDMA/irdma: Add support for revocable pinned dmabuf import
Date: Thu, 26 Feb 2026 10:55:17 +0200 [thread overview]
Message-ID: <20260226085517.GG12611@unreal> (raw)
In-Reply-To: <20260225210705.373126-5-jmoroni@google.com>
On Wed, Feb 25, 2026 at 09:07:05PM +0000, Jacob Moroni wrote:
> 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.
>
> Signed-off-by: Jacob Moroni <jmoroni@google.com>
> ---
> drivers/infiniband/hw/irdma/main.h | 1 +
> drivers/infiniband/hw/irdma/verbs.c | 71 ++++++++++++++++++++++++++++-
> 2 files changed, 71 insertions(+), 1 deletion(-)
<...>
> * irdma_dereg_mr - deregister mr
> * @ib_mr: mr ptr for dereg
> @@ -3911,6 +3977,9 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
> struct irdma_pbl *iwpbl = &iwmr->iwpbl;
> int ret;
>
> + if (iwmr->region && iwmr->region->is_dmabuf)
> + return irdma_dereg_mr_dmabuf(iwdev, iwmr);
I wonder if you really need to leak umem properties and can't use
existing irdma_dereg_mr(). ib_umem_release() handles both regular and dmabuf correctly.
Thanks
> +
> if (iwmr->type != IRDMA_MEMREG_TYPE_MEM) {
> if (iwmr->region) {
> struct irdma_ucontext *ucontext;
> --
> 2.53.0.414.gf7e9f6c205-goog
>
next prev parent reply other threads:[~2026-02-26 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 21:07 [PATCH rdma-next 0/4] Add pinned revocable dmabuf import interface Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 1/4] RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helper Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 2/4] RDMA/umem: Move umem dmabuf revoke logic into helper function Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 3/4] RDMA/umem: Add pinned revocable dmabuf import interface Jacob Moroni
2026-02-25 21:07 ` [PATCH rdma-next 4/4] RDMA/irdma: Add support for revocable pinned dmabuf import Jacob Moroni
2026-02-26 8:55 ` Leon Romanovsky [this message]
2026-02-26 19:22 ` Jacob Moroni
2026-02-26 19:41 ` Leon Romanovsky
2026-02-26 21:38 ` Jacob Moroni
2026-02-27 14:44 ` Jacob Moroni
2026-02-27 14:50 ` Jason Gunthorpe
2026-02-27 14:53 ` 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=20260226085517.GG12611@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jmoroni@google.com \
--cc=krzysztof.czurylo@intel.com \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.com \
/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