Re: [PATCH v6 14/17] static_call: Handle tail-calls

2020-07-10 Thread Peter Zijlstra
On Fri, Jul 10, 2020 at 08:23:19PM -0400, Steven Rostedt wrote: > On Fri, 10 Jul 2020 15:38:45 +0200 > Peter Zijlstra wrote: > > @@ -1639,6 +1647,10 @@ static int decode_sections(struct objtoo > > if (ret) > > return ret; > > > > + ret = read_static_call_tramps(file); > > + i

Re: [PATCH v6 14/17] static_call: Handle tail-calls

2020-07-10 Thread Peter Zijlstra
On Fri, Jul 10, 2020 at 08:23:19PM -0400, Steven Rostedt wrote: > On Fri, 10 Jul 2020 15:38:45 +0200 > Peter Zijlstra wrote: > > > GCC can turn our static_call(name)(args...) into a tail call, in which > > case we get a JMP.d32 into the trampoline (which then does a further > > tail-call). > > >

Re: [PATCH v6 14/17] static_call: Handle tail-calls

2020-07-10 Thread Steven Rostedt
On Fri, 10 Jul 2020 15:38:45 +0200 Peter Zijlstra wrote: > GCC can turn our static_call(name)(args...) into a tail call, in which > case we get a JMP.d32 into the trampoline (which then does a further > tail-call). > > Teach objtool to recognise and mark these in .static_call_sites and > adjust

[PATCH v6 14/17] static_call: Handle tail-calls

2020-07-10 Thread Peter Zijlstra
GCC can turn our static_call(name)(args...) into a tail call, in which case we get a JMP.d32 into the trampoline (which then does a further tail-call). Teach objtool to recognise and mark these in .static_call_sites and adjust the code patching to deal with this. Signed-off-by: Peter Zijlstra (In