Re: [Kgdb-bugreport] [PATCH 26/28] kdb, panic, debug_core: Allow the debug core to receive a panic before smp_send_stop()

2010-02-12 Thread Andrew Morton
On Fri, 12 Feb 2010 17:43:39 -0600 Jason Wessel wrote: > >>printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf); > >> #ifdef CONFIG_DEBUG_BUGVERBOSE > >>dump_stack(); > >> @@ -91,8 +94,6 @@ NORET_TYPE void panic(const char * fmt, ...) > >> */ > >>smp_send_stop(); > >> > >

Re: [Kgdb-bugreport] [PATCH 22/28] printk, kdb: capture printk() when in kdb shell

2010-02-12 Thread Andrew Morton
On Fri, 12 Feb 2010 17:20:22 -0600 Jason Wessel wrote: > Andrew Morton wrote: > > On Fri, 12 Feb 2010 16:35:37 -0600 Jason Wessel > > wrote: > > > > > >> @@ -609,6 +610,14 @@ asmlinkage int printk(const char *fmt, ...) > >>va_list args; > >>int r; > >> > >> +#ifdef CONFIG_KGDB_KDB

Re: [Kgdb-bugreport] [PATCH 6/7] kgdb, docs: Update the kgdb docs to include kms

2010-02-12 Thread Randy Dunlap
On 02/12/10 14:36, Jason Wessel wrote: > Update the kgdb docs to include information about kernel mode setting support. > > Signed-off-by: Jason Wessel > --- > Documentation/DocBook/kgdb.tmpl | 82 > +++ > Documentation/kernel-parameters.txt |9 +++- >

Re: [Kgdb-bugreport] [PATCH 06/28] kgdb, blackfin: Add in kgdb_arch_set_pc for blackfin

2010-02-12 Thread Mike Frysinger
On Fri, Feb 12, 2010 at 17:35, Jason Wessel wrote: > The new debug core api requires all architectures that use to debug > core to implement a function to set the program counter. > > CC: Mike Frysinger sorry, thought i Acked-by this already ... -mike

Re: [Kgdb-bugreport] [PATCH 26/28] kdb, panic, debug_core: Allow the debug core to receive a panic before smp_send_stop()

2010-02-12 Thread Jason Wessel
Andrew Morton wrote: > On Fri, 12 Feb 2010 16:35:41 -0600 Jason Wessel > wrote: > > >> It is highly desirable to trap into kdb on panic, >> > > s/kdb/kgdb/ > > But is it necessary to do it in-kernel? Why not just put a > breakpoint at panic(), add that to your .gdbinit? > > If you do

Re: [Kgdb-bugreport] [PATCH 22/28] printk, kdb: capture printk() when in kdb shell

2010-02-12 Thread Jason Wessel
Andrew Morton wrote: > On Fri, 12 Feb 2010 16:35:37 -0600 Jason Wessel > wrote: > > >> @@ -609,6 +610,14 @@ asmlinkage int printk(const char *fmt, ...) >> va_list args; >> int r; >> >> +#ifdef CONFIG_KGDB_KDB >> +if (unlikely(kdb_trap_printk)) { >> +va_start(args, f

Re: [Kgdb-bugreport] [PATCH 26/28] kdb, panic, debug_core: Allow the debug core to receive a panic before smp_send_stop()

2010-02-12 Thread Andrew Morton
On Fri, 12 Feb 2010 16:35:41 -0600 Jason Wessel wrote: > It is highly desirable to trap into kdb on panic, s/kdb/kgdb/ But is it necessary to do it in-kernel? Why not just put a breakpoint at panic(), add that to your .gdbinit? > diff --git a/kernel/panic.c b/kernel/panic.c > index c787333..

Re: [Kgdb-bugreport] [PATCH 22/28] printk, kdb: capture printk() when in kdb shell

2010-02-12 Thread Andrew Morton
On Fri, 12 Feb 2010 16:35:37 -0600 Jason Wessel wrote: > @@ -609,6 +610,14 @@ asmlinkage int printk(const char *fmt, ...) > va_list args; > int r; > > +#ifdef CONFIG_KGDB_KDB > + if (unlikely(kdb_trap_printk)) { > + va_start(args, fmt); > + r = vkdb_prin

[Kgdb-bugreport] [PATCH 4/8] x86, early dr regs, kgdb: Allow kernel debugger early dr register access

