[RFC PATCH tip/master 3/3] kprobes: Limit kretprobe maximum instances

2017-03-28 Thread Masami Hiramatsu
Limit kretprobe maximum instance up to MAXACTIVE_ALLOC. Without this limit, kretprobe user can specify huge number (e.g. forget to zero-fill struct kretprobe) to maxactive and may cause out-of-memory. Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c |3 +++ 1 file

[RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

2017-03-28 Thread Masami Hiramatsu
Try to allocate kretprobe instance by GFP_ATOMIC if kretprobe's free list is empty. This can prevent kretprobe miss-hit on the function which can be heavily invoked and slept inside (like locking syscall entries.) NOTE: This may easily cause nested kprobe call which will be just skipped (but

[RFC PATCH tip/master 1/3] trace: kprobes: Show sum of probe/retprobe nmissed count

2017-03-28 Thread Masami Hiramatsu
Show sum of probe and retprobe nmissed count in kprobe_profile, since retprobe can be missed even if the kprobe itself succeeeded. This explains user why their return probe didn't hit sometimes. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_kprobe.c |2 +- 1

[RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation

2017-03-28 Thread Masami Hiramatsu
Here is a correction of patches to introduce kretprobe_instance dynamic allocation for avoiding kretprobe silently miss-hits. Original issue was reported by Lukasz on linux-trace ml. https://www.spinics.net/lists/linux-trace/msg00448.html Also Alban is working on kprobe-tracer side because of

Re: [PATCH v5 6/9] coresight: add support for CPU debug module

2017-03-28 Thread Leo Yan
Hi Suzuki, On Mon, Mar 27, 2017 at 05:34:57PM +0100, Suzuki K Poulose wrote: > On 25/03/17 18:23, Leo Yan wrote: [...] > Leo, > > Thanks a lot for the quick rework. I don't fully understand (yet!) why we > need the > idle_constraint. I will leave it for Sudeep to comment on it, as he is the

Re: [PATCH v5 6/9] coresight: add support for CPU debug module

2017-03-28 Thread Leo Yan
Hi Mathieu, On Tue, Mar 28, 2017 at 10:50:10AM -0600, Mathieu Poirier wrote: > On Sun, Mar 26, 2017 at 02:23:14AM +0800, Leo Yan wrote: [...] > > +static void debug_force_cpu_powered_up(struct debug_drvdata *drvdata) > > +{ > > + int timeout = DEBUG_WAIT_TIMEOUT; > > + > > + drvdata->edprsr

Re: [PATCH] Add initial SX3000b platform related documentation to document tree

2017-03-28 Thread Rob Herring
On Wed, Mar 22, 2017 at 05:59:49AM +, Amit Kama IL wrote: > Add initial SX3000b platform related documentation to document tree: > - Vendor prefix > - Platform binding documentation > - Interrupt Controller Unit binding documentation. Probably should be 3 patches. Preferred subject prefix

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Masami Hiramatsu
On Tue, 28 Mar 2017 18:08:16 +0200 Alban Crequy wrote: > Thanks for the review, > > On Tue, Mar 28, 2017 at 5:23 PM, Masami Hiramatsu wrote: > > On Tue, 28 Mar 2017 15:52:22 +0200 > > Alban Crequy wrote: > > > >> When a kretprobe

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Masami Hiramatsu
On Tue, 28 Mar 2017 11:34:07 -0400 Steven Rostedt wrote: > On Wed, 29 Mar 2017 00:23:35 +0900 > Masami Hiramatsu wrote: > > > > @@ -598,8 +601,10 @@ static int create_trace_kprobe(int argc, char **argv) > > > { > > > /* > > >* Argument syntax: >

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-28 Thread Jim Mattson
On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: > 2017-03-27 15:34+0200, Alexander Graf: >> On 15/03/2017 22:22, Michael S. Tsirkin wrote: >>> Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: >>> unless explicitly provided with kernel command line

Re: [PATCH v5 6/9] coresight: add support for CPU debug module

2017-03-28 Thread Mathieu Poirier
Hi Leo, On Sun, Mar 26, 2017 at 02:23:14AM +0800, Leo Yan wrote: > Coresight includes debug module and usually the module connects with CPU > debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has > description for related info in "Part H: External Debug". > > Chapter H7 "The

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Alban Crequy
Thanks for the review, On Tue, Mar 28, 2017 at 5:23 PM, Masami Hiramatsu wrote: > On Tue, 28 Mar 2017 15:52:22 +0200 > Alban Crequy wrote: > >> When a kretprobe is installed on a kernel function, there is a maximum >> limit of how many calls in

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Steven Rostedt
On Wed, 29 Mar 2017 00:23:35 +0900 Masami Hiramatsu wrote: > > @@ -598,8 +601,10 @@ static int create_trace_kprobe(int argc, char **argv) > > { > > /* > > * Argument syntax: > > -* - Add kprobe: p[:[GRP/]EVENT] [MOD:]KSYM[+OFFS]|KADDR [FETCHARGS] > > -* -

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Masami Hiramatsu
On Tue, 28 Mar 2017 15:52:22 +0200 Alban Crequy wrote: > When a kretprobe is installed on a kernel function, there is a maximum > limit of how many calls in parallel it can catch (aka "maxactive"). A > kernel module could call register_kretprobe() and initialize maxactive

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Steven Rostedt
"[PATCH v1]" I like your confidence, or lack of, that there isn't going to be a v2 or v3 ;-) Masami, what do you think of this? -- Steve On Tue, 28 Mar 2017 15:52:22 +0200 Alban Crequy wrote: > When a kretprobe is installed on a kernel function, there is a maximum >

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-28 Thread Radim Krčmář
2017-03-27 15:34+0200, Alexander Graf: > On 15/03/2017 22:22, Michael S. Tsirkin wrote: >> Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: >> unless explicitly provided with kernel command line argument >> "idlehalt=0" they'd implicitly assume MONITOR and MWAIT

[PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Alban Crequy
When a kretprobe is installed on a kernel function, there is a maximum limit of how many calls in parallel it can catch (aka "maxactive"). A kernel module could call register_kretprobe() and initialize maxactive (see example in samples/kprobes/kretprobe_example.c). But that is not exposed to