* [GIT PULL] kgdb regression fixes for 2.6.35-rc5
@ 2010-07-22 0:36 Jason Wessel
2010-07-22 0:36 ` [PATCH 1/5] kdb: break out of kdb_ll() when command is terminated Jason Wessel
0 siblings, 1 reply; 6+ messages in thread
From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, kgdb-bugreport
Linus, please pull the for_linus branch for 2.6.35-rc5.
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_linus
The following patch set covers cleaning up problems that have been
found since the merge of kdb to the 2.6.35-rc1 kernel.
Thanks,
Jason.
---
Jason Wessel (4):
repair gdbstub to match the gdbserial protocol specification
Fix merge regression from external kdb to upstream kdb
debug_core,kdb: fix kgdb_connected bit set in the wrong place
sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function
Martin Hicks (1):
kdb: break out of kdb_ll() when command is terminated
drivers/char/sysrq.c | 2 +-
include/linux/sysrq.h | 1 +
kernel/debug/debug_core.c | 2 +-
kernel/debug/gdbstub.c | 9 +++------
kernel/debug/kdb/kdb_main.c | 7 +++++--
5 files changed, 11 insertions(+), 10 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/5] kdb: break out of kdb_ll() when command is terminated 2010-07-22 0:36 [GIT PULL] kgdb regression fixes for 2.6.35-rc5 Jason Wessel @ 2010-07-22 0:36 ` Jason Wessel 2010-07-22 0:36 ` [PATCH 2/5] repair gdbstub to match the gdbserial protocol specification Jason Wessel 0 siblings, 1 reply; 6+ messages in thread From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw) To: torvalds; +Cc: linux-kernel, kgdb-bugreport From: Martin Hicks <mort@sgi.com> Without this patch the "ll" linked-list traversal command won't terminate when you hit q/Q. Signed-off-by: Martin Hicks <mort@sgi.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> --- kernel/debug/kdb/kdb_main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 184cd82..a7fe2e9 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -2291,6 +2291,9 @@ static int kdb_ll(int argc, const char **argv) while (va) { char buf[80]; + if (KDB_FLAG(CMD_INTERRUPT)) + return 0; + sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va); diag = kdb_parse(buf); if (diag) -- 1.6.3.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/5] repair gdbstub to match the gdbserial protocol specification 2010-07-22 0:36 ` [PATCH 1/5] kdb: break out of kdb_ll() when command is terminated Jason Wessel @ 2010-07-22 0:36 ` Jason Wessel 2010-07-22 0:36 ` [PATCH 3/5] Fix merge regression from external kdb to upstream kdb Jason Wessel 0 siblings, 1 reply; 6+ messages in thread From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw) To: torvalds; +Cc: linux-kernel, kgdb-bugreport The gdbserial protocol handler should return an empty packet instead of an error string when ever it responds to a command it does not implement. The problem cases come from a debugger client sending qTBuffer, qTStatus, qSearch, qSupported. The incorrect response from the gdbstub leads the debugger clients to not function correctly. Recent versions of gdb will not detach correctly as a result of this behavior. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com> --- kernel/debug/gdbstub.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c index 4b17b32..e8fd686 100644 --- a/kernel/debug/gdbstub.c +++ b/kernel/debug/gdbstub.c @@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks) switch (remcom_in_buffer[1]) { case 's': case 'f': - if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) { - error_packet(remcom_out_buffer, -EINVAL); + if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) break; - } i = 0; remcom_out_buffer[0] = 'm'; @@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks) pack_threadid(remcom_out_buffer + 2, thref); break; case 'T': - if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) { - error_packet(remcom_out_buffer, -EINVAL); + if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) break; - } + ks->threadid = 0; ptr = remcom_in_buffer + 17; kgdb_hex2long(&ptr, &ks->threadid); -- 1.6.3.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/5] Fix merge regression from external kdb to upstream kdb 2010-07-22 0:36 ` [PATCH 2/5] repair gdbstub to match the gdbserial protocol specification Jason Wessel @ 2010-07-22 0:36 ` Jason Wessel 2010-07-22 0:36 ` [PATCH 4/5] debug_core,kdb: fix kgdb_connected bit set in the wrong place Jason Wessel 0 siblings, 1 reply; 6+ messages in thread From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw) To: torvalds; +Cc: linux-kernel, kgdb-bugreport In the process of merging kdb to the mainline, the kdb lsmod command stopped printing the base load address of kernel modules. This is needed for using kdb in conjunction with external tools such as gdb. Simply restore the functionality by adding a kdb_printf for the base load address of the kernel modules. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> --- kernel/debug/kdb/kdb_main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index a7fe2e9..7e9bfd5 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -1883,6 +1883,7 @@ static int kdb_lsmod(int argc, const char **argv) kdb_printf(" (Loading)"); else kdb_printf(" (Live)"); + kdb_printf(" 0x%p", mod->module_core); #ifdef CONFIG_MODULE_UNLOAD { -- 1.6.3.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/5] debug_core,kdb: fix kgdb_connected bit set in the wrong place 2010-07-22 0:36 ` [PATCH 3/5] Fix merge regression from external kdb to upstream kdb Jason Wessel @ 2010-07-22 0:36 ` Jason Wessel 2010-07-22 0:36 ` [PATCH 5/5] sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function Jason Wessel 0 siblings, 1 reply; 6+ messages in thread From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw) To: torvalds; +Cc: linux-kernel, kgdb-bugreport Immediately following an exit from the kdb shell the kgdb_connected variable should be set to zero, unless there are breakpoints planted. If the kgdb_connected variable is not zeroed out with kdb, it is impossible to turn off kdb. This patch is merely a work around for now, the real fix will check for the breakpoints. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> --- kernel/debug/debug_core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 5cb7cd1..8bc5eef 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -605,13 +605,13 @@ cpu_master_loop: if (dbg_kdb_mode) { kgdb_connected = 1; error = kdb_stub(ks); + kgdb_connected = 0; } else { error = gdb_serial_stub(ks); } if (error == DBG_PASS_EVENT) { dbg_kdb_mode = !dbg_kdb_mode; - kgdb_connected = 0; } else if (error == DBG_SWITCH_CPU_EVENT) { dbg_cpu_switch(cpu, dbg_switch_cpu); goto cpu_loop; -- 1.6.3.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/5] sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function 2010-07-22 0:36 ` [PATCH 4/5] debug_core,kdb: fix kgdb_connected bit set in the wrong place Jason Wessel @ 2010-07-22 0:36 ` Jason Wessel 0 siblings, 0 replies; 6+ messages in thread From: Jason Wessel @ 2010-07-22 0:36 UTC (permalink / raw) To: torvalds; +Cc: linux-kernel, kgdb-bugreport The kdb code should not toggle the sysrq state in case an end user wants to try and resume the normal kernel execution. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/char/sysrq.c | 2 +- include/linux/sysrq.h | 1 + kernel/debug/kdb/kdb_main.c | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5d64e3a..878ac0c 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) sysrq_key_table[i] = op_p; } -static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) +void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) { struct sysrq_key_op *op_p; int orig_log_level; diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 4496322..609e8ca 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h @@ -45,6 +45,7 @@ struct sysrq_key_op { */ void handle_sysrq(int key, struct tty_struct *tty); +void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); int register_sysrq_key(int key, struct sysrq_key_op *op); int unregister_sysrq_key(int key, struct sysrq_key_op *op); struct sysrq_key_op *__sysrq_get_key_op(int key); diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 7e9bfd5..ebe4a28 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char **argv) { if (argc != 1) return KDB_ARGCOUNT; - sysrq_toggle_support(1); kdb_trap_printk++; - handle_sysrq(*argv[1], NULL); + __handle_sysrq(*argv[1], NULL, 0); kdb_trap_printk--; return 0; -- 1.6.3.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-07-22 0:38 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-07-22 0:36 [GIT PULL] kgdb regression fixes for 2.6.35-rc5 Jason Wessel 2010-07-22 0:36 ` [PATCH 1/5] kdb: break out of kdb_ll() when command is terminated Jason Wessel 2010-07-22 0:36 ` [PATCH 2/5] repair gdbstub to match the gdbserial protocol specification Jason Wessel 2010-07-22 0:36 ` [PATCH 3/5] Fix merge regression from external kdb to upstream kdb Jason Wessel 2010-07-22 0:36 ` [PATCH 4/5] debug_core,kdb: fix kgdb_connected bit set in the wrong place Jason Wessel 2010-07-22 0:36 ` [PATCH 5/5] sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function Jason Wessel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®