2010-02-12 Thread Jason Wessel
If the kernel debugger was configured, attached and started with kgdbwait, the hardware breakpoint registers should get restored by the kgdb code which is managing the dr registers. CC: x...@kernel.org CC: Thomas Gleixner CC: Ingo Molnar CC: H. Peter Anvin Signed-off-by: Jason Wessel --- arch

[Kgdb-bugreport] [PATCH 6/8] earlyprintk, vga, kdb: Fix \b and \r for earlyprintk=vga with kdb

2010-02-12 Thread Jason Wessel
Allow kdb to work properly with with earlyprintk=vga by interpreting the backspace and carriage return output characters. These interpretation of these characters is used for simple line editing provided in the kdb shell. CC: Thomas Gleixner CC: Ingo Molnar CC: H. Peter Anvin CC: x...@kernel.o

[Kgdb-bugreport] [PATCH 8/8] echi-dbgp: Add kernel debugger support for the usb debug port

2010-02-12 Thread Jason Wessel
This patch adds the capability to use the usb debug port with the kernel debugger. It is also still possible to use this functionality with or without the earlyprintk=dbgpX. It is possible to use the kgdbwait boot argument to debug very early in the kernel start up code. There are two ways to us

[Kgdb-bugreport] [PATCH 5/8] kgdboc: Add ekgdboc for early use of the kernel debugger

2010-02-12 Thread Jason Wessel
The ekgdboc= differs from kgdboc= in that you can begin debuggin as soon as the exceptions are setup and the kgdb I/O driver is available, instead of waiting until the tty subsystem is available. CC: kgdb-bugreport@lists.sourceforge.net Signed-off-by: Jason Wessel --- Documentation/kernel-parame

[Kgdb-bugreport] [PATCH 3/8] x86, kgdb: Implement early hardware breakpoint debugging

2010-02-12 Thread 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

[Kgdb-bugreport] [PATCH 7/8] ehci-dbgp: split PID register updates for IN and OUT pipes

2010-02-12 Thread Jason Wessel
This patch addresses two problems: 1) Bulk reads should always use the DATA0 for the pid, and the write PID should toggle between DATA0 and DATA1. The fix is using dbgp_pid_write_update() and dbgp_pid_read_update(). 2) The delay loop for waiting for a transaction was not long enough to

[Kgdb-bugreport] [PATCH 1/8] x86, kgdb: early trap init for early debug

2010-02-12 Thread Jason Wessel
From: Jan Kiszka Allow the x86 arch to have early exception processing for the purpose of debugging via the kgdb. Signed-off-by: Jan Kiszka Signed-off-by: Jason Wessel --- arch/x86/include/asm/processor.h |2 ++ arch/x86/kernel/setup.c |1 + arch/x86/kernel/traps.c |

[Kgdb-bugreport] [PATCH 2/8] x86, kgdb, init: Add early and late debug states

2010-02-12 Thread 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 ru

[Kgdb-bugreport] [PATCH 0/7] early debugging kgdb & kdb proposed merge for 2.6.34

2010-02-12 Thread Jason Wessel
Patch set 3 of 3 - The kdb / kgdb merge This patch set stacks on top of the kgdb / kdb / kms patches and focuses on allowing the kernel debugger to as early as the earlyprintk is available. Right now early debugging is only available on x86, but the API in the debug core are generic and the only

[Kgdb-bugreport] [PATCH 5/7] drm_fb_helper: Preserve capability to use atomic kms

2010-02-12 Thread Jason Wessel
Commit 5349ef3127c77075ff70b2014f17ae0fbcaaf199 changed logic of when a pixclock was valid vs invalid. The atomic kernel mode setting used by the kernel debugger relied upon the drm_fb_helper_check_var() to always return -EINVAL. Until a better solution exists, this behavior will be restored. CC

[Kgdb-bugreport] [PATCH 7/7] RFC, HACK, EXPERIMENTAL, drm, i915 - atomic mutex HACKS

2010-02-12 Thread Jason Wessel
Here are some hacks to work around mutex crashes in the drm / i915 code. For now, this is the only way to make the kms / kgdb path safe on an SMP system. Helper macros were added to allow kms code to declare debugger safe mutexes which can be used so long as the debugger restores the state before

[Kgdb-bugreport] [PATCH 3/7] kms, kdb: Force unblank a console device

