[Kgdb-bugreport] [PATCH 02/37] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpoint API

2009-12-23 Thread 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

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

2009-12-23 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

[Kgdb-bugreport] [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series

2009-12-23 Thread Jason Wessel
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

[Kgdb-bugreport] [PATCH 01/37] softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume

2009-12-23 Thread Jason Wessel
When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set sched_clock() gets the time from hardware, such as from TSC. In this configuration kgdb will report a softlock warning messages on resuming or detaching from a debug session. Sequence of events in the problem case: 1) cpu sched clock and hardware

[Kgdb-bugreport] [PATCH 03/37] Move kernel/kgdb.c to kernel/debug/debug_core.c

2009-12-23 Thread Jason Wessel
Move kgdb.c in preparation for to separate the gdbstub from the debug core and exception handling.n CC: Ingo Molnar mi...@elte.hu Signed-off-by: Jason Wessel jason.wes...@windriver.com --- kernel/Makefile |2 +- kernel/debug/Makefile |5 +

[Kgdb-bugreport] [PATCH 08/37] kgdb, sh: update superh kgdb exception handling

2009-12-23 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

[Kgdb-bugreport] [PATCH 16/37] kgdb: gdb monitor - kdb passthrough

2009-12-23 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

[Kgdb-bugreport] [PATCH 12/37] kgdb: core changes to support kdb

2009-12-23 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

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

2009-12-23 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

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

2009-12-23 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 those

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

2009-12-23 Thread Jason Wessel
Update the maintained files sections. Signed-off-by: Jason Wessel jason.wes...@windriver.com --- MAINTAINERS |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index d5244f1..98b2669 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3177,15

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

2009-12-23 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. CC: Jesse Barnes jbar...@virtuousgeek.org Signed-off-by: Jason Wessel jason.wes...@windriver.com --- drivers/serial/kgdboc.c | 15 +++

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

2009-12-23 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 jason.wes...@windriver.com --- drivers/serial/kgdboc.c | 14 ++ include/linux/kgdb.h |3 +++

[Kgdb-bugreport] [PATCH 31/37] kgdb: add ops arg to kgdb console active restore hooks

2009-12-23 Thread Jason Wessel
From: Jesse Barnes jbar...@virtuousgeek.org This allows callers to store the ops structure in a parent device structure. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org Signed-off-by: Jason Wessel jason.wes...@windriver.com --- drivers/serial/kgdboc.c |4 ++-- include/linux/kgdb.h|

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

2009-12-23 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

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

2009-12-23 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 28/37] kdb, panic, debug_core: Allow the debug core to receive a panic before smp_send_stop()

2009-12-23 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 mi...@elte.hu CC: Andrew Morton a...@linux-foundation.org Signed-off-by: Jason Wessel

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

2009-12-23 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. CC: Paul Mundt let...@linux-sh.org Signed-off-by: Jason Wessel

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

2009-12-23 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 jason.wes...@windriver.com --- kernel/debug/debug_core.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/kernel/debug/debug_core.c

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

2009-12-23 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

[Kgdb-bugreport] [PATCH 20/37] arm, kgdb: Add hook to catch an oops with debugger

2009-12-23 Thread Jason Wessel
Add in a low level hook to catch calls to die() in the debugger. After the debugger is done, the standard system rules will be in play for the original exception. The kdb debugger wants a chance to catch these sorts of exceptions for analysis. CC: Russell King li...@arm.linux.org.uk

[Kgdb-bugreport] [PATCH 18/37] kgdb: remove post_primary_code references

2009-12-23 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

[Kgdb-bugreport] [PATCH 04/37] Separate the gdbstub from the debug core

2009-12-23 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 22/37] mips, kgdb: kdb low level trap catch and stack trace

2009-12-23 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

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

2009-12-23 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

[Kgdb-bugreport] [PATCH 09/37] kgdb, blackfin: Add in kgdb_arch_set_pc for blackfin

2009-12-23 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 vap...@gentoo.org Signed-off-by: Jason Wessel jason.wes...@windriver.com --- arch/blackfin/kernel/kgdb.c |5 + 1 files changed, 5 insertions(+),

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

2009-12-23 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 randy.dun...@oracle.com CC: Andrew

[Kgdb-bugreport] [PATCH 11/37] kgdb: Fix kernel-doc format error in kgdb.h

2009-12-23 Thread Jason Wessel
From: Randy Dunlap randy.dun...@oracle.com linux-next-20081022//include/linux/kgdb.h:308): duplicate section name 'Description' and fix typos in that file's kernel-doc comments. Signed-off-by: Randy Dunlap randy.dun...@oracle.com Signed-off-by: Andrew Morton a...@linux-foundation.org

[Kgdb-bugreport] [PATCH 35/37] drm_fb_helper: Preserve capability to use atomic kms

2009-12-23 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.

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

2009-12-23 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 37/37] kgdbts, sh: Add in breakpoint pc offset for superh

