Thread (7 messages) read the whole thread 7 messages, 1 author, 2014-02-19
STALE4547d REVIEWED: 2 (1M)

Revision v10 of 3 in this series; 2 review trailers (1 from subsystem maintainers).

Revisions (3)
  1. v7 [diff vs current]
  2. v9 [diff vs current]
  3. v10 current

[PATCH v10 4/6] KGDB: make kgdb_breakpoint() as noinline

From: vijay.kilari at gmail.com <hidden>
Date: 2014-02-19 04:35:39
Subsystem: kgdb / kdb /debug_core, the rest · Maintainers: Jason Wessel, Daniel Thompson, Linus Torvalds

From: Vijaya Kumar K <redacted>

The function kgdb_breakpoint() sets up break point at
compile time by calling arch_kgdb_breakpoint();
Though this call is surrounded by wmb() barrier,
the compile can still re-order the break point,
because this scheduling barrier is not a code motion
barrier in gcc.

Making kgdb_breakpoint() as noinline solves this problem
of code reording around break point instruction and also
avoids problem of being called as inline function from
other places

More details about discussion on this can be found here
http://comments.gmane.org/gmane.linux.ports.arm.kernel/269732

Signed-off-by: Vijaya Kumar K <redacted>
Acked-by: Will Deacon <redacted>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
---
 kernel/debug/debug_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 61d1d14..16ff807 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -1047,7 +1047,7 @@ int dbg_io_get_char(void)
  * otherwise as a quick means to stop program execution and "break" into
  * the debugger.
  */
-void kgdb_breakpoint(void)
+noinline void kgdb_breakpoint(void)
 {
 	atomic_inc(&kgdb_setting_breakpoint);
 	wmb(); /* Sync point before breakpoint */
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help