]> git.baikalelectronics.ru Git - kernel.git/commit
x86/alternative: Handle Jcc __x86_indirect_thunk_\reg
authorPeter Zijlstra <peterz@infradead.org>
Tue, 26 Oct 2021 12:01:43 +0000 (14:01 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 28 Oct 2021 21:25:28 +0000 (23:25 +0200)
commitf73af0dc54e85ffffa45603d4e6e40240ffe8641
treeea3435712f5e8b8a09d1a06e38da15d9b7f126bf
parentb124c32128330967101492f74af1cc4da50382e4
x86/alternative: Handle Jcc __x86_indirect_thunk_\reg

Handle the rare cases where the compiler (clang) does an indirect
conditional tail-call using:

  Jcc __x86_indirect_thunk_\reg

For the !RETPOLINE case this can be rewritten to fit the original (6
byte) instruction like:

  Jncc.d8 1f
  JMP *%\reg
  NOP
1:

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/r/20211026120310.296470217@infradead.org
arch/x86/kernel/alternative.c