Skip to content
Commit 2d49b721 authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

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: 9bc0bb50

 ("objtool/x86: Rewrite retpoline thunk calls")
Reported-by: default avatarLukasz Majczak <lma@semihalf.com>
Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
parent 584fd3b3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment