mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 bpf-next 0/2] bpf: add a ksym BPF iterator
@ 2022-07-06 13:16 Alan Maguire
  2022-07-06 13:16 ` [PATCH v4 bpf-next 1/2] " Alan Maguire
  2022-07-06 13:16 ` [PATCH v4 bpf-next 2/2] selftests/bpf: add a ksym iter subtest Alan Maguire
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Maguire @ 2022-07-06 13:16 UTC (permalink / raw)
  To: ast, andrii, daniel
  Cc: kafai, songliubraving, yhs, john.fastabend, kpsingh, jolsa,
	mhiramat, akpm, void, swboyd, ndesaulniers, 9erthalion6, kennyyu,
	geliang.tang, kuniyu, bpf, linux-kernel

a ksym BPF iterator would be useful as it would allow more flexible
interactions with kernel symbols than are currently supported; it could
for example create more efficient map representations for lookup,
speed up symbol resolution etc.

The idea was initially discussed here [1].

Changes since v3 [2]:

- use late_initcall() to register iter; means we are both consistent
  with other iters and can encapsulate all iter-specific code in
  kallsyms.c in CONFIG_BPF_SYSCALL (Alexei, Yonghong, patch 1).

Changes since v2 [3]:

- set iter->show_value on initialization based on current creds
  and use it in selftest to determine if we show values
  (Yonghong, patches 1/2)
- inline iter registration into kallsyms_init (Yonghong, patch 1)

Changes since RFC [4]:

- change name of iterator (and associated structures/fields) to "ksym"
  (Andrii, patches 1, 2)
- remove dependency on CONFIG_PROC_FS; it was used for other BPF
  iterators, and I assumed it was needed because of seq ops but I
  don't think it is required on digging futher (Andrii, patch 1)

[1] https://lore.kernel.org/all/YjRPZj6Z8vuLeEZo@krava/
[2] https://lore.kernel.org/bpf/1656942916-13491-1-git-send-email-alan.maguire@oracle.com
[3] https://lore.kernel.org/bpf/1656667620-18718-1-git-send-email-alan.maguire@oracle.com/
[4] https://lore.kernel.org/all/1656089118-577-1-git-send-email-alan.maguire@oracle.com/

Alan Maguire (2):
  bpf: add a ksym BPF iterator
  selftests/bpf: add a ksym iter subtest

 kernel/kallsyms.c                                 | 95 +++++++++++++++++++++++
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 16 ++++
 tools/testing/selftests/bpf/progs/bpf_iter_ksym.c | 74 ++++++++++++++++++
 3 files changed, 185 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_iter_ksym.c

-- 
1.8.3.1


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

end of thread, other threads:[~2022-07-08 23:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 13:16 [PATCH v4 bpf-next 0/2] bpf: add a ksym BPF iterator Alan Maguire
2022-07-06 13:16 ` [PATCH v4 bpf-next 1/2] " Alan Maguire
2022-07-08 22:26   ` Andrii Nakryiko
2022-07-08 23:17   ` Hao Luo
2022-07-06 13:16 ` [PATCH v4 bpf-next 2/2] selftests/bpf: add a ksym iter subtest Alan Maguire
2022-07-08 22:27   ` Andrii Nakryiko

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®