From 684b8232503663df365bb58f79f823c62e96e83c Mon Sep 17 00:00:00 2001 From: t_jeang Date: Tue, 6 Jan 2009 12:06:06 +0000 Subject: [PATCH] imported patch kdb-fixes --- arch/i386/kdb/kdba_io.c | 4 ---- arch/i386/kernel/traps-xen.c | 19 +++++++++++++++---- arch/x86_64/kdb/kdba_io.c | 4 ---- kdb/kdbmain.c | 11 ++++++++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/arch/i386/kdb/kdba_io.c b/arch/i386/kdb/kdba_io.c index 35faeafd..b2709a5c 100644 --- a/arch/i386/kdb/kdba_io.c +++ b/arch/i386/kdb/kdba_io.c @@ -30,11 +30,7 @@ #include #endif -#ifdef CONFIG_VT_CONSOLE -#define KDB_BLINK_LED 1 -#else #undef KDB_BLINK_LED -#endif #ifdef CONFIG_KDB_USB struct kdb_usb_exchange kdb_usb_infos; diff --git a/arch/i386/kernel/traps-xen.c b/arch/i386/kernel/traps-xen.c index 6e77ae2e..ccac68a9 100644 --- a/arch/i386/kernel/traps-xen.c +++ b/arch/i386/kernel/traps-xen.c @@ -370,15 +370,26 @@ static void handle_BUG(struct pt_regs *regs) printk(KERN_EMERG "------------[ cut here ]------------\n"); #ifdef CONFIG_DEBUG_BUGVERBOSE do { + unsigned char ljmp; unsigned short line; char *file; char c; - if (__get_user(line, (unsigned short __user *)(eip + 2))) + if (__get_user(ljmp, (unsigned char __user *)(eip + 2))) + break; + if (ljmp == 0xea) { + if (__get_user(line, (unsigned short __user *)(eip + 7))) + break; + if (__get_user(file, (char * __user *)(eip + 3))) + break; + } else { + if (__get_user(line, (unsigned short __user *)(eip + 2))) + break; + if (__get_user(file, (char * __user *)(eip + 4))) + break; + } + if ((unsigned long)file < PAGE_OFFSET || __get_user(c, file)) break; - if (__get_user(file, (char * __user *)(eip + 4)) || - (unsigned long)file < PAGE_OFFSET || __get_user(c, file)) - file = ""; printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line); return; diff --git a/arch/x86_64/kdb/kdba_io.c b/arch/x86_64/kdb/kdba_io.c index 2fe3761d..769a514e 100644 --- a/arch/x86_64/kdb/kdba_io.c +++ b/arch/x86_64/kdb/kdba_io.c @@ -30,11 +30,7 @@ #include #endif -#ifdef CONFIG_VT_CONSOLE -#define KDB_BLINK_LED 1 -#else #undef KDB_BLINK_LED -#endif #ifdef CONFIG_KDB_USB struct kdb_usb_exchange kdb_usb_infos; diff --git a/kdb/kdbmain.c b/kdb/kdbmain.c index 3168006a..f45affbe 100644 --- a/kdb/kdbmain.c +++ b/kdb/kdbmain.c @@ -3852,11 +3852,16 @@ kdb_cmd_init(void) { int i, diag; for (i = 0; kdb_cmds[i]; ++i) { - if (!defcmd_in_progress) - kdb_printf("kdb_cmd[%d]: %s", i, kdb_cmds[i]); + if (!defcmd_in_progress) { + /* Use printk as kdb_printf writes to all consoles bypassing loglevel + * checks, and we don't want this stuff appearing in the console at boot + * time unless something goes wrong + */ + printk(KERN_DEBUG "kdb_cmd[%d]: %s", i, kdb_cmds[i]); + } diag = kdb_parse(kdb_cmds[i], NULL); if (diag) - kdb_printf("command failed, kdb diag %d\n", diag); + kdb_printf("kdb_cmd[%d]: command %s failed, kdb diag %d", i, kdb_cmds[i], diag); } if (defcmd_in_progress) { kdb_printf("Incomplete 'defcmd' set, forcing endefcmd\n"); -- 2.39.5