BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: support shift operations with non-const source operand
@ 2026-06-23 12:02 Tianci Cao
  2026-06-23 12:02 ` [PATCH bpf-next 1/2] bpf: support shift operations with non-const src operand Tianci Cao
  2026-06-23 12:02 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for non-const src shift with bounded dst Tianci Cao
  0 siblings, 2 replies; 12+ messages in thread
From: Tianci Cao @ 2026-06-23 12:02 UTC (permalink / raw)
  To: bpf
  Cc: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, tangyazhou518,
	shenghaoyuan0928, ziye

Add support for BPF shift operations (BPF_LSH, BPF_RSH, BPF_ARSH)
when the source operand is not a constant.

---

v2 => v3:
- Make comments in scalar32_min_max_arsh and scalar_min_max_arsh
  more concise.
- Change the variable name: umin/umax -> min_shift/max_shift.
- Add tests for non-const src shift operations:
  1. overflow for lsh, rsh and arsh
  2. positive, negative and mixed range dst for arsh

v2: https://lore.kernel.org/bpf/20260612121041.25254-1-ziye@zju.edu.cn/

v1 => v2:
- Fix incorrect comments in scalar32_min_max_arsh and scalar_min_max_arsh.

v1: https://lore.kernel.org/bpf/20260612093818.18609-1-ziye@zju.edu.cn/

Tianci Cao (2):
  bpf: support shift operations with non-const src operand
  selftests/bpf: Add tests for non-const src shift with bounded dst

 kernel/bpf/verifier.c                         |  99 ++++++++---
 .../selftests/bpf/progs/verifier_bounds.c     | 167 ++++++++++++++++++
 2 files changed, 241 insertions(+), 25 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH bpf-next 0/2] bpf: support shift operations with non-const source operand
@ 2026-06-12  9:38 Tianci Cao
  2026-06-12  9:38 ` [PATCH bpf-next 1/2] bpf: support shift operations with non-const src operand Tianci Cao
  0 siblings, 1 reply; 12+ messages in thread
From: Tianci Cao @ 2026-06-12  9:38 UTC (permalink / raw)
  To: bpf
  Cc: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, tangyazhou518,
	shenghaoyuan0928, ziye

Add support for BPF shift operations (BPF_LSH, BPF_RSH, BPF_ARSH)
when the source operand is not a constant but is bounded.

Tianci Cao (2):
  bpf: support shift operations with non-const src operand
  selftests/bpf: Add tests for non-const src shift

 kernel/bpf/verifier.c                         | 100 ++++++++++++----
 .../selftests/bpf/progs/verifier_bounds.c     | 108 ++++++++++++++++++
 2 files changed, 184 insertions(+), 24 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-06-25  6:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 12:02 [PATCH bpf-next 0/2] bpf: support shift operations with non-const source operand Tianci Cao
2026-06-23 12:02 ` [PATCH bpf-next 1/2] bpf: support shift operations with non-const src operand Tianci Cao
2026-06-23 12:42   ` bot+bpf-ci
2026-06-25  6:47     ` Shung-Hsi Yu
2026-06-23 12:02 ` [PATCH bpf-next 2/2] selftests/bpf: Add tests for non-const src shift with bounded dst Tianci Cao
  -- strict thread matches above, loose matches on Subject: below --
2026-06-12  9:38 [PATCH bpf-next 0/2] bpf: support shift operations with non-const source operand Tianci Cao
2026-06-12  9:38 ` [PATCH bpf-next 1/2] bpf: support shift operations with non-const src operand Tianci Cao
2026-06-12 10:19   ` bot+bpf-ci
2026-06-12 16:09   ` Alexei Starovoitov
2026-06-12 21:20     ` Eduard Zingerman
2026-06-15 14:50     ` 曹天赐
2026-06-12 21:17   ` Eduard Zingerman
2026-06-15 14:51     ` 曹天赐

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox