From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86_32: move do_nmi() to nmi_32.c
Date: Fri, 02 May 2008 16:45:19 -0700 [thread overview]
Message-ID: <481BA78F.50202@ct.jp.nec.com> (raw)
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
on x86_64 do_nmi() is in nmi_64.c.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
arch/x86/kernel/nmi_32.c | 30 ++++++++++++++++++++++++++++++
arch/x86/kernel/traps_32.c | 32 +-------------------------------
include/asm-x86/nmi.h | 3 ++-
3 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 69bdae5..641d2d9 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -398,6 +398,36 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
return rc;
}
+static unsigned ignore_nmis;
+
+notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
+{
+ int cpu;
+
+ nmi_enter();
+
+ cpu = smp_processor_id();
+
+ ++nmi_count(cpu);
+
+ if (!ignore_nmis)
+ default_do_nmi(regs);
+
+ nmi_exit();
+}
+
+void stop_nmi(void)
+{
+ acpi_nmi_disable();
+ ignore_nmis++;
+}
+
+void restart_nmi(void)
+{
+ ignore_nmis--;
+ acpi_nmi_enable();
+}
+
#ifdef CONFIG_SYSCTL
static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 7fad084..b1793ad 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -787,7 +787,7 @@ void notrace __kprobes die_nmi(struct pt_regs *regs, const char *msg)
do_exit(SIGSEGV);
}
-static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
+notrace __kprobes void default_do_nmi(struct pt_regs *regs)
{
unsigned char reason = 0;
@@ -827,36 +827,6 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
reassert_nmi();
}
-static int ignore_nmis;
-
-notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
-{
- int cpu;
-
- nmi_enter();
-
- cpu = smp_processor_id();
-
- ++nmi_count(cpu);
-
- if (!ignore_nmis)
- default_do_nmi(regs);
-
- nmi_exit();
-}
-
-void stop_nmi(void)
-{
- acpi_nmi_disable();
- ignore_nmis++;
-}
-
-void restart_nmi(void)
-{
- ignore_nmis--;
- acpi_nmi_enable();
-}
-
#ifdef CONFIG_KPROBES
void __kprobes do_int3(struct pt_regs *regs, long error_code)
{
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h
index 1e36302..9fd90b6 100644
--- a/include/asm-x86/nmi.h
+++ b/include/asm-x86/nmi.h
@@ -37,13 +37,14 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev)
#endif /* CONFIG_PM */
#ifdef CONFIG_X86_64
-extern void default_do_nmi(struct pt_regs *);
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
extern void nmi_watchdog_default(void);
#else
#define nmi_watchdog_default() do {} while (0)
#endif
+extern void default_do_nmi(struct pt_regs *);
+
extern int check_nmi_watchdog(void);
extern int nmi_watchdog_enabled;
extern int unknown_nmi_panic;
--
1.5.4.1
next reply other threads:[~2008-05-02 23:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 23:45 Hiroshi Shimamoto [this message]
2008-05-03 21:11 ` [PATCH] x86_32: move do_nmi() to nmi_32.c Thomas Gleixner
2008-05-04 0:41 ` Hiroshi Shimamoto
2008-05-04 9:40 ` Ingo Molnar
2008-05-04 15:12 ` Hiroshi Shimamoto
2008-05-04 15:22 ` Hiroshi Shimamoto
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=481BA78F.50202@ct.jp.nec.com \
--to=h-shimamoto@ct.jp.nec.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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