]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, x64: use %rcx instead of %rax for tail call retpolines
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Wed, 16 Sep 2020 21:10:04 +0000 (23:10 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 17 Sep 2020 19:59:31 +0000 (12:59 -0700)
commit5a624b98fa8bec59d572a788372e099cde51a0ab
tree22311eed321b0c57a13b7a809218af47ef6216ea
parent742a1a22d2f02dea47749468f26c4f44d6ddf9f7
bpf, x64: use %rcx instead of %rax for tail call retpolines

Currently, %rax is used to store the jump target when BPF program is
emitting the retpoline instructions that are handling the indirect
tailcall.

There is a plan to use %rax for different purpose, which is storing the
tail call counter. In order to preserve this value across the tailcalls,
adjust the BPF indirect tailcalls so that the target program will reside
in %rcx and teach the retpoline instructions about new location of jump
target.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/include/asm/nospec-branch.h
arch/x86/net/bpf_jit_comp.c