1. 12 12月, 2011 1 次提交
  2. 01 11月, 2011 2 次提交
  3. 02 8月, 2011 4 次提交
  4. 27 7月, 2011 1 次提交
  5. 31 3月, 2011 1 次提交
  6. 26 3月, 2011 2 次提交
  7. 19 3月, 2011 1 次提交
  8. 18 11月, 2010 2 次提交
  9. 02 11月, 2010 1 次提交
  10. 30 10月, 2010 3 次提交
  11. 23 10月, 2010 8 次提交
    • J
      kdb,debug_core: adjust master cpu switch logic against new debug_core locking · 495363d3
      Jason Wessel 提交于
      The kdb shell needs to enforce switching back to the original CPU that
      took the exception before restoring normal kernel execution.  Resuming
      from a different CPU than what took the original exception will cause
      problems with spin locks that are freed from the a different processor
      than had taken the lock.
      
      The special logic in dbg_cpu_switch() can go away entirely with
      because the state of what cpus want to be masters or slaves will
      remain unchanged between entry and exit of the debug_core exception
      context.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      495363d3
    • J
      debug_core: refactor locking for master/slave cpus · dfee3a7b
      Jason Wessel 提交于
      For quite some time there have been problems with memory barriers and
      various races with NMI on multi processor systems using the kernel
      debugger.  The algorithm for entering the kernel debug core and
      resuming kernel execution was racy and had several known edge case
      problems with attempting to debug something on a heavily loaded system
      using breakpoints that are hit repeatedly and quickly.
      
      The prior "locking" design entry worked as follows:
      
        * The atomic counter kgdb_active was used with atomic exchange in
          order to elect a master cpu out of all the cpus that may have
          taken a debug exception.
        * The master cpu increments all elements of passive_cpu_wait[].
        * The master cpu issues the round up cpus message.
        * Each "slave cpu" that enters the debug core increments its own
          element in cpu_in_kgdb[].
        * Each "slave cpu" spins on passive_cpu_wait[] until it becomes 0.
        * The master cpu debugs the system.
      
      The new scheme removes the two arrays of atomic counters and replaces
      them with 2 single counters.  One counter is used to count the number
      of cpus waiting to become a master cpu (because one or more hit an
      exception). The second counter is use to indicate how many cpus have
      entered as slave cpus.
      
      The new entry logic works as follows:
      
        * One or more cpus enters via kgdb_handle_exception() and increments
          the masters_in_kgdb. Each cpu attempts to get the spin lock called
          dbg_master_lock.
        * The master cpu sets kgdb_active to the current cpu.
        * The master cpu takes the spinlock dbg_slave_lock.
        * The master cpu asks to round up all the other cpus.
        * Each slave cpu that is not already in kgdb_handle_exception()
          will enter and increment slaves_in_kgdb.  Each slave will now spin
          try_locking on dbg_slave_lock.
        * The master cpu waits for the sum of masters_in_kgdb and slaves_in_kgdb
          to be equal to the sum of the online cpus.
        * The master cpu debugs the system.
      
      In the new design the kgdb_active can only be changed while holding
      dbg_master_lock.  Stress testing has not turned up any further
      entry/exit races that existed in the prior locking design.  The prior
      locking design suffered from atomic variables not being truly atomic
      (in the capacity as used by kgdb) along with memory barrier races.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NDongdong Deng <dongdong.deng@windriver.com>
      dfee3a7b
    • D
      debug_core: disable hw_breakpoints on all cores in kgdb_cpu_enter() · c1bb9a9c
      Dongdong Deng 提交于
      The slave cpus do not have the hw breakpoints disabled upon entry to
      the debug_core and as a result could cause unrecoverable recursive
      faults on badly placed breakpoints, or get out of sync with the arch
      specific hw breakpoint operations.
      
      This patch addresses the problem by invoking kgdb_disable_hw_debug()
      earlier in kgdb_enter_cpu for each cpu that enters the debug core.
      
      The hw breakpoint dis/enable flow should be:
      
      master_debug_cpu   slave_debug_cpu
               \              /
                kgdb_cpu_enter
                      |
              kgdb_disable_hw_debug --> uninstall pre-enabled hw_breakpoint
                      |
       do add/rm dis/enable operates to hw_breakpoints on master_debug_cpu..
                      |
              correct_hw_break --> correct/install the enabled hw_breakpoint
                      |
                 leave_kgdb
      Signed-off-by: NDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      c1bb9a9c
    • J
      kdb,kgdb: fix sparse fixups · 91b152aa
      Jason Wessel 提交于
      Fix the following sparse warnings:
      
      kdb_main.c:328:5: warning: symbol 'kdbgetu64arg' was not declared. Should it be static?
      kgdboc.c:246:12: warning: symbol 'kgdboc_early_init' was not declared. Should it be static?
      kgdb.c:652:26: warning: incorrect type in argument 1 (different address spaces)
      kgdb.c:652:26:    expected void const *ptr
      kgdb.c:652:26:    got struct perf_event *[noderef] <asn:3>*pev
      
      The one in kgdb.c required the (void * __force) because of the return
      code from register_wide_hw_breakpoint looking like:
      
              return (void __percpu __force *)ERR_PTR(err);
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      91b152aa
    • J
      kdb: Fix oops in kdb_unregister · 75d14ede
      Jason Wessel 提交于
      Nothing should try to use kdb_commands directly as sometimes it is
      null.  Instead, use the for_each_kdbcmd() iterator.
      
      This particular problem dates back to the initial kdb merge (2.6.35),
      but at that point nothing was dynamically unregistering commands from
      the kdb shell.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      75d14ede
    • J
      kdb: Allow kernel loadable modules to add kdb shell functions · f7030bbc
      Jason Wessel 提交于
      In order to allow kernel modules to dynamically add a command to the
      kdb shell the kdb_register, kdb_register_repeat, kdb_unregister, and
      kdb_printf need to be exported as GPL symbols.
      
      Any kernel module that adds a dynamic kdb shell function should only
      need to include linux/kdb.h.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f7030bbc
    • J
      debug_core: stop rcu warnings on kernel resume · fb70b588
      Jason Wessel 提交于
      When returning from the kernel debugger reset the rcu jiffies_stall
      value to prevent the rcu stall detector from sending NMI events which
      invoke a stack dump for each cpu in the system.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      fb70b588
    • J
      debug_core: move all watch dog syncs to a single function · 16cdc628
      Jason Wessel 提交于
      Move the various clock and watch dog syncs to a single function in
      advance of adding another sync for the rcu stall detector.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      16cdc628
  12. 05 9月, 2010 1 次提交
  13. 21 8月, 2010 1 次提交
  14. 20 8月, 2010 1 次提交
  15. 17 8月, 2010 1 次提交
    • J
      kdb: fix compile error without CONFIG_KALLSYMS · b590cddf
      Jason Wessel 提交于
      If CONFIG_KGDB_KDB is set and CONFIG_KALLSYMS is not set the kernel
      will fail to build with the error:
      
      kernel/built-in.o: In function `kallsyms_symbol_next':
      kernel/debug/kdb/kdb_support.c:237: undefined reference to `kdb_walk_kallsyms'
      kernel/built-in.o: In function `kallsyms_symbol_complete':
      kernel/debug/kdb/kdb_support.c:193: undefined reference to `kdb_walk_kallsyms'
      
      The kdb_walk_kallsyms needs a #ifdef proper header to match the C
      implementation.  This patch also fixes the compiler warnings in
      kdb_support.c when compiling without CONFIG_KALLSYMS set.  The
      compiler warnings are a result of the kallsyms_lookup() macro not
      initializing the two of the pass by reference variables.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Reported-by: NMichal Simek <monstr@monstr.eu>
      b590cddf
  16. 05 8月, 2010 7 次提交
  17. 29 7月, 2010 1 次提交
  18. 22 7月, 2010 2 次提交