From: Song Liu <songliubraving@fb.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Song Liu <song@kernel.org>, bpf <bpf@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
"live-patching@vger.kernel.org" <live-patching@vger.kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
Kernel Team <Kernel-team@fb.com>,
"jolsa@kernel.org" <jolsa@kernel.org>
Subject: Re: [PATCH v4 bpf-next 2/4] ftrace: allow IPMODIFY and DIRECT ops on the same function
Date: Tue, 19 Jul 2022 23:24:35 +0000 [thread overview]
Message-ID: <D9D41674-8EFF-4A30-97C5-F2C1B31C1F22@fb.com> (raw)
In-Reply-To: <20220719142856.7d87ea6d@gandalf.local.home>
> On Jul 19, 2022, at 11:28 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
>> /**
>> * register_ftrace_function - register a function for profiling
>> * @ops: ops structure that holds the function for profiling.
>> @@ -8016,17 +8192,29 @@ int ftrace_is_dead(void)
>> * recursive loop.
>> */
>> int register_ftrace_function(struct ftrace_ops *ops)
>> + __releases(&direct_mutex)
>> {
>> + bool direct_mutex_locked = false;
>> int ret;
>>
>> ftrace_ops_init(ops);
>>
>
> I agree with Petr.
>
> Just grab the direct_mutex_lock here.
>
> mutex_lock(&direct_mutex);
Actually, we cannot blindly lock direct_mutex here, as
register_ftrace_direct() already locks it before calling
register_ftrace_function(). We still need the if (IPMODIFY)
check.
Thanks,
Song
>
>> + ret = prepare_direct_functions_for_ipmodify(ops);
>> + if (ret < 0)
>> + return ret;
>
next prev parent reply other threads:[~2022-07-19 23:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 5:54 [PATCH v4 bpf-next 0/4] ftrace: host klp and bpf trampoline together Song Liu
2022-07-18 5:54 ` [PATCH v4 bpf-next 1/4] ftrace: add modify_ftrace_direct_multi_nolock Song Liu
2022-07-19 17:57 ` Steven Rostedt
2022-07-18 5:54 ` [PATCH v4 bpf-next 2/4] ftrace: allow IPMODIFY and DIRECT ops on the same function Song Liu
2022-07-18 7:42 ` kernel test robot
2022-07-18 13:19 ` Petr Mladek
2022-07-18 16:59 ` Song Liu
2022-07-19 18:32 ` Steven Rostedt
2022-07-19 22:28 ` Song Liu
2022-07-19 18:28 ` Steven Rostedt
2022-07-19 18:39 ` Steven Rostedt
2022-07-19 22:57 ` Song Liu
2022-07-19 23:04 ` Steven Rostedt
2022-07-19 23:24 ` Song Liu [this message]
2022-07-19 23:27 ` Steven Rostedt
2022-07-18 5:54 ` [PATCH v4 bpf-next 3/4] bpf, x64: Allow to use caller address from stack Song Liu
2022-07-18 5:54 ` [PATCH v4 bpf-next 4/4] bpf: support bpf_trampoline on functions with IPMODIFY (e.g. livepatch) Song Liu
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=D9D41674-8EFF-4A30-97C5-F2C1B31C1F22@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=song@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
all inboxes | Powered by JetHome®