Skip to content

Commit 45f4134

Browse files
chenhengqiKernel Patches Daemon
authored andcommitted
LoongArch: BPF: Don't assume trampoline size is page aligned
Currently, arch_alloc_bpf_trampoline() use bpf_prog_pack_alloc() which will pack multiple trampolines into a huge page. So no need to assume the trampoline size is page aligned. Signed-off-by: Hengqi Chen <[email protected]>
1 parent d1d7283 commit 45f4134

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/loongarch/net/bpf_jit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,8 +1747,7 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
17471747

17481748
ret = __arch_prepare_bpf_trampoline(&ctx, &im, m, tlinks, func_addr, flags);
17491749

1750-
/* Page align */
1751-
return ret < 0 ? ret : round_up(ret * LOONGARCH_INSN_SIZE, PAGE_SIZE);
1750+
return ret < 0 ? ret : ret * LOONGARCH_INSN_SIZE;
17521751
}
17531752

17541753
struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)

0 commit comments

Comments
 (0)