Re: [PATCH bpf-next] selftests/bpf: Enable signed division and modulo overflow tests for LoongArch
From: Tiezhu Yang
Date: Tue Oct 27 2026 - 01:29:17 EST
On 2026/10/27 下午12:16, Tiezhu Yang wrote:
The LoongArch hardware divider handles signed overflow boundaries (such
as INT_MIN/-1 or LLONG_MIN/-1) natively and perfectly well on physical
silicon: (1)for division operations, it naturally returns the dividend
itself; (2)for modulo operations, it returns 0. Thus enable the signed
division and modulo overflow tests for LoongArch in verifier_sdiv.c.
Besides the 8 signed overflow (MIN/-1) test cases, I noticed that
there are another 8 test cases for small value signed calculations
with negative divisors (small_val/-1) that were also masked by
__arch_x86_64.
I've tested both blocks locally on a physical LoongArch machine, and
all 16 test cases passed flawlessly (Summary: 1/144 PASSED, 0 SKIPPED).
IMO it is better to enable these 16 test cases together in a single
patch, I will send v2 later.
Thanks,
Tiezhu