mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: Kees Cook <kees@kernel.org>, Kees Cook <kees+treewide@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the bpf-next tree with the origin tree
Date: Thu, 12 Nov 2026 14:19:19 +0000	[thread overview]
Message-ID: <avXK527T4yDydgya@sirena.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 4030 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got a conflict in:

  kernel/bpf/scev.c

between commit:

  0af298e62e5cf ("treewide: refresh kmalloc_obj() conversions")

from the origin tree and commits:

  e2f3d29e88d08 ("bpf: Refine registers linked by scalar evolution at conditional jumps")
  aba76dc75e35f ("bpf: Construct scalar evolution expressions without allocations")
  cfef7bfa2c2a1 ("bpf: Give SSA names to the values that scalar evolution does not track")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc kernel/bpf/cfg.c
index 1b04538351a1f,bbcf42eae9d92..0000000000000
--- a/kernel/bpf/cfg.c
+++ b/kernel/bpf/cfg.c
diff --cc kernel/bpf/scev.c
index db123ef1f0718,b413998d9cf93..0000000000000
--- a/kernel/bpf/scev.c
+++ b/kernel/bpf/scev.c
@@@ -1260,23 -2430,13 +2430,13 @@@ static int compute_scev_for_loop(struc
  	u32 r;
  
  	if (log_level2)
- 		bpf_log(&env->log, "Computing SCEV for loop at %d:\n", cur_header);
+ 		bpf_log(&env->log, "Computing SCEV for %s at %d:\n",
+ 			cur_loop ? "loop" : "subprog", first);
  
- 	/*
- 	 * For irreducible loops, and for loops nesting a loop with a truncated
- 	 * exit list, just assume that everything is clobbered for now.
- 	 */
- 	if (!can_compute_loop_scev(cur_loop)) {
- 		header_env = get_loop_env(scev, cur_header, cur_header);
- 		if (!header_env)
- 			return -ENOMEM;
- 		/* The freshly allocated environment has all expressions unknown. */
- 		bitmap_fill(cur_loop->store_base_regs, REGS_NUM);
- 		header_env->empty = false;
+ 	if (!cur_loop && !can_compute_subprog_scev(env, sub))
  		return 0;
- 	}
  
 -	cur_env = kzalloc(sizeof(*cur_env), GFP_KERNEL_ACCOUNT);
 +	cur_env = kzalloc_obj(*cur_env, GFP_KERNEL_ACCOUNT);
  	if (!cur_env)
  		goto nomem;
  	if (log_level2) {
@@@ -1724,25 -3142,27 +3142,29 @@@ void bpf_free_scev(struct bpf_verifier_
  int bpf_init_scev(struct bpf_verifier_env *env)
  {
  	struct scev *scev;
+ 	u32 r;
  
 -	scev = kzalloc(sizeof(struct scev), GFP_KERNEL_ACCOUNT);
 +	scev = kzalloc_obj(struct scev, GFP_KERNEL_ACCOUNT);
  	if (!scev)
  		return -ENOMEM;
  	env->scev = scev;
  	bpf_mark_reg_known_scalar(&scev->zero_reg, 0);
- 	bpf_mark_reg_unknown_imprecise(&scev->unknown_reg);
- 	/* A power of two for hash & (exprs_ht_cnt - 1)` indexing. */
- 	scev->exprs_ht_cnt = roundup_pow_of_two(max(256U, DIV_ROUND_UP(env->prog->len, 4)));
- 	scev->exprs_ht = kvzalloc_objs(*scev->exprs_ht, scev->exprs_ht_cnt,
- 				       GFP_KERNEL_ACCOUNT);
- 	if (!scev->exprs_ht)
- 		goto nomem;
- 	if (expr0(scev, UNKNOWN) < 0 || expr0(scev, OPAQUE)  < 0)
+ 	bpf_mark_reg_unknown(&scev->unknown_reg);
+ 	setup_initial_loop_env(&scev->identity_env);
+ 	if (grow_exprs(scev, roundup_pow_of_two(REG_EXPR_ID(REGS_NUM))))
  		goto nomem;
+ 	scev->exprs[UNKNOWN_EXPR_ID] = (struct expr){ .op = UNKNOWN };
+ 	scev->exprs[OPAQUE_EXPR_ID] = (struct expr){ .op = OPAQUE };
+ 	for (r = 0; r < REGS_NUM; r++)
+ 		scev->exprs[REG_EXPR_ID(r)] = (struct expr){ .op = REG, .is_vn = true,
+ 							     .params = { r, 0 } };
+ 	for (r = 0; r < REG_EXPR_ID(REGS_NUM); r++)
+ 		set_expr_base(scev, &scev->exprs[r], r);
+ 	scev->exprs_cnt = REG_EXPR_ID(REGS_NUM);
 -	scev->envs = kvcalloc(env->prog->len, sizeof(*scev->envs), GFP_KERNEL_ACCOUNT);
 -	scev->discovered = kvcalloc(env->prog->len, sizeof(*scev->discovered), GFP_KERNEL_ACCOUNT);
 +	scev->envs = kvzalloc_objs(*scev->envs, env->prog->len,
 +				   GFP_KERNEL_ACCOUNT);
 +	scev->discovered = kvzalloc_objs(*scev->discovered, env->prog->len,
 +					 GFP_KERNEL_ACCOUNT);
  	if (!scev->envs || !scev->discovered)
  		goto nomem;
  	/*

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2026-11-12 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 14:19 Mark Brown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-10 17:05 Mark Brown
2026-04-14 12:18 Mark Brown
2026-04-14 14:09 ` Alexei Starovoitov
2026-04-14 14:38   ` Mark Brown

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=avXK527T4yDydgya@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kees+treewide@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.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

all inboxes | Powered by JetHome®