From: Beau Belgrave <beaub@linux.microsoft.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
bpf <bpf@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>,
Beau Belgrave <beaub@microsoft.com>,
linux-arch <linux-arch@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-trace-devel <linux-trace-devel@vger.kernel.org>,
rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Alexei Starovoitov <ast@kernel.org>
Subject: Re: Comments on new user events ABI
Date: Tue, 29 Mar 2022 09:57:18 -0700 [thread overview]
Message-ID: <20220329165718.GA10381@kbox> (raw)
In-Reply-To: <CAADnVQK=GCuhTHz=iwv0r7Y37gYvt_UBzkfFJmNT+uR0z+7Myw@mail.gmail.com>
On Tue, Mar 29, 2022 at 09:25:52AM -0700, Alexei Starovoitov wrote:
> On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> wrote:
> >
> > >
> > >> include/uapi/linux/user_events.h:
> > >>
> > >> struct user_bpf_iter {
> > >>
> > >> /* Offset of the data within the first iovec */
> > >> __u32 iov_offset;
> > >>
> > >> /* Number of iovec structures */
> > >> __u32 nr_segs;
> > >>
> > >> /* Pointer to iovec structures */
> > >> const struct iovec *iov;
> > >>
> > >> ^ a pointer in a uapi header is usually a no-go. This should be a u64.
> > >> };
> > >>
> > >> include/uapi/linux/user_events.h:
> > >>
> > >> struct user_bpf_context {
> > >>
> > >> /* Data type being passed (see union below) */
> > >> __u32 data_type;
> > >>
> > >> /* Length of the data */
> > >> __u32 data_len;
> > >>
> > >> /* Pointer to data, varies by data type */
> > >> union {
> > >> /* Kernel data (data_type == USER_BPF_DATA_KERNEL) */
> > >> void *kdata;
> > >>
> > >> /* User data (data_type == USER_BPF_DATA_USER) */
> > >> void *udata;
> > >>
> > >> /* Direct iovec (data_type == USER_BPF_DATA_ITER) */
> > >> struct user_bpf_iter *iter;
> > >>
> > >> ^ likewise for the 3 pointers above. Should be u64 in uapi headers.
> > >> };
> > >> };
> > >>
> > >
> > > The bpf structs are only used within a BPF program. At that point the pointer
> > > sizes should all align, right?
> >
> > I must admit I do not know enough about the eBPF uapi practices to answer this.
> > [CCing Alexei on this]
>
> Mathieu,
>
> Thanks for flagging.
>
> Whoever added this user_bpf* stuff please remove it immediately.
> It was never reviewed by bpf maintainers.
>
> It's a hard Nack to add a bpf interface to user_events.
Sorry about that, I'm sending a patch to remove this.
I'll have another patch to add it back in out to bpf and trace-devel for
review.
Thanks,
-Beau
next prev parent reply other threads:[~2022-03-29 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com>
[not found] ` <20220329002935.2869-1-beaub@linux.microsoft.com>
[not found] ` <1014535694.197402.1648570634323.JavaMail.zimbra@efficios.com>
2022-03-29 16:25 ` Comments on new user events ABI Alexei Starovoitov
2022-03-29 16:57 ` Beau Belgrave [this message]
2022-03-29 19:45 ` Steven Rostedt
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=20220329165718.GA10381@kbox \
--to=beaub@linux.microsoft.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=beaub@microsoft.com \
--cc=bpf@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@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).