]> git.itanic.dy.fi Git - linux-stable/commit
x86,bpf: Avoid IBT objtool warning
authorPeter Zijlstra <peterz@infradead.org>
Mon, 28 Mar 2022 11:13:41 +0000 (13:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:36:23 +0000 (09:36 +0200)
commit440c44c3d6d58db7bb1ae36760b77672d6dde891
tree802c6e1191be66e7287ab994ef5b689e1d92b659
parentb39fdc7a0d87f7f5d287dce1ae297a329775a1a3
x86,bpf: Avoid IBT objtool warning

[ Upstream commit be8a096521ca1a252bf078b347f96ce94582612e ]

Clang can inline emit_indirect_jump() and then folds constants, which
results in:

  | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x6a4: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40
  | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x67d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40
  | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x386: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20
  | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x35d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20

Suppress the optimization such that it must emit a code reference to
the __x86_indirect_thunk_array[] base.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lkml.kernel.org/r/20220405075531.GB30877@worktop.programming.kicks-ass.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/net/bpf_jit_comp.c