public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>,
	Arjan van de Ven <arjan@infradead.org>
Cc: Steven Rostedt <srostedt@redhat.com>,
	Corey Minyard <minyard@acm.org>,
	Thomas Mingarelli <thomas.mingarelli@hp.com>
Subject: [PATCH 2/5] ftrace: do not trace nmi callers in drivers
Date: Tue, 29 Jul 2008 21:29:41 -0400	[thread overview]
Message-ID: <20080730014350.847388842@goodmis.org> (raw)
In-Reply-To: 20080730012939.885172468@goodmis.org

[-- Attachment #1: ftrace-notrace-nmi-drivers.patch --]
[-- Type: text/plain, Size: 2705 bytes --]

The dynamic ftrace code performs run time modification of the code text
section. This is not safe to do unless all other CPUS are halted. Because
there is no good way to halt NMIs while doing the modification, we must
make sure that the NMIs will not execute code that will be modified.

This patch adds notrace annotation to functions called by NMIs in the
drivers section.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
CC: Corey Minyard <minyard@acm.org>
CC: Thomas Mingarelli <thomas.mingarelli@hp.com>
---
 drivers/char/ipmi/ipmi_watchdog.c |    2 +-
 drivers/misc/sgi-xp/xpc_main.c    |    4 ++--
 drivers/watchdog/hpwdt.c          |    5 +++--
 3 files changed, 6 insertions(+), 5 deletions(-)

Index: linux-tip.git/drivers/char/ipmi/ipmi_watchdog.c
===================================================================
--- linux-tip.git.orig/drivers/char/ipmi/ipmi_watchdog.c	2008-07-29 20:03:09.000000000 -0400
+++ linux-tip.git/drivers/char/ipmi/ipmi_watchdog.c	2008-07-29 20:03:20.000000000 -0400
@@ -1051,7 +1051,7 @@ static void ipmi_unregister_watchdog(int
 }
 
 #ifdef HAVE_DIE_NMI
-static int
+static notrace int
 ipmi_nmi(struct notifier_block *self, unsigned long val, void *data)
 {
 	struct die_args *args = data;
Index: linux-tip.git/drivers/misc/sgi-xp/xpc_main.c
===================================================================
--- linux-tip.git.orig/drivers/misc/sgi-xp/xpc_main.c	2008-07-29 20:03:09.000000000 -0400
+++ linux-tip.git/drivers/misc/sgi-xp/xpc_main.c	2008-07-29 20:03:20.000000000 -0400
@@ -1004,7 +1004,7 @@ xpc_system_reboot(struct notifier_block 
 /*
  * Notify other partitions to disengage from all references to our memory.
  */
-static void
+static notrace void
 xpc_die_disengage(void)
 {
 	struct xpc_partition *part;
@@ -1083,7 +1083,7 @@ xpc_die_disengage(void)
  * for a time. In this case we need to notify other partitions to not worry
  * about the lack of a heartbeat.
  */
-static int
+static notrace int
 xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
 {
 	switch (event) {
Index: linux-tip.git/drivers/watchdog/hpwdt.c
===================================================================
--- linux-tip.git.orig/drivers/watchdog/hpwdt.c	2008-07-29 20:03:09.000000000 -0400
+++ linux-tip.git/drivers/watchdog/hpwdt.c	2008-07-29 20:03:20.000000000 -0400
@@ -417,8 +417,9 @@ static int __devinit detect_cru_service(
 /*
  *	NMI Handler
  */
-static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
-			    void *data)
+static notrace int
+hpwdt_pretimeout(struct notifier_block *nb,
+				unsigned long ulReason, void *data)
 {
 	static unsigned long rom_pl;
 	static int die_nmi_called;

-- 

  parent reply	other threads:[~2008-07-30  1:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30  1:29 [PATCH 0/5] ftrace: do not trace NMI handlers Steven Rostedt
2008-07-30  1:29 ` [PATCH 1/5] ftrace: do not trace nmi callers in x86 Steven Rostedt
2008-07-30  1:29 ` Steven Rostedt [this message]
2008-07-30  1:29 ` [PATCH 3/5] ftrace: do not trace nmi callers in RCU Steven Rostedt
2008-07-30  1:29 ` [PATCH 4/5] ftrace: do not trace nmi callers in kernel directory Steven Rostedt
2008-07-30  1:29 ` [PATCH 5/5] ftrace: warn on NMI calling code that may be modified Steven Rostedt
2008-07-30  7:28 ` [PATCH 0/5] ftrace: do not trace NMI handlers Peter Zijlstra
2008-07-30 14:04   ` Mathieu Desnoyers
2008-07-30 14:23     ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080730014350.847388842@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=minyard@acm.org \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.mingarelli@hp.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox