]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Allow nesting of the debug stack IDT setting
authorSteven Rostedt <srostedt@redhat.com>
Wed, 30 May 2012 15:47:00 +0000 (11:47 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 1 Jun 2012 03:12:21 +0000 (23:12 -0400)
commit8a7ca090ed9fabbd6631fe6cca008c9b80ca132c
tree2f00c9f7986e17b2cead373325e01081bc879b6c
parentd4992f8f9fda903d289176f554c6496a25497e73
x86: Allow nesting of the debug stack IDT setting

When the NMI handler runs, it checks if it preempted a debug handler
and if that handler is using the debug stack. If it is, it changes the
IDT table not to update the stack, otherwise it will reset the debug
stack and corrupt the debug handler it preempted.

Now that ftrace uses breakpoints to change functions from nops to
callers, many more places may hit a breakpoint. Unfortunately this
includes some of the calls that lockdep performs. Which causes issues
with the debug stack. It too needs to change the debug stack before
tracing (if called from the debug handler).

Allow the debug_stack_set_zero() and debug_stack_reset() to be nested
so that the debug handlers can take advantage of them too.

[ Used this_cpu_*() over __get_cpu_var() as suggested by H. Peter Anvin ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/cpu/common.c