From: Yonghong Song <yhs@fb.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>, <linux-rdma@vger.kernel.org>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH] RDMA/core: Remove rcu attr for uverbs_api_ioctl_method.handler
Date: Tue, 25 Oct 2022 08:24:20 -0700 [thread overview]
Message-ID: <20221025152420.198036-1-yhs@fb.com> (raw)
The current uverbs_api_ioctl_method definition:
struct uverbs_api_ioctl_method {
int(__rcu *handler)(struct uverbs_attr_bundle *attrs);
DECLARE_BITMAP(attr_mandatory, UVERBS_API_ATTR_BKEY_LEN);
...
};
The struct member 'handler' is marked with __rcu. But unless
the function body pointed by 'handler' is changing (e.g., jited)
during runtime, there is no need with __rcu.
I discovered this issue when I tried to define __rcu with
__attribute__((btf_type_tag("rcu"))). See [1] for an example
how __user is handled in a similar way.
clang crashed with __attribute__((btf_type_tag("rcu"))) since it
does not support such a pattern of btf_type_tag for a function
pointer. Removing __rcu attr for uverbs_api_ioctl_method.handler
allows building kernel successfully with __attribute__((btf_type_tag("rcu"))).
Since __rcu is not really needed in uverbs_api_ioctl_method.handler,
I suggest we remove it.
[1] https://lore.kernel.org/r/20220127154600.652613-1-yhs@fb.com
Signed-off-by: Yonghong Song <yhs@fb.com>
---
drivers/infiniband/core/rdma_core.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/rdma_core.h b/drivers/infiniband/core/rdma_core.h
index 33706dad6c0f..633a241d355a 100644
--- a/drivers/infiniband/core/rdma_core.h
+++ b/drivers/infiniband/core/rdma_core.h
@@ -85,7 +85,7 @@ struct ib_udata *uverbs_get_cleared_udata(struct uverbs_attr_bundle *attrs);
*/
struct uverbs_api_ioctl_method {
- int(__rcu *handler)(struct uverbs_attr_bundle *attrs);
+ int(*handler)(struct uverbs_attr_bundle *attrs);
DECLARE_BITMAP(attr_mandatory, UVERBS_API_ATTR_BKEY_LEN);
u16 bundle_size;
u8 use_stack:1;
--
2.30.2
next reply other threads:[~2022-10-25 15:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 15:24 Yonghong Song [this message]
2022-10-25 16:00 ` [PATCH] RDMA/core: Remove rcu attr for uverbs_api_ioctl_method.handler Jason Gunthorpe
2022-10-25 16:29 ` Paul E. McKenney
2022-10-25 16:30 ` Jason Gunthorpe
2022-10-25 17:51 ` Yonghong Song
2022-10-25 23:33 ` kernel test robot
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=20221025152420.198036-1-yhs@fb.com \
--to=yhs@fb.com \
--cc=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=paulmck@kernel.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