bpf/tests: Add zero-extension checks in BPF_ATOMIC tests
authorJohan Almbladh <johan.almbladh@anyfinetworks.com>
Fri, 1 Oct 2021 13:03:40 +0000 (15:03 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Oct 2021 15:04:25 +0000 (17:04 +0200)
commit89b63462765cc0370f22ebec53d3e83cbbb17613
tree168d3364a90e9c833d9da6e6c442f1d88d9dc99c
parentcaaaa1667bf198c54cc3141ad92ca6ce853e99cd
bpf/tests: Add zero-extension checks in BPF_ATOMIC tests

This patch updates the existing tests of BPF_ATOMIC operations to verify
that a 32-bit register operand is properly zero-extended. In particular,
it checks the operation on archs that require 32-bit operands to be
properly zero-/sign-extended or the result is undefined, e.g. MIPS64.

Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211001130348.3670534-3-johan.almbladh@anyfinetworks.com
lib/test_bpf.c