Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-11 Thread Andy Lutomirski
> On Oct 11, 2018, at 5:52 AM, Josh Poimboeuf wrote: > >> On Wed, Oct 10, 2018 at 10:07:38PM -0500, Josh Poimboeuf wrote: >>> On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-11 Thread Andy Lutomirski
> On Oct 11, 2018, at 5:52 AM, Josh Poimboeuf wrote: > >> On Wed, Oct 10, 2018 at 10:07:38PM -0500, Josh Poimboeuf wrote: >>> On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-11 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 10:07:38PM -0500, Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: > > On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > > > > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > > On Wed, Oct 10, 2018 at

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-11 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 10:07:38PM -0500, Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: > > On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > > > > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > > On Wed, Oct 10, 2018 at

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: > On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > > > +#define

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 02:13:22PM -0700, Andy Lutomirski wrote: > On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > > > +#define

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > > +#define DECLARE_STATIC_CALL(tramp, func) > > > > \ > > > > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 11:17 AM Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > > +#define DECLARE_STATIC_CALL(tramp, func) > > > > \ > > > > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 1:16 PM Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 02:56:08PM -0400, Steven Rostedt wrote: > > On Wed, 10 Oct 2018 13:33:30 -0500 > > Josh Poimboeuf wrote: > > > > > Re-reading your suggestion, I may have misunderstood what you're > > > suggesting here, but I'm

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 1:16 PM Josh Poimboeuf wrote: > > On Wed, Oct 10, 2018 at 02:56:08PM -0400, Steven Rostedt wrote: > > On Wed, 10 Oct 2018 13:33:30 -0500 > > Josh Poimboeuf wrote: > > > > > Re-reading your suggestion, I may have misunderstood what you're > > > suggesting here, but I'm

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 02:56:08PM -0400, Steven Rostedt wrote: > On Wed, 10 Oct 2018 13:33:30 -0500 > Josh Poimboeuf wrote: > > > Re-reading your suggestion, I may have misunderstood what you're > > suggesting here, but I'm thinking about doing something like what you > > proposed earlier: > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 02:56:08PM -0400, Steven Rostedt wrote: > On Wed, 10 Oct 2018 13:33:30 -0500 > Josh Poimboeuf wrote: > > > Re-reading your suggestion, I may have misunderstood what you're > > suggesting here, but I'm thinking about doing something like what you > > proposed earlier: > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Steven Rostedt
On Wed, 10 Oct 2018 13:33:30 -0500 Josh Poimboeuf wrote: > Re-reading your suggestion, I may have misunderstood what you're > suggesting here, but I'm thinking about doing something like what you > proposed earlier: > > GLOBAL(tramp) > jmp *current_func(%rip) > ENDPROC(tramp) > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Steven Rostedt
On Wed, 10 Oct 2018 13:33:30 -0500 Josh Poimboeuf wrote: > Re-reading your suggestion, I may have misunderstood what you're > suggesting here, but I'm thinking about doing something like what you > proposed earlier: > > GLOBAL(tramp) > jmp *current_func(%rip) > ENDPROC(tramp) > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > +#define DEFINE_STATIC_CALL(tramp, func) > > > \ > > > + DECLARE_STATIC_CALL(tramp, func); \ > > > + asm(".pushsection .text, \"ax\"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > > > +#define DEFINE_STATIC_CALL(tramp, func) > > > \ > > > + DECLARE_STATIC_CALL(tramp, func); \ > > > + asm(".pushsection .text, \"ax\"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > +#define DECLARE_STATIC_CALL(tramp, func) \ > > > + extern typeof(func) tramp; \ > > > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 01:16:05PM -0500, Josh Poimboeuf wrote: > On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > > +#define DECLARE_STATIC_CALL(tramp, func) \ > > > + extern typeof(func) tramp; \ > > > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > +#define DECLARE_STATIC_CALL(tramp, func) \ > > + extern typeof(func) tramp; \ > > + static void __used __section(.discard.static_call_tramps) \

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Wed, Oct 10, 2018 at 11:03:43AM -0700, Andy Lutomirski wrote: > > +#define DECLARE_STATIC_CALL(tramp, func) \ > > + extern typeof(func) tramp; \ > > + static void __used __section(.discard.static_call_tramps) \

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 10:52 AM Josh Poimboeuf wrote: > > On Mon, Oct 08, 2018 at 11:57:50PM -0400, Steven Rostedt wrote: > > On Mon, 8 Oct 2018 21:17:10 -0500 > > Josh Poimboeuf wrote: > > > > > I'm not really convinced we need objtool for this, maybe I'll try > > > whipping up a POC. > > > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Andy Lutomirski
On Wed, Oct 10, 2018 at 10:52 AM Josh Poimboeuf wrote: > > On Mon, Oct 08, 2018 at 11:57:50PM -0400, Steven Rostedt wrote: > > On Mon, 8 Oct 2018 21:17:10 -0500 > > Josh Poimboeuf wrote: > > > > > I'm not really convinced we need objtool for this, maybe I'll try > > > whipping up a POC. > > > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Mon, Oct 08, 2018 at 11:57:50PM -0400, Steven Rostedt wrote: > On Mon, 8 Oct 2018 21:17:10 -0500 > Josh Poimboeuf wrote: > > > I'm not really convinced we need objtool for this, maybe I'll try > > whipping up a POC. > > Awesome! > > I wasn't thinking of actually having objtool itself

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-10 Thread Josh Poimboeuf
On Mon, Oct 08, 2018 at 11:57:50PM -0400, Steven Rostedt wrote: > On Mon, 8 Oct 2018 21:17:10 -0500 > Josh Poimboeuf wrote: > > > I'm not really convinced we need objtool for this, maybe I'll try > > whipping up a POC. > > Awesome! > > I wasn't thinking of actually having objtool itself

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-09 Thread Masami Hiramatsu
On Mon, 8 Oct 2018 23:55:34 -0400 Steven Rostedt wrote: > On Tue, 9 Oct 2018 12:44:01 +0900 > Masami Hiramatsu wrote: > > > On Fri, 05 Oct 2018 21:51:11 -0400 > > Steven Rostedt wrote: > > > > > +typedef long dynfunc_t; > > > + > > > +struct dynfunc_struct; > > > + > > > +#define

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-09 Thread Masami Hiramatsu
On Mon, 8 Oct 2018 23:55:34 -0400 Steven Rostedt wrote: > On Tue, 9 Oct 2018 12:44:01 +0900 > Masami Hiramatsu wrote: > > > On Fri, 05 Oct 2018 21:51:11 -0400 > > Steven Rostedt wrote: > > > > > +typedef long dynfunc_t; > > > + > > > +struct dynfunc_struct; > > > + > > > +#define

