Skip to content

Commit a04731c

Browse files
chenhengqichenhuacai
authored andcommitted
LoongArch: BPF: Don't align trampoline size
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. Cc: [email protected] Tested-by: Vincent Li <[email protected]> Signed-off-by: Hengqi Chen <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent e82406c commit a04731c

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
@@ -1743,8 +1743,7 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
17431743

17441744
ret = __arch_prepare_bpf_trampoline(&ctx, &im, m, tlinks, func_addr, flags);
17451745

1746-
/* Page align */
1747-
return ret < 0 ? ret : round_up(ret * LOONGARCH_INSN_SIZE, PAGE_SIZE);
1746+
return ret < 0 ? ret : ret * LOONGARCH_INSN_SIZE;
17481747
}
17491748

17501749
struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)

0 commit comments

Comments
 (0)