1. 28 Feb, 2017 1 commit
    • Luis R. Rodriguez's avatar
      kprobes: move kprobe declarations to asm-generic/kprobes.h · 7d134b2c
      Luis R. Rodriguez authored
      Often all is needed is these small helpers, instead of compiler.h or a
      full kprobes.h.  This is important for asm helpers, in fact even some
      asm/kprobes.h make use of these helpers...  instead just keep a generic
      asm file with helpers useful for asm code with the least amount of
      clutter as possible.
      Likewise we need now to also address what to do about this file for both
      when architectures have CONFIG_HAVE_KPROBES, and when they do not.  Then
      for when architectures have CONFIG_HAVE_KPROBES but have disabled
      Right now most asm/kprobes.h do not have guards against CONFIG_KPROBES,
      this means most architecture code cannot include asm/kprobes.h safely.
      Correct this and add guards for architectures missing them.
      Additionally provide architectures that not have kprobes support with
      the default asm-generic solution.  This lets us force asm/kprobes.h on
      the header include/linux/kprobes.h always, but most importantly we can
      now safely include just asm/kprobes.h on architecture code without
      bringing the full kitchen sink of header files.
      Two architectures already provided a guard against CONFIG_KPROBES on its
      kprobes.h: sh, arch.  The rest of the architectures needed gaurds added.
      We avoid including any not-needed headers on asm/kprobes.h unless
      kprobes have been enabled.
      In a subsequent atomic change we can try now to remove compiler.h from
      During this sweep I've also identified a few architectures defining a
      common macro needed for both kprobes and ftrace, that of the definition
      of the breakput instruction up.  Some refer to this as
      BREAKPOINT_INSTRUCTION.  This must be kept outside of the #ifdef
      CONFIG_KPROBES guard.
      [mcgrof@kernel.org: fix arm64 build]
        Link: http://lkml.kernel.org/r/CAB=NE6X1WMByuARS4mZ1g9+W=LuVBnMDnh_5zyN0CLADaVh=Jw@mail.gmail.com
      [sfr@canb.auug.org.au: fixup for kprobes declarations moving]
        Link: http://lkml.kernel.org/r/20170214165933.13ebd4f4@canb.auug.org.au
      Link: http://lkml.kernel.org/r/20170203233139.32682-1-mcgrof@kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  2. 06 Jan, 2010 1 commit
  3. 01 Aug, 2008 1 commit
    • Tony Luck's avatar
      [IA64] Move include/asm-ia64 to arch/ia64/include/asm · 7f30491c
      Tony Luck authored
      After moving the the include files there were a few clean-ups:
      1) Some files used #include <asm-ia64/xyz.h>, changed to <asm/xyz.h>
      2) Some comments alerted maintainers to look at various header files to
      make matching updates if certain code were to be changed. Updated these
      comments to use the new include paths.
      3) Some header files mentioned their own names in initial comments. Just
      deleted these self references.
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
  4. 09 Apr, 2008 1 commit
    • Masami Hiramatsu's avatar
      [IA64] kprobes: kprobe-booster for ia64 · 34e1ceb1
      Masami Hiramatsu authored
      Add kprobe-booster support on ia64.
      Kprobe-booster improves the performance of kprobes by eliminating single-step,
      where possible.  Currently, kprobe-booster is implemented on x86 and x86-64.
      This is an ia64 port.
      On ia64, kprobe-booster executes a copied bundle directly, instead of single
      stepping.  Bundles which have B or X unit and which may cause an exception
      (including break) are not executed directly.  And also, to prevent hitting
      break exceptions on the copied bundle, only the hindmost kprobe is executed
      directly if several kprobes share a bundle and are placed in different slots.
      Note: set_brl_inst() is used for preparing an instruction buffer(it does not
      modify any active code), so it does not need any atomic operation.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: bibo,mao <bibo.mao@intel.com>
      Cc: Rusty Lynch <rusty.lynch@intel.com>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
  5. 06 Mar, 2008 1 commit
  6. 05 Mar, 2008 1 commit
  7. 04 Mar, 2008 1 commit
  8. 16 Oct, 2007 2 commits
  9. 19 Jul, 2007 1 commit
  10. 16 May, 2007 1 commit
  11. 11 May, 2007 1 commit
    • Anil S Keshavamurthy's avatar
      [IA64] fix Kprobes reentrancy · cdc7dbdf
      Anil S Keshavamurthy authored
      In case of reentrance i.e when a probe handler calls a functions which
      inturn has a probe, we save a previous kprobe information and just single
      step the reentrant probe without calling the actual probe handler.  During
      this reentracy period, if an interrupt occurs and if probe happens to
      trigger in the inturrupt path, then we were corrupting the previous kprobe(
      as we were overriding the previous kprobe info) info their by crashing the
      system.  This patch fixes this issues by having a an array of previous
      kprobe info struct(with the array size of 2).
      This similar technique is not needed on i386 and x86_64 because by default
      interrupts are turn off in the break/int3 exception handler.
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
  12. 12 Dec, 2006 1 commit
    • Tony Luck's avatar
      [IA64] enable trap code on slot 1 · 08ed38b6
      Tony Luck authored
      Because slot 1 of one instr bundle crosses border of two consecutive
      8-bytes, kprobe on slot 1 is disabled. This patch enables kprobe on
      slot1, it only replaces higher 8-bytes of the instruction bundle and
      changes the exception code to ignore the low 12 bits of the break
      number (which is across the border in the lower 8-bytes of the bundle).
      For those instructions which must execute regardless qp bits,
      kprobe on slot 1 is still disabled.
      Signed-off-by: default avatarbibo,mao <bibo.mao@intel.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
  13. 26 Sep, 2006 1 commit
  14. 31 Jul, 2006 1 commit
  15. 26 Jun, 2006 1 commit
  16. 13 Jan, 2006 1 commit
  17. 10 Jan, 2006 4 commits
  18. 07 Nov, 2005 1 commit
  19. 07 Sep, 2005 1 commit
  20. 27 Jun, 2005 2 commits
    • Rusty Lynch's avatar
      [PATCH] Return probe redesign: ia64 specific implementation · 9508dbfe
      Rusty Lynch authored
      The following patch implements function return probes for ia64 using
      the revised design.  With this new design we no longer need to do some
      of the odd hacks previous required on the last ia64 return probe port
      that I sent out for comments.
      Note that this new implementation still does not resolve the problem noted
      by Keith Owens where backtrace data is lost after a return probe is hit.
      Changes include:
       * Addition of kretprobe_trampoline to act as a dummy function for instrumented
         functions to return to, and for the return probe infrastructure to place
         a kprobe on on, gaining control so that the return probe handler
         can be called, and so that the instruction pointer can be moved back
         to the original return address.
       * Addition of arch_init(), allowing a kprobe to be registered on
       * Addition of trampoline_probe_handler() which is used as the pre_handler
         for the kprobe inserted on kretprobe_implementation.  This is the function
         that handles the details for calling the return probe handler function
         and returning control back at the original return address
       * Addition of arch_prepare_kretprobe() which is setup as the pre_handler
         for a kprobe registered at the beginning of the target function by
         kernel/kprobes.c so that a return probe instance can be setup when
         a caller enters the target function.  (A return probe instance contains
         all the needed information for trampoline_probe_handler to do it's job.)
       * Hooks added to the exit path of a task so that we can cleanup any left-over
         return probe instances (i.e. if a task dies while inside a targeted function
         then the return probe instance was reserved at the beginning of the function
         but the function never returns so we need to mark the instance as unused.)
      Signed-off-by: default avatarRusty Lynch <rusty.lynch@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Ananth N Mavinakayanahalli's avatar
      [PATCH] kprobes: fix single-step out of line - take2 · 9ec4b1f3
      Ananth N Mavinakayanahalli authored
      Now that PPC64 has no-execute support, here is a second try to fix the
      single step out of line during kprobe execution.  Kprobes on x86_64 already
      solved this problem by allocating an executable page and using it as the
      scratch area for stepping out of line.  Reuse that.
      Signed-off-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  21. 23 Jun, 2005 6 commits
    • Anil S Keshavamurthy's avatar
      [PATCH] Kprobes IA64: cmp ctype unc support · 1674eafc
      Anil S Keshavamurthy authored
      The current Kprobes when patching the original instruction with the break
      instruction tries to retain the original qualifying predicate(qp), however
      for cmp.crel.ctype where ctype == unc, which is a special instruction
      always needs to be executed irrespective of qp.  Hence, if the instruction
      we are patching is of this type, then we should not copy the original qp to
      the break instruction, this is because we always want the break fault to
      happen so that we can emulate the instruction.
      This patch is based on the feedback given by David Mosberger
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Rusty Lynch's avatar
      [PATCH] Kprobes ia64 cleanup · 8bc76772
      Rusty Lynch authored
      A cleanup of the ia64 kprobes implementation such that all of the bundle
      manipulation logic is concentrated in arch_prepare_kprobe().
      With the current design for kprobes, the arch specific code only has a
      chance to return failure inside the arch_prepare_kprobe() function.
      This patch moves all of the work that was happening in arch_copy_kprobe()
      and most of the work that was happening in arch_arm_kprobe() into
      arch_prepare_kprobe().  By doing this we can add further robustness checks
      in arch_arm_kprobe() and refuse to insert kprobes that will cause problems.
      Signed-off-by: default avatarRusty Lynch <Rusty.lynch@intel.com>
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Anil S Keshavamurthy's avatar
      [PATCH] Kprobes/IA64: support kprobe on branch/call instructions · cd2675bf
      Anil S Keshavamurthy authored
      This patch is required to support kprobe on branch/call instructions.
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Anil S Keshavamurthy's avatar
      [PATCH] Kprobes/IA64: architecture specific JProbes support · b2761dc2
      Anil S Keshavamurthy authored
      This patch adds IA64 architecture specific JProbes support on top of Kprobes
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarRusty Lynch <Rusty.lynch@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Anil S Keshavamurthy's avatar
      [PATCH] Kprobes/IA64: arch specific handling · fd7b231f
      Anil S Keshavamurthy authored
      This is an IA64 arch specific handling of Kprobes
      Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarRusty Lynch <Rusty.lynch@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    • Hien Nguyen's avatar
      [PATCH] kprobes: function-return probes · b94cce92
      Hien Nguyen authored
      This patch adds function-return probes to kprobes for the i386
      architecture.  This enables you to establish a handler to be run when a
      function returns.
      1. API
      Two new functions are added to kprobes:
      	int register_kretprobe(struct kretprobe *rp);
      	void unregister_kretprobe(struct kretprobe *rp);
      2. Registration and unregistration
      2.1 Register
        To register a function-return probe, the user populates the following
        fields in a kretprobe object and calls register_kretprobe() with the
        kretprobe address as an argument:
        kp.addr - the function's address
        handler - this function is run after the ret instruction executes, but
        before control returns to the return address in the caller.
        maxactive - The maximum number of instances of the probed function that
        can be active concurrently.  For example, if the function is non-
        recursive and is called with a spinlock or mutex held, maxactive = 1
        should be enough.  If the function is non-recursive and can never
        relinquish the CPU (e.g., via a semaphore or preemption), NR_CPUS should
        be enough.  maxactive is used to determine how many kretprobe_instance
        objects to allocate for this particular probed function.  If maxactive <=
        0, it is set to a default value (if CONFIG_PREEMPT maxactive=max(10, 2 *
        NR_CPUS) else maxactive=NR_CPUS)
        For example:
          struct kretprobe rp;
          rp.kp.addr = /* entrypoint address */
          rp.handler = /*return probe handler */
          rp.maxactive = /* e.g., 1 or NR_CPUS or 0, see the above explanation */
        The following field may also be of interest:
        nmissed - Initialized to zero when the function-return probe is
        registered, and incremented every time the probed function is entered but
        there is no kretprobe_instance object available for establishing the
        function-return probe (i.e., because maxactive was set too low).
      2.2 Unregister
        To unregiter a function-return probe, the user calls
        unregister_kretprobe() with the same kretprobe object as registered
        previously.  If a probed function is running when the return probe is
        unregistered, the function will return as expected, but the handler won't
        be run.
      3. Limitations
      3.1 This patch supports only the i386 architecture, but patches for
          x86_64 and ppc64 are anticipated soon.
      3.2 Return probes operates by replacing the return address in the stack
          (or in a known register, such as the lr register for ppc).  This may
          cause __builtin_return_address(0), when invoked from the return-probed
          function, to return the address of the return-probes trampoline.
      3.3 This implementation uses the "Multiprobes at an address" feature in
      3.4 Due to a limitation in multi-probes, you cannot currently establish
          a return probe and a jprobe on the same function.  A patch to remove
          this limitation is being tested.
      This feature is required by SystemTap (http://sourceware.org/systemtap
      and reflects ideas contributed by several SystemTap developers, including
      Will Cohen and Ananth Mavinakayanahalli.
      Signed-off-by: default avatarHien Nguyen <hien@us.ibm.com>
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: default avatarFrederik Deweerdt <frederik.deweerdt@laposte.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  22. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      Let it rip!