2009-12-23 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. CC: Paul Mundt let...@linux-sh.org Signed-off-by: Jason Wessel jason.wes...@windriver.com --- drivers/misc/kgdbts.c |6 ++ 1 files changed, 6 insertions(+), 0

[Kgdb-bugreport] [PATCH 36/37] drm,i915 - atomic mutex hacks

2009-12-23 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. CC: Jesse Barnes jbar...@virtuousgeek.org CC: David Airlie airl...@linux.ie Signed-off-by: Jason Wessel jason.wes...@windriver.com ---

Re: [Kgdb-bugreport] [PATCH 07/37] kgdb, sparc: Add in kgdb_arch_set_pc for sparc

2009-12-23 Thread David Miller
From: Jason Wessel jason.wes...@windriver.com Date: Wed, 23 Dec 2009 15:19:20 -0600 +void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) +{ + regs-pc = regs-npc; + regs-npc = ip; +} + Is this right? It should probably be something like: + regs-pc = ip; +

Re: [Kgdb-bugreport] [PATCH 15/37] sparc, sunzilog: Add console polling support for sunzilog serial driver

2009-12-23 Thread David Miller
From: Jason Wessel jason.wes...@windriver.com Date: Wed, 23 Dec 2009 15:19:28 -0600 +static void sunzilog_put_poll_char(struct uart_port *port, + unsigned char ch) +{ + struct uart_sunzilog_port *up = (struct uart_sunzilog_port *)port; + +

Re: [Kgdb-bugreport] [PATCH 15/37] sparc, sunzilog: Add console polling support for sunzilog serial driver

2009-12-23 Thread Jason Wessel
David Miller wrote: From: Jason Wessel jason.wes...@windriver.com Date: Wed, 23 Dec 2009 15:19:28 -0600 +static void sunzilog_put_poll_char(struct uart_port *port, +unsigned char ch) +{ +struct uart_sunzilog_port *up = (struct uart_sunzilog_port *)port; + +

Re: [Kgdb-bugreport] [PATCH 07/37] kgdb, sparc: Add in kgdb_arch_set_pc for sparc

2009-12-23 Thread Jason Wessel
David Miller wrote: From: Jason Wessel jason.wes...@windriver.com Date: Wed, 23 Dec 2009 15:19:20 -0600 +void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) +{ + regs-pc = regs-npc; + regs-npc = ip; +} + Is this right? It should probably be something

Re: [Kgdb-bugreport] [PATCH 05/37] kdb: core for kgdb back end

2009-12-23 Thread Andi Kleen
Jason Wessel jason.wes...@windriver.com writes: I remember going with kaos through all the code outside kdb/ in his own patch and for nearly all hooks outside we found some way to eliminate them. I think a lot of this is here too. +#ifdef CONFIG_KGDB_KDB +/* Like meminfo_proc_show()

Re: [Kgdb-bugreport] [PATCH 0/37] kgdb, kdb and atomic kernel modesetting series

2009-12-23 Thread Jason Wessel
Greg KH wrote: On Wed, Dec 23, 2009 at 03:19:13PM -0600, Jason Wessel wrote: 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

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

2009-12-23 Thread Paul Mundt
On Wed, Dec 23, 2009 at 03:43:04PM -0600, Jason Wessel wrote: The kgdb test suite mimics the behavior of gdb. For the sh architecture the pc must be decremented by 2 for software breakpoint. CC: Paul Mundt let...@linux-sh.org Signed-off-by: Jason Wessel jason.wes...@windriver.com ---

Re: [Kgdb-bugreport] [PATCH 07/37] kgdb, sparc: Add in kgdb_arch_set_pc for sparc

2009-12-23 Thread David Miller
From: Jason Wessel jason.wes...@windriver.com Date: Wed, 23 Dec 2009 17:04:11 -0600 This fix and the other fix you asked about are both in kgdb-next which feeds into linux-next, if you are ultimately ok with the changes, I'll add an ack from you as well. Feel free to add it: Acked-by: David

[Kgdb-bugreport] Using kgdb to debug kernel modules

2009-12-23 Thread Grigory Makarevich
Dear All, I was trying to debug loadable linux kernel modules using standard setup environment. It is x86_64, Kernel - 2.6.32, gdb - 6.8.29 (the same with 7.0 and even gdbmod which is based on 6.4). While it was complete success to debug kernel itself, debugging the module is not - I was able to

Re: [Kgdb-bugreport] [PATCH 14/37] sh, sh-sci: Use NO_POLL_CHAR in the SCIF polled console code

2009-12-23 Thread Paul Mundt
On Wed, Dec 23, 2009 at 03:19:27PM -0600, Jason Wessel wrote: 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. CC: Paul

Re: [Kgdb-bugreport] [PATCH 08/37] kgdb, sh: update superh kgdb exception handling

2009-12-23 Thread Paul Mundt
On Wed, Dec 23, 2009 at 03:19:21PM -0600, Jason Wessel wrote: 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