diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-18 16:42:57 +0800 | 
|---|---|---|
| committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-18 20:36:59 -0400 | 
| commit | e9d9df44736d116726f4596f7e2f9ce2764ffc0a (patch) | |
| tree | bca129639885fa7288b925e5053f3787fa7e625a /net/lapb/lapb_in.c | |
| parent | 4acd4d00f716873e27e7b60ae292cbdbfae674dd (diff) | |
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>
Diffstat (limited to 'net/lapb/lapb_in.c')
0 files changed, 0 insertions, 0 deletions
