public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	martin.lau@kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v4 bpf-next 1/7] bpf: improve JEQ/JNE branch taken logic
Date: Mon, 23 Oct 2023 10:33:59 +0800	[thread overview]
Message-ID: <ZTXbl7MsUlXgg9d1@u94a> (raw)
In-Reply-To: <20231022205743.72352-2-andrii@kernel.org>

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@kernel.org>

Otherwise,

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

  reply	other threads:[~2023-10-23  2:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-22 20:57 [PATCH v4 bpf-next 0/7] BPF register bounds logic and testing improvements Andrii Nakryiko
2023-10-22 20:57 ` [PATCH v4 bpf-next 1/7] bpf: improve JEQ/JNE branch taken logic Andrii Nakryiko
2023-10-23  2:33   ` Shung-Hsi Yu [this message]
2023-10-22 20:57 ` [PATCH v4 bpf-next 2/7] bpf: derive smin/smax from umin/max bounds Andrii Nakryiko
2023-10-23  2:36   ` Shung-Hsi Yu
2023-10-24 13:08   ` Daniel Borkmann
2023-10-24 14:53     ` Andrii Nakryiko
2023-10-24 15:43       ` Daniel Borkmann
2023-10-22 20:57 ` [PATCH v4 bpf-next 3/7] bpf: enhance subregister bounds deduction logic Andrii Nakryiko
2023-10-23  3:20   ` Shung-Hsi Yu
2023-10-23  3:56     ` Shung-Hsi Yu
2023-10-23 16:23       ` Andrii Nakryiko
2023-10-24 12:05         ` Shung-Hsi Yu
2023-10-24 12:22   ` Shung-Hsi Yu
2023-10-24 15:31     ` Alexei Starovoitov
2023-10-27  8:16       ` Shung-Hsi Yu
2023-10-22 20:57 ` [PATCH v4 bpf-next 4/7] bpf: improve deduction of 64-bit bounds from 32-bit bounds Andrii Nakryiko
2023-10-22 20:57 ` [PATCH v4 bpf-next 5/7] bpf: try harder to deduce register bounds from different numeric domains Andrii Nakryiko
2023-10-22 20:57 ` [PATCH v4 bpf-next 6/7] bpf: drop knowledge-losing __reg_combine_{32,64}_into_{64,32} logic Andrii Nakryiko
2023-10-22 20:57 ` [PATCH v4 bpf-next 7/7] selftests/bpf: BPF register range bounds tester Andrii Nakryiko
2023-10-22 23:01   ` kernel test robot
2023-10-24 13:40 ` [PATCH v4 bpf-next 0/7] BPF register bounds logic and testing improvements patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTXbl7MsUlXgg9d1@u94a \
    --to=shung-hsi.yu@suse.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox