Re: [PATCH bpf-next v3 0/4] selftests/bpf: Handle unexpected failures on unsupported hardware

From: Tiezhu Yang

Date: Thu Dec 03 2026 - 00:09:11 EST


On 12/3/26 12:00 PM, Alexei Starovoitov wrote:
On Mon, Nov 30, 2026 at 05:29 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
On 11/16/26 11:59 AM, Tiezhu Yang wrote:
v3:
- Introduce SKIP_TESTS() as a generic utility to avoid fragile
hardcoded string arrays in test runners.

Every runner still has to call it. The series changes one runner.
More than 20 objects with an arena map go through test_loader.
verifier_arena, verifier_ldsx, verifier_zext, compute_live_registers
and stream fail the same way on 3A5000:

run_subtest()
bpf_object__load() creates all maps of the object
arena_map_alloc()
bpf_jit_supports_arena() false without SCQ, -EOPNOTSUPP

I'm not going to accept any selftest tweaks because loongarch
doesn't support some feature.

Understood, thanks for the clear explanation. I will drop the
SKIP_TESTS() and arena skipping patches (patches 1 and 2).

CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not always set on arm,
loongarch, m68k and riscv:

$ grep "select HAVE_EFFICIENT_UNALIGNED_ACCESS" arch/*/Kconfig
arch/arc/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/arm64/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/arm/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
arch/loongarch/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS if !ARCH_STRICT_ALIGN
arch/m68k/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS if !CPU_HAS_NO_UNALIGNED
arch/powerpc/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/riscv/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/s390/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/x86/Kconfig: select HAVE_EFFICIENT_UNALIGNED_ACCESS

$ grep -B 4 "select HAVE_EFFICIENT_UNALIGNED_ACCESS" arch/riscv/Kconfig
config RISCV_EFFICIENT_UNALIGNED_ACCESS
bool "Assume the system supports fast unaligned memory accesses"
depends on NONPORTABLE
select DCACHE_WORD_ACCESS if MMU
select HAVE_EFFICIENT_UNALIGNED_ACCESS

What about the following three patches that fix verifier alignment
rejections when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set:

selftests/bpf: Fix unaligned access failure in fexit_bpf2bpf
https://lore.kernel.org/bpf/20261116035907.4215-4-yangtiezhu@xxxxxxxxxxx/

selftests/bpf: Allow unaligned access in jit_insns/tail_call
https://lore.kernel.org/bpf/20261116035907.4215-5-yangtiezhu@xxxxxxxxxxx/

selftests/bpf: Allow unaligned access in callx_rodata_misaligned_read
https://lore.kernel.org/bpf/20261123045008.23691-3-yangtiezhu@xxxxxxxxxxx/

Would you be open to taking these three patches as a separate series?
If yes, I will send v4 for them; if not, I will drop them too.

Thanks,
Tiezhu