Skip to content

bpf, arm64: Add fsession support

Leon Hwang bpf linux-arm-kernel linux-kselftest lkml 5 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 0 repliesApplied 3/3
  2. v43 patches 0 repliesSuperseded
  3. v33 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches13 repliesSuperseded
v12 patches0 repliesSuperseded

Changes in v5 from the cover letter

* Address comment from Alexei:
* Rename helper bpf_link_prog_session_cookie() to bpf_prog_calls_session_cookie().
* v4: https://lore.kernel.org/bpf/[email protected]/

Patches in v5 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Add bpf_jit_supports_fsession()arch/x86/net/bpf_jit_comp.c include/linux/filter.h kernel/bpf/core.c +2 more+40 -80 repliesApplied
2/3bpf, arm64: Add fsession supportarch/arm64/net/bpf_jit_comp.c include/linux/bpf.h+68 -100 repliesApplied
3/3selftests/bpf: Enable get_func_args and get_func_ip tests on arm64tools/testing/selftests/bpf/progs/get_func_args_test.c tools/testing/selftests/bpf/progs/get_func_ip_test.c+2 -20 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPuranjay Mohan
1/3A-b T-b
2/3A-b T-b
3/3A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH bpf-next v5 0/3] bpf, arm64: Add fsession support

Similar to commit 98770bd4e6df ("bpf,x86: add fsession support for x86_64"), add fsession support on arm64.

Patch #1 adds bpf_jit_supports_fsession() to prevent fsession loading on architectures that do not implement fsession support.

Patch #2 implements fsession support in the arm64 BPF JIT trampoline.

Patch #3 enables the relevant selftests on arm64, including get_func_ip, and get_func_args.

All enabled tests pass on arm64:

cd tools/testing/selftests/bpf
./test_progs -t fsession

 #136/1   fsession_test/fsession_test:OK
 #136/2   fsession_test/fsession_reattach:OK
 #136/3   fsession_test/fsession_cookie:OK
 #136     fsession_test:OK

Summary: 1/3 PASSED, 0 SKIPPED, 0 FAILED

./test_progs -t get_func
#138 get_func_args_test:OK
#139 get_func_ip_test:OK
Summary: 2/0 PASSED, 0 SKIPPED, 0 FAILED

Changes:
v4 -> v5:
* Address comment from Alexei:
* Rename helper bpf_link_prog_session_cookie() to bpf_prog_calls_session_cookie().
* v4: https://lore.kernel.org/bpf/[email protected]/

v3 -> v4:
* Add a log when !bpf_jit_supports_fsession() in patch #1 (per AI).
* v3: https://lore.kernel.org/bpf/[email protected]/

v2 -> v3:
* Fix typo in subject and patch message of patch #1 (per AI and Chris).
* Collect Acked-by, and Tested-by from Puranjay, thanks.
* v2: https://lore.kernel.org/bpf/[email protected]/

v1 -> v2:
* Add bpf_jit_supports_fsession().
* v1: https://lore.kernel.org/bpf/[email protected]/

Leon Hwang (3):
bpf: Add bpf_jit_supports_fsession()
bpf, arm64: Add fsession support
selftests/bpf: Enable get_func_args and get_func_ip tests on arm64

 arch/arm64/net/bpf_jit_comp.c                 | 71 ++++++++++++++++---
 arch/x86/net/bpf_jit_comp.c                   |  5 ++
 include/linux/bpf.h                           |  7 +-
 include/linux/filter.h                        |  1 +
 kernel/bpf/core.c                             |  5 ++
 kernel/bpf/verifier.c                         |  5 ++
 .../selftests/bpf/prog_tests/fsession_test.c  | 32 ++++++---
 .../selftests/bpf/progs/get_func_args_test.c  |  2 +-
 .../selftests/bpf/progs/get_func_ip_test.c    |  2 +-
 9 files changed, 110 insertions(+), 20 deletions(-)

--
2.52.0