Commit d498d4b47fb3050f2f7840cc49251f87f04d1ca9

Authored by Vijaya Kumar K
Committed by Catalin Marinas
1 parent 44679a4f14

KGDB: make kgdb_breakpoint() as noinline

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 <Vijaya.Kumar@caviumnetworks.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

kernel/debug/debug_core.c
... ... @@ -1035,7 +1035,7 @@
1035 1035 * otherwise as a quick means to stop program execution and "break" into
1036 1036 * the debugger.
1037 1037 */
1038   -void kgdb_breakpoint(void)
  1038 +noinline void kgdb_breakpoint(void)
1039 1039 {
1040 1040 atomic_inc(&kgdb_setting_breakpoint);
1041 1041 wmb(); /* Sync point before breakpoint */