-
Notifications
You must be signed in to change notification settings - Fork 5
bpf, arm64: support for timed may_goto #5635
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 #5635
Conversation
|
Upstream branch: 95993dc |
4bae2d4 to
8204217
Compare
|
Upstream branch: 9ea0691 |
9c44484 to
7c69ed2
Compare
8204217 to
af31cfa
Compare
|
Upstream branch: b7b3500 |
7c69ed2 to
0bafe79
Compare
af31cfa to
c6f1448
Compare
|
Upstream branch: b114fce |
0bafe79 to
ece3855
Compare
c6f1448 to
f34ad0b
Compare
|
Upstream branch: e9f545d |
ece3855 to
146fd80
Compare
f34ad0b to
6978e3e
Compare
|
Upstream branch: 5345e64 |
146fd80 to
641f6bc
Compare
6978e3e to
1661322
Compare
|
Upstream branch: 5b4c54a |
641f6bc to
9b02fe7
Compare
1661322 to
6217ef6
Compare
|
Upstream branch: cd7c97f |
9b02fe7 to
1eb6edf
Compare
6217ef6 to
9879802
Compare
|
Upstream branch: e8d780d |
1eb6edf to
1195445
Compare
9879802 to
dbe33e3
Compare
|
Upstream branch: 821c9e5 |
1195445 to
eb96967
Compare
dbe33e3 to
6409044
Compare
|
Upstream branch: a6923c0 |
eb96967 to
e98232b
Compare
6409044 to
9db1c0b
Compare
|
Upstream branch: f3af62b |
e98232b to
57d2689
Compare
51c6121 to
ed19bc9
Compare
|
Upstream branch: f3af62b |
57d2689 to
e35810e
Compare
ed19bc9 to
1a33a8f
Compare
|
Upstream branch: 911c035 |
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]>
e35810e to
71f3baa
Compare
2b5b988 to
8821f0b
Compare
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