-
Notifications
You must be signed in to change notification settings - Fork 151
powerpc/bpf: fix JIT code size calculation of bpf trampoline #8821
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
Conversation
|
Upstream branch: 5709be4 |
27c7945 to
4f05866
Compare
|
Upstream branch: be2fea9 |
867f260 to
7f379ec
Compare
4f05866 to
e9b7177
Compare
|
Upstream branch: 5cffad0 |
7f379ec to
074cf3a
Compare
e9b7177 to
f106256
Compare
|
Upstream branch: 53ebef5 |
074cf3a to
d1fbd11
Compare
f106256 to
8b59228
Compare
|
Upstream branch: 6aca583 |
d1fbd11 to
a7687d2
Compare
8b59228 to
9c93586
Compare
|
Upstream branch: b9c09fb |
a7687d2 to
78ed4df
Compare
9c93586 to
ca1daab
Compare
|
Upstream branch: 60400cd |
9afa005 to
993c0c1
Compare
|
Upstream branch: 38d976c |
d33bb6c to
925f194
Compare
993c0c1 to
97831b9
Compare
|
Upstream branch: 358b1c0 |
925f194 to
13489e7
Compare
97831b9 to
c60a0e6
Compare
|
Upstream branch: 358b1c0 |
13489e7 to
ae71349
Compare
c60a0e6 to
bebc5be
Compare
|
Upstream branch: 7b05f43 |
ae71349 to
77e5372
Compare
bebc5be to
bc80b4f
Compare
|
Upstream branch: 7b05f43 |
77e5372 to
c41a846
Compare
bc80b4f to
ad4665c
Compare
|
Upstream branch: 7b05f43 |
c41a846 to
53dc3f8
Compare
ad4665c to
f363929
Compare
|
Upstream branch: 86870d0 |
53dc3f8 to
7138be5
Compare
f363929 to
632a377
Compare
arch_bpf_trampoline_size() provides JIT size of the BPF trampoline
before the buffer for JIT'ing it is allocated. The total number of
instructions emitted for BPF trampoline JIT code depends on where
the final image is located. So, the size arrived at with the dummy
pass in arch_bpf_trampoline_size() can vary from the actual size
needed in arch_prepare_bpf_trampoline(). When the instructions
accounted in arch_bpf_trampoline_size() is less than the number of
instructions emitted during the actual JIT compile of the trampoline,
the below warning is produced:
WARNING: CPU: 8 PID: 204190 at arch/powerpc/net/bpf_jit_comp.c:981 __arch_prepare_bpf_trampoline.isra.0+0xd2c/0xdcc
which is:
/* Make sure the trampoline generation logic doesn't overflow */
if (image && WARN_ON_ONCE(&image[ctx->idx] >
(u32 *)rw_image_end - BPF_INSN_SAFETY)) {
So, during the dummy pass, instead of providing some arbitrary image
location, account for maximum possible instructions if and when there
is a dependency with image location for JIT'ing.
Fixes: d243b62 ("powerpc64/bpf: Add support for bpf trampolines")
Reported-by: Venkat Rao Bagalkote <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Cc: [email protected] # v6.13+
Acked-by: Naveen N Rao (AMD) <[email protected]>
Tested-by: Venkat Rao Bagalkote <[email protected]>
Signed-off-by: Hari Bathini <[email protected]>
|
Upstream branch: f263336 |
7138be5 to
19e2783
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=955580 irrelevant now. Closing PR. |
Pull request for series with
subject: powerpc/bpf: fix JIT code size calculation of bpf trampoline
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=955580