From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Daniel Borkmann" <daniel@iogearbox.net>,
"Jiri Olsa" <olsajiri@gmail.com>
Cc: <bpf@vger.kernel.org>, <andrii@kernel.org>,
"Menglong Dong" <dongml2@chinatelecom.cn>,
"Steven Rostedt" <rostedt@goodmis.org>
Subject: Re: [PATCH bpf 1/2] x86/ftrace: Use jmp mode only where functions are aligned
Date: Sun, 25 Oct 2026 17:38:05 +0000 [thread overview]
Message-ID: <DME3OUNAYUV6.2JD94UVU3DBNP@gmail.com> (raw)
In-Reply-To: <8c2784c0-2b13-4cc2-b770-51bbb8006f26@iogearbox.net>
On Sun, Oct 25, 2026 at 08:27 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
> I had the below first as well, but then saw that there were similar issues
> regarding function alignment in the past and they were solved on kconfig
> level, some picks:
>
> - b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE")
> - a743f26d03a9 ("arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang")
> - c41bf4326c7b ("riscv: ftrace: align patchable functions to 4 Byte boundary")
> - 9315e22b0c0a ("arm64: ftrace: allow DIRECT_CALLS without CALL_OPS")
I think those are different. They need the traced function to be aligned
by design. CALL_OPS keeps an 8 byte literal in front of it.
Here nothing needs C functions to be aligned. The callback is hit by
the bit 0 check only because it goes through ftrace_call_replace().
> But I can also spin a v2 with the code change instead if preferred.
I don't insist, but imo my approach is cleaner.
prev parent reply other threads:[~2026-10-25 17:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 7:37 [PATCH bpf 1/2] x86/ftrace: Use jmp mode only where functions are aligned Daniel Borkmann
2026-10-24 7:37 ` [PATCH bpf 2/2] selftests/bpf: Test kprobe and fentry programs on one function Daniel Borkmann
2026-10-24 19:10 ` [PATCH bpf 1/2] x86/ftrace: Use jmp mode only where functions are aligned Alexei Starovoitov
2026-10-25 13:18 ` Jiri Olsa
2026-10-25 15:27 ` Daniel Borkmann
2026-10-25 17:38 ` Alexei Starovoitov [this message]
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=DME3OUNAYUV6.2JD94UVU3DBNP@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dongml2@chinatelecom.cn \
--cc=olsajiri@gmail.com \
--cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.