* kernel/bpf/scev.c:1736:undefined reference to `__udivmoddi4'
@ 2026-10-01 15:15 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-01 15:15 UTC (permalink / raw)
To: Eduard Zingerman; +Cc: oe-kbuild-all, 0day robot
tree: https://github.com/intel-lab-lkp/linux/commits/Eduard-Zingerman/bpf-track-may_write-flags-in-liveness/20260926-071959
head: 588faaac20422c91861700e863668674da9cc06f
commit: 280ac823486cf3ef2a002b680a99c1e162a16204 bpf: use SCEV to widen bounded loops
date: 5 days ago
config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20261001/202610011731.DcYbvUbx-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261001/202610011731.DcYbvUbx-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610011731.DcYbvUbx-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: kernel/bpf/verifier.o: in function `scalar_step_lsh':
kernel/bpf/verifier.c:15665:(.text+0x149c2): undefined reference to `__umoddi3'
ld: kernel/bpf/verifier.o: in function `scalar_step_mul':
kernel/bpf/verifier.c:15654:(.text+0x15c36): undefined reference to `__umoddi3'
ld: kernel/bpf/scev.o: in function `compute_max_iters':
>> kernel/bpf/scev.c:1736:(.text+0xf7b): undefined reference to `__udivmoddi4'
vim +1736 kernel/bpf/scev.c
1681
1682 /*
1683 * Loop with post-condition:
1684 *
1685 * r0 = 0
1686 * l: ... r0 ∈ [0,1,2] header executed 3 times
1687 * r0 += 1 r0 ∈ [0,1,2]
1688 * ... r0 ∈ [1,2,3]
1689 * if r0 != 3 goto l r0 ∈ [1,2,3] backedge taken 2 times
1690 * ... r0 ∈ [3]
1691 *
1692 * SCEV at header: r0 = k
1693 * SCEV at latch: r0 = 1 + k
1694 *
1695 * Loop with pre-condition:
1696 *
1697 * r0 = 0
1698 * l: ... r0 ∈ [0,1,2,3] header executed 4 times
1699 * if r0 == 3 goto e r0 ∈ [0,1,2,3] backedge taken 3 times
1700 * r0 += 1 r0 ∈ [0,1,2]
1701 * ... r0 ∈ [1,2,3]
1702 * goto l r0 ∈ [1,2,3]
1703 * e: ... r0 ∈ [3]
1704 *
1705 * SCEV at header: r0 = k
1706 * SCEV at latch: r0 = k
1707 */
1708 static bool compute_max_iters(struct bpf_verifier_env *env,
1709 struct bpf_func_state *st,
1710 struct linear_latch *latch,
1711 struct bpf_loop_iters *iters)
1712 {
1713 u64 base, step, diff, bound, initial, max_iters;
1714 struct bpf_insn_aux_data *aux = env->insn_aux_data;
1715 struct bpf_loop *loop = aux[bpf_loop_at_index(env, latch->insn_idx)].loop;
1716 struct scev *scev = env->scev;
1717 u8 op = latch->op;
1718
1719 if (!eval_expr(env, scev, st, latch->base_expr, &base) ||
1720 !eval_expr(env, scev, st, latch->step_expr, &step) ||
1721 !eval_expr(env, scev, st, latch->bound_expr, &bound) ||
1722 !eval_expr(env, scev, st, latch->reg_expr, &initial))
1723 return false;
1724
1725 if (step == 0)
1726 return false;
1727 if ((s64)step == S64_MIN)
1728 return false;
1729 if ((s64)step < 0) {
1730 /* Multiply both sides of the equation by -1, e.g. -2*i > -3 becomes 2*i < 3 */
1731 op = bpf_flip_opcode(op);
1732 step = -step;
1733 swap(bound, initial);
1734 }
1735 diff = bound - initial;
> 1736 if (diff / step == U64_MAX)
1737 return false;
1738 switch (op) {
1739 case BPF_JLT:
1740 max_iters = (u64)initial >= (u64)bound ? 0 : div_round_up(diff, step);
1741 break;
1742 case BPF_JLE:
1743 max_iters = (u64)initial > (u64)bound ? 0 : diff / step + 1;
1744 break;
1745 case BPF_JSLT:
1746 max_iters = (s64)initial >= (s64)bound ? 0 : div_round_up(diff, step);
1747 break;
1748 case BPF_JSLE:
1749 max_iters = (s64)initial > (s64)bound ? 0 : diff / step + 1;
1750 break;
1751 case BPF_JNE:
1752 max_iters = diff % step ? U32_MAX : div_round_up(diff, step);
1753 break;
1754 default:
1755 return false;
1756 }
1757
1758 if (max_iters > U32_MAX)
1759 return false;
1760
1761 /*
1762 * The latch is a conditional jump with one jump target exiting the loop.
1763 * Linear latch is matched only if the loop has a single backedge.
1764 * The loop still, however can have multiple exits.
1765 * In such case, conservatively assume that non-latch exit can happen
1766 * at any iteration, thus setting minimal number of iterations as 0.
1767 */
1768 iters->max_header_count = max_iters + (base == 0 ? 1 : 0);
1769 iters->min_header_count = loop->exits_cnt == 1 ? iters->max_header_count : 0;
1770 iters->pre_cond = base == 0;
1771 return true;
1772 }
1773
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-01 15:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 15:15 kernel/bpf/scev.c:1736:undefined reference to `__udivmoddi4' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.