]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/tests: Add JMP tests with small offsets
authorJohan Almbladh <johan.almbladh@anyfinetworks.com>
Tue, 14 Sep 2021 09:18:37 +0000 (11:18 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 28 Sep 2021 07:26:28 +0000 (09:26 +0200)
commit50754aa9ee41b13960b63962dbc6798720e20a80
treeb700bd3094bb59693716cb7df8fe2e1aa33ab718
parent1ae5b966c6ed8d9bf52ede4e02f0c81fa5f17eae
bpf/tests: Add JMP tests with small offsets

This patch adds a set of tests for JMP to verify that the JITed jump
offset is calculated correctly. We pretend that the verifier has inserted
any zero extensions to make the jump-over operations JIT to one
instruction each, in order to control the exact JITed jump offset.

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