kernel_optimize_test/arch
Lai Jiangshan e9d9df4473 ftrace: protect running nmi (V3)
When I review the sensitive code ftrace_nmi_enter(), I found
the atomic variable nmi_running does protect NMI VS do_ftrace_mod_code(),
but it can not protects NMI(entered nmi) VS NMI(ftrace_nmi_enter()).

cpu#1                   | cpu#2                 | cpu#3
ftrace_nmi_enter()      | do_ftrace_mod_code()  |
  not modify            |                       |
------------------------|-----------------------|--
executing               | set mod_code_write = 1|
executing             --|-----------------------|--------------------
executing               |                       | ftrace_nmi_enter()
executing               |                       |    do modify
------------------------|-----------------------|-----------------
ftrace_nmi_exit()       |                       |

cpu#3 may be being modified the code which is still being executed on cpu#1,
it will have undefined results and possibly take a GPF, this patch
prevents it occurred.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <49C0B411.30003@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2009-03-18 20:36:59 -04:00
..
alpha Merge branch 'x86/core' into tracing/textedit 2009-03-06 16:45:01 +01:00
arm Merge branches 'tracing/ftrace', 'tracing/syscalls' and 'linus' into tracing/core 2009-03-16 09:12:42 +01:00
avr32 Merge branch 'x86/core' into tracing/textedit 2009-03-06 16:45:01 +01:00
blackfin Merge branch 'x86/core' into tracing/ftrace 2009-03-10 10:17:48 +01:00
cris tracing: make CALLER_ADDRx overwriteable 2009-03-02 16:49:37 -05:00
frv FRV: in_interrupt() requires #inclusion of linux/hardirq.h not asm/hardirq.h now 2009-02-09 08:51:35 -08:00
h8300 Merge branch 'x86/core' into tracing/textedit 2009-03-06 16:45:01 +01:00
ia64 Merge branches 'tracing/doc', 'tracing/ftrace', 'tracing/printk' and 'linus' into tracing/core 2009-03-10 09:56:25 +01:00
m32r eeprom: More consistent symbol names 2009-01-26 21:19:57 +01:00
m68k tracing: make CALLER_ADDRx overwriteable 2009-03-02 16:49:37 -05:00
m68knommu m68knommu: m528x build fix 2009-03-10 15:55:12 -07:00
mips Merge branches 'tracing/ftrace', 'tracing/syscalls' and 'linus' into tracing/core 2009-03-16 09:12:42 +01:00
mn10300 Merge branch 'linus' into x86/apic 2009-02-22 20:05:19 +01:00
parisc Merge branches 'tracing/ftrace', 'tracing/syscalls' and 'linus' into tracing/core 2009-03-16 09:12:42 +01:00
powerpc Merge branch 'core/locking' into tracing/ftrace 2009-03-13 01:33:21 +01:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2009-03-03 17:05:08 -08:00
sh sh: Add media/soc_camera.h to board setup of Renesas AP325RXA 2009-03-10 15:20:54 +09:00
sparc Merge branch 'core/locking' into tracing/ftrace 2009-03-13 01:33:21 +01:00
um Merge branch 'core/locking' into tracing/ftrace 2009-03-13 01:33:21 +01:00
x86 ftrace: protect running nmi (V3) 2009-03-18 20:36:59 -04:00
xtensa Merge branch 'core/locking' into tracing/ftrace 2009-03-13 01:33:21 +01:00
.gitignore
Kconfig tracing: clean up menu 2009-03-05 21:53:25 +01:00