diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-30 20:29:29 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-09-05 09:31:32 -0400 |
commit | af058ab04d3d11383e5159132fc78a3700be3af5 (patch) | |
tree | de93ea2d0b82f679cafb788444ed91e127abcf48 | |
parent | 59338f754a55f07857342dbcd81652a4f091d72f (diff) |
x86-32, ftrace: Fix static ftrace when early microcode is enabled
Early microcode loading runs C code before paging is enabled on 32
bits. Since ftrace puts a hook into every function, that hook needs
to be safe to execute in the pre-paging environment. This is
currently true for dynamic ftrace but not for static ftrace.
Static ftrace is obsolescent and assumed to not be
performance-critical, so we can simply test that the stack pointer
falls within the valid range of kernel addresses.
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | arch/x86/kernel/entry_32.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 2cfbc3a3a2dd..f0dcb0ceb6a2 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1176,6 +1176,9 @@ ftrace_restore_flags: | |||
1176 | #else /* ! CONFIG_DYNAMIC_FTRACE */ | 1176 | #else /* ! CONFIG_DYNAMIC_FTRACE */ |
1177 | 1177 | ||
1178 | ENTRY(mcount) | 1178 | ENTRY(mcount) |
1179 | cmpl $__PAGE_OFFSET, %esp | ||
1180 | jb ftrace_stub /* Paging not enabled yet? */ | ||
1181 | |||
1179 | cmpl $0, function_trace_stop | 1182 | cmpl $0, function_trace_stop |
1180 | jne ftrace_stub | 1183 | jne ftrace_stub |
1181 | 1184 | ||