Re: [PATCH v2 14/14] objtool,x86: Rewrite retpoline thunk calls

From: Josh Poimboeuf
Date: Fri Mar 19 2021 - 11:31:22 EST


On Fri, Mar 19, 2021 at 09:06:44AM +0100, Peter Zijlstra wrote:
> > Also doesn't the alternative code already insert nops?
>
> Problem is that the {call,jmp} *%\reg thing is not fixed length. They're
> 2 or 3 bytes depending on which register is picked.

Why do they need to be fixed length? Objtool can use sym->len as the
alternative replacement length. Then alternatives can add nops as
needed.

--
Josh