1. 27 2月, 2008 1 次提交
    • H
      avr32: Fix OCD refcounting bug · 325d6f55
      Haavard Skinnemoen 提交于
      Iff the parent has TIF_DEBUG set, _and_ clone_flags includes
      CLONE_PTRACE we should set the TIF_DEBUG flag for the child and
      increment the ocd refcount. Otherwise, the TIF_DEBUG flag must be
      unset.
      
      Currently, the child inherits TIF_DEBUG from the parent before
      copy_thread is called, so TIF_DEBUG may be already be set before we
      determine whether the child is supposed to inherit debugging
      capabilities from the parent or not. This means that ocd_enable()
      won't increment the refcount, because TIF_DEBUG is already set, and
      that TIF_DEBUG will be set for processes that aren't being debugged.
      
      This leads to a refcounting asymmetry, which may show up as
      
      ------------[ cut here ]------------
      Badness at arch/avr32/kernel/ocd.c:73
      PC is at ocd_disable+0x34/0x60
      LR is at put_lock_stats+0xa/0x20
      
      as reported by David Brownell. Happens when strace'ing a process that
      forks a new child process, e.g. "strace mount -tjffs2 mtd1 /mnt", and
      subsequently killing the child process (e.g. "umount /mnt".)
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      325d6f55
  2. 15 2月, 2008 1 次提交
  3. 25 1月, 2008 1 次提交
    • H
      [AVR32] Enable debugging only when needed · 13b54a50
      Haavard Skinnemoen 提交于
      Keep track of processes being debugged (including the kernel itself)
      and turn the OCD system on and off as appropriate. Since enabling
      debugging turns off some optimizations in the CPU core, this fixes the
      issue that enabling KProbes support or simply running a program under
      gdbserver will reduce system performance significantly until the next
      reboot.
      
      The CPU performance will still be reduced for all processes while a
      process is being debugged, but this is a lot better than reducing the
      performance forever.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      13b54a50
  4. 07 12月, 2007 2 次提交
    • H
      [AVR32] Clean up OCD register usage · 8dfe8f29
      Haavard Skinnemoen 提交于
      Generate a new set of OCD register definitions in asm/ocd.h and rename
      __mfdr() and __mtdr() to ocd_read() and ocd_write() respectively.
      
      The bitfield definitions are a lot more complete now, and they are
      entirely based on bit numbers, not masks. This is because OCD
      registers are frequently accessed from assembly code, where bit
      numbers are a lot more useful (can be fed directly to sbr, bfins,
      etc.)
      
      Bitfields that consist of more than one bit have two definitions:
      _START, which indicates the number of the first bit, and _SIZE, which
      indicates the number of bits. These directly correspond to the
      parameters taken by the bfextu, bfexts and bfins instructions.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      8dfe8f29
    • H
      [AVR32] Fix invalid status register bit definitions in asm/ptrace.h · df679771
      Haavard Skinnemoen 提交于
      The 'H' bit is bit 29, while the 'R' bit doesn't exist. Luckily, we
      don't actually use any of the bits in question.
      
      Also update show_regs() to show the Debug Mask and Debug state bits.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      df679771
  5. 10 5月, 2007 1 次提交
  6. 27 4月, 2007 2 次提交
  7. 08 12月, 2006 1 次提交
  8. 26 9月, 2006 1 次提交