aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/nmi.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-04-24 16:31:07 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-04-27 21:11:28 -0400
commit4a6d70c9505fef1d8906b1d61db3de5d8ecf9454 (patch)
tree1e0ad175481cf0156f4377e92eaaaea5acf528c6 /arch/x86/kernel/nmi.c
parent08d636b6d4fb80647fe8869ea1cd97b2c26a4751 (diff)
ftrace/x86: Remove the complex ftrace NMI handling code
As ftrace function tracing would require modifying code that could be executed in NMI context, which is not stopped with stop_machine(), ftrace had to do a complex algorithm with various stages of setup and memory barriers to make it work. With the new breakpoint method, this is no longer required. The changes to the code can be done without any problem in NMI context, as well as without stop machine altogether. Remove the complex code as it is no longer needed. Also, a lot of the notrace annotations could be removed from the NMI code as it is now safe to trace them. With the exception of do_nmi itself, which does some special work to handle running in the debug stack. The breakpoint method can cause NMIs to double nest the debug stack if it's not setup properly, and that is done in do_nmi(), thus that function must not be traced. (Note the arch sh may want to do the same) Cc: Paul Mundt <lethal@linux-sh.org> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel/nmi.c')
-rw-r--r--arch/x86/kernel/nmi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 47acaf319165..eb1539eac393 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -84,7 +84,7 @@ __setup("unknown_nmi_panic", setup_unknown_nmi_panic);
84 84
85#define nmi_to_desc(type) (&nmi_desc[type]) 85#define nmi_to_desc(type) (&nmi_desc[type])
86 86
87static int notrace __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b) 87static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b)
88{ 88{
89 struct nmi_desc *desc = nmi_to_desc(type); 89 struct nmi_desc *desc = nmi_to_desc(type);
90 struct nmiaction *a; 90 struct nmiaction *a;
@@ -209,7 +209,7 @@ void unregister_nmi_handler(unsigned int type, const char *name)
209 209
210EXPORT_SYMBOL_GPL(unregister_nmi_handler); 210EXPORT_SYMBOL_GPL(unregister_nmi_handler);
211 211
212static notrace __kprobes void 212static __kprobes void
213pci_serr_error(unsigned char reason, struct pt_regs *regs) 213pci_serr_error(unsigned char reason, struct pt_regs *regs)
214{ 214{
215 pr_emerg("NMI: PCI system error (SERR) for reason %02x on CPU %d.\n", 215 pr_emerg("NMI: PCI system error (SERR) for reason %02x on CPU %d.\n",
@@ -236,7 +236,7 @@ pci_serr_error(unsigned char reason, struct pt_regs *regs)
236 outb(reason, NMI_REASON_PORT); 236 outb(reason, NMI_REASON_PORT);
237} 237}
238 238
239static notrace __kprobes void 239static __kprobes void
240io_check_error(unsigned char reason, struct pt_regs *regs) 240io_check_error(unsigned char reason, struct pt_regs *regs)
241{ 241{
242 unsigned long i; 242 unsigned long i;
@@ -263,7 +263,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
263 outb(reason, NMI_REASON_PORT); 263 outb(reason, NMI_REASON_PORT);
264} 264}
265 265
266static notrace __kprobes void 266static __kprobes void
267unknown_nmi_error(unsigned char reason, struct pt_regs *regs) 267unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
268{ 268{
269 int handled; 269 int handled;
@@ -305,7 +305,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
305static DEFINE_PER_CPU(bool, swallow_nmi); 305static DEFINE_PER_CPU(bool, swallow_nmi);
306static DEFINE_PER_CPU(unsigned long, last_nmi_rip); 306static DEFINE_PER_CPU(unsigned long, last_nmi_rip);
307 307
308static notrace __kprobes void default_do_nmi(struct pt_regs *regs) 308static __kprobes void default_do_nmi(struct pt_regs *regs)
309{ 309{
310 unsigned char reason = 0; 310 unsigned char reason = 0;
311 int handled; 311 int handled;