Skip to content

Commit 812f770

Browse files
kkdwivediAlexei Starovoitov
authored andcommitted
bpf, x86: Fix objtool warning for timed may_goto
Kernel test robot reported "call without frame pointer save/setup" warning in objtool. This will make stack traces unreliable on CONFIG_UNWINDER_FRAME_POINTER=y, however it works on CONFIG_UNWINDER_ORC=y. Fix this by creating a stack frame for the function. Fixes: 2fb7618 ("bpf, x86: Add x86 JIT support for timed may_goto") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent bb2243f commit 812f770

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

arch/x86/net/bpf_timed_may_goto.S

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
SYM_FUNC_START(arch_bpf_timed_may_goto)
1212
ANNOTATE_NOENDBR
1313

14+
/*
15+
* r10 passes us stack depth, load the pointer to count and timestamp
16+
* into r10 by adding it to BPF frame pointer.
17+
*/
18+
leaq (%rbp, %r10, 1), %r10
19+
20+
/* Setup frame. */
21+
pushq %rbp
22+
movq %rsp, %rbp
23+
1424
/* Save r0-r5. */
1525
pushq %rax
1626
pushq %rdi
@@ -20,10 +30,10 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)
2030
pushq %r8
2131

2232
/*
23-
* r10 passes us stack depth, load the pointer to count and timestamp as
24-
* first argument to the call below.
33+
* r10 has the pointer to count and timestamp, pass it as first
34+
* argument.
2535
*/
26-
leaq (%rbp, %r10, 1), %rdi
36+
movq %r10, %rdi
2737

2838
/* Emit call depth accounting for call below. */
2939
CALL_DEPTH_ACCOUNT
@@ -40,5 +50,6 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)
4050
popq %rdi
4151
popq %rax
4252

53+
leave
4354
RET
4455
SYM_FUNC_END(arch_bpf_timed_may_goto)

0 commit comments

Comments
 (0)