2010-02-12 Thread Jason Wessel
The kgdboc pre exception handler must atomically save the state of the existing VC console and activate it, if it is blanked. Before restoring the kernel to a running state, the kgdboc post exception handler will restore the state of the VC variables that got changed while atomic. CC: David Airli

[Kgdb-bugreport] [PATCH 4/7] i915: when kgdb is active display compression should be off

2010-02-12 Thread Jason Wessel
If the HW compression is left on, the call backs from the HW will crash the kernel. The only time this code is called is when kernel mode setting is in use with kgdb and the kdb shell. The atomic display pipe handler callback will reset everything when kgdb restores kernel to the run state. CC:

[Kgdb-bugreport] [PATCH 6/7] kgdb, docs: Update the kgdb docs to include kms

2010-02-12 Thread Jason Wessel
Update the kgdb docs to include information about kernel mode setting support. Signed-off-by: Jason Wessel --- Documentation/DocBook/kgdb.tmpl | 82 +++ Documentation/kernel-parameters.txt |9 +++- 2 files changed, 79 insertions(+), 12 deletions(-) diff

[Kgdb-bugreport] [PATCH 1/7] kgdboc, debug_core: Add call backs to allow kernel mode switching

2010-02-12 Thread Jason Wessel
Hooks for the kgdb core for registration of the drm layer to provide a call backs so as to perform kernel mode switching, for use with kdb. [jbar...@virtuousgeek.org: add ops arg to kgdb console active & restore hooks] CC: Jesse Barnes Signed-off-by: Jason Wessel --- drivers/serial/kgdboc.c

[Kgdb-bugreport] [PATCH 2/7] drm: add KGDB/KDB support Add support for KDB entry/exit.

2010-02-12 Thread Jason Wessel
From: Jesse Barnes --- drivers/gpu/drm/drm_fb_helper.c | 79 drivers/gpu/drm/i915/intel_display.c | 93 ++ include/drm/drm_crtc_helper.h|2 + include/drm/drm_fb_helper.h |4 ++ 4 files changed, 178 ins

[Kgdb-bugreport] [PATCH 0/7] kms + kgdb & kdb proposed merge for 2.6.34

2010-02-12 Thread Jason Wessel
Patch set 2 of 3 - The kdb / kgdb merge This patch set stacks on top of the kgdb / kdb patches and focuses on further extending kdb to accommodate atomic kernel mode setting (kms). At the moment only the Intel i915 class video devices are supported, but the API is generic and would allow for othe

[Kgdb-bugreport] [PATCH 26/28] kdb, panic, debug_core: Allow the debug core to receive a panic before smp_send_stop()

2010-02-12 Thread Jason Wessel
It is highly desirable to trap into kdb on panic, and in order to do so the notifier must be called before smp_send_stop(), else the debug_core will not be able to correctly trap all the CPUs. CC: Ingo Molnar CC: Andrew Morton Signed-off-by: Jason Wessel --- kernel/debug/debug_core.c | 18 ++

[Kgdb-bugreport] [PATCH 22/28] printk, kdb: capture printk() when in kdb shell

2010-02-12 Thread Jason Wessel
Certain calls from the kdb shell will call out to printk(), and any of these calls should get vectored back to the kdb_printf() so that the kdb pager and processing can be used, as well as to properly channel I/O to the polled I/O devices. CC: Randy Dunlap CC: Andrew Morton Signed-off-by: Jason

[Kgdb-bugreport] [PATCH 18/28] powerpc, kgdb: Introduce low level trap catching

2010-02-12 Thread Jason Wessel
The only way the debugger can handle a trap in inside rcu_lock, notify_die, or atomic_notifier_call_chain without a recursive fault is to have a low level "first opportunity handler" low level program_check_exception() handler. The other change here is to make sure that kgdb_handle_exception() is

[Kgdb-bugreport] [PATCH 27/28] kgdbts, sh: Add in breakpoint pc offset for superh

2010-02-12 Thread Jason Wessel
The kgdb test suite mimics the behavior of gdb. For the sh architecture the pc must be decremented by 2 for software breakpoint. Signed-off-by: Jason Wessel Acked-by: Paul Mundt --- drivers/misc/kgdbts.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/misc

[Kgdb-bugreport] [PATCH 28/28] debug_core: Turn off tracing while in the debugger

2010-02-12 Thread Jason Wessel
The kernel debugger should turn off kernel tracing any time the debugger is active and restore it on resume. CC: Steven Rostedt Signed-off-by: Jason Wessel --- kernel/debug/debug_core.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/kernel/debug/debug_core.c b/k

