kgdb/kdb fixes for 2.6.36-rc1
Subsystems (4)
Jason Wessel
maintainerLinus, please pull the for_linus branch which contains:
* Fixes for compilation/warning errors since the kdb/kms merge
* 1 run time fix for atomic kms where console_blanked was not saved
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_lin us
Thanks,
Jason.
---
The following changes since commit da5cabf80e2433131bf0ed8993abc0f7ea618c73:
Linus Torvalds (1):
Linux 2.6.36-rc1
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_lin
us
Eric Miao (1):
arm,kgdb: fix GDB_MAX_REGS no longer used
Jason Wessel (3):
kdb: fix compile error without CONFIG_KALLSYMS
vt: fix regression warnings from KMS merge vt,console,kdb: preserve console_blanked while in kdb
Namhyung Kim (1):
kgdb: add missing __percpu markup in arch/x86/kernel/kgdb.c
arch/arm/kernel/kgdb.c | 2 +- arch/x86/kernel/kgdb.c | 2 +- drivers/char/vt.c | 11 +++++++---- kernel/debug/kdb/kdb_private.h | 7 +++++++ kernel/debug/kdb/kdb_support.c | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-)
Jason Wessel
maintainerPATCH 1/5 kdb: fix compile error without CONFIG_KALLSYMS
If CONFIG_KGDB_KDB is set and CONFIG_KALLSYMS is not set the kernel will fail to build with the error:
kernel/built-in.o: In function `kallsyms_symbol_next':kernel/debug/kdb/kdb_support.c:237: undefined reference to kdb_walk_kallsyms' kernel/built-in.o: In function kallsyms_symbol_complete':kernel/debug/kdb/kdb_support.c:193: undefined reference to `kdb_walk_kallsyms'
The kdb_walk_kallsyms needs a #ifdef proper header to match the C implementation. This patch also fixes the compiler warnings in kdb_support.c when compiling without CONFIG_KALLSYMS set. The compiler warnings are a result of the kallsyms_lookup() macro not initializing the two of the pass by reference variables.
--- kernel/debug/kdb/kdb_private.h | 7 +++++++ kernel/debug/kdb/kdb_support.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-)
kernel/debug/kdb/kdb_private.h +7 -0
@@ -255,7 +255,14 @@ extern void kdb_ps1(const struct task_struct *p);extern void kdb_print_nameval (const char *name,unsigned long val);extern void kdb_send_sig_info (struct task_struct *p,struct siginfo *info);extern void kdb_meminfo_proc_show (void ); +#ifdef CONFIG_KALLSYMS extern const char *kdb_walk_kallsyms (loff_t *pos); +#else /* ! CONFIG_KALLSYMS */ +static inline const char *kdb_walk_kallsyms (loff_t *pos) +{ +return NULL ; +} +#endif /* ! CONFIG_KALLSYMS */ extern char *kdb_getstr (char *,size_t ,char *);/* Defines for kdb_symbol_print */
kernel/debug/kdb/kdb_support.c +2 -2
@@ -82,8 +82,8 @@ static char *kdb_name_table[100]; /* arbitrary size */int kdbnearsym (unsigned long addr,kdb_symtab_t *symtab) {int ret =0 ; -unsigned long symbolsize; -unsigned long offset; +unsigned long symbolsize =0 ; +unsigned long offset =0 ;#define knt1_size 128/* must be >= kallsyms table size */ char *knt1 =NULL ;
Signature · 1 line
1.6.3.3
Jason Wessel
maintainerPATCH 2/5 kgdb: add missing __percpu markup in arch/x86/kernel/kgdb.c
From: Namhyung Kim <[email protected]>
breakinfo->pev is a pointer to percpu pointer but was missing __percpu markup. Add it.
--- arch/x86/kernel/kgdb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/kgdb.c +1 -1
@@ -194,7 +194,7 @@ static struct hw_breakpoint {unsigned long addr;int len;int type; -struct perf_event **pev; +struct perf_event *__percpu *pev; } breakinfo[HBP_NUM ];static unsigned long early_dr7;
Signature · 1 line
1.6.3.3
Jason Wessel
maintainerPATCH 3/5 arm,kgdb: fix GDB_MAX_REGS no longer used
From: Eric Miao <[email protected]>
According to commit 22eeef4bb2a7fd225089c0044060ed1fbf091958
kgdb,arm: Individual register get/set for arm
It's now replaced by DBG_MAX_REG_NUM.
--- arch/arm/kernel/kgdb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/kgdb.c +1 -1
@@ -79,7 +79,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)return ;/* Initialize to zero */ -for (regno =0 ; regno <GDB_MAX_REGS ; regno++) +for (regno =0 ; regno <DBG_MAX_REG_NUM ; regno++) gdb_regs[regno] =0 ;/* Otherwise, we have only some registers from switch_to() */
Signature · 1 line
1.6.3.3
Jason Wessel
maintainerPATCH 4/5 vt: fix regression warnings from KMS merge
Fix the following new sparse warnings in vt.c introduced by the commit b45cfba4e9005d64d419718e7ff7f7cab44c1994 (vt,console,kdb: implement atomic console enter/leave functions):
drivers/char/vt.c:197:5: warning: symbol 'saved_fg_console' was not declared. Should it be static? drivers/char/vt.c:198:5: warning: symbol 'saved_last_console' was not declared. Should it be static? drivers/char/vt.c:199:5: warning: symbol 'saved_want_console' was not declared. Should it be static? drivers/char/vt.c:200:5: warning: symbol 'saved_vc_mode' was not declared. Should it be static?
--- drivers/char/vt.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/char/vt.c +4 -4
@@ -194,10 +194,10 @@ static DECLARE_WORK(console_work, console_callback);int fg_console;int last_console;int want_console =-1 ; -int saved_fg_console; -int saved_last_console; -int saved_want_console; -int saved_vc_mode; +static int saved_fg_console; +static int saved_last_console; +static int saved_want_console; +static int saved_vc_mode;/* * For each existing display, we have a pointer to console currently visible
Signature · 1 line
1.6.3.3
Jason Wessel
maintainerPATCH 5/5 vt,console,kdb: preserve console_blanked while in kdb
Commit b45cfba4e9005d64d419718e7ff7f7cab44c1994 (vt,console,kdb:
implement atomic console enter/leave functions) introduced the ability to atomically change the console mode with kernel mode setting but did not preserve the state of the console_blanked variable.
The console_blanked variable must be restored when executing the con_debug_leave() or further kernel mode set changes (such as using chvt X) will fail to correctly set the state of console.
--- drivers/char/vt.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/char/vt.c +3 -0
@@ -198,6 +198,7 @@ static int saved_fg_console;static int saved_last_console;static int saved_want_console;static int saved_vc_mode; +static int saved_console_blanked;/* * For each existing display, we have a pointer to console currently visible
@@ -3449,6 +3450,7 @@ int con_debug_enter(struct vc_data *vc) saved_last_console = last_console; saved_want_console = want_console; saved_vc_mode = vc->vc_mode; + saved_console_blanked = console_blanked; vc->vc_mode =KD_TEXT ; console_blanked =0 ;if (vc->vc_sw->con_debug_enter)
@@ -3492,6 +3494,7 @@ int con_debug_leave(void) fg_console = saved_fg_console; last_console = saved_last_console; want_console = saved_want_console; + console_blanked = saved_console_blanked; vc_cons[fg_console].d->vc_mode = saved_vc_mode; vc = vc_cons[fg_console].d;
Signature · 1 line
1.6.3.3