From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795967109; b=Tg0M2Ato/UJNYUwYOrI2JydWDl1KC51X9VW7DK2kWUUiSwtrR7yZJQYlIUMIMGpfrrwB TMIvFqFx5nyKKzmeeuxXFWJ4cQGSlY8QA7GLx8qRz1Nmb/L2Gxq0ed12FnBGRrxeFbHin fGxhgUo1tPNBAgeJAtEbykSyA88ZxG5RQQknaK0gSVkexmYf3JVSvS+ma/WTrsEe0jDp6 UfKXMyKi/5NunSLoCTruUE1Y1Sq32I6x53U4iu12+ZGwDQ0fHlqSL2eQv0cTmFuXMV1m/ K1oB3F0czl9w874PP66k3+cRLnQBUorVz86Ey2uRTnlX8aFskhHu3PnvSFdUxeepfZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795967109; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Iqi4j9G/r+SnICml2hhB/J/ZOJPilwIm3ZW4uuQ0rTo=; b=Jory6sPsc82dJkt8f6CPryJQx0xu9xtO6puASgrNF8aHS6OSY3cTe+FT3gcdRRilLWRQ Aw/fliewO4vAHDrkOsPeVCFFaPg000X1NHP5Pt5wjAngkY6z3XLOsOUJ88hmaX8APrk7R APQxZ+yiYShI65ywi3Xz4gr67HcUbPDaomXuEcXSEbVV85/8i2M5MT80/cdwCvdIbSLut 5QXWKywDoAGewwGYP1BpASFxWgiVYiD4IAiXOrOYk7d5Rdw7hW2JOJ20+6ZWz67JIUAWD oD1LpCT/DM+JJwuCKWSOA7lY+KkIi9lBkWvEtjpcvX0ynFpn50x2Sl6SHP/mBAmhuzw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hseP0Crw; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07D6C606A323 for ; Sun, 29 Nov 2026 15:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hseP0Crw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DEC71F000C1; Sun, 29 Nov 2026 15:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795967108; bh=Iqi4j9G/r+SnICml2hhB/J/ZOJPilwIm3ZW4uuQ0rTo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=hseP0CrwLFcBPGSHLHPqszq/crgo6Hq4Tw57pKlvRVz4odc94+1XXVc3xZnE82AIO 4woJFuANoa5WHZipt8kN5nWcBQzl3K6H5PogzGiRwlm+Lp3wRi4RUCPSVKsjMYkKoZ DnrB7E+zbQYbYbC3o6Z5d3pOXB1JOaqoENjkCDYPU6EDyGes+mKsfLr0bdftOfsZWy jjbP6SjfnSsEVINYUj15Yk1M4mALtOzxAmF1myTB7FOyb127BN5Pnm0ERxu4VzvVMG dhsIGWtIRoK9293mJwnmuLqVd8bbgKdHdAQuAQhxrnkuyqtV+J8ZRvaXiFJpJtTrAI dBwn5l5wzte4w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH rdma-next v2 3/3] RDMA/mlx5: Try pinned revocable dmabuf import by default Reply-To: sashiko-reviews@lists.linux.dev To: "Edward Srouji" Cc: linux-rdma@vger.kernel.org, dri-devel@lists.freedesktop.org, media-ci@linuxtv.org In-Reply-To: <20261129-mlx5-pinned-revocable-dmabuf-v2-3-830a412a3369@nvidia.com> References: <20261129-mlx5-pinned-revocable-dmabuf-v2-0-830a412a3369@nvidia.com> <20261129-mlx5-pinned-revocable-dmabuf-v2-3-830a412a3369@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 15:45:07 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] RDMA/mlx5: user-triggerable WARN_ON(!page_size) in alloc_cacheable_mr() -- commit 3a4c35010e9f8b10e62196ece5aade6e6065212c Author: Yishai Hadas RDMA/mlx5: Try pinned revocable dmabuf import by default This commit attempts a pinned, revocable dma-buf attachment by default when registering a dma-buf MR so that the mkey can be sized exactly, falling back to a movable ODP import only when the exporter does not grant it. > diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5= /mr.c > index 3c59cfbbbd19f..0ba82356963dd 100644 > --- a/drivers/infiniband/hw/mlx5/mr.c > +++ b/drivers/infiniband/hw/mlx5/mr.c > @@ -443,7 +443,7 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct i= b_pd *pd, > struct mlx5_ib_mr *mr; > unsigned long page_size; > =20 > - if (umem->is_dmabuf) > + if (umem->is_dmabuf && !to_ib_umem_dmabuf(umem)->pinned) > page_size =3D mlx5_umem_dmabuf_default_pgsz(umem, iova); > else > page_size =3D mlx5_umem_mkc_find_best_pgsz(pd_to_mdev(pd), umem, [Severity: Medium] Can userspace trigger WARN_ON(!page_size) right below this when registering a pinned dma-buf MR? Previously all dma-buf MRs took the mlx5_umem_dmabuf_default_pgsz() branch here and checked mlx5_umem_dmabuf_find_best_pgsz() later in mlx5_ib_dmabuf_mr_update_pas(), which returns -EINVAL without a warning when page_size is 0. Now pinned dma-buf MRs call mlx5_umem_mkc_find_best_pgsz() -> ib_umem_find_best_pgsz() in alloc_cacheable_mr(). Because UVERBS_METHOD_REG_DMABUF_MR only checks that offset and iova share the same sub-page alignment, a user-supplied iova where iova + umem->length - 1 overflows u64 causes ib_umem_find_best_pgsz() to return 0 and hit WARN_ON(!page_size). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129-mlx5-pinne= d-revocable-dmabuf-v2-0-830a412a3369@nvidia.com?part=3D3