Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf, arm64: support for timed may_goto
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 9ea0691
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b7b3500
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b114fce
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: e9f545d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 5345e64
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 5b4c54a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: cd7c97f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: e8d780d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 821c9e5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: a6923c0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: f3af62b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: f3af62b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 911c035
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985549
version: 1

When verifier sees a timed may_goto instruction, it emits a call to
arch_bpf_timed_may_goto() with a stack offset in BPF_REG_AX (arm64 r9)
and expects a count value to be returned in the same register. The
verifier doesn't save or restore any registers before emitting this
call.

arch_bpf_timed_may_goto() should act as a trampoline to call
bpf_check_timed_may_goto() with AAPCS64 calling convention.

To support this custom calling convention, implement
arch_bpf_timed_may_goto() in assembly and make sure BPF caller saved
registers are saved and restored, call bpf_check_timed_may_goto with
arm64 calling convention where first argument and return value both are
in x0, then put the result back into BPF_REG_AX before returning.

Signed-off-by: Puranjay Mohan <[email protected]>
As arm64 JIT now supports timed may_goto instruction, make sure all
relevant tests run on this architecture. Some tests were enabled and
other required modifications to work properly on arm64.

 $ ./test_progs -a "stream*","*may_goto*",verifier_bpf_fastcall

 #404     stream_errors:OK
 [...]
 #406/2   stream_success/stream_cond_break:OK
 [...]
 #494/23  verifier_bpf_fastcall/may_goto_interaction_x86_64:SKIP
 #494/24  verifier_bpf_fastcall/may_goto_interaction_arm64:OK
 [...]
 #539/1   verifier_may_goto_1/may_goto 0:OK
 #539/2   verifier_may_goto_1/batch 2 of may_goto 0:OK
 #539/3   verifier_may_goto_1/may_goto batch with offsets 2/1/0:OK
 #539/4   verifier_may_goto_1/may_goto batch with offsets 2/0:OK
 #539     verifier_may_goto_1:OK
 #540/1   verifier_may_goto_2/C code with may_goto 0:OK
 #540     verifier_may_goto_2:OK
 Summary: 7/16 PASSED, 25 SKIPPED, 0 FAILED

Signed-off-by: Puranjay Mohan <[email protected]>
@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot force-pushed the bpf-next_base branch 2 times, most recently from 2b5b988 to 8821f0b Compare August 8, 2025 02:23
@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot deleted the series/985549=>bpf-next branch August 10, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants