From: Jiri Olsa <olsajiri@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
bpf@vger.kernel.org, "Martin KaFai Lau" <kafai@fb.com>,
"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"KP Singh" <kpsingh@chromium.org>,
"Stanislav Fomichev" <sdf@google.com>,
"Hao Luo" <haoluo@google.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Björn Töpel" <bjorn@kernel.org>
Subject: Re: [PATCHv3 bpf-next 2/2] bpf: Move bpf_dispatcher function out of ftrace locations
Date: Tue, 6 Sep 2022 12:07:59 +0200 [thread overview]
Message-ID: <Yxcb/9W3XsoA+QM/@krava> (raw)
In-Reply-To: <20220905112345.3daf34a1@gandalf.local.home>
On Mon, Sep 05, 2022 at 11:23:45AM -0400, Steven Rostedt wrote:
> On Sat, 3 Sep 2022 15:11:54 +0200
> Jiri Olsa <jolsa@kernel.org> wrote:
>
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index f9920f1341c8..089c20cefd2b 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -284,6 +284,7 @@ config X86
> > select PROC_PID_ARCH_STATUS if PROC_FS
> > select HAVE_ARCH_NODE_DEV_GROUP if X86_SGX
> > imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI
> > + select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
> >
> > config INSTRUCTION_DECODER
> > def_bool y
> > diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> > index 9c1674973e03..e267625557cb 100644
> > --- a/include/linux/bpf.h
> > +++ b/include/linux/bpf.h
> > @@ -924,7 +924,14 @@ int arch_prepare_bpf_dispatcher(void *image, s64 *funcs, int num_funcs);
> > }, \
> > }
> >
> > +#ifdef CONFIG_X86_64
>
> I think Peter may have already mentioned this, but shouldn't he above be:
>
> #ifdef HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
different archs need different patchable_function_entry(X) attribute
so I think we should use arch configs in here
also having HAVE_DYNAMIC_FTRACE_NO_PATCHABLE option enabled does not
imply there's support for dispatcher image generation, so we might
endup with extra nop bytes
jirka
>
> ??
>
> -- Steve
>
> > +#define BPF_DISPATCHER_ATTRIBUTES __attribute__((patchable_function_entry(5)))
> > +#else
> > +#define BPF_DISPATCHER_ATTRIBUTES
> > +#endif
> > +
> > #define DEFINE_BPF_DISPATCHER(name) \
> > + notrace BPF_DISPATCHER_ATTRIBUTES \
> > noinline __nocfi unsigned int bpf_dispatcher_##name##_func( \
> > const void *ctx, \
> > const struct bpf_insn *insnsi, \
> > --
next prev parent reply other threads:[~2022-09-06 10:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-03 13:11 [PATCHv3 bpf-next 0/2] bpf,ftrace: bpf dispatcher function fix Jiri Olsa
2022-09-03 13:11 ` [PATCHv3 bpf-next 1/2] ftrace: Add HAVE_DYNAMIC_FTRACE_NO_PATCHABLE Jiri Olsa
2022-09-03 13:11 ` [PATCHv3 bpf-next 2/2] bpf: Move bpf_dispatcher function out of ftrace locations Jiri Olsa
2022-09-05 15:23 ` Steven Rostedt
2022-09-06 10:07 ` Jiri Olsa [this message]
2022-09-06 11:32 ` Peter Zijlstra
2022-09-16 20:30 ` [PATCHv3 bpf-next 0/2] bpf,ftrace: bpf dispatcher function fix patchwork-bot+netdevbpf
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=Yxcb/9W3XsoA+QM/@krava \
--to=olsajiri@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sdf@google.com \
--cc=songliubraving@fb.com \
--cc=tglx@linutronix.de \
--cc=yhs@fb.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