1. 10 1月, 2013 1 次提交
  2. 10 9月, 2012 2 次提交
  3. 07 9月, 2012 1 次提交
  4. 24 8月, 2012 1 次提交
    • M
      powerpc: Fix null pointer deref in perf hardware breakpoints · 6d9c00c6
      Michael Neuling 提交于
      Currently if you are doing a global perf recording with hardware
      breakpoints (ie perf record -e mem:0xdeadbeef -a), you can oops with:
      
        Faulting instruction address: 0xc000000000738890
        cpu 0xc: Vector: 300 (Data Access) at [c0000003f76af8d0]
            pc: c000000000738890: .hw_breakpoint_handler+0xa0/0x1e0
            lr: c000000000738830: .hw_breakpoint_handler+0x40/0x1e0
            sp: c0000003f76afb50
           msr: 8000000000001032
           dar: 6f0
         dsisr: 42000000
          current = 0xc0000003f765ac00
          paca    = 0xc00000000f262a00   softe: 0        irq_happened: 0x01
          pid   = 6810, comm = loop-read
        enter ? for help
        [c0000003f76afbe0] c00000000073cd04 .notifier_call_chain.isra.0+0x84/0xe0
        [c0000003f76afc80] c00000000073cdbc .notify_die+0x3c/0x60
        [c0000003f76afd20] c0000000000139f0 .do_dabr+0x40/0xf0
        [c0000003f76afe30] c000000000005a9c handle_dabr_fault+0x14/0x48
        --- Exception: 300 (Data Access) at 0000000010000480
        SP (ff8679e0) is in userspace
      
      This is because we don't check to see if the break point is associated
      with task before we deference the task_struct pointer.
      
      This changes the update to use current.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6d9c00c6
  5. 11 7月, 2012 1 次提交
  6. 01 11月, 2011 1 次提交
  7. 30 6月, 2010 1 次提交
    • P
      powerpc, hw_breakpoint: Tell generic code we have no instruction breakpoints · d09ec738
      Paul Mackerras 提交于
      At present, hw_breakpoint_slots() returns 1 regardless of what
      type of breakpoint is specified in the type argument.  Since we
      don't define CONFIG_HAVE_MIXED_BREAKPOINTS_REGS, there are
      separate values for TYPE_INST and TYPE_DATA, and hw_breakpoint_slots()
      returns 1 for both, effectively advertising instruction breakpoint
      support which doesn't exist.
      
      This fixes it by making hw_breakpoint_slots return 1 for TYPE_DATA
      and 0 for TYPE_INST.  This moves hw_breakpoint_slots() from the
      powerpc hw_breakpoint.h to hw_breakpoint.c because the definitions
      of TYPE_INST and TYPE_DATA aren't available in <asm/hw_breakpoint.h>.
      They are defined in <linux/hw_breakpoint.h> but we can't include
      that header in <asm/hw_breakpoint.h>, and nor can we rely on
      <linux/hw_breakpoint.h> being included before <asm/hw_breakpoint.h>.
      Since hw_breakpoint_slots() is only called at boot time, there is
      no performance impact from making it a real function rather than
      a static inline.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      d09ec738
  8. 23 6月, 2010 2 次提交
  9. 22 6月, 2010 3 次提交
    • K
      powerpc, hw_breakpoint: Discard extraneous interrupt due to accesses outside symbol length · e3e94084
      K.Prasad 提交于
      Many a times, the requested breakpoint length can be less than the
      fixed breakpoint length i.e. 8 bytes supported by PowerPC 64-bit
      server (Book III S) processors.  This could lead to extraneous
      interrupts resulting in false breakpoint notifications.  This
      detects and discards such interrupts for non-ptrace requests.
      We don't change ptrace behaviour to avoid breaking compatability.
      
      [Suggestion from Paul Mackerras <paulus@samba.org> to add a new flag in
      'struct arch_hw_breakpoint' to identify extraneous interrupts]
      Signed-off-by: NK.Prasad <prasad@linux.vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e3e94084
    • K
      powerpc, hw_breakpoint: Enable hw-breakpoints while handling intervening signals · 06532a67
      K.Prasad 提交于
      A signal delivered between a hw_breakpoint_handler() and the
      single_step_dabr_instruction() will not have the breakpoint active
      while the signal handler is running -- the signal delivery will
      set up a new MSR value which will not have MSR_SE set, so we
      won't get the signal step interrupt until and unless the signal
      handler returns (which it may never do).
      
      To fix this, we restore the breakpoint when delivering a signal --
      we clear the MSR_SE bit and set the DABR again.  If the signal
      handler returns, the DABR interrupt will occur again when the
      instruction that we were originally trying to single-step gets
      re-executed.
      
      [Paul Mackerras <paulus@samba.org> pointed out the need to do this.]
      Signed-off-by: NK.Prasad <prasad@linux.vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      06532a67
    • K
      powerpc, hw_breakpoints: Implement hw_breakpoints for 64-bit server processors · 5aae8a53
      K.Prasad 提交于
      Implement perf-events based hw-breakpoint interfaces for PowerPC
      64-bit server (Book III S) processors.  This allows access to a
      given location to be used as an event that can be counted or
      profiled by the perf_events subsystem.
      
      This is done using the DABR (data breakpoint register), which can
      also be used for process debugging via ptrace.  When perf_event
      hw_breakpoint support is configured in, the perf_event subsystem
      manages the DABR and arbitrates access to it, and ptrace then
      creates a perf_event when it is requested to set a data breakpoint.
      
      [Adopted suggestions from Paul Mackerras <paulus@samba.org> to
      - emulate_step() all system-wide breakpoints and single-step only the
        per-task breakpoints
      - perform arch-specific cleanup before unregistration through
        arch_unregister_hw_breakpoint()
      ]
      Signed-off-by: NK.Prasad <prasad@linux.vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      5aae8a53