ftrace.c (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) ftrace.c (f2cc020d7876de7583feb52ec939a32419cf9468)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2008 Matt Fleming <matt@console-pimps.org>
4 * Copyright (C) 2008 Paul Mundt <lethal@linux-sh.org>
5 *
6 * Code for replacing ftrace calls with jumps.
7 *
8 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>

--- 53 unchanged lines hidden (view full) ---

62 */
63 return ftrace_replaced_code;
64}
65
66/*
67 * Modifying code must take extra care. On an SMP machine, if
68 * the code being modified is also being executed on another CPU
69 * that CPU will have undefined results and possibly take a GPF.
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2008 Matt Fleming <matt@console-pimps.org>
4 * Copyright (C) 2008 Paul Mundt <lethal@linux-sh.org>
5 *
6 * Code for replacing ftrace calls with jumps.
7 *
8 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>

--- 53 unchanged lines hidden (view full) ---

62 */
63 return ftrace_replaced_code;
64}
65
66/*
67 * Modifying code must take extra care. On an SMP machine, if
68 * the code being modified is also being executed on another CPU
69 * that CPU will have undefined results and possibly take a GPF.
70 * We use kstop_machine to stop other CPUS from exectuing code.
70 * We use kstop_machine to stop other CPUS from executing code.
71 * But this does not stop NMIs from happening. We still need
72 * to protect against that. We separate out the modification of
73 * the code to take care of this.
74 *
75 * Two buffers are added: An IP buffer and a "code" buffer.
76 *
77 * 1) Put the instruction pointer into the IP buffer
78 * and the new code into the "code" buffer.

--- 292 unchanged lines hidden ---
71 * But this does not stop NMIs from happening. We still need
72 * to protect against that. We separate out the modification of
73 * the code to take care of this.
74 *
75 * Two buffers are added: An IP buffer and a "code" buffer.
76 *
77 * 1) Put the instruction pointer into the IP buffer
78 * and the new code into the "code" buffer.

--- 292 unchanged lines hidden ---