Skip to contentSkip to conversation

x86,kgdb: Always initialize the hw breakpoint attribute

PATCH Applied Jason Wessel 2 participants 3 messages Mar 30, 2010 – Apr 2, 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.

---
 arch/x86/kernel/kgdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/kgdb.c +1 -1
index bfba601..b2258ca 100644
@@ -618,8 +618,8 @@ 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;
 	attr.bp_type = HW_BREAKPOINT_W;
 	attr.disabled = 1;
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 8 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.

Queued for perf/urgent, thanks!

Quoted 21 lines
---
 arch/x86/kernel/kgdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/kgdb.c +1 -1
index bfba601..b2258ca 100644
@@ -618,8 +618,8 @@ 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;
 	attr.bp_type = HW_BREAKPOINT_W;
 	attr.disabled = 1;
Signature · 1 line
1.5.4.3
#2 lore raw
In reply to Jason Wessel
Commit-ID:  ab310b5edb8b601bcb02491ed6f7676da4fd1757
Gitweb:     http://git.kernel.org/tip/ab310b5edb8b601bcb02491ed6f7676da4fd1757
Author:     Jason Wessel <[email protected]>
AuthorDate: Tue, 30 Mar 2010 14:05:07 -0500
Committer:  Frederic Weisbecker <[email protected]>
CommitDate: Thu, 1 Apr 2010 08:26:32 +0200

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.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/kgdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/kgdb.c +1 -1
index bfba601..b2258ca 100644
@@ -618,8 +618,8 @@ 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;
 	attr.bp_type = HW_BREAKPOINT_W;
 	attr.disabled = 1;