Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-17 Thread Torsten Duwe
On Wed, Jan 16, 2019 at 09:57:39AM +, Julien Thierry wrote: > > I wanted to test this patch (and try to benchmark having the "mov x9, > x30" always present in function prelude vs having two nops), but I > cannot get this patch to apply (despite having a version including both > commits below).

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-16 Thread Julien Thierry
On 16/01/2019 15:56, Julien Thierry wrote: > On 14/01/2019 12:26, Mark Rutland wrote: >> On Mon, Jan 14, 2019 at 11:13:59PM +1100, Balbir Singh wrote: >>> On Fri, Jan 04, 2019 at 05:50:18PM +, Mark Rutland wrote: Hi Torsten, On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Du

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-16 Thread Julien Thierry
Hi, On 14/01/2019 12:26, Mark Rutland wrote: > On Mon, Jan 14, 2019 at 11:13:59PM +1100, Balbir Singh wrote: >> On Fri, Jan 04, 2019 at 05:50:18PM +, Mark Rutland wrote: >>> Hi Torsten, >>> >>> On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Duwe wrote: Use -fpatchable-function-entry (g

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-16 Thread Julien Thierry
On 16/01/2019 09:57, Julien Thierry wrote: > Hi Torsten, > > On 04/01/2019 14:10, Torsten Duwe wrote: >> Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning >> of each function. Replace the first NOP thus generated with a quick LR >> saver (move it to scratch reg x9), so the 2n

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-16 Thread Julien Thierry
Hi Torsten, On 04/01/2019 14:10, Torsten Duwe wrote: > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > of each function. Replace the first NOP thus generated with a quick LR > saver (move it to scratch reg x9), so the 2nd replacement insn, the call > to ftrace, does not clob

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-14 Thread Mark Rutland
On Mon, Jan 14, 2019 at 11:13:59PM +1100, Balbir Singh wrote: > On Fri, Jan 04, 2019 at 05:50:18PM +, Mark Rutland wrote: > > Hi Torsten, > > > > On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Duwe wrote: > > > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > > > of ea

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-14 Thread Balbir Singh
On Fri, Jan 04, 2019 at 05:50:18PM +, Mark Rutland wrote: > Hi Torsten, > > On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Duwe wrote: > > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > > of each function. Replace the first NOP thus generated with a quick LR > > save

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-07 Thread Mark Rutland
On Fri, Jan 04, 2019 at 11:41:45PM +0100, Torsten Duwe wrote: > On Fri, Jan 04, 2019 at 01:06:48PM -0500, Steven Rostedt wrote: > > On Fri, 4 Jan 2019 17:50:18 + > > Mark Rutland wrote: > > > > > At Linux Plumbers, I had a conversation with Steve Rostedt, and we came > > > to the conclusion t

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-06 Thread Amit Daniel Kachhap
On Fri, Jan 4, 2019 at 8:05 PM Torsten Duwe wrote: > > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > of each function. Replace the first NOP thus generated with a quick LR > saver (move it to scratch reg x9), so the 2nd replacement insn, the call > to ftrace, does not clob

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-05 Thread Steven Rostedt
On Sat, 5 Jan 2019 12:05:43 +0100 Torsten Duwe wrote: > > My point is: those 2 insn will _never_ be split by any alignment > > boundary > 8; does that mean anything, have you considered this? > > Forget that. Steve mentioned the keyword *interrupt*, which creates a > completely different situa

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-05 Thread Torsten Duwe
On Fri, Jan 04, 2019 at 11:41:45PM +0100, Torsten Duwe wrote: > On Fri, Jan 04, 2019 at 01:06:48PM -0500, Steven Rostedt wrote: > > On Fri, 4 Jan 2019 17:50:18 + > > Mark Rutland wrote: > > > > > At Linux Plumbers, I had a conversation with Steve Rostedt, and we came > > > to the conclusion t

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-04 Thread Torsten Duwe
On Fri, Jan 04, 2019 at 01:06:48PM -0500, Steven Rostedt wrote: > On Fri, 4 Jan 2019 17:50:18 + > Mark Rutland wrote: > > > At Linux Plumbers, I had a conversation with Steve Rostedt, and we came > > to the conclusion that (withut heavyweight synchronization) patching two > > NOPs at runtime

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-04 Thread Steven Rostedt
On Fri, 4 Jan 2019 17:50:18 + Mark Rutland wrote: > At Linux Plumbers, I had a conversation with Steve Rostedt, and we came > to the conclusion that (withut heavyweight synchronization) patching two > NOPs at runtime isn't safe, since a CPU might have executed the first > NOP as a NOP before

Re: [PATCH v6] arm64: implement ftrace with regs

2019-01-04 Thread Mark Rutland
Hi Torsten, On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Duwe wrote: > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > of each function. Replace the first NOP thus generated with a quick LR > saver (move it to scratch reg x9), so the 2nd replacement insn, the call > to

[PATCH v6] arm64: implement ftrace with regs

2019-01-04 Thread Torsten Duwe
Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning of each function. Replace the first NOP thus generated with a quick LR saver (move it to scratch reg x9), so the 2nd replacement insn, the call to ftrace, does not clobber the value. Ftrace will then generate the standard stack fr