Re: [PATCH bpf-next v2 3/5] bpf: support bpf_fastcall patterns for kfuncs

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

 




On 8/16/24 6:51 PM, Eduard Zingerman wrote:
Recognize bpf_fastcall patterns around kfunc calls.
For example, suppose bpf_cast_to_kern_ctx() follows bpf_fastcall
contract (which it does), in such a case allow verifier to rewrite BPF
program below:

   r2 = 1;
   *(u64 *)(r10 - 32) = r2;
   call %[bpf_cast_to_kern_ctx];
   r2 = *(u64 *)(r10 - 32);
   r0 = r2;

By removing the spill/fill pair:

   r2 = 1;
   call %[bpf_cast_to_kern_ctx];
   r0 = r2;

Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>




[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