RE: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-09 Thread David Laight
From: Masami Hiramatsu > Sent: 09 October 2018 04:44 ... > I think we can replace the first 5 bytes of the default function > to jmp instruction (to alternative function) instead of making > this trampoline. Or have a trampoline that is just a jump instruction and overwrite the target address at

RE: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-09 Thread David Laight
From: Masami Hiramatsu > Sent: 09 October 2018 04:44 ... > I think we can replace the first 5 bytes of the default function > to jmp instruction (to alternative function) instead of making > this trampoline. Or have a trampoline that is just a jump instruction and overwrite the target address at

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 21:17:10 -0500 Josh Poimboeuf wrote: > I'm not really convinced we need objtool for this, maybe I'll try > whipping up a POC. Awesome! I wasn't thinking of actually having objtool itself perform this task, but instead breaking the internals of objtool up into more of a

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 21:17:10 -0500 Josh Poimboeuf wrote: > I'm not really convinced we need objtool for this, maybe I'll try > whipping up a POC. Awesome! I wasn't thinking of actually having objtool itself perform this task, but instead breaking the internals of objtool up into more of a

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Tue, 9 Oct 2018 12:44:01 +0900 Masami Hiramatsu wrote: > On Fri, 05 Oct 2018 21:51:11 -0400 > Steven Rostedt wrote: > > > +typedef long dynfunc_t; > > + > > +struct dynfunc_struct; > > + > > +#define arch_dynfunc_trampoline(name, def) \ > > + asm volatile ( \ > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Tue, 9 Oct 2018 12:44:01 +0900 Masami Hiramatsu wrote: > On Fri, 05 Oct 2018 21:51:11 -0400 > Steven Rostedt wrote: > > > +typedef long dynfunc_t; > > + > > +struct dynfunc_struct; > > + > > +#define arch_dynfunc_trampoline(name, def) \ > > + asm volatile ( \ > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Masami Hiramatsu
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +typedef long dynfunc_t; > + > +struct dynfunc_struct; > + > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ":

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Masami Hiramatsu
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +typedef long dynfunc_t; > + > +struct dynfunc_struct; > + > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ":

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Josh Poimboeuf
On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Josh Poimboeuf
On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 10:44 AM Jiri Kosina wrote: > > On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > > > Does that mean that architectures could opt out of doing the whole > > objtool + relocation processing thing, and instead take the hit of > > going through the trampoline for all calls? > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 10:44 AM Jiri Kosina wrote: > > On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > > > Does that mean that architectures could opt out of doing the whole > > objtool + relocation processing thing, and instead take the hit of > > going through the trampoline for all calls? > >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 8 October 2018 at 19:44, Jiri Kosina wrote: > On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > >> Does that mean that architectures could opt out of doing the whole >> objtool + relocation processing thing, and instead take the hit of >> going through the trampoline for all calls? > > There are

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 8 October 2018 at 19:44, Jiri Kosina wrote: > On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > >> Does that mean that architectures could opt out of doing the whole >> objtool + relocation processing thing, and instead take the hit of >> going through the trampoline for all calls? > > There are

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Jiri Kosina
On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > Does that mean that architectures could opt out of doing the whole > objtool + relocation processing thing, and instead take the hit of > going through the trampoline for all calls? There are architectures that aren't [currently] supported by objtool

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Jiri Kosina
On Mon, 8 Oct 2018, Ard Biesheuvel wrote: > Does that mean that architectures could opt out of doing the whole > objtool + relocation processing thing, and instead take the hit of > going through the trampoline for all calls? There are architectures that aren't [currently] supported by objtool

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 10:30 AM Ard Biesheuvel wrote: > > On 8 October 2018 at 19:25, Andy Lutomirski wrote: > > On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: > >> > >> On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > >> > > >> > > >> > > On Oct 8, 2018, at 8:57 AM,

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 10:30 AM Ard Biesheuvel wrote: > > On 8 October 2018 at 19:25, Andy Lutomirski wrote: > > On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: > >> > >> On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > >> > > >> > > >> > > On Oct 8, 2018, at 8:57 AM,

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 8 October 2018 at 19:25, Andy Lutomirski wrote: > On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: >> >> On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: >> > >> > >> > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: >> > > >> > > On Mon, Oct 08, 2018 at 01:33:14AM

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 8 October 2018 at 19:25, Andy Lutomirski wrote: > On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: >> >> On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: >> > >> > >> > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: >> > > >> > > On Mon, Oct 08, 2018 at 01:33:14AM

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: > > On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > >>> Can't we hijack the

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
On Mon, Oct 8, 2018 at 9:40 AM Peter Zijlstra wrote: > > On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > >>> Can't we hijack the

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Mon, Oct 08, 2018 at 09:29:56AM -0700, Andy Lutomirski wrote: > > > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 09:29:56 -0700 Andy Lutomirski wrote: > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out in the

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 09:29:56 -0700 Andy Lutomirski wrote: > > On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > >>> Can't we hijack the relocation records for these functions before they > >>> get thrown out in the

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 17:57:57 +0200 Peter Zijlstra wrote: > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > > Can't we hijack the relocation records for these functions before they > > > get thrown out in the (final) link pass or something? > > > > I could be talking out my

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Steven Rostedt
On Mon, 8 Oct 2018 17:57:57 +0200 Peter Zijlstra wrote: > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > > Can't we hijack the relocation records for these functions before they > > > get thrown out in the (final) link pass or something? > > > > I could be talking out my

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
> On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: >>> Can't we hijack the relocation records for these functions before they >>> get thrown out in the (final) link pass or something? >> >> I could be talking out my arse

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
> On Oct 8, 2018, at 8:57 AM, Peter Zijlstra wrote: > > On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: >>> Can't we hijack the relocation records for these functions before they >>> get thrown out in the (final) link pass or something? >> >> I could be talking out my arse

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > Can't we hijack the relocation records for these functions before they > > get thrown out in the (final) link pass or something? > > I could be talking out my arse here, but I thought we could do this, > too, then changed my

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Mon, Oct 08, 2018 at 01:33:14AM -0700, Andy Lutomirski wrote: > > Can't we hijack the relocation records for these functions before they > > get thrown out in the (final) link pass or something? > > I could be talking out my arse here, but I thought we could do this, > too, then changed my

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 6 October 2018 at 15:39, Steven Rostedt wrote: > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > >> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: >> > +#define arch_dynfunc_trampoline(name, def) \ >> > + asm volatile ( \ >> > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Ard Biesheuvel
On 6 October 2018 at 15:39, Steven Rostedt wrote: > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > >> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: >> > +#define arch_dynfunc_trampoline(name, def) \ >> > + asm volatile ( \ >> > +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
> On Oct 8, 2018, at 12:21 AM, Peter Zijlstra wrote: > >> On Sat, Oct 06, 2018 at 09:39:05AM -0400, Steven Rostedt wrote: >> On Sat, 6 Oct 2018 14:12:11 +0200 >> Peter Zijlstra wrote: >> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: +#define

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Andy Lutomirski
> On Oct 8, 2018, at 12:21 AM, Peter Zijlstra wrote: > >> On Sat, Oct 06, 2018 at 09:39:05AM -0400, Steven Rostedt wrote: >> On Sat, 6 Oct 2018 14:12:11 +0200 >> Peter Zijlstra wrote: >> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: +#define

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Sat, Oct 06, 2018 at 09:39:05AM -0400, Steven Rostedt wrote: > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > > > On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > > > +#define arch_dynfunc_trampoline(name, def) \ > > > + asm volatile (

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-08 Thread Peter Zijlstra
On Sat, Oct 06, 2018 at 09:39:05AM -0400, Steven Rostedt wrote: > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > > > On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > > > +#define arch_dynfunc_trampoline(name, def) \ > > > + asm volatile (

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Sat, 6 Oct 2018 08:13:18 -0700 Andy Lutomirski wrote: > > Perhaps a gcc plugin might work too. > > > > My suggestion was to have objtool do the dirty work. Josh said something > suspiciously like “sounds fun” on IRC :) > objtool does basically the same thing as recordmcount does. Josh

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Sat, 6 Oct 2018 08:13:18 -0700 Andy Lutomirski wrote: > > Perhaps a gcc plugin might work too. > > > > My suggestion was to have objtool do the dirty work. Josh said something > suspiciously like “sounds fun” on IRC :) > objtool does basically the same thing as recordmcount does. Josh

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Fri, 5 Oct 2018 22:03:51 -0400 Steven Rostedt wrote: > On Fri, 05 Oct 2018 21:51:11 -0400 > Steven Rostedt wrote: > > > +#ifndef PARAMS > > +#define PARAMS(x...) x > > +#endif > > + > > +#ifndef ARGS > > +#define ARGS(x...) x > > +#endif > > + > > This is also leftover from the first

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Fri, 5 Oct 2018 22:03:51 -0400 Steven Rostedt wrote: > On Fri, 05 Oct 2018 21:51:11 -0400 > Steven Rostedt wrote: > > > +#ifndef PARAMS > > +#define PARAMS(x...) x > > +#endif > > + > > +#ifndef ARGS > > +#define ARGS(x...) x > > +#endif > > + > > This is also leftover from the first

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Andy Lutomirski
> On Oct 6, 2018, at 6:39 AM, Steven Rostedt wrote: > > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > >>> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: >>> +#define arch_dynfunc_trampoline(name, def)\ >>> +asm volatile (\ >>> +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Andy Lutomirski
> On Oct 6, 2018, at 6:39 AM, Steven Rostedt wrote: > > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > >>> On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: >>> +#define arch_dynfunc_trampoline(name, def)\ >>> +asm volatile (\ >>> +

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Sat, 6 Oct 2018 14:12:11 +0200 Peter Zijlstra wrote: > On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > > +#define arch_dynfunc_trampoline(name, def) \ > > + asm volatile ( \ > > + ".globl dynfunc_" #name "; \n\t"\ > > + "dynfunc_" #name

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Steven Rostedt
On Sat, 6 Oct 2018 14:12:11 +0200 Peter Zijlstra wrote: > On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > > +#define arch_dynfunc_trampoline(name, def) \ > > + asm volatile ( \ > > + ".globl dynfunc_" #name "; \n\t"\ > > + "dynfunc_" #name

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Peter Zijlstra
On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ": \n\t" \ > + "jmp " #def " \n\t"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-06 Thread Peter Zijlstra
On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ": \n\t" \ > + "jmp " #def " \n\t"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +#ifndef PARAMS > +#define PARAMS(x...) x > +#endif > + > +#ifndef ARGS > +#define ARGS(x...) x > +#endif > + This is also leftover from the first attempt and can be nuked. Yeah, yeah, I should have reviewed my patches better before

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +#ifndef PARAMS > +#define PARAMS(x...) x > +#endif > + > +#ifndef ARGS > +#define ARGS(x...) x > +#endif > + This is also leftover from the first attempt and can be nuked. Yeah, yeah, I should have reviewed my patches better before

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ": \n\t" \ > + "jmp " #def " \n\t"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > +#define arch_dynfunc_trampoline(name, def) \ > + asm volatile ( \ > + ".globl dynfunc_" #name "; \n\t"\ > + "dynfunc_" #name ": \n\t" \ > + "jmp " #def " \n\t"

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > Signed-off-by: Steven Rostedt (VMware) > --- > include/asm-generic/vmlinux.lds.h | 4 + > include/linux/jump_function.h | 93 > kernel/Makefile | 2 +- >

Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

2018-10-05 Thread Steven Rostedt
On Fri, 05 Oct 2018 21:51:11 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > Signed-off-by: Steven Rostedt (VMware) > --- > include/asm-generic/vmlinux.lds.h | 4 + > include/linux/jump_function.h | 93 > kernel/Makefile | 2 +- >