Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-08-06 Thread Sami Tolvanen
On Wed, Jul 22, 2020 at 08:06:08PM -0400, Steven Rostedt wrote: > On Thu, 23 Jul 2020 01:56:20 +0200 > Peter Zijlstra wrote: > > > Anyway, what do you prefer, I suppose I can make objtool whatever we > > need, that patch is trivial. Simply recording the sites and not > > rewriting them should be

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Steven Rostedt
On Thu, 23 Jul 2020 01:56:20 +0200 Peter Zijlstra wrote: > Anyway, what do you prefer, I suppose I can make objtool whatever we > need, that patch is trivial. Simply recording the sites and not > rewriting them should be simple enough. Either way. If objtool turns it into nops, just make it wher

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Peter Zijlstra
On Wed, Jul 22, 2020 at 03:09:43PM -0400, Steven Rostedt wrote: > On Wed, 22 Jul 2020 20:41:37 +0200 > Peter Zijlstra wrote: > > > > That said, Andi Kleen added an option to gcc called -mnop-mcount which > > > will have gcc do both create the mcount section and convert the calls > > > into nops.

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Sami Tolvanen
On Wed, Jul 22, 2020 at 12:09 PM Steven Rostedt wrote: > > On Wed, 22 Jul 2020 20:41:37 +0200 > Peter Zijlstra wrote: > > > > That said, Andi Kleen added an option to gcc called -mnop-mcount which > > > will have gcc do both create the mcount section and convert the calls > > > into nops. When do

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Steven Rostedt
On Wed, 22 Jul 2020 20:41:37 +0200 Peter Zijlstra wrote: > > That said, Andi Kleen added an option to gcc called -mnop-mcount which > > will have gcc do both create the mcount section and convert the calls > > into nops. When doing so, it defines CC_USING_NOP_MCOUNT which will > > tell ftrace to

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Peter Zijlstra
On Wed, Jul 22, 2020 at 01:55:42PM -0400, Steven Rostedt wrote: > > Ha! it is trying to convert the "CALL __fentry__" into a NOP and not > > finding the CALL -- because objtool already made it a NOP... > > > > Weird, I thought recordmcount would also write NOPs, it certainly has > > code for that

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Sami Tolvanen
On Wed, Jul 22, 2020 at 10:58 AM Steven Rostedt wrote: > > On Mon, 20 Jul 2020 09:52:37 -0700 > Sami Tolvanen wrote: > > > > Does x86 have a way to differentiate between the two that record mcount > > > can check? > > > > I'm not sure if looking at the relocation alone is sufficient on x86, > > w

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Steven Rostedt
On Mon, 20 Jul 2020 09:52:37 -0700 Sami Tolvanen wrote: > > Does x86 have a way to differentiate between the two that record mcount > > can check? > > I'm not sure if looking at the relocation alone is sufficient on x86, > we might also have to decode the instruction, which is what objtool > d

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-22 Thread Steven Rostedt
On Fri, 26 Jun 2020 13:29:31 +0200 Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > > > Not boot tested, but it generates the required sections and they look > > > more or less as expected, ymmv. > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfi

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-20 Thread Sami Tolvanen
On Fri, Jul 17, 2020 at 11:05 AM Steven Rostedt wrote: > > On Fri, 17 Jul 2020 10:47:51 -0700 > Sami Tolvanen wrote: > > > > Someone just submitted a patch for arm64 for this: > > > > > > https://lore.kernel.org/r/20200717143338.19302-1-gregory.herr...@oracle.com > > > > > > Is that what you want

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-17 Thread Steven Rostedt
On Fri, 17 Jul 2020 10:47:51 -0700 Sami Tolvanen wrote: > > Someone just submitted a patch for arm64 for this: > > > > https://lore.kernel.org/r/20200717143338.19302-1-gregory.herr...@oracle.com > > > > Is that what you want? > > That looks like the same issue, but we need to fix this on x86 i

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-17 Thread Sami Tolvanen
On Fri, Jul 17, 2020 at 10:36 AM Steven Rostedt wrote: > > On Fri, 17 Jul 2020 10:28:13 -0700 > Sami Tolvanen wrote: > > > On Fri, Jun 26, 2020 at 4:29 AM Peter Zijlstra wrote: > > > > > > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > > > > > > > Not boot tested, but it gene

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-17 Thread Steven Rostedt
On Fri, 17 Jul 2020 10:28:13 -0700 Sami Tolvanen wrote: > On Fri, Jun 26, 2020 at 4:29 AM Peter Zijlstra wrote: > > > > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > > > > > Not boot tested, but it generates the required sections and they look > > > > more or less as expec

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-07-17 Thread Sami Tolvanen
On Fri, Jun 26, 2020 at 4:29 AM Peter Zijlstra wrote: > > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > > > Not boot tested, but it generates the required sections and they look > > > more or less as expected, ymmv. > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > >

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-06-26 Thread Peter Zijlstra
On Fri, Jun 26, 2020 at 01:29:31PM +0200, Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > Anyway, since objtool is run before recordmcount, I just left this unchanged > > for testing and ignored the recordmcount warnings about __mcount_loc already > > exi

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-06-26 Thread Peter Zijlstra
On Thu, Jun 25, 2020 at 03:40:42PM -0700, Sami Tolvanen wrote: > > Not boot tested, but it generates the required sections and they look > > more or less as expected, ymmv. > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index a291823f3f26..189575c12434 100644 > > --- a/arch/x86/Kconfig

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-06-25 Thread Sami Tolvanen
On Thu, Jun 25, 2020 at 10:02:35PM +0200, Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 09:15:03AM -0700, Sami Tolvanen wrote: > > On Thu, Jun 25, 2020 at 09:45:30AM +0200, Peter Zijlstra wrote: > > > > At least for x86_64 I can do a really quick take for a recordmcount pass > > > in objtool, bu

Re: [RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-06-25 Thread Nick Desaulniers
On Thu, Jun 25, 2020 at 1:02 PM Peter Zijlstra wrote: > > On Thu, Jun 25, 2020 at 09:15:03AM -0700, Sami Tolvanen wrote: > > On Thu, Jun 25, 2020 at 09:45:30AM +0200, Peter Zijlstra wrote: > > > > At least for x86_64 I can do a really quick take for a recordmcount pass > > > in objtool, but I supp

[RFC][PATCH] objtool,x86_64: Replace recordmcount with objtool

2020-06-25 Thread Peter Zijlstra
On Thu, Jun 25, 2020 at 09:15:03AM -0700, Sami Tolvanen wrote: > On Thu, Jun 25, 2020 at 09:45:30AM +0200, Peter Zijlstra wrote: > > At least for x86_64 I can do a really quick take for a recordmcount pass > > in objtool, but I suppose you also need this for ARM64 ? > > Sure, sounds good. arm64 u