]> 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)
commite85645cbaaa04c41d542344fd4b37e7684f6b407
treeea3435712f5e8b8a09d1a06e38da15d9b7f126bf
parent13e13dbf4b4a28dd414a9d4f0e48fd9440f2e0ce
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