-
Notifications
You must be signed in to change notification settings - Fork 5
bpf, arm64: support for timed may_goto #5713
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
bpf, arm64: support for timed may_goto #5713
Conversation
|
Upstream branch: fa47913 |
71f5f86 to
32bec89
Compare
|
Upstream branch: 9e293d4 |
64e6f94 to
be5d77e
Compare
32bec89 to
88bd43a
Compare
|
Upstream branch: 3e2b799 |
be5d77e to
d617e06
Compare
88bd43a to
fa50325
Compare
|
Upstream branch: c93c59b |
d617e06 to
94d1b94
Compare
2ef6166 to
28cde7b
Compare
|
Upstream branch: b5bbbb7 |
0139dd5 to
1db93e7
Compare
28cde7b to
e571275
Compare
|
Upstream branch: 2693227 |
1db93e7 to
7f8a94a
Compare
e571275 to
cffbb10
Compare
|
Upstream branch: 78e097f |
7f8a94a to
e523274
Compare
cffbb10 to
3975be7
Compare
|
Upstream branch: 21aeabb |
e523274 to
0222563
Compare
3975be7 to
6bdd33d
Compare
|
Upstream branch: 0780f54 |
0222563 to
076bf56
Compare
6bdd33d to
b62323c
Compare
|
Upstream branch: d47cc4d |
076bf56 to
27c26c7
Compare
b62323c to
07f2c0d
Compare
|
Upstream branch: 4223bf8 |
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]>
27c26c7 to
9007723
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