Re: [PATCH v2 12/14] objtool: Allow archs to rewrite retpolines

2021-03-19 Thread Peter Zijlstra
On Fri, Mar 19, 2021 at 12:21:03PM +0100, Peter Zijlstra wrote: > Let me see if I can come up with something better. Duh, we can put the instructions on a list and process them later, just like static_call, can even use the same insn list_head since a retpoline cannot be a static call. Lemme go

Re: [PATCH v2 12/14] objtool: Allow archs to rewrite retpolines

2021-03-19 Thread Peter Zijlstra
On Thu, Mar 18, 2021 at 09:54:40PM -0500, Josh Poimboeuf wrote: > On Thu, Mar 18, 2021 at 06:11:15PM +0100, Peter Zijlstra wrote: > > @@ -1212,6 +1225,8 @@ static int handle_group_alt(struct objto > > dest_off = arch_jump_destination(insn); > > if (dest_off ==

Re: [PATCH v2 12/14] objtool: Allow archs to rewrite retpolines

2021-03-18 Thread Josh Poimboeuf
On Thu, Mar 18, 2021 at 06:11:15PM +0100, Peter Zijlstra wrote: > @@ -1212,6 +1225,8 @@ static int handle_group_alt(struct objto > dest_off = arch_jump_destination(insn); > if (dest_off == special_alt->new_off + special_alt->new_len) >

[PATCH v2 12/14] objtool: Allow archs to rewrite retpolines

2021-03-18 Thread Peter Zijlstra
When retpolines are employed, compilers typically emit calls to retpoline thunks. Objtool recognises these calls and marks them as dynamic calls. Provide infrastructure for architectures to rewrite/augment what the compiler wrote for us. Signed-off-by: Peter Zijlstra (Intel) ---