Skip to content

Commit c52a1e6

Browse files
eddyz87Alexei Starovoitov
authored andcommitted
selftests/bpf: match both retq/rethunk in verifier_tailcall_jit
Depending on kernel parameters, x86 jit generates either retq or jump to rethunk for 'exit' instruction. The difference could be seen when kernel is booted with and without mitigations=off parameter. Relax the verifier_tailcall_jit test case to match both variants. Fixes: e5bdd6a ("selftests/bpf: validate jit behaviour for tail calls") Signed-off-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent ec1f77f commit c52a1e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/bpf/progs/verifier_tailcall_jit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ __jited(" movq -0x10(%rbp), %rax")
5959
__jited(" callq 0x{{.*}}") /* call to sub() */
6060
__jited(" xorl %eax, %eax")
6161
__jited(" leave")
62-
__jited(" retq")
62+
__jited(" {{(retq|jmp 0x)}}") /* return or jump to rethunk */
6363
__jited("...")
6464
/* subprogram entry for sub(), regular function prologue */
6565
__jited(" endbr64")
@@ -89,7 +89,7 @@ __jited(" popq %rax")
8989
__jited(" popq %rax")
9090
__jited(" jmp {{.*}}") /* jump to tail call tgt */
9191
__jited("L0: leave")
92-
__jited(" retq")
92+
__jited(" {{(retq|jmp 0x)}}") /* return or jump to rethunk */
9393
SEC("tc")
9494
__naked int main(void)
9595
{

0 commit comments

Comments
 (0)