x86,kgdb: Always initialize the hw breakpoint attribute
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]>
Signed-off-by Jason Wessel <[email protected]>
--- arch/x86/kernel/kgdb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
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 ; attr.bp_len =HW_BREAKPOINT_LEN_1 ;
Signature · 1 line
1.6.3.1.9.g95405b
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 onx86_64.CC Frederic Weisbecker <[email protected]>CC Ingo Molnar <[email protected]>Signed-off-by Jason Wessel <[email protected]>--- arch/x86/kernel/kgdb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/x86/kernel/kgdb.c +0
-0
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
-0attr.bp_len =HW_BREAKPOINT_LEN_1 ;Signature · 1 line
1.6.3.1.9.g95405b