[Kgdb-bugreport] [PATCH 19/28] mips, kgdb: kdb low level trap catch and stack trace

2010-02-12 Thread Jason Wessel
The only way the debugger can handle a trap in inside rcu_lock, notify_die, or atomic_notifier_call_chain without a recursive fault is to have a low level "first opportunity handler" do_trap_or_bp() handler. Generally this will be something the vast majority of folks will not need, but for those w

[Kgdb-bugreport] [PATCH 21/28] kgdboc, kdb: Allow kdb to work on a non open console port

2010-02-12 Thread Jason Wessel
If kdb is open on a serial port that is not actually a console make sure to call the poll routines to emit and receive characters. Signed-off-by: Jason Wessel --- drivers/serial/kgdboc.c | 14 ++ include/linux/kgdb.h |3 +++ kernel/debug/kdb/kdb_io.c | 16 +

[Kgdb-bugreport] [PATCH 24/28] debug_core, kdb: Allow the debug core to process a recursive debug entry

2010-02-12 Thread Jason Wessel
This allows kdb to debug a crash with in the kms code with a single level recursive re-entry. Signed-off-by: Jason Wessel --- kernel/debug/debug_core.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index ef46a

[Kgdb-bugreport] [PATCH 23/28] keyboard, input: Add hook to input to allow low level event clear

2010-02-12 Thread Jason Wessel
When using a keyboard with kdb, on resuming the system there needs to be a hook to allow for the keyboard state to get reset. This is mainly because there is no way to force the end user to hold down the original keys that were pressed prior to entering kdb. CC: Dmitry Torokhov Signed-off-by: Ja

[Kgdb-bugreport] [PATCH 15/28] kgdb, docs: Update the kgdb docs to include kdb

2010-02-12 Thread Jason Wessel
Update the kgdb docs to reflect the new directory structure and API. Merge in the kdb shell information. Signed-off-by: Jason Wessel --- Documentation/DocBook/kgdb.tmpl | 640 ++- Documentation/kernel-parameters.txt |7 +- include/linux/kgdb.h

[Kgdb-bugreport] [PATCH 13/28] kgdb: gdb "monitor" -> kdb passthrough

2010-02-12 Thread Jason Wessel
One of the driving forces behind integrating another front end (kdb) to the debug core is to allow front end commands to be accessible via gdb's monitor command. It is true that you could write gdb macros to get certain data, but you may want to just use gdb to access the commands that are availab

[Kgdb-bugreport] [PATCH 16/28] kgdb: remove post_primary_code references

2010-02-12 Thread 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->

[Kgdb-bugreport] [PATCH 20/28] kgdb: Add the ability to schedule a breakpoint via a tasklet

2010-02-12 Thread Jason Wessel
Some kgdb I/O modules require the ability to create a breakpoint tasklet, such as kgdboc and external modules such as kgdboe. The breakpoint tasklet is used as an asynchronous entry point into the debugger which will have a different function scope than the current execution path where it might no

[Kgdb-bugreport] [PATCH 25/28] MAINTAINERS: update kgdb, kdb, and debug_core info

2010-02-12 Thread Jason Wessel
Update the maintained files sections. Signed-off-by: Jason Wessel --- MAINTAINERS |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 412eff6..b7b192a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3172,15 +3172,17 @@ S: Maintained

[Kgdb-bugreport] [PATCH 14/28] kgdboc, keyboard: Keyboard driver for kdb with kgdb

2010-02-12 Thread Jason Wessel
This patch adds in the kdb PS/2 keyboard driver. This was mostly a direct port from the original kdb where I cleaned up the code against checkpatch.pl and added the glue to stitch it into kgdb. This patch also enables early kdb debug via kgdbwait and the keyboard. All the access to configure kdb

[Kgdb-bugreport] [PATCH 09/28] kgdb: core changes to support kdb

2010-02-12 Thread 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 simp

[Kgdb-bugreport] [PATCH 17/28] x86,kgdb: Add low level debug hook

2010-02-12 Thread 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 thos

[Kgdb-bugreport] [PATCH 06/28] kgdb, blackfin: Add in kgdb_arch_set_pc for blackfin

2010-02-12 Thread Jason Wessel
The new debug core api requires all architectures that use to debug core to implement a function to set the program counter. CC: Mike Frysinger Signed-off-by: Jason Wessel Acked-by: Sonic Zhang --- arch/blackfin/kernel/kgdb.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff

