aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2022-01-06 20:51:56 +0000
committerDaniel Borkmann <[email protected]>2022-01-06 21:25:53 +0000
commit70bc793382a0e37ba4e35e4d1a317b280b829a44 (patch)
tree4268e76853208cdcc9d54122b80e7772497da51e /tools/lib/bpf/bpf.c
parentxdp: Add xdp_do_redirect_frame() for pre-computed xdp_frames (diff)
downloadkernel-70bc793382a0e37ba4e35e4d1a317b280b829a44.tar.gz
kernel-70bc793382a0e37ba4e35e4d1a317b280b829a44.zip
selftests/bpf: Don't rely on preserving volatile in PT_REGS macros in loop3
PT_REGS*() macro on some architectures force-cast struct pt_regs to other types (user_pt_regs, etc) and might drop volatile modifiers, if any. Volatile isn't really required as pt_regs value isn't supposed to change during the BPF program run, so this is correct behavior. But progs/loop3.c relies on that volatile modifier to ensure that loop is preserved. Fix loop3.c by declaring i and sum variables as volatile instead. It preserves the loop and makes the test pass on all architectures (including s390x which is currently broken). Fixes: 3cc31d794097 ("libbpf: Normalize PT_REGS_xxx() macro definitions") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf.c')
0 files changed, 0 insertions, 0 deletions