Re: [PATCH v4 bpf-next 1/7] bpf: improve JEQ/JNE branch taken logic

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

 



On Sun, Oct 22, 2023 at 01:57:37PM -0700, Andrii Nakryiko wrote:
> When determining if if/else branch will always or never be taken, use

Nitpick: "... if an if/else branch will ..."
                 ^^

> signed range knowledge in addition to currently used unsigned range knowledge.
> If either signed or unsigned range suggests that condition is
> always/never taken, return corresponding branch_taken verdict.
> 
> Current use of unsigned range for this seems arbitrary and unnecessarily
> incomplete. It is possible for *signed* operations to be performed on
> register, which could "invalidate" unsigned range for that register. In
> such case branch_taken will be artificially useless, even if we can
> still tell that some constant is outside of register value range based
> on its signed bounds.
> 
> veristat-based validation shows zero differences across selftests,
> Cilium, and Meta-internal BPF object files.
> 
> Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

Otherwise,

Acked-by: Shung-Hsi Yu <shung-hsi.yu@xxxxxxxx>




[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