[Kgdb-bugreport] [PATCH 0/28] kgdb, kdb proposed merge for 2.6.34

2010-02-12 Thread Jason Wessel
Patch set 1 of 3 - The kdb / kgdb merge This is 3rd and hopefully final kgdb/kdb series originally posted in December 2009. The next version will hopefully be a pull request to Linus, depending on any further feedback from the community. Thank you very much to everyone who provided feedback on t

[Kgdb-bugreport] [PATCH 08/28] kdb: core for kgdb back end (2 of 2)

2010-02-12 Thread Jason Wessel
This patch contains the hooks and instrumentation into kernel which live outside the kernel/debug directory, which the kdb core will call to run commands like lsmod, dmesg, bt etc... CC: m...@sgi.com CC: linux-a...@vger.kernel.org Signed-off-by: Jason Wessel --- arch/arm/include/asm/kmap_types.h

[Kgdb-bugreport] [PATCH 10/28] kgdb, 8250, pl011: Return immediately from console poll

2010-02-12 Thread Jason Wessel
The design of kdb required that every device that can provide input to kdb have a polling routine that exits immediately if there is no character available. This is required in order to get the page scrolling mechanism working, it is also a reasonable requirement for future kgdb I/O drivers becaus

[Kgdb-bugreport] [PATCH 11/28] sh, sh-sci: Use NO_POLL_CHAR in the SCIF polled console code

2010-02-12 Thread Jason Wessel
The sci_poll_get_char() needs to return immediately if there is no input from the chip to process, and must return a value of NO_POLL_CHAR. This allows kgdboc to process multiple polled devices while kgdb is active. Signed-off-by: Jason Wessel Acked-by: Paul Mundt --- drivers/serial/sh-sci.c |

[Kgdb-bugreport] [PATCH 12/28] sparc, sunzilog: Add console polling support for sunzilog serial driver

2010-02-12 Thread Jason Wessel
Allow kgdboc to work on sparc hardware with the Zilog serial chips. Signed-off-by: Jason Wessel Acked-by: David S. Miller --- drivers/serial/sunzilog.c | 50 + 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/drivers/serial/sunzilog.c

[Kgdb-bugreport] [PATCH 02/28] Separate the gdbstub from the debug core

2010-02-12 Thread Jason Wessel
Split the former kernel/kgdb.c into debug_core.c which contains the kernel debugger exception logic and to the gdbstub.c which contains the logic for allowing gdb to talk to the debug core. This also created a private include file called debug_core.h which contains all the definitions to glue the

[Kgdb-bugreport] [PATCH 05/28] kgdb, sh: update superh kgdb exception handling

2010-02-12 Thread Jason Wessel
Implement kgdb_arch_pc() which adjusts the pc if it needs to be adjusted after a software breakpoint trap. Implement kgdb_arch_set_pc() which is a new required function in the kgdb debug core. When processing a single step return zero in the error exception field so that the debug core can distin

[Kgdb-bugreport] [PATCH 04/28] kgdb, sparc: Add in kgdb_arch_set_pc for sparc

2010-02-12 Thread Jason Wessel
The new debug core api requires all architectures that use to debug core to implement a function to set the program counter. Signed-off-by: Jason Wessel Acked-by: David S. Miller --- arch/sparc/kernel/kgdb_32.c |6 ++ arch/sparc/kernel/kgdb_64.c |6 ++ 2 files changed, 12 insert

[Kgdb-bugreport] [PATCH 01/28] Move kernel/kgdb.c to kernel/debug/debug_core.c

2010-02-12 Thread Jason Wessel
Move kgdb.c in preparation for to separate the gdbstub from the debug core and exception handling.n CC: Ingo Molnar Signed-off-by: Jason Wessel --- kernel/Makefile |2 +- kernel/debug/Makefile |5 + kernel/{kgdb.c => debug/debug_core.c} |0

[Kgdb-bugreport] [PATCH 03/28] kgdb: eliminate kgdb_wait(), all cpus enter the same way

2010-02-12 Thread Jason Wessel
This is a kgdb architectural change to have all the cpus (master or slave) enter the same function. A cpu that hits an exception (wants to be the master cpu) will call kgdb_handle_exception() from the trap handler and then invoke a kgdb_roundup_cpu() to synchronize the other cpus and bring them in