Re: [PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Steven Rostedt
On Mon, 26 Nov 2018 16:43:56 +0100 Peter Zijlstra wrote: > > + /* Patch the call site: */ > > + text_poke_bp((void *)insn, opcodes, CALL_INSN_SIZE, > > +static_call_bp_handler); > > I'm confused by the whole static_call_bp_handler thing; why not jump > straight to @func ?

Re: [PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Steven Rostedt
On Mon, 26 Nov 2018 16:43:56 +0100 Peter Zijlstra wrote: > > + /* Patch the call site: */ > > + text_poke_bp((void *)insn, opcodes, CALL_INSN_SIZE, > > +static_call_bp_handler); > > I'm confused by the whole static_call_bp_handler thing; why not jump > straight to @func ?

Re: [PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Peter Zijlstra
On Mon, Nov 26, 2018 at 07:54:59AM -0600, Josh Poimboeuf wrote: > +void static_call_bp_handler(void); > +void *bp_handler_dest; > + > +asm(".pushsection .text, \"ax\" > \n" > +".globl static_call_bp_handler \n" >

Re: [PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Peter Zijlstra
On Mon, Nov 26, 2018 at 07:54:59AM -0600, Josh Poimboeuf wrote: > +void static_call_bp_handler(void); > +void *bp_handler_dest; > + > +asm(".pushsection .text, \"ax\" > \n" > +".globl static_call_bp_handler \n" >

[PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Josh Poimboeuf
Add the x86 out-of-line static call implementation. For each key, a permanent trampoline is created which is the destination for all static calls for the given key. The trampoline has a direct jump which gets patched by static_call_update() when the destination function changes. Signed-off-by:

[PATCH v2 3/4] x86/static_call: Add out-of-line static call implementation

2018-11-26 Thread Josh Poimboeuf
Add the x86 out-of-line static call implementation. For each key, a permanent trampoline is created which is the destination for all static calls for the given key. The trampoline has a direct jump which gets patched by static_call_update() when the destination function changes. Signed-off-by: