Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Andy Lutomirski
> On Apr 28, 2019, at 2:22 PM, Nicolai Stange wrote: > > Steven Rostedt writes: > >> On Sun, 28 Apr 2019 10:41:10 -0700 >> Andy Lutomirski wrote: >> >> Note that at any given point in time, there can be at most four such call insn emulations pending: namely at most one per "

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Nicolai Stange
Steven Rostedt writes: > On Sun, 28 Apr 2019 10:41:10 -0700 > Andy Lutomirski wrote: > > >> > Note that at any given point >> > in time, there can be at most four such call insn emulations pending: >> > namely at most one per "process", "irq", "softirq" and "nmi" context. >> > >> >> That’s q

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Andy Lutomirski
> On Apr 28, 2019, at 12:43 PM, Steven Rostedt wrote: > > On Sun, 28 Apr 2019 11:08:34 -0700 > Andy Lutomirski wrote: > >>> >>> Perhaps adding another slot into pt_regs that gets used by int3 to >>> store a slot to emulate a call on return? >>> >>> >> >> That’s not totally nuts, although

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Steven Rostedt
On Sun, 28 Apr 2019 11:08:34 -0700 Andy Lutomirski wrote: > > > > Perhaps adding another slot into pt_regs that gets used by int3 to > > store a slot to emulate a call on return? > > > > > > That’s not totally nuts, although finding pt_regs isn’t entirely trivial. I meant on the int3 handl

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Andy Lutomirski
> On Apr 28, 2019, at 10:51 AM, Steven Rostedt wrote: > > On Sun, 28 Apr 2019 10:41:10 -0700 > Andy Lutomirski wrote: > > >>> Note that at any given point >>> in time, there can be at most four such call insn emulations pending: >>> namely at most one per "process", "irq", "softirq" and "nm

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Steven Rostedt
On Sun, 28 Apr 2019 10:41:10 -0700 Andy Lutomirski wrote: > > Note that at any given point > > in time, there can be at most four such call insn emulations pending: > > namely at most one per "process", "irq", "softirq" and "nmi" context. > > > > That’s quite an assumption. I think your list

Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-28 Thread Andy Lutomirski
> On Apr 27, 2019, at 3:06 AM, Nicolai Stange wrote: > > Before actually rewriting an insn, x86' DYNAMIC_FTRACE implementation > places an int3 breakpoint on it. Currently, ftrace_int3_handler() simply > treats the insn in question as nop and advances %rip past it. How does this not crash all

[PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member

2019-04-27 Thread Nicolai Stange
Before actually rewriting an insn, x86' DYNAMIC_FTRACE implementation places an int3 breakpoint on it. Currently, ftrace_int3_handler() simply treats the insn in question as nop and advances %rip past it. An upcoming patch will improve this by making the int3 trap handler emulate the call insn. To