summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2024-01-02 20:30:37 +0100
committerAlexei Starovoitov <ast@kernel.org>2024-01-04 14:37:25 -0800
commit63fac34669e4cc666f943173ed2aa76b8db999f0 (patch)
tree7269325aad0d4d47fab766b3f8dcfc07cfa8f0a5 /tools
parent445aea5afda4759c13dc5c492b309cc1d5c1c486 (diff)
downloadlinux-stable-63fac34669e4cc666f943173ed2aa76b8db999f0.tar.gz
linux-stable-63fac34669e4cc666f943173ed2aa76b8db999f0.tar.bz2
linux-stable-63fac34669e4cc666f943173ed2aa76b8db999f0.zip
selftests/bpf: Test gotol with large offsets
Test gotol with offsets that don't fit into a short (i.e., larger than 32k or smaller than -32k). Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Acked-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/r/20240102193531.3169422-4-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/progs/verifier_gotol.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/verifier_gotol.c b/tools/testing/selftests/bpf/progs/verifier_gotol.c
index d1edbcff9a18..05a329ee45ee 100644
--- a/tools/testing/selftests/bpf/progs/verifier_gotol.c
+++ b/tools/testing/selftests/bpf/progs/verifier_gotol.c
@@ -33,6 +33,25 @@ l3_%=: \
: __clobber_all);
}
+SEC("socket")
+__description("gotol, large_imm")
+__success __failure_unpriv __retval(40000)
+__naked void gotol_large_imm(void)
+{
+ asm volatile (" \
+ gotol 1f; \
+0: \
+ r0 = 0; \
+ .rept 40000; \
+ r0 += 1; \
+ .endr; \
+ exit; \
+1: gotol 0b; \
+" :
+ :
+ : __clobber_all);
+}
+
#else
SEC("socket")