Skip to contentSkip to conversation

x86,kgdb: Always initialize the hw breakpoint attribute

PATCH In review Jason Wessel 2 participants 2 messages Mar 30, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86,kgdb: Always initialize the hw breakpoint attribute

It is required to call hw_breakpoint_init() on an attr before using it in any other calls. This fixes the problem where kgdb will sometimes fail to initialize on x86_64.

CC Frederic Weisbecker <[email protected]>
CC Ingo Molnar <[email protected]>
---
 arch/x86/kernel/kgdb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/kgdb.c +1 -0
index bfba601..d9adcde 100644
@@ -618,6 +618,7 @@ int kgdb_arch_init(void)
 	 * portion of kgdb because this operation requires mutexs to
 	 * complete.
 	 */
+	hw_breakpoint_init(&attr);
 	attr.bp_addr = (unsigned long)kgdb_arch_init;
 	attr.type = PERF_TYPE_BREAKPOINT;
 	attr.bp_len = HW_BREAKPOINT_LEN_1;
Signature · 1 line
1.6.3.1.9.g95405b
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Jason Wessel

It is required to call hw_breakpoint_init() on an attr before using it in any other calls. This fixes the problem where kgdb will sometimes fail to initialize on x86_64.

CC Frederic Weisbecker <[email protected]>
CC Ingo Molnar <[email protected]>
---
 arch/x86/kernel/kgdb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/kgdb.c +0 -0
index bfba601..d9adcde 100644

arch/x86/kernel/kgdb.c int kgdb_arch_init(void) · line 623

Quoted 6 lines
arch/x86/kernel/kgdb.c +1 -0
@@ -618,6 +618,7 @@ int kgdb_arch_init(void)
 	 * portion of kgdb because this operation requires mutexs to
 	 * complete.
 	 */
+	hw_breakpoint_init(&attr);
 	attr.bp_addr = (unsigned long)kgdb_arch_init;
 	attr.type = PERF_TYPE_BREAKPOINT;

Minor neat: In this case you don't need to set the type.

Quoted 4 lines
arch/x86/kernel/kgdb.c +0 -0
 	attr.bp_len = HW_BREAKPOINT_LEN_1;
Signature · 1 line
1.6.3.1.9.g95405b