From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Aharon Landau <aharonl@nvidia.com>,
Doug Ledford <dledford@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jason Wang <jasowang@redhat.com>,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
Maor Gottlieb <maorg@nvidia.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH mlx5-next 1/7] RDMA/mlx5: Don't set esc_size in user mr
Date: Tue, 12 Oct 2021 11:32:44 -0300 [thread overview]
Message-ID: <20211012143244.GW2744544@nvidia.com> (raw)
In-Reply-To: <YWWYPCHv6moPv5pW@unreal>
On Tue, Oct 12, 2021 at 05:14:20PM +0300, Leon Romanovsky wrote:
> On Tue, Oct 12, 2021 at 11:04:33AM -0300, Jason Gunthorpe wrote:
> > On Tue, Oct 12, 2021 at 04:57:16PM +0300, Aharon Landau wrote:
> > >
> > > On 10/12/2021 3:52 PM, Jason Gunthorpe wrote:
> > > > On Tue, Oct 12, 2021 at 01:26:29PM +0300, Leon Romanovsky wrote:
> > > > > From: Aharon Landau <aharonl@nvidia.com>
> > > > >
> > > > > reg_create() is used for user MRs only and should not set desc_size at
> > > > > all. Attempt to set it causes to the following trace:
> > > > >
> > > > > BUG: unable to handle page fault for address: 0000000800000000
> > > > > PGD 0 P4D 0
> > > > > Oops: 0000 [#1] SMP PTI
> > > > > CPU: 5 PID: 890 Comm: ib_write_bw Not tainted 5.15.0-rc4+ #47
> > > > > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
> > > > > RIP: 0010:mlx5_ib_dereg_mr+0x14/0x3b0 [mlx5_ib]
> > > > > Code: 48 63 cd 4c 89 f7 48 89 0c 24 e8 37 30 03 e1 48 8b 0c 24 eb a0 90 0f 1f 44 00 00 41 56 41 55 41 54 55 53 48 89 fb 48 83 ec 30 <48> 8b 2f 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 8b 87 c8
> > > > > RSP: 0018:ffff88811afa3a60 EFLAGS: 00010286
> > > > > RAX: 000000000000001c RBX: 0000000800000000 RCX: 0000000000000000
> > > > > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000800000000
> > > > > RBP: 0000000800000000 R08: 0000000000000000 R09: c0000000fffff7ff
> > > > > R10: ffff88811afa38f8 R11: ffff88811afa38f0 R12: ffffffffa02c7ac0
> > > > > R13: 0000000000000000 R14: ffff88811afa3cd8 R15: ffff88810772fa00
> > > > > FS: 00007f47b9080740(0000) GS:ffff88852cd40000(0000) knlGS:0000000000000000
> > > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > > > CR2: 0000000800000000 CR3: 000000010761e003 CR4: 0000000000370ea0
> > > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > > > > Call Trace:
> > > > > mlx5_ib_free_odp_mr+0x95/0xc0 [mlx5_ib]
> > > > > mlx5_ib_dereg_mr+0x128/0x3b0 [mlx5_ib]
> > > > > ib_dereg_mr_user+0x45/0xb0 [ib_core]
> > > > > ? xas_load+0x8/0x80
> > > > > destroy_hw_idr_uobject+0x1a/0x50 [ib_uverbs]
> > > > > uverbs_destroy_uobject+0x2f/0x150 [ib_uverbs]
> > > > > uobj_destroy+0x3c/0x70 [ib_uverbs]
> > > > > ib_uverbs_cmd_verbs+0x467/0xb00 [ib_uverbs]
> > > > > ? uverbs_finalize_object+0x60/0x60 [ib_uverbs]
> > > > > ? ttwu_queue_wakelist+0xa9/0xe0
> > > > > ? pty_write+0x85/0x90
> > > > > ? file_tty_write.isra.33+0x214/0x330
> > > > > ? process_echoes+0x60/0x60
> > > > > ib_uverbs_ioctl+0xa7/0x110 [ib_uverbs]
> > > > > __x64_sys_ioctl+0x10d/0x8e0
> > > > > ? vfs_write+0x17f/0x260
> > > > > do_syscall_64+0x3c/0x80
> > > > > entry_SYSCALL_64_after_hwframe+0x44/0xae
> > > > >
> > > > > Fixes: a639e66703ee ("RDMA/mlx5: Zero out ODP related items in the mlx5_ib_mr")
> > > > Can you explain why this is crashing?
> > > >
> > > > reg_create isn't used on the ODP implicit children path.
> > > >
> > > > Jason
> > > It is not implicit ODP flow, therefore, mr->implicit_children shouldn't be
> > > set.
> >
> > It should always be initialized. That seems to be the bug here, add the
> > missing xa_init as well as delete the extra desc_size set:
>
> I would expect such change in mlx5_ib_init_odp_mr().
It is too late
Jason
next prev parent reply other threads:[~2021-10-12 14:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 10:26 [PATCH mlx5-next 0/7] Clean MR key use across mlx5_* modules Leon Romanovsky
2021-10-12 10:26 ` [PATCH mlx5-next 1/7] RDMA/mlx5: Don't set esc_size in user mr Leon Romanovsky
2021-10-12 12:52 ` Jason Gunthorpe
2021-10-12 13:57 ` Aharon Landau
2021-10-12 14:04 ` Jason Gunthorpe
2021-10-12 14:14 ` Leon Romanovsky
2021-10-12 14:32 ` Jason Gunthorpe [this message]
2021-10-12 10:26 ` [PATCH mlx5-next 2/7] RDMA/mlx5: Remove iova from struct mlx5_core_mkey Leon Romanovsky
2021-10-12 10:26 ` [PATCH mlx5-next 3/7] RDMA/mlx5: Remove size " Leon Romanovsky
2021-10-12 10:26 ` [PATCH mlx5-next 4/7] RDMA/mlx5: Remove pd " Leon Romanovsky
2021-10-12 10:26 ` [PATCH mlx5-next 5/7] RDMA/mlx5: Replace struct mlx5_core_mkey by u32 key Leon Romanovsky
2021-10-12 10:26 ` [PATCH mlx5-next 6/7] RDMA/mlx5: Move struct mlx5_core_mkey to mlx5_ib Leon Romanovsky
2021-10-13 14:39 ` Jason Gunthorpe
2021-10-12 10:26 ` [PATCH mlx5-next 7/7] RDMA/mlx5: Attach ndescs to mlx5_ib_mkey Leon Romanovsky
2021-10-13 14:41 ` Jason Gunthorpe
2021-10-12 11:16 ` [PATCH mlx5-next 0/7] Clean MR key use across mlx5_* modules Michael S. Tsirkin
2021-10-12 11:19 ` Leon Romanovsky
2021-10-13 14:43 ` Jason Gunthorpe
2021-10-19 11:51 ` Leon Romanovsky
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=20211012143244.GW2744544@nvidia.com \
--to=jgg@nvidia.com \
--cc=aharonl@nvidia.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@nvidia.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=virtualization@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).