public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series
@ 2009-12-23 21:19 Jason Wessel
  2009-12-23 21:19 ` [PATCH 01/37] softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume Jason Wessel
  2009-12-24  0:56 ` [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series Greg KH
  0 siblings, 2 replies; 76+ messages in thread
From: Jason Wessel @ 2009-12-23 21:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: kgdb-bugreport, kdb, mingo

Back in May 2009 an initial kdb prototype was posted to lkml as an RFC
to see if there was sufficient interest to merge kdb and kgdb together.

There was enough interest to continue on with the project, and it is
now in a state where further work can occur to review, and hopefully
merge the code into a future kernel.

If this is the first time you have heard about kgdb or kdb, you might
consider taking a look at the presentation slides from LPC 2009.

http://kgdb.wiki.kernel.org/index.php/Main_Page#Linux_Plumbers_Conference_presentation_2009

The code included in this series does not include any of the USB code
referenced in the presentation.

Several changes have occurred since the original prototype was posted.
All of the architectures using the kgdb core today have had the
functions implemented to make use of the kdb shell.  This list
includes x86, arm, ppc, mips, sh, sparc, and blackfin.  The proposed
atomic kernel modesetting project now has an initial implementation
for the intel i915 driver, and it should be possible to add atomic
mode setting hooks for any other video driver which makes use of
builtin kernel mode setting.  All the dead code and functions that
were not previously implemented in the RFC have been removed or
implemented.

The directory of the kernel debugger changed as well.  All the kernel
debugger pieces, the debug core, gdbstub and kdb now live under
kernel/debug.

While the patch set may be slightly large, it is broken down into
logical, incremental functionality.  Only the first 12 patches are
needed to see kdb in action on a serial port which has a kgdboc driver
for example.

It is important to understand that this work was directly derived from
the original kdb, and the intent is to deprecate the out of tree kdb
and move all its functionality to this code base.  This version of kdb
is completely wired into the debug core and the kgdboc polled I/O
model using the same API used by the gdbstub (which people call kgdb).

The kdb front end in this patch series works a little differently than
if you were to take the original kdb patch set from:

ftp://oss.sgi.com/projects/kdb/download/v4.4/

In the kernel .config you should enable the following options:

CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_KGDB_LOW_LEVEL_TRAP=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y

To use kdb with a serial port you would use the kgdb/kgdboc way of
doing things.  You would used a kernel command line with:

   console=ttyS0,115200 kgdboc=ttyS0 kgdbwait

That will get you access to kdb just after the console has been
registered.  If you want to use the keyboard, you could use the
following (NOTE it is kbd and not kdb, kbd is short for keyboard):

   console=tty0 kgdboc=kbd kgdbwait

You can also use the keyboard and or serial console:

   console=ttyS0,115200 console=tty0 kgdboc=kbd,ttyS0


In terms of breaking into the debugger after the system is up, you
must use the sysrq-g sequence.  That means you could run:
   echo g > /proc/sysrq-trigger

Or you can use the SysRq key on your key board.  On a typical laptop
you might have to do the following:

press and hold ALT    -- You will be holding this the whole time
press and hold FN
press and release the key with the SysRq label
release FN
press and release g
release ALT

Once you are in kdb you can run help to see a limited list of
commands.

You can also still connect gdb or re-enter kdb without leaving the
exception state, if you are using a serial port.  To get out of kgdb
mode you can type "$3#33", or to get into kgdb mode from kdb, you can
type "kgdb".

>From gdb you can issue commands to the kdb front end, via gdb's
monitor command.  For instance you could issue "monitor lsmod".
Allowing the gdb monitor extension was certainly another motivation
behind the prototype.

Included among the kdb patches are some kgdb specific fixes for the
next kernel merge window, and if kdb were to not make the cut, these
patches will be split out of the series.  Anything too ugly for a
possible merge is also a candidate to get removed from the series.

Thanks,
Jason.

You can find the development branch for this here:

http://git.kernel.org/?p=linux/kernel/git/jwessel/linux-2.6-kgdb.git;a=shortlog;h=kdb_prototype10

or grab a static version of the patches here:

http://kernel.org/pub/linux/kernel/people/jwessel/branches/kdb_prototype10.tar.bz2

---
short log follow:

The following changes since commit f42ecb2808db5386f983d593a7c08d3ea3b94a27:
  Linus Torvalds (1):
        Merge branch 'drm-linus' of git://git.kernel.org/.../airlied/drm-2.6

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git kdb_prototype10

Jason Wessel (33):
      softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume
      x86,hw_breakpoint,kgdb: kgdb to use hw_breakpoint API
      Move kernel/kgdb.c to kernel/debug/debug_core.c
      Separate the gdbstub from the debug core
      kdb: core for kgdb back end
      kgdb: eliminate kgdb_wait(), all cpus enter the same way
      kgdb,sparc: Add in kgdb_arch_set_pc for sparc
      kgdb,sh: update superh kgdb exception handling
      kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin
      kgdb: core changes to support kdb
      kgdb,8250,pl011: Return immediately from console poll
      sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code
      sparc,sunzilog: Add console polling support for sunzilog serial driver
      kgdb: gdb "monitor" -> kdb passthrough
      kgdboc,keyboard: Keyboard driver for kdb with kgdb
      kgdb: remove post_primary_code references
      x86,kgdb: Add low level debug hook
      arm,kgdb: Add hook to catch an oops with debugger
      powerpc,kgdb: Introduce low level trap catching
      mips,kgdb: kdb low level trap catch and stack trace
      kgdb: Add the ability to schedule a breakpoint via a tasklet
      kgdboc,kdb: Allow kdb to work on a non open console port
      printk,kdb: capture printk() when in kdb shell
      keyboard, input: Add hook to input to allow low level event clear
      debug_core,kdb: Allow the debug core to process a recursive debug entry
      kdb,panic,debug_core: Allow the debug core to receive a panic before smp_send_stop()
      MAINTAINERS: update kgdb, kdb, and debug_core info
      kgdboc,debug_core: Add call backs to allow kernel mode switching
      kms,kdb: Force unblank a console device
      i915: when kgdb is active display compression should be off
      drm_fb_helper: Preserve capability to use atomic kms
      drm,i915 - atomic mutex hacks
      kgdbts,sh: Add in breakpoint pc offset for superh

Jesse Barnes (2):
      kgdb: add ops arg to kgdb console active & restore hooks
      drm: add KGDB/KDB support Add support for KDB entry/exit.

Randy Dunlap (1):
      kgdb: Fix kernel-doc format error in kgdb.h

Sonic Zhang (1):
      kgdb: Make mem access function weak in kgdb.c and kgdb.h

 MAINTAINERS                           |    6 +-
 arch/arm/include/asm/kgdb.h           |    2 +
 arch/arm/include/asm/kmap_types.h     |    1 +
 arch/arm/kernel/kgdb.c                |   13 +
 arch/arm/kernel/traps.c               |    5 +
 arch/blackfin/kernel/kgdb.c           |    5 +
 arch/mips/include/asm/kgdb.h          |    2 +
 arch/mips/kernel/kgdb.c               |   27 +-
 arch/mips/kernel/traps.c              |   14 +
 arch/powerpc/include/asm/kmap_types.h |    1 +
 arch/powerpc/kernel/kgdb.c            |   12 +-
 arch/powerpc/kernel/traps.c           |    7 +
 arch/sh/kernel/kgdb.c                 |   14 +-
 arch/sparc/kernel/kgdb_32.c           |    6 +
 arch/sparc/kernel/kgdb_64.c           |    6 +
 arch/x86/include/asm/kgdb.h           |    3 +
 arch/x86/kernel/hw_breakpoint.c       |    5 +-
 arch/x86/kernel/kgdb.c                |  247 ++-
 arch/x86/kernel/traps.c               |    6 +
 drivers/char/Makefile                 |    1 +
 drivers/char/kdb_keyboard.c           |  207 +++
 drivers/char/kdb_keyboard.h           |  143 ++
 drivers/char/keyboard.c               |   30 +-
 drivers/gpu/drm/drm_fb_helper.c       |  105 ++
 drivers/gpu/drm/i915/intel_display.c  |  118 ++
 drivers/input/input.c                 |   15 +
 drivers/misc/kgdbts.c                 |    6 +
 drivers/serial/8250.c                 |    4 +-
 drivers/serial/amba-pl011.c           |    6 +-
 drivers/serial/kgdboc.c               |  150 ++-
 drivers/serial/sh-sci.c               |    6 +-
 drivers/serial/sunzilog.c             |   52 +
 drivers/video/console/fbcon.c         |    8 +
 fs/proc/meminfo.c                     |  143 ++
 fs/proc/mmu.c                         |   16 +-
 include/asm-generic/kmap_types.h      |    3 +-
 include/drm/drm_crtc_helper.h         |    2 +
 include/drm/drm_fb_helper.h           |    4 +
 include/linux/hugetlb.h               |    4 +
 include/linux/input.h                 |   10 +
 include/linux/kdb.h                   |  119 ++
 include/linux/keyboard.h              |    2 +
 include/linux/kgdb.h                  |   79 +-
 include/linux/sched.h                 |    4 +
 include/linux/serial_core.h           |    1 +
 include/linux/swap.h                  |    2 +
 init/main.c                           |    6 +
 kernel/Makefile                       |    2 +-
 kernel/debug/Makefile                 |    7 +
 kernel/debug/debug_core.c             |  977 +++++++++++
 kernel/debug/debug_core.h             |   82 +
 kernel/debug/gdbstub.c                | 1022 ++++++++++++
 kernel/debug/kdb/.gitignore           |    1 +
 kernel/debug/kdb/Makefile             |   24 +
 kernel/debug/kdb/kdb_bp.c             |  671 ++++++++
 kernel/debug/kdb/kdb_bt.c             |  217 +++
 kernel/debug/kdb/kdb_cmds             |   32 +
 kernel/debug/kdb/kdb_debugger.c       |  168 ++
 kernel/debug/kdb/kdb_io.c             |  820 ++++++++++
 kernel/debug/kdb/kdb_main.c           | 2852 +++++++++++++++++++++++++++++++++
 kernel/debug/kdb/kdb_private.h        |  420 +++++
 kernel/debug/kdb/kdb_support.c        |  942 +++++++++++
 kernel/kallsyms.c                     |   21 +
 kernel/kgdb.c                         | 1760 --------------------
 kernel/module.c                       |   19 +-
 kernel/panic.c                        |    7 +-
 kernel/printk.c                       |   26 +-
 kernel/sched.c                        |   93 ++-
 kernel/signal.c                       |   42 +
 kernel/softlockup.c                   |   16 +
 lib/Kconfig.kgdb                      |   22 +
 mm/hugetlb.c                          |   19 +
 mm/swapfile.c                         |   10 +-
 73 files changed, 9992 insertions(+), 1908 deletions(-)
 create mode 100644 drivers/char/kdb_keyboard.c
 create mode 100644 drivers/char/kdb_keyboard.h
 create mode 100644 include/linux/kdb.h
 create mode 100644 kernel/debug/Makefile
 create mode 100644 kernel/debug/debug_core.c
 create mode 100644 kernel/debug/debug_core.h
 create mode 100644 kernel/debug/gdbstub.c
 create mode 100644 kernel/debug/kdb/.gitignore
 create mode 100644 kernel/debug/kdb/Makefile
 create mode 100644 kernel/debug/kdb/kdb_bp.c
 create mode 100644 kernel/debug/kdb/kdb_bt.c
 create mode 100644 kernel/debug/kdb/kdb_cmds
 create mode 100644 kernel/debug/kdb/kdb_debugger.c
 create mode 100644 kernel/debug/kdb/kdb_io.c
 create mode 100644 kernel/debug/kdb/kdb_main.c
 create mode 100644 kernel/debug/kdb/kdb_private.h
 create mode 100644 kernel/debug/kdb/kdb_support.c
 delete mode 100644 kernel/kgdb.c


PS:

* This is not meant to replace printk :-)
* Happy Holidays!

