OpenCloudOS-Kernel/tools/objtool/arch/x86
Peter Zijlstra 2d49b721dc objtool: Only rewrite unconditional retpoline thunk calls
It turns out that the compilers generate conditional branches to the
retpoline thunks like:

  5d5:   0f 85 00 00 00 00       jne    5db <cpuidle_reflect+0x22>
	5d7: R_X86_64_PLT32     __x86_indirect_thunk_r11-0x4

while the rewrite can only handle JMP/CALL to the thunks. The result
is the alternative wrecking the code. Make sure to skip writing the
alternatives for conditional branches.

Fixes: 9bc0bb5072 ("objtool/x86: Rewrite retpoline thunk calls")
Reported-by: Lukasz Majczak <lma@semihalf.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
2021-06-11 08:53:06 +02:00
..
include/arch Objtool updates in this cycle were: 2021-04-28 12:53:24 -07:00
Build objtool: Abstract alternative special case handling 2020-09-10 10:43:13 -05:00
decode.c objtool: Only rewrite unconditional retpoline thunk calls 2021-06-11 08:53:06 +02:00
special.c objtool: Fix retpoline detection in asm code 2021-01-26 11:11:59 -06:00