linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/2] fentry supports function optimized by complier
@ 2025-04-30 16:46 Tao Chen
  2025-04-30 16:46 ` [RFC PATCH bpf-next 1/2] libbpf: Try get fentry func addr from available_filter_functions_addr Tao Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tao Chen @ 2025-04-30 16:46 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, alan.maguire
  Cc: bpf, linux-kernel, Tao Chen

The previous discussion about fentry invalid on function optimeized by complier
is as follows:
https://lore.kernel.org/bpf/3c6f539b-b498-4587-b0dc-5fdeba717600@oracle.com/

This seems to be something that pahole needs to resolve. However, Alan
mentioned that there are many situations involved in this, and he proposed
that the available_filter_functions_addr can be used to find the address of
the real function. If we can get the real address from user, maybe this address
can be used when the function obtained from the BTF is invalid.

The specific selftest has not been added yet. I just wrote a simple test
program and ran it.

This is the initial RFC patch, feedback is welcome.

Tao Chen (2):
  libbpf: Try get fentry func addr from available_filter_functions_addr
  bpf: Get fentry func addr from user when BTF info invalid

 include/linux/bpf.h            |  1 +
 include/uapi/linux/bpf.h       |  1 +
 kernel/bpf/syscall.c           |  1 +
 kernel/bpf/verifier.c          |  9 ++++++
 tools/include/uapi/linux/bpf.h |  1 +
 tools/lib/bpf/bpf.c            |  1 +
 tools/lib/bpf/bpf.h            |  1 +
 tools/lib/bpf/gen_loader.c     |  1 +
 tools/lib/bpf/libbpf.c         | 53 ++++++++++++++++++++++++++++++++++
 9 files changed, 69 insertions(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-06  3:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 16:46 [RFC PATCH bpf-next 0/2] fentry supports function optimized by complier Tao Chen
2025-04-30 16:46 ` [RFC PATCH bpf-next 1/2] libbpf: Try get fentry func addr from available_filter_functions_addr Tao Chen
2025-04-30 16:46 ` [RFC PATCH bpf-next 2/2] bpf: Get fentry func addr from user when BTF info invalid Tao Chen
2025-04-30 17:57   ` Alan Maguire
2025-04-30 22:23     ` Alexei Starovoitov
2025-05-06  3:17       ` Tao Chen
2025-04-30 17:58 ` [RFC PATCH bpf-next 0/2] fentry supports function optimized by complier Alan Maguire

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).