Skip to content

bpf, arm64: use emit_addr_mov_i64() for BPF_PSEUDO_FUNC #2351

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

Closed
wants to merge 2 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: bpf, arm64: use emit_addr_mov_i64() for BPF_PSEUDO_FUNC
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=602174

@kernel-patches-bot
Copy link
Author

Master branch: 9e6b19a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=602174
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: e63a023
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=602174
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 5e22dd1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=602174
version: 1

Nobody and others added 2 commits January 5, 2022 04:40
The following error is reported when running "./test_progs -t for_each"
under arm64:

    bpf_jit: multi-func JIT bug 58 != 56
    ......
    JIT doesn't support bpf-to-bpf calls

The root cause is the size of BPF_PSEUDO_FUNC instruction increases
from 2 to 3 after the address of called bpf-function is settled and
there are two bpf-to-bpf calls in test_pkt_access. The generated
instructions are shown below:

>before callback_fn is jited, its addr is 0x1-00000001
0x48:  21 00 C0 D2    movz x1, #0x1, lsl #32
0x4c:  21 00 80 F2    movk x1, #0x1

>after callback_fn is jited, its addr is 0xfffffe0017f2fb84
0x48:  E1 3F C0 92    movn x1, #0x1ff, lsl #32
0x4c:  41 FE A2 F2    movk x1, #0x17f2, lsl #16
0x50:  81 70 9F F2    movk x1, #0xfb84

Fixing it by using emit_addr_mov_i64() for BPF_PSEUDO_FUNC, so
the size of jited image will not change.

Fixes: 69c087b ("bpf: Add bpf_for_each_map_elem() helper")
Signed-off-by: Hou Tao <[email protected]>
@kernel-patches-bot kernel-patches-bot deleted the series/602174=>bpf-next branch January 8, 2022 03:51
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.

1 participant