summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-10-11CrystalForest: Enable PCI extended config space for CrystalForest Machine.yocto-3.6Kishore Bodke
Quick Assist 1.0 version needs to enable the extended Configuration Space for the PCI devices. Signed-off-by: Kishore Bodke <kishore.k.bodke@intel.com>
2012-10-11meta: Add a new feature for PCI devices.Kishore Bodke
Enable PCI device Extended Configuration space Signed-off-by: Kishore Bodke <kishore.k.bodke@intel.com>
2012-10-11meta: fishriver: remove meta-dataNitin A Kamble
The fishriver BSP is getting retired, because it is superseded by Fish-River-Island-2 BSP. The BSP files are getting removed meta-intel layer of Yocto project, so remove it from here too. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2012-10-11meta: Add nfsd kernel featuresYang Shi
Add nfsd kernel config and scc file. Signed-off-by: Yang Shi <yang.shi@windriver.com>
2012-10-08perf tools: Fix parallel buildBruce Ashfield
1/2 [ Author: Eric Sandeen Email: sandeen@redhat.com Subject: perf tools: Fix parallel build Date: Thu, 20 Sep 2012 21:31:44 -0500 Parallel builds of perf were failing for me on a 32p box, with: * new build flags or prefix util/pmu.l:7:23: error: pmu-bison.h: No such file or directory ... make: *** [util/pmu-flex.o] Error 1 make: *** Waiting for unfinished jobs.... This can pretty quickly be seen by adding a sleep in front of the bison calls in tools/perf/Makefile and running make -j4 on a smaller box i.e.: sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c Adding the following dependencies fixes it for me. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/505BD190.40707@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ] 2/2 [ Author: Tom Zanussi Email: tom.zanussi@intel.com Subject: perf annotate: replace 'expand' with equivalent sed expression Date: Fri, 5 Oct 2012 11:35:26 -0500 We don't have 'expand' in our userspace so we need to accomplish the same thing using 'sed', which we do have. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-05tiny: Add qemu KMACHINE to common-pc-tiny.sccBruce Ashfield
Ensure the qemux86 machine is defined in common-pc-tiny as it is for -standard and -rt. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-05uprobes: split into enable and patchesBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01kver: bump to v3.6Bruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01meta: cleanup invalid/obselete 3.4 CONFIG optionsBruce Ashfield
The kernel configuration audit subsystem was previously focussed on BSP/hardware specific options, since that is the part of configuration that the end developer maintains. But not auditing the non-hardware specific options on each run meant that some options that do not exist in the kernel have remained in the configuration fragments. Removing them clarifies the fragments, and updating the audit to report on non-hardware options ensures that they will stay clean. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01meta: disable OCFS2 by defaultBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01meta: drm: tag DRM options as 'hardware'Bruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01meta: emenlow: clean emenlow configuration warningsBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-10-01meta: add CONFIG_SHMEM to standard kernel configBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-24kmeta: bsp cfg: beagleboard: add USB related optionsLiang Li
Signed-off-by: Liang Li <liang.li@windriver.com>
2012-09-24kmeta: bsp cfg: beagleboard: enable DVI display driverLiang Li
Enable kernel option for DVI display. Signed-off-by: Liang Li <liang.li@windriver.com>
2012-09-23sys940x: Update to emgd 1.14Darren Hart
Merge the emgd-1.14 branch in the sys940x-standard.scc. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-09-23fri2: Update to emgd 1.14Darren Hart
Merge the emgd-1.14 branch in the fri2-standard.scc. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-09-17meta: use profiling and latencytop features in yocto bspsTom Zanussi
Where appropriate, add the standard profiling and latencytop features to the meta-yocto-bsp BSPs. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-14meta: add PERF_EVENTS config to uprobes featureTom Zanussi
CONFIG_UPROBES depends on CONFIG_PERF_EVENTS being set, so PERF_EVENTS needs to be added whenever uprobes are enabled. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-13meta: add paravirtualized KVM guest config fragmentCristian Iorga
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
2012-09-13meta: add MMIO support in virtio config fragmentCristian Iorga
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
2012-09-11meta: add x32 configuration fragmentBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-10meta: have systemtap use kprobes and uprobes featureTom Zanussi
The systemtap feature can use the new kprobes and uprobes feature and remove the corresponding open-coded options. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-10meta: add kprobes support to ktypes/standardTom Zanussi
Add kprobes support to ktypes/standard alongside uprobes and other tracing options enabled there. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-10meta: add kprobes featureTom Zanussi
Add config options to turn KPROBES on, along with KPROBE_EVENT which provides an trace events interface that can be used by other tools such as perf. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-10meta: have uprobe feature use uprobe.cfgTom Zanussi
The uprobe feature includes the patches for uprobes but doesn't include config options for it - add them. Also, add description and compatibility strings. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-10meta: add uprobe.cfgTom Zanussi
Add config options to turn UPROBES on, along with UPROBE_EVENT which provides an trace events interface that can be used by other tools such as perf. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2012-09-09perf: temporary gcc 4.7 build fixesBruce Ashfield
1/1 [ Author: Bruce Ashfield Email: bruce.ashfield@windriver.com Subject: perf: temporary gcc 4.7 build fixes Date: Sun, 9 Sep 2012 13:47:36 -0400 Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-073.6: build fixupsBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-07aufs: import aufs 3.xBruce Ashfield
1/1 [ Author: Bruce Ashfield Email: bruce.ashfield@windriver.com Subject: aufs: import aufs 3.x Date: Fri, 7 Sep 2012 15:12:38 -0400 Importing aufs from: git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-07v3.6: remove invalid/removed Kconfig entriesBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-06yocto-3.6: bump to 3.6-rc4Bruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-09-05kver: bump to 3.6-rc4Bruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-2700-README: review comments v3Bruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-27kernel-cache: create 3.6-rc3 baseBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-23perf: add SLANG_INC for slang.hyocto-3.5Bruce Ashfield
1/1 [ Author: Liang Li Email: liang.li@windriver.com Subject: perf: add SLANG_INC for slang.h Date: Wed, 22 Aug 2012 16:04:50 +0800 CFLAGS was previously hard coded to contain "-I/usr/include/slang" to work with hosts that have "/usr/include/slang/slang.h" as well as hosts that have "/usr/include/slang.h". This path can cause compile warnings like: cc1: warning: '/usr/include/slang' doesn't exists. or cc1: warning: include location "/usr/include/slang" is unsafe for cross-compilation [-Wpoison-system-directories] Then in some cases warnings become errors if WERROR is enabled hence build errors. To fix this issue, we can use -idirafter to downgrade the priority of the default hard coded path. We can also make the slang include directory a variable, to allow the user to specify SLANG_INC and set their own include location. And add a '=' prefix to indicate better compatibility with sysroot/cross compile cases. Signed-off-by: Liang Li <liang.li@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-23unionfs: restore FD_* utility definesBruce Ashfield
1/1 [ Author: Bruce Ashfield Email: bruce.ashfield@windriver.com Subject: unionfs: restore FD_* utility defines Date: Tue, 21 Aug 2012 22:14:49 -0400 commit 27cd8f513 [posix_types.h: Cleanup stale __NFDBITS and related definition] removes the defintions for: #define NFDBITS __NFDBITS #define FD_SETSIZE __FD_SETSIZE #define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp) #define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp) #define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO(fdsetp) Which are still used by unionfs. We restore them to union.h for local use by unionfs until full replacements are found. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-2100-README: correct and clarificationsBruce Ashfield
Updating the 00-README with fixes and updates from Darren Hart's review of the initial patch. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-17unionfs: update unionfs fork to align with mainlineBruce Ashfield
1/1 [ Author: Liang Li Email: liang.li@windriver.com Subject: unionfs: update unionfs fork to align with mainline Date: Thu, 16 Aug 2012 21:25:01 +0800 mainline commit 0145acc [vfs: uninline full_name_hash] changes the interface to full_name_hash, so unionfs fork must be updated. Otherwise unionfs might have the odd behavior that newly created directories/files in unionfs won't show up in underlying fs properly. This also implies that 0145acc fixes the corner issue/regression that introduced by mainline commit bfcfaa7 [vfs: use 'unsigned long' accesses for dcache name comparison and hashing] and e419b4c [vfs: make word-at-a-time accesses handle a non-existing page], that newly adopted fast hash function might have hash collision issue on x86. Signed-off-by: Liang Li <liang.li@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-15CrystalForest: Enable PCI IOV featureKishore Bodke
Enable Single Root PCI I/O Virtualization feature. Signed-off-by: Kishore Bodke <kishore.k.bodke@intel.com>
2012-08-15meta: Add new pci iov featureKishore Bodke
Add Single Root PCI I/O Virtualization feature to meta. Signed-off-by: Kishore Bodke <kishore.k.bodke@intel.com>
2012-08-15mpc8315: remove now obsolete CONFIG_MISC_DEVICESPaul Gortmaker
Since this BSP now uses 3.4.x kernel, this option is obsolete and generates a warning. The option was removed in mainline: commit 7c5763b8453a94871d356f20df30f350f8631e8b Author: Fabio Estevam <festevam@gmail.com> Date: Tue Jan 24 02:11:25 2012 -0200 drivers: misc: Remove MISC_DEVICES config option as of v3.3-rc4 and so is gone in v3.4.x codebase. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-08-09meta: move emgd features to stagingBruce Ashfield
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-09meta: Crystal Forest Machine Created.Kishore Bodke
Initial checkin for the new Crystal Forest Machine Branch. This Machine is based on Sandybridge CPU and Cave Creek Chipset. Signed-off-by: Kishore Bodke <kishore.k.bodke@intel.com>
2012-08-09meta/qemuppc: remove redundant profiling optionsBruce Ashfield
qemuppc had some old profiling options in its BSP configuration fragments. These are better pulled from the profiling feature. This also removes a warning when options like CONFIG_FRAME_POINTER are dropped from the final .config (since they are not available on the arch). Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-09powerpc: Add trap_nr to thread_structBruce Ashfield
1/2 [ Author: Ananth N Mavinakayanahalli Email: ananth@in.ibm.com Subject: powerpc: Add trap_nr to thread_struct Date: Wed, 25 Jul 2012 19:19:02 +0000 http://patchwork.ozlabs.org/patch/173338/ Add thread_struct.trap_nr and use it to store the last exception the thread experienced. In this patch, we populate the field at various places where we force_sig_info() to the process. This is also used in uprobes to determine if the probed instruction caused an exception. Patch applies on the current master branch of Linus' tree (bdc0077af) Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 2/2 [ Author: Ananth N Mavinakayanahalli Email: ananth@in.ibm.com Subject: powerpc: Uprobes port to powerpc Date: Wed, 25 Jul 2012 19:20:29 +0000 http://patchwork.ozlabs.org/patch/173343/ This is the port of uprobes to powerpc. Usage is similar to x86. [root@xxxx ~]# ./bin/perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc (on 0xb4860) You can now use it in all perf tools, such as: perf record -e probe_libc:malloc -aR sleep 1 [root@xxxx ~]# ./bin/perf record -e probe_libc:malloc -aR sleep 20 [ perf record: Woken up 22 times to write data ] [ perf record: Captured and wrote 5.843 MB perf.data (~255302 samples) ] [root@xxxx ~]# ./bin/perf report --stdio ... 69.05% tar libc-2.12.so [.] malloc 28.57% rm libc-2.12.so [.] malloc 1.32% avahi-daemon libc-2.12.so [.] malloc 0.58% bash libc-2.12.so [.] malloc 0.28% sshd libc-2.12.so [.] malloc 0.08% irqbalance libc-2.12.so [.] malloc 0.05% bzip2 libc-2.12.so [.] malloc 0.04% sleep libc-2.12.so [.] malloc 0.03% multipathd libc-2.12.so [.] malloc 0.01% sendmail libc-2.12.so [.] malloc 0.01% automount libc-2.12.so [.] malloc Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-09meta: kgdb: update configuration for out of box functionalityBruce Ashfield
To ensure that the kernel is debugable by default, and that self tests pass, we should enable KDB, and KDB_KEYBOARD and KGDB_LOW_LEVEL_TRAP for x86 boards. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-08move key_repace_session_keyring() into tracehook_notify_resume()Bruce Ashfield
1/6 [ Author: Al Viro Email: viro@zeniv.linux.org.uk Subject: move key_repace_session_keyring() into tracehook_notify_resume() Date: Wed, 23 May 2012 14:44:37 -0400 commit a42c6ded827dbd396d2efde7530620be029a72d1 upstream. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> [Pb: dropped changes to archs lacking TIF_NOTIFY_RESUME: microblaze, m68k, um, xtensa, score] Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 2/6 [ Author: Oleg Nesterov Email: oleg@redhat.com Subject: task_work_add: generic process-context callbacks Date: Fri, 11 May 2012 10:59:07 +1000 commit e73f8959af0439d114847eab5a8a5ce48f1217c4 upstream. Provide a simple mechanism that allows running code in the (nonatomic) context of the arbitrary task. The caller does task_work_add(task, task_work) and this task executes task_work->func() either from do_notify_resume() or from do_exit(). The callback can rely on PF_EXITING to detect the latter case. "struct task_work" can be embedded in another struct, still it has "void *data" to handle the most common/simple case. This allows us to kill the ->replacement_session_keyring hack, and potentially this can have more users. Performance-wise, this adds 2 "unlikely(!hlist_empty())" checks into tracehook_notify_resume() and do_exit(). But at the same time we can remove the "replacement_session_keyring != NULL" checks from arch/*/signal.c and exit_creds(). Note: task_work_add/task_work_run abuses ->pi_lock. This is only because this lock is already used by lookup_pi_state() to synchronize with do_exit() setting PF_EXITING. Fortunately the scope of this lock in task_work.c is really tiny, and the code is unlikely anyway. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 3/6 [ Author: Oleg Nesterov Email: oleg@redhat.com Subject: genirq: reimplement exit_irq_thread() hook via task_work_add() Date: Fri, 11 May 2012 10:59:08 +1000 commit 4d1d61a6b203d957777d73fcebf19d90b038b5b2 upstream. exit_irq_thread() and task->irq_thread are needed to handle the unexpected (and unlikely) exit of irq-thread. We can use task_work instead and make this all private to kernel/irq/manage.c, cleanup plus micro-optimization. 1. rename exit_irq_thread() to irq_thread_dtor(), make it static, and move it up before irq_thread(). 2. change irq_thread() to do task_work_add(irq_thread_dtor) at the start and task_work_cancel() before return. tracehook_notify_resume() can never play with kthreads, only do_exit()->exit_task_work() can call the callback and this is what we want. 3. remove task_struct->irq_thread and the special hook in do_exit(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Howells <dhowells@redhat.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 4/6 [ Author: Oleg Nesterov Email: oleg@redhat.com Subject: keys: change keyctl_session_to_parent() to use task_work_add() Date: Fri, 11 May 2012 10:59:08 +1000 commit 413cd3d9abeaef590e5ce00564f7a443165db238 upstream. Change keyctl_session_to_parent() to use task_work_add() and move key_replace_session_keyring() logic into task_work->func(). Note that we do task_work_cancel() before task_work_add() to ensure that only one work can be pending at any time. This is important, we must not allow user-space to abuse the parent's ->task_works list. The callback, replace_session_keyring(), checks PF_EXITING. I guess this is not really needed but looks better. As a side effect, this fixes the (unlikely) race. The callers of key_replace_session_keyring() and keyctl_session_to_parent() lack the necessary barriers, the parent can miss the request. Now we can remove task_struct->replacement_session_keyring and related code. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 5/6 [ Author: Oleg Nesterov Email: oleg@redhat.com Subject: keys: kill the dummy key_replace_session_keyring() Date: Fri, 11 May 2012 10:59:09 +1000 commit dea649b8ac1861107c5d91e1a71121434fc64193 upstream. After the previouse change key_replace_session_keyring() becomes a nop. Remove the dummy definition in key.h and update the callers in arch/*/kernel/signal.c. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 6/6 [ Author: Oleg Nesterov Email: oleg@redhat.com Subject: keys: kill task_struct->replacement_session_keyring Date: Fri, 11 May 2012 10:59:09 +1000 commit f23ca335462e3c84f13270b9e65f83936068ec2c upstream. Kill the no longer used task_struct->replacement_session_keyring, update copy_creds() and exit_creds(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-08uprobes, mm, x86: Add the ability to install and remove uprobes breakpointsBruce Ashfield
1/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes, mm, x86: Add the ability to install and remove uprobes breakpoints Date: Thu, 9 Feb 2012 14:56:42 +0530 Add uprobes support to the core kernel, with x86 support. This commit adds the kernel facilities, the actual uprobes user-space ABI and perf probe support comes in later commits. General design: Uprobes are maintained in an rb-tree indexed by inode and offset (the offset here is from the start of the mapping). For a unique (inode, offset) tuple, there can be at most one uprobe in the rb-tree. Since the (inode, offset) tuple identifies a unique uprobe, more than one user may be interested in the same uprobe. This provides the ability to connect multiple 'consumers' to the same uprobe. Each consumer defines a handler and a filter (optional). The 'handler' is run every time the uprobe is hit, if it matches the 'filter' criteria. The first consumer of a uprobe causes the breakpoint to be inserted at the specified address and subsequent consumers are appended to this list. On subsequent probes, the consumer gets appended to the existing list of consumers. The breakpoint is removed when the last consumer unregisters. For all other unregisterations, the consumer is removed from the list of consumers. Given a inode, we get a list of the mms that have mapped the inode. Do the actual registration if mm maps the page where a probe needs to be inserted/removed. We use a temporary list to walk through the vmas that map the inode. - The number of maps that map the inode, is not known before we walk the rmap and keeps changing. - extending vm_area_struct wasn't recommended, it's a size-critical data structure. - There can be more than one maps of the inode in the same mm. We add callbacks to the mmap methods to keep an eye on text vmas that are of interest to uprobes. When a vma of interest is mapped, we insert the breakpoint at the right address. Uprobe works by replacing the instruction at the address defined by (inode, offset) with the arch specific breakpoint instruction. We save a copy of the original instruction at the uprobed address. This is needed for: a. executing the instruction out-of-line (xol). b. instruction analysis for any subsequent fixups. c. restoring the instruction back when the uprobe is unregistered. We insert or delete a breakpoint instruction, and this breakpoint instruction is assumed to be the smallest instruction available on the platform. For fixed size instruction platforms this is trivially true, for variable size instruction platforms the breakpoint instruction is typically the smallest (often a single byte). Writing the instruction is done by COWing the page and changing the instruction during the copy, this even though most platforms allow atomic writes of the breakpoint instruction. This also mirrors the behaviour of a ptrace() memory write to a PRIVATE file map. The core worker is derived from KSM's replace_page() logic. In essence, similar to KSM: a. allocate a new page and copy over contents of the page that has the uprobed vaddr b. modify the copy and insert the breakpoint at the required address c. switch the original page with the copy containing the breakpoint d. flush page tables. replace_page() is being replicated here because of some minor changes in the type of pages and also because Hugh Dickins had plans to improve replace_page() for KSM specific work. Instruction analysis on x86 is based on instruction decoder and determines if an instruction can be probed and determines the necessary fixups after singlestep. Instruction analysis is done at probe insertion time so that we avoid having to repeat the same analysis every time a probe is hit. A lot of code here is due to the improvement/suggestions/inputs from Peter Zijlstra. Changelog: (v10): - Add code to clear REX.B prefix as suggested by Denys Vlasenko and Masami Hiramatsu. (v9): - Use insn_offset_modrm as suggested by Masami Hiramatsu. (v7): Handle comments from Peter Zijlstra: - Dont take reference to inode. (expect inode to uprobe_register to be sane). - Use PTR_ERR to set the return value. - No need to take reference to inode. - use PTR_ERR to return error value. - register and uprobe_unregister share code. (v5): - Modified del_consumer as per comments from Peter. - Drop reference to inode before dropping reference to uprobe. - Use i_size_read(inode) instead of inode->i_size. - Ensure uprobe->consumers is NULL, before __uprobe_unregister() is called. - Includes errno.h as recommended by Stephen Rothwell to fix a build issue on sparc defconfig - Remove restrictions while unregistering. - Earlier code leaked inode references under some conditions while registering/unregistering. - Continue the vma-rmap walk even if the intermediate vma doesnt meet the requirements. - Validate the vma found by find_vma before inserting/removing the breakpoint - Call del_consumer under mutex_lock. - Use hash locks. - Handle mremap. - Introduce find_least_offset_node() instead of close match logic in find_uprobe - Uprobes no more depends on MM_OWNER; No reference to task_structs while inserting/removing a probe. - Uses read_mapping_page instead of grab_cache_page so that the pages have valid content. - pass NULL to get_user_pages for the task parameter. - call SetPageUptodate on the new page allocated in write_opcode. - fix leaking a reference to the new page under certain conditions. - Include Instruction Decoder if Uprobes gets defined. - Remove const attributes for instruction prefix arrays. - Uses mm_context to know if the application is 32 bit. commit 2b144498350860b6ee9dc57ff27a93ad488de5dc upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Also-written-by: Jim Keniston <jkenisto@us.ibm.com> Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Roland McGrath <roland@hack.frob.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Denys Vlasenko <vda.linux@googlemail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linux-mm <linux-mm@kvack.org> Link: http://lkml.kernel.org/r/20120209092642.GE16600@linux.vnet.ibm.com [ Made various small edits to the commit log ] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 2/24 [ Author: Ingo Molnar Email: mingo@elte.hu Subject: uprobes/core: Clean up, refactor and improve the code Date: Fri, 17 Feb 2012 09:27:41 +0100 Make the uprobes code readable to me: - improve the Kconfig text so that a mere mortal gets some idea what CONFIG_UPROBES=y is really about - do trivial renames to standardize around the uprobes_*() namespace - clean up and simplify various code flow details - separate basic blocks of functionality - line break artifact and white space related removal - use standard local varible definition blocks - use vertical spacing to make things more readable - remove unnecessary volatile - restructure comment blocks to make them more uniform and more readable in general commit 7b2d81d48a2d8e37efb6ce7b4d5ef58822b30d89 upstream Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Link: http://lkml.kernel.org/n/tip-ewbwhb8o6navvllsauu7k07p@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 3/24 [ Author: Ingo Molnar Email: mingo@elte.hu Subject: uprobes: Move to kernel/events/ Date: Wed, 22 Feb 2012 11:01:49 +0100 Consolidate the uprobes code under kernel/events/, where the various core kernel event handling routines live. commit a5f4374a9610fd7286c2164d4e680436727eff71 upstream Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Link: http://lkml.kernel.org/n/tip-biuyhhwohxgbp2vzbap5yr8o@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 4/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Make instruction tables volatile Date: Wed, 22 Feb 2012 14:45:35 +0530 Some versions of gcc spits a warning about the asm operand for test_bit and also causes the first long of the instruction table to be output. Fix is similar to 7115e3fc on arch/x86/kernel/kprobes.c commit 04a3d984d32e47983770d314cdb4e4d8f38fccb7 upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Josh Stone <jistone@redhat.com> Link: http://lkml.kernel.org/r/20120222091535.15880.12502.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 5/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Remove uprobe_opcode_sz Date: Wed, 22 Feb 2012 14:45:49 +0530 uprobe_opcode_sz refers to the smallest instruction size for that architecture. UPROBES_BKPT_INSN_SIZE refers to the size of the breakpoint instruction for that architecture. For now we are assuming that both uprobe_opcode_sz and UPROBES_BKPT_INSN_SIZE are the same for all archs and hence removing uprobe_opcode_sz in favour of UPROBES_BKPT_INSN_SIZE. However if we have to support architectures where the smallest instruction size is different from the size of breakpoint instruction, we may have to re-introduce uprobe_opcode_sz. commit 96379f60075c75b261328aa7830ef8aa158247ac upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Josh Stone <jistone@redhat.com> Link: http://lkml.kernel.org/r/20120222091549.15880.67020.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 6/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Move insn to arch specific structure Date: Wed, 22 Feb 2012 14:46:02 +0530 Few cleanups suggested by Ingo Molnar. - Rename struct uprobe_arch_info to struct arch_uprobe. - Move insn from struct uprobe to struct arch_uprobe. - Make arch specific uprobe functions to accept struct arch_uprobe instead of struct uprobe. - Move struct uprobe to kernel/uprobes.c from include/linux/uprobes.h commit 3ff54efdfaace9e9b2b7c1959a865be6b91de96c upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Josh Stone <jistone@redhat.com> Link: http://lkml.kernel.org/r/20120222091602.15880.40249.sendpatchset@srdronam.in.ibm.com [ Made various small improvements ] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 7/24 [ Author: Ingo Molnar Email: mingo@elte.hu Subject: uprobes: Update copyright notices Date: Wed, 22 Feb 2012 11:37:29 +0100 Add Peter Zijlstra's copyright to the uprobes code, whose contributions to the uprobes code are not visible in the Git history, because they were backmerged. Also update existing copyright notices to the year 2012. commit 35aa621b5ab9d08767f7bc8d209b696df281d715 upstream Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Link: http://lkml.kernel.org/n/tip-vjqxst502pc1efz7ah8cyht4@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 8/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Make macro names consistent Date: Mon, 12 Mar 2012 14:55:14 +0530 Rename macros that refer to individual uprobe to start with UPROBE_ instead of UPROBES_. This is pure cleanup, no functional change intended. commit 900771a483ef28915a48066d7895d8252315607a upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120312092514.5379.36595.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 9/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Make order of function parameters consistent across functions Date: Mon, 12 Mar 2012 14:55:30 +0530 If a function takes struct uprobe or struct arch_uprobe, then it is passed as the first parameter. This is pure cleanup, no functional change intended. commit e3343e6a2819ff5d0dfc4bb5c9fb7f9a4d04da73 upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120312092530.5379.18394.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 10/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Rename bkpt to swbp Date: Mon, 12 Mar 2012 14:55:45 +0530 bkpt doesnt seem to be a correct abbrevation for breakpoint. Choice was between bp and breakpoint. Since bp can refer to things other than breakpoint, use swbp to refer to breakpoints. This is pure cleanup, no functional change intended. commit 5cb4ac3a583d4ee18c8682ab857e093c4a0d0895 upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120312092545.5379.91251.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 11/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Handle breakpoint and singlestep exceptions Date: Tue, 13 Mar 2012 23:30:11 +0530 Uprobes uses exception notifiers to get to know if a thread hit a breakpoint or a singlestep exception. When a thread hits a uprobe or is singlestepping post a uprobe hit, the uprobe exception notifier sets its TIF_UPROBE bit, which will then be checked on its return to userspace path (do_notify_resume() ->uprobe_notify_resume()), where the consumers handlers are run (in task context) based on the defined filters. Uprobe hits are thread specific and hence we need to maintain information about if a task hit a uprobe, what uprobe was hit, the slot where the original instruction was copied for xol so that it can be singlestepped with appropriate fixups. In some cases, special care is needed for instructions that are executed out of line (xol). These are architecture specific artefacts, such as handling RIP relative instructions on x86_64. Since the instruction at which the uprobe was inserted is executed out of line, architecture specific fixups are added so that the thread continues normal execution in the presence of a uprobe. Postpone the signals until we execute the probed insn. post_xol() path does a recalc_sigpending() before return to user-mode, this ensures the signal can't be lost. Uprobes relies on DIE_DEBUG notification to notify if a singlestep is complete. Adds x86 specific uprobe exception notifiers and appropriate hooks needed to determine a uprobe hit and subsequent post processing. Add requisite x86 fixups for xol for uprobes. Specific cases needing fixups include relative jumps (x86_64), calls, etc. Where possible, we check and skip singlestepping the breakpointed instructions. For now we skip single byte as well as few multibyte nop instructions. However this can be extended to other instructions too. Credits to Oleg Nesterov for suggestions/patches related to signal, breakpoint, singlestep handling code. commit 0326f5a94ddea33fa331b2519f4172f4fb387baa upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120313180011.29771.89027.sendpatchset@srdronam.in.ibm.com [ Performed various cleanliness edits ] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 12/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Allocate XOL slots for uprobes use Date: Fri, 30 Mar 2012 23:56:31 +0530 Uprobes executes the original instruction at a probed location out of line. For this, we allocate a page (per mm) upon the first uprobe hit, in the process user address space, divide it into slots that are used to store the actual instructions to be singlestepped. These slots are known as xol (execution out of line) slots. Care is taken to ensure that the allocation is in an unmapped area as close to the top of the user address space as possible, with appropriate permission settings to keep selinux like frameworks happy. Upon a uprobe hit, a free slot is acquired, and is released after the singlestep completes. Lots of improvements courtesy suggestions/inputs from Peter and Oleg. [ Folded a fix for build issue on powerpc fixed and reported by Stephen Rothwell. ] commit d4b3b6384f98f8692ad0209891ccdbc7e78bbefe upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120330182631.10018.48175.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 13/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Optimize probe hits with the help of a counter Date: Fri, 30 Mar 2012 23:56:46 +0530 Maintain a per-mm counter: number of uprobes that are inserted on this process address space. This counter can be used at probe hit time to determine if we need a lookup in the uprobes rbtree. Everytime a probe gets inserted successfully, the probe count is incremented and everytime a probe gets removed, the probe count is decremented. The new uprobe_munmap hook ensures the count is correct on a unmap or remap of a region. We expect that once a uprobe_munmap() is called, the vma goes away. So uprobe_unregister() finding a probe to unregister would either mean unmap event hasnt occurred yet or a mmap event on the same executable file occured after a unmap event. Additionally, uprobe_mmap hook now also gets called: a. on every executable vma that is COWed at fork. b. a vma of interest is newly mapped; breakpoint insertion also happens at the required address. On process creation, make sure the probes count in the child is set correctly. Special cases that are taken care include: a. mremap b. VM_DONTCOPY vmas on fork() c. insertion/removal races in the parent during fork(). commit 682968e0c425c60f0dde37977e5beb2b12ddc4cc upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120330182646.10018.85805.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 14/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Make background page replacement logic account for rss_stat counters Date: Wed, 11 Apr 2012 16:05:16 +0530 Background page replacement logic adds a new anonymous page instead of a file backed (while inserting a breakpoint) / anonymous page (while removing a breakpoint). Hence the uprobes logic should take care to update the task->ss_stat counters accordingly. This bug became apparent courtesy of commit c3f0327f8e9d ("mm: add rss counters consistency check"). commit 7396fa818d6278694a44840f389ddc40a3269a9a upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120411103516.23245.2700.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 15/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: uprobes/core: Decrement uprobe count before the pages are unmapped Date: Wed, 11 Apr 2012 16:05:27 +0530 Uprobes has a callback (uprobe_munmap()) in the unmap path to maintain the uprobes count. In the exit path this callback gets called in unlink_file_vma(). However by the time unlink_file_vma() is called, the pages would have been unmapped (in unmap_vmas()) and the task->rss_stat counts accounted (in zap_pte_range()). If the exiting process has probepoints, uprobe_munmap() checks if the breakpoint instruction was around before decrementing the probe count. This results in a file backed page being reread by uprobe_munmap() and hence it does not find the breakpoint. This patch fixes this problem by moving the callback to unmap_single_vma(). Since unmap_single_vma() may not unmap the complete vma, add start and end parameters to uprobe_munmap(). This bug became apparent courtesy of commit c3f0327f8e9d ("mm: add rss counters consistency check"). commit cbc91f71b51b8335f1fc7ccfca8011f31a717367 upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120411103527.23245.9835.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 16/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: tracing: Modify is_delete, is_return from int to bool Date: Mon, 9 Apr 2012 14:41:33 +0530 is_delete and is_return can take utmost 2 values and are better of being a boolean than a int. There are no functional changes. commit 3a6b76661da8e92124a813b43607f5bec1a618de upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120409091133.8343.65289.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 17/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: tracing: Extract out common code for kprobes/uprobes trace events Date: Mon, 9 Apr 2012 14:41:44 +0530 Move parts of trace_kprobe.c that can be shared with upcoming trace_uprobe.c. Common code to kernel/trace/trace_probe.h and kernel/trace/trace_probe.c. There are no functional changes. commit 8ab83f56475ec9151645a888dfe1941f4a92091d upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120409091144.8343.76218.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 18/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: tracing: Provide trace events interface for uprobes Date: Wed, 11 Apr 2012 16:00:43 +0530 Implements trace_event support for uprobes. In its current form it can be used to put probes at a specified offset in a file and dump the required registers when the code flow reaches the probed address. The following example shows how to dump the instruction pointer and %ax a register at the probed text address. Here we are trying to probe zfree in /bin/zsh: # cd /sys/kernel/debug/tracing/ # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp 00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh # objdump -T /bin/zsh | grep -w zfree 0000000000446420 g DF .text 0000000000000012 Base zfree # echo 'p /bin/zsh:0x46420 %ip %ax' > uprobe_events # cat uprobe_events p:uprobes/p_zsh_0x46420 /bin/zsh:0x0000000000046420 # echo 1 > events/uprobes/enable # sleep 20 # echo 0 > events/uprobes/enable # cat trace # tracer: nop # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | zsh-24842 [006] 258544.995456: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 zsh-24842 [007] 258545.000270: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 zsh-24842 [002] 258545.043929: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 zsh-24842 [004] 258547.046129: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 commit f3f096cfedf8113380c56fc855275cc75cd8cf55 upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120411103043.GB29437@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 19/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: tracing: Fix kconfig warning due to a typo Date: Tue, 8 May 2012 16:41:26 +0530 Commit f3f096cfe ("tracing: Provide trace events interface for uprobes") throws a warning about unmet dependencies. The exact warning message is: warning: (UPROBE_EVENT) selects UPROBES which has unmet direct dependencies (UPROBE_EVENTS && PERF_EVENTS) This is due to a typo in arch/Kconfig file. Fix similar typos in the uprobetracer documentation. Also add sample format of a uprobe event in the uprobetracer documentation as suggested by Masami Hiramatsu. commit ec83db0f78cd44c3b586ec1c3a348d1a8a389797 upstream Reported-by: Stephen Boyd <sboyd@codeaurora.org> Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Anton Arapov <anton@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120508111126.21004.38285.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 20/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: perf probe: Provide perf interface for uprobes Date: Mon, 16 Apr 2012 17:39:09 +0530 - Enhances perf to probe user space executables and libraries. - Enhances -F/--funcs option of "perf probe" to list possible probe points in an executable file or library. - Documents userspace probing support in perf. [ Probing a function in the executable using function name ] perf probe -x /bin/zsh zfree [ Probing a library function using function name ] perf probe -x /lib64/libc.so.6 malloc [ list probe-able functions in an executable ] perf probe -F -x /bin/zsh [ list probe-able functions in an library] perf probe -F -x /lib/libc.so.6 commit 225466f1c2d816c33b4341008f45dfdc83a9f0cb upstream Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Anton Arapov <anton@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Linux-mm <linux-mm@kvack.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20120416120909.30661.99781.sendpatchset@srdronam.in.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 21/24 [ Author: Srikar Dronamraju Email: srikar@linux.vnet.ibm.com Subject: perf probe: Detect probe target when m/x options are absent Date: Mon, 16 Apr 2012 17:39:25 +0530 Options -m and -x explicitly allow tracing of modules / user space binaries. In absense of these options, check if the first argument can be used as a target. perf probe /bin/zsh zfree is equivalent to perf probe -x /bin/zsh zfree. commit 73eff9f56e15598c8399c0b86899fd889b97f085 upstream Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Anton Arapov <anton@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Linux-mm <linux-mm@kvack.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20120416120925.30661.40409.sendpatchset@srdronam.in.ibm.com Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 22/24 [ Author: Ananth N Mavinakayanahalli Email: ananth@in.ibm.com Subject: On RISC architectures like powerpc, instructions are fixed size. Instruction analysis on such platforms is just a matter of (insn % 4). Pass the vaddr at which the uprobe is to be inserted so that arch_uprobe_analyze_insn() can flag misaligned registration requests. Date: Wed, 13 Jun 2012 10:43:40 -0400 Changes in V2: Pass (unsigned long)addr instead of (loff_t)vaddr to arch_uprobe_analyze_insn(). We need the loff_t vaddr to take care of the offset of inode:offset pair for large file sizes on 32bit. Link: https://lkml.org/lkml/2012/6/6/139 Signed-off-by: Ananth N Mavinakaynahalli <ananth@in.ibm.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 23/24 [ Author: Ananth N Mavinakayanahalli Email: ananth@in.ibm.com Subject: This is the port of uprobes to powerpc. Usage is similar to x86. Date: Wed, 13 Jun 2012 11:32:33 -0400 One TODO in this port compared to x86 is the uprobe abort_xol() logic. x86 depends on the thread_struct.trap_nr (absent in powerpc) to determine if a signal was caused when the uprobed instruction was single-stepped/ emulated, in which case, we reset the instruction pointer to the probed address and retry the probe again. Tested on POWER6; I don't see anything here that should stop it from working on a ppc32; since I don't have access to a ppc32 machine, it would be good if somoene could verify that part. [root@xxxx ~]# ./bin/perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc (on 0xb4860) You can now use it in all perf tools, such as: perf record -e probe_libc:malloc -aR sleep 1 [root@xxxx ~]# ./bin/perf record -e probe_libc:malloc -aR sleep 20 [ perf record: Woken up 22 times to write data ] [ perf record: Captured and wrote 5.843 MB perf.data (~255302 samples) ] [root@xxxx ~]# ./bin/perf report --stdio # ======== # captured on: Mon Jun 4 05:26:31 2012 # hostname : xxxx.ibm.com # os release : 3.4.0-uprobe # perf version : 3.4.0 # arch : ppc64 # nrcpus online : 4 # nrcpus avail : 4 # cpudesc : POWER6 (raw), altivec supported # cpuid : 62,769 # total memory : 7310528 kB # cmdline : /root/bin/perf record -e probe_libc:malloc -aR sleep 20 # event : name = probe_libc:malloc, type = 2, config = 0x124, config1 = 0x0, con # HEADER_CPU_TOPOLOGY info available, use -I to display # HEADER_NUMA_TOPOLOGY info available, use -I to display # ======== # # Samples: 83K of event 'probe_libc:malloc' # Event count (approx.): 83484 # # Overhead Command Shared Object Symbol # ........ ............ ............. .......... # 69.05% tar libc-2.12.so [.] malloc 28.57% rm libc-2.12.so [.] malloc 1.32% avahi-daemon libc-2.12.so [.] malloc 0.58% bash libc-2.12.so [.] malloc 0.28% sshd libc-2.12.so [.] malloc 0.08% irqbalance libc-2.12.so [.] malloc 0.05% bzip2 libc-2.12.so [.] malloc 0.04% sleep libc-2.12.so [.] malloc 0.03% multipathd libc-2.12.so [.] malloc 0.01% sendmail libc-2.12.so [.] malloc 0.01% automount libc-2.12.so [.] malloc V2: a. arch_uprobe_analyze_insn() now gets unsigned long addr. b. Verified that mtmsr[d] and rfi[d] are handled correctly by emulate_step() (no changes to this patch). Link: https://lkml.org/lkml/2012/6/6/181 Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] 24/24 [ Author: Paul Barrette Email: paul.barrette@windriver.com Subject: powerpc: uprobes: removed external declaration of uprobe_get_swbp_addr. Date: Tue, 12 Jun 2012 14:24:12 -0400 uprobe_get_swbp_addr is declared as static inline in linux/uprobes.h. Redeclaring it differently breaks compilation. Signed-off-by: Paul Barrette <paul.barrette@windriver.com> ] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2012-08-08uprobe: tie in for uprobe featureMichel Thebeau
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>