^ permalink raw reply	[flat|nested] 76+ messages in thread

end of thread, other threads:[~2010-01-07  6:27 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 21:19 [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series Jason Wessel
2009-12-23 21:19 ` [PATCH 01/37] softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume Jason Wessel
2009-12-23 21:19   ` [PATCH 02/37] x86,hw_breakpoint,kgdb: kgdb to use hw_breakpoint API Jason Wessel
2009-12-23 21:19     ` [PATCH 03/37] Move kernel/kgdb.c to kernel/debug/debug_core.c Jason Wessel
2009-12-23 21:19       ` [PATCH 04/37] Separate the gdbstub from the debug core Jason Wessel
2009-12-23 21:19         ` [PATCH 05/37] kdb: core for kgdb back end Jason Wessel
2009-12-23 21:19           ` [PATCH 06/37] kgdb: eliminate kgdb_wait(), all cpus enter the same way Jason Wessel
2009-12-23 21:19             ` [PATCH 07/37] kgdb,sparc: Add in kgdb_arch_set_pc for sparc Jason Wessel
2009-12-23 21:19               ` [PATCH 08/37] kgdb,sh: update superh kgdb exception handling Jason Wessel
2009-12-23 21:19                 ` [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin Jason Wessel
2009-12-23 21:19                   ` [PATCH 10/37] kgdb: Make mem access function weak in kgdb.c and kgdb.h Jason Wessel
2009-12-23 21:19                     ` [PATCH 11/37] kgdb: Fix kernel-doc format error in kgdb.h Jason Wessel
2009-12-23 21:19                       ` [PATCH 12/37] kgdb: core changes to support kdb Jason Wessel
2009-12-23 21:19                         ` [PATCH 13/37] kgdb,8250,pl011: Return immediately from console poll Jason Wessel
2009-12-23 21:19                           ` [PATCH 14/37] sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code Jason Wessel
2009-12-23 21:19                             ` [PATCH 15/37] sparc,sunzilog: Add console polling support for sunzilog serial driver Jason Wessel
2009-12-23 21:19                               ` [PATCH 16/37] kgdb: gdb "monitor" -> kdb passthrough Jason Wessel
2009-12-23 21:19                                 ` [PATCH 17/37] kgdboc,keyboard: Keyboard driver for kdb with kgdb Jason Wessel
2009-12-23 21:19                                   ` [PATCH 18/37] kgdb: remove post_primary_code references Jason Wessel
2009-12-23 21:19                                     ` [PATCH 19/37] x86,kgdb: Add low level debug hook Jason Wessel
2009-12-23 21:19                                       ` [PATCH 20/37] arm,kgdb: Add hook to catch an oops with debugger Jason Wessel
2009-12-23 21:19                                         ` [PATCH 21/37] powerpc,kgdb: Introduce low level trap catching Jason Wessel
2009-12-23 21:19                                           ` [PATCH 22/37] mips,kgdb: kdb low level trap catch and stack trace Jason Wessel
2009-12-23 21:19                                             ` [PATCH 23/37] kgdb: Add the ability to schedule a breakpoint via a tasklet Jason Wessel
2009-12-23 21:19                                               ` [PATCH 24/37] kgdboc,kdb: Allow kdb to work on a non open console port Jason Wessel
2009-12-23 21:19                                                 ` [PATCH 25/37] printk,kdb: capture printk() when in kdb shell Jason Wessel
2009-12-23 21:19                                                   ` [PATCH 26/37] keyboard, input: Add hook to input to allow low level event clear Jason Wessel
2009-12-23 21:19                                                     ` [PATCH 27/37] debug_core,kdb: Allow the debug core to process a recursive debug entry Jason Wessel
2009-12-23 21:19                                                       ` [PATCH 28/37] kdb,panic,debug_core: Allow the debug core to receive a panic before smp_send_stop() Jason Wessel
2009-12-23 21:19                                                         ` [PATCH 29/37] MAINTAINERS: update kgdb, kdb, and debug_core info Jason Wessel
2009-12-23 21:19                                                           ` [PATCH 30/37] kgdboc,debug_core: Add call backs to allow kernel mode switching Jason Wessel
2009-12-23 21:19                                                             ` [PATCH 31/37] kgdb: add ops arg to kgdb console active & restore hooks Jason Wessel
2009-12-23 21:19                                                               ` [PATCH 32/37] kms,kdb: Force unblank a console device Jason Wessel
2009-12-23 21:43                                                                 ` [PATCH 33/37] drm: add KGDB/KDB support Add support for KDB entry/exit Jason Wessel
2009-12-23 21:43                                                                   ` [PATCH 34/37] i915: when kgdb is active display compression should be off Jason Wessel
2009-12-23 21:43                                                                     ` [PATCH 35/37] drm_fb_helper: Preserve capability to use atomic kms Jason Wessel
2009-12-23 21:43                                                                       ` [PATCH 36/37] drm,i915 - atomic mutex hacks Jason Wessel
2009-12-23 21:43                                                                         ` [PATCH 37/37] kgdbts,sh: Add in breakpoint pc offset for superh Jason Wessel
2009-12-24  3:58                                                                           ` Paul Mundt
2010-01-04 17:23                                                                   ` [PATCH 33/37] drm: add KGDB/KDB support Add support for KDB entry/exit Jesse Barnes
2009-12-23 21:50                               ` [PATCH 15/37] sparc,sunzilog: Add console polling support for sunzilog serial driver David Miller
2009-12-23 21:54                                 ` Jason Wessel
2009-12-23 22:00                                   ` David Miller
2009-12-24  6:08                             ` [PATCH 14/37] sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code Paul Mundt
2009-12-26 21:07                     ` [PATCH 10/37] kgdb: Make mem access function weak in kgdb.c and kgdb.h Mike Frysinger
2009-12-26 21:12                   ` [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin Mike Frysinger
2009-12-28  9:49                     ` Zhang, Sonic
2009-12-28  9:57                     ` Zhang, Sonic
2009-12-28 10:17                     ` Zhang, Sonic
2009-12-31  2:45                       ` Sonic Zhang
2010-01-06 19:43                         ` [Kgdb-bugreport] " Jason Wessel
2010-01-06 20:08                           ` Mike Frysinger
2010-01-06 20:34                             ` Jason Wessel
2010-01-06 20:39                               ` Mike Frysinger
2010-01-06 22:40                                 ` Jason Wessel
2010-01-07  6:27                                   ` Mike Frysinger
2010-01-07  3:50                           ` Zhang, Sonic
2009-12-24  6:07                 ` [PATCH 08/37] kgdb,sh: update superh kgdb exception handling Paul Mundt
2009-12-23 21:48               ` [PATCH 07/37] kgdb,sparc: Add in kgdb_arch_set_pc for sparc David Miller
2009-12-23 23:04                 ` Jason Wessel
2009-12-24  4:42                   ` David Miller
2009-12-24  1:28           ` [PATCH 05/37] kdb: core for kgdb back end Andi Kleen
2009-12-28 22:36             ` Jason Wessel
2009-12-28 23:37               ` Andi Kleen
2009-12-24 11:01           ` Peter Zijlstra
2009-12-24 11:16             ` Peter Zijlstra
2009-12-24 15:57               ` Jason Wessel
2009-12-26 21:34                 ` Mike Frysinger
2009-12-24 11:55             ` Jason Wessel
2009-12-24 12:01               ` Peter Zijlstra
2009-12-24 11:04           ` Peter Zijlstra
2009-12-28 16:33             ` Jason Wessel
2009-12-28 16:55               ` Peter Zijlstra
2009-12-28 17:15                 ` Jason Wessel
2009-12-24  0:56 ` [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series Greg KH
2009-12-24  3:55   ` [Kgdb-bugreport] [PATCH 0/37] kgdb,kdb " Jason Wessel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox