1. 28 9月, 2015 1 次提交
  2. 02 4月, 2015 1 次提交
  3. 23 3月, 2015 1 次提交
  4. 07 1月, 2014 1 次提交
  5. 12 10月, 2012 1 次提交
  6. 18 6月, 2012 1 次提交
  7. 30 3月, 2012 1 次提交
    • J
      x86,kgdb: Fix DEBUG_RODATA limitation using text_poke() · 3751d3e8
      Jason Wessel 提交于
      There has long been a limitation using software breakpoints with a
      kernel compiled with CONFIG_DEBUG_RODATA going back to 2.6.26. For
      this particular patch, it will apply cleanly and has been tested all
      the way back to 2.6.36.
      
      The kprobes code uses the text_poke() function which accommodates
      writing a breakpoint into a read-only page.  The x86 kgdb code can
      solve the problem similarly by overriding the default breakpoint
      set/remove routines and using text_poke() directly.
      
      The x86 kgdb code will first attempt to use the traditional
      probe_kernel_write(), and next try using a the text_poke() function.
      The break point install method is tracked such that the correct break
      point removal routine will get called later on.
      
      Cc: x86@kernel.org
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: stable@vger.kernel.org # >= 2.6.36
      Inspried-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      3751d3e8
  8. 29 3月, 2012 1 次提交
  9. 23 3月, 2012 1 次提交
  10. 10 10月, 2011 1 次提交
  11. 01 7月, 2011 2 次提交
    • A
      perf: Add context field to perf_event · 4dc0da86
      Avi Kivity 提交于
      The perf_event overflow handler does not receive any caller-derived
      argument, so many callers need to resort to looking up the perf_event
      in their local data structure.  This is ugly and doesn't scale if a
      single callback services many perf_events.
      
      Fix by adding a context parameter to perf_event_create_kernel_counter()
      (and derived hardware breakpoints APIs) and storing it in the perf_event.
      The field can be accessed from the callback as event->overflow_handler_context.
      All callers are updated.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1309362157-6596-2-git-send-email-avi@redhat.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      4dc0da86
    • P
      perf: Remove the nmi parameter from the swevent and overflow interface · a8b0ca17
      Peter Zijlstra 提交于
      The nmi parameter indicated if we could do wakeups from the current
      context, if not, we would set some state and self-IPI and let the
      resulting interrupt do the wakeup.
      
      For the various event classes:
      
        - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from
          the PMI-tail (ARM etc.)
        - tracepoint: nmi=0; since tracepoint could be from NMI context.
        - software: nmi=[0,1]; some, like the schedule thing cannot
          perform wakeups, and hence need 0.
      
      As one can see, there is very little nmi=1 usage, and the down-side of
      not using it is that on some platforms some software events can have a
      jiffy delay in wakeup (when arch_irq_work_raise isn't implemented).
      
      The up-side however is that we can remove the nmi parameter and save a
      bunch of conditionals in fast paths.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Michael Cree <mcree@orcon.net.nz>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@elte.hu>
      a8b0ca17
  12. 26 3月, 2011 1 次提交
  13. 18 3月, 2011 1 次提交
  14. 18 2月, 2011 1 次提交
  15. 07 1月, 2011 2 次提交
    • D
      x86, NMI: Remove DIE_NMI_IPI · c410b830
      Don Zickus 提交于
      With priorities in place and no one really understanding the difference between
      DIE_NMI and DIE_NMI_IPI, just remove DIE_NMI_IPI and convert everyone to DIE_NMI.
      
      This also simplifies default_do_nmi() a little bit.  Instead of calling the
      die_notifier in both the if and else part, just pull it out and call it before
      the if-statement.  This has the side benefit of avoiding a call to the ioport
      to see if there is an external NMI sitting around until after the (more frequent)
      internal NMIs are dealt with.
      Patch-Inspired-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1294348732-15030-5-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c410b830
    • D
      x86, NMI: Add priorities to handlers · 166d7514
      Don Zickus 提交于
      In order to consolidate the NMI die_chain events, we need to setup the priorities
      for the die notifiers.
      
      I started by defining a bunch of common priorities that can be used by the
      notifier blocks.  Then I modified the notifier blocks to use the newly created
      priorities.
      
      Now that the priorities are straightened out, it should be easier to remove the
      event DIE_NMI_IPI.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1294348732-15030-4-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      166d7514
  16. 18 11月, 2010 1 次提交
  17. 30 10月, 2010 1 次提交
  18. 23 10月, 2010 3 次提交
    • D
      x86,kgdb: remove unnecessary call to kgdb_correct_hw_break() · 39a0715f
      Dongdong Deng 提交于
      The kernel debug_core invokes hw breakpoint install and removal via
      call backs.  The architecture specific kgdb stubs only need to
      implement the call backs and not actually call the functions.
      Signed-off-by: NDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      CC: x86@kernel.org
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: H. Peter Anvin <hpa@zytor.com>
      39a0715f
    • 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
      x86,kgdb: fix debugger hw breakpoint test regression in 2.6.35 · fad99fac
      Jason Wessel 提交于
      HW breakpoints events stopped working correctly with kgdb as a result
      of commit: 018cbffe (Merge commit
      'v2.6.33' into perf/core), later commit:
      ba773f7c (x86,kgdb: Fix hw breakpoint
      regression) allowed breakpoints to propagate to the debugger core but
      did not completely address the original regression in functionality
      found in 2.6.35.
      
      When the DR_STEP flag is set in dr6 along with any of the DR_TRAP
      bits, the kgdb exception handler will enter once from the
      hw_breakpoint API call back and again from the die notifier for
      do_debug(), which causes the debugger to stop twice and also for the
      kgdb regression tests to fail running under kvm with:
      
      echo V2I1 > /sys/module/kgdbts/parameters/kgdbts
      
      To address the problem, the kgdb overflow handler needs to implement
      the same logic as the ptrace overflow handler call back with respect
      to updating the virtual copy of dr6.  This will allow the kgdb
      do_debug() die notifier to properly handle the exception and the
      attached debugger, or kgdb test suite, will only receive a single
      notification.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: x86@kernel.org
      fad99fac
  19. 17 8月, 2010 1 次提交
  20. 05 8月, 2010 3 次提交
  21. 29 7月, 2010 1 次提交
    • J
      x86,kgdb: Fix hw breakpoint regression · ba773f7c
      Jason Wessel 提交于
      HW breakpoints events stopped working correctly with kgdb
      as a result of commit: 018cbffe
      (Merge commit 'v2.6.33' into perf/core).
      
      The regression occurred because the behavior changed for setting
      NOTIFY_STOP as the return value to the die notifier if the breakpoint
      was known to the HW breakpoint API.  Because kgdb is using the HW
      breakpoint API to register HW breakpoints slots, it must also now
      implement the overflow_handler call back else kgdb does not get to see
      the events from the die notifier.
      
      The kgdb_ll_trap function will be changed to be general purpose code
      which can allow an easy way to implement the hw_breakpoint API
      overflow call back.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NDongdong Deng <dongdong.deng@windriver.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      ba773f7c
  22. 21 5月, 2010 5 次提交
    • J
      x86,kgdb: Implement early hardware breakpoint debugging · 031acd8c
      Jason Wessel 提交于
      It is not possible to use the hw_breakpoint.c API prior to mm_init(),
      but it is possible to use hardware breakpoints with the kernel
      debugger.
      
      Prior to smp_init() it is possible to simply write to the dr registers
      of the boot cpu directly.  This can be used up until the
      kgdb_arch_late() is invoked, at which point the standard hw_breakpoint.c
      API will get used.
      
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      031acd8c
    • J
      x86, kgdb, init: Add early and late debug states · 0b4b3827
      Jason Wessel 提交于
      The kernel debugger can operate well before mm_init(), but the x86
      hardware breakpoint code which uses the perf api requires that the
      kernel allocators are initialized.
      
      This means the kernel debug core needs to provide an optional arch
      specific call back to allow the initialization functions to run after
      the kernel has been further initialized.
      
      The kdb shell already had a similar restriction with an early
      initialization and late initialization.  The kdb_init() was moved into
      the debug core's version of the late init which is called
      dbg_late_init();
      
      CC: kgdb-bugreport@lists.sourceforge.net
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      0b4b3827
    • J
      x86,kgdb: Add low level debug hook · f503b5ae
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a triple fault is
      to have a low level "first opportunity handler" in the int3 exception
      handler.
      
      Generally this will be something the vast majority of folks will not
      need, but for those who need it, it is added as a kernel .config
      option called KGDB_LOW_LEVEL_TRAP.
      
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: x86@kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f503b5ae
    • J
      kgdb: remove post_primary_code references · 98ec1878
      Jason Wessel 提交于
      Remove all the references to the kgdb_post_primary_code.  This
      function serves no useful purpose because you can obtain the same
      information from the "struct kgdb_state *ks" from with in the
      debugger, if for some reason you want the data.
      
      Also remove the unintentional duplicate assignment for ks->ex_vector.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      98ec1878
    • J
      kgdb: core changes to support kdb · dcc78711
      Jason Wessel 提交于
      These are the minimum changes to the kgdb core in order to enable an
      API to connect a new front end (kdb) to the debug core.
      
      This patch introduces the dbg_kdb_mode variable controls where the
      user level I/O is routed.  It will be routed to the gdbstub (kgdb) or
      to the kdb front end which is a simple shell available over the kgdboc
      connection.
      
      You can switch back and forth between kdb or the gdb stub mode of
      operation dynamically.  From gdb stub mode you can blindly type
      "$3#33", or from the kdb mode you can enter "kgdb" to switch to the
      gdb stub.
      
      The logic in the debug core depends on kdb to look for the typical gdb
      connection sequences and return immediately with KGDB_PASS_EVENT if a
      gdb serial command sequence is detected.  That should allow a
      reasonably seamless transition between kdb -> gdb without leaving the
      kernel exception state.  The two gdb serial queries that kdb is
      responsible for detecting are the "?" and "qSupported" packets.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NMartin Hicks <mort@sgi.com>
      dcc78711
  23. 01 4月, 2010 1 次提交
  24. 30 1月, 2010 2 次提交
    • J
      perf, hw_breakpoint, kgdb: Do not take mutex for kernel debugger · 5352ae63
      Jason Wessel 提交于
      This patch fixes the regression in functionality where the
      kernel debugger and the perf API do not nicely share hw
      breakpoint reservations.
      
      The kernel debugger cannot use any mutex_lock() calls because it
      can start the kernel running from an invalid context.
      
      A mutex free version of the reservation API needed to get
      created for the kernel debugger to safely update hw breakpoint
      reservations.
      
      The possibility for a breakpoint reservation to be concurrently
      processed at the time that kgdb interrupts the system is
      improbable. Should this corner case occur the end user is
      warned, and the kernel debugger will prohibit updating the
      hardware breakpoint reservations.
      
      Any time the kernel debugger reserves a hardware breakpoint it
      will be a system wide reservation.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: kgdb-bugreport@lists.sourceforge.net
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: torvalds@linux-foundation.org
      LKML-Reference: <1264719883-7285-3-git-send-email-jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5352ae63
    • J
      x86, hw_breakpoints, kgdb: Fix kgdb to use hw_breakpoint API · cc096749
      Jason Wessel 提交于
      In the 2.6.33 kernel, the hw_breakpoint API is now used for the
      performance event counters.  The hw_breakpoint_handler() now
      consumes the hw breakpoints that were previously set by kgdb
      arch specific code.  In order for kgdb to work in conjunction
      with this core API change, kgdb must use some of the low level
      functions of the hw_breakpoint API to install, uninstall, and
      deal with hw breakpoint reservations.
      
      The kgdb core required a change to call kgdb_disable_hw_debug
      anytime a slave cpu enters kgdb_wait() in order to keep all the
      hw breakpoints in sync as well as to prevent hitting a hw
      breakpoint while kgdb is active.
      
      During the architecture specific initialization of kgdb, it will
      pre-allocate 4 disabled (struct perf event **) structures.  Kgdb
      will use these to manage the capabilities for the 4 hw
      breakpoint registers, per cpu.  Right now the hw_breakpoint API
      does not have a way to ask how many breakpoints are available,
      on each CPU so it is possible that the install of a breakpoint
      might fail when kgdb restores the system to the run state.  The
      intent of this patch is to first get the basic functionality of
      hw breakpoints working and leave it to the person debugging the
      kernel to understand what hw breakpoints are in use and what
      restrictions have been imposed as a result.  Breakpoint
      constraints will be dealt with in a future patch.
      
      While atomic, the x86 specific kgdb code will call
      arch_uninstall_hw_breakpoint() and arch_install_hw_breakpoint()
      to manage the cpu specific hw breakpoints.
      
      The net result of these changes allow kgdb to use the same pool
      of hw_breakpoints that are used by the perf event API, but
      neither knows about future reservations for the available hw
      breakpoint slots.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: kgdb-bugreport@lists.sourceforge.net
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: torvalds@linux-foundation.org
      LKML-Reference: <1264719883-7285-2-git-send-email-jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cc096749
  25. 11 12月, 2009 3 次提交
    • J
      kgdb,x86: do not set kgdb_single_step on x86 · 8097551d
      Jason Wessel 提交于
      On an SMP system the kgdb_single_step flag has the possibility to
      indefinitely hang the system in the case.  Consider the case where,
      CPU 1 has the schedule lock and CPU 0 is set to single step, there is
      no way for CPU 0 to run another task.
      
      The easy way to observe the problem is to make 2 cpus busy, and run
      the kgdb test suite.  You will see that it hangs the system very
      quickly.
      
      while [ 1 ] ; do find /proc > /dev/null 2>&1 ; done &
      while [ 1 ] ; do find /proc > /dev/null 2>&1 ; done &
      echo V1 > /sys/module/kgdbts/parameters/kgdbts
      
      The side effect of this patch is that there is the possibility
      to miss a breakpoint in the case that a single step operation
      was executed to step over a breakpoint in common code.
      
      The trade off of the missed breakpoint is preferred to
      hanging the kernel.  This can be fixed in the future by
      using kprobes or another strategy to step over planted
      breakpoints with out of line execution.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      8097551d
    • J
      kgdb,i386: Fix corner case access to ss with NMI watch dog exception · cf6f196d
      Jason Wessel 提交于
      It is possible for the user_mode_vm(regs) check to return true on the
      i368 arch for a non master kgdb cpu or when the master kgdb cpu
      handles the NMI watch dog exception.
      
      The solution is simply to select the correct gdb_ss location
      based on the check to user_mode_vm(regs).
      
      CC: Ingo Molnar <mingo@elte.hu>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      cf6f196d
    • R
      kgdb,x86: remove redundant test · a5d09d68
      Roel Kluin 提交于
      The for loop starts with a breakno of 0, and ends when it's 4. so
      this test is always true.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      a5d09d68
  26. 13 10月, 2009 1 次提交
    • H
      x86: use kernel_stack_pointer() in kgdb.c · 5ca6c0ca
      H. Peter Anvin 提交于
      The way to obtain a kernel-mode stack pointer from a struct
      pt_regs in 32-bit mode is "subtle": the stack doesn't actually
      contain the stack pointer, but rather the location where it would
      have been marks the actual previous stack frame.  For clarity, use
      kernel_stack_pointer() instead of coding this weirdness
      explicitly.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      5ca6c0ca
  27. 03 6月, 2009 1 次提交