]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - arch/x86/kernel/traps.c
ftrace/x86: Have arch x86_64 use breakpoints instead of stop machine
authorSteven Rostedt <srostedt@redhat.com>
Tue, 16 Aug 2011 13:57:10 +0000 (09:57 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Sat, 28 Apr 2012 01:10:44 +0000 (21:10 -0400)
commit08d636b6d4fb80647fe8869ea1cd97b2c26a4751
treeeb85c37e3a67e1c21df9b82e2d302d5d1899343a
parent438ced1720b584000a9e8a4349d1f6bb7ee3ad6d
ftrace/x86: Have arch x86_64 use breakpoints instead of stop machine

This method changes x86 to add a breakpoint to the mcount locations
instead of calling stop machine.

Now that iret can be handled by NMIs, we perform the following to
update code:

1) Add a breakpoint to all locations that will be modified

2) Sync all cores

3) Update all locations to be either a nop or call (except breakpoint
   op)

4) Sync all cores

5) Remove the breakpoint with the new code.

6) Sync all cores

[
  Added updates that Masami suggested:
   Use unlikely(modifying_ftrace_code) in int3 trap to keep kprobes efficient.
   Don't use NOTIFY_* in ftrace handler in int3 as it is not a notifier.
]

Cc: H. Peter Anvin <hpa@zytor.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/include/asm/ftrace.h
arch/x86/kernel/ftrace.c
arch/x86/kernel/traps.c
include/linux/ftrace.h