-
Notifications
You must be signed in to change notification settings - Fork 148
bpf, arm64: support for timed may_goto #9439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: fa47913 |
2a0e5cd
to
2562e0e
Compare
Upstream branch: 9e293d4 |
d7f1ccf
to
5a3bc06
Compare
2562e0e
to
5583eb6
Compare
Upstream branch: 3e2b799 |
5a3bc06
to
e9546d6
Compare
5583eb6
to
601ea2d
Compare
Upstream branch: c93c59b |
e9546d6
to
5782fc3
Compare
601ea2d
to
7390c2c
Compare
Upstream branch: bf0c2a8 |
5782fc3
to
fa25bf6
Compare
7390c2c
to
3a736b5
Compare
Upstream branch: 2caa6b8 |
fa25bf6
to
a27cd59
Compare
3a736b5
to
c210f22
Compare
Upstream branch: 0786654 |
a27cd59
to
b229eb1
Compare
c210f22
to
2530e45
Compare
Upstream branch: dc0fe95 |
b229eb1
to
65dffe3
Compare
2530e45
to
61c9cef
Compare
Upstream branch: c80d797 |
65dffe3
to
8cf6a6e
Compare
61c9cef
to
715d6cb
Compare
Upstream branch: 3ec8560 |
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]>
8cf6a6e
to
d394b96
Compare
Pull request for series with
subject: bpf, arm64: support for timed may_goto
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=989634