Re: [PATCH bpf-next 4/8] bpf: Add helpers for trampoline image management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Sep 19, 2023, at 10:31 PM, Song Liu <song@xxxxxxxxxx> wrote:
> 
> As BPF trampoline of different archs moves from bpf_jit_[alloc|free]_exec()
> to bpf_prog_pack_[alloc|free](), we need to use different _alloc, _free for
> different archs during the transition. Add the following helpers for this
> transition:
> 
> void *arch_alloc_bpf_trampoline(int size);
> void arch_free_bpf_trampoline(void *image, int size);
> void arch_protect_bpf_trampoline(void *image, int size);
> void arch_unprotect_bpf_trampoline(void *image, int size);
> 
> The fallback version of these helpers require size <= PAGE_SIZE, but they
> are only called with size == PAGE_SIZE. They will be called with size <
> PAGE_SIZE when arch_bpf_trampoline_size() helper is introduced later.
> 
> Signed-off-by: Song Liu <song@xxxxxxxxxx>
> ---
> include/linux/bpf.h         |  5 +++++
> kernel/bpf/bpf_struct_ops.c | 12 +++++-----

I just found that we need similar changes in net/bpf/bpf_dummy_struct_ops.c. 

Added it to the next version. 

Song






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux