[PATCH bpf-next 1/3] bpf: Use precise image size for struct_ops trampoline

Song Liu song at kernel.org
Mon Jan 29 09:21:49 PST 2024


On Tue, Jan 23, 2024 at 2:32 AM Pu Lehui <pulehui at huaweicloud.com> wrote:
>
> From: Pu Lehui <pulehui at huawei.com>
>
> For trampoline using bpf_prog_pack, we need to generate a rw_image
> buffer with size of (image_end - image). For regular trampoline, we use
> the precise image size generated by arch_bpf_trampoline_size to allocate
> rw_image. But for struct_ops trampoline, we allocate rw_image directly
> using close to PAGE_SIZE size. We do not need to allocate for that much,
> as the patch size is usually much smaller than PAGE_SIZE. Let's use
> precise image size for it too.
>
> Signed-off-by: Pu Lehui <pulehui at huawei.com>

Acked-by: Song Liu <song at kernel.org>



More information about the linux-riscv mailing list