diff options
author | Andi Kleen <ak@suse.de> | 2007-07-22 05:12:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-22 14:03:37 -0400 |
commit | 8f4e956b313dcccbc7be6f10808952345e3b638c (patch) | |
tree | cc8c93fa1faf5e0b608e3a21330a32bd82fe6f47 /include | |
parent | 19d36ccdc34f5ed444f8a6af0cbfdb6790eb1177 (diff) |
x86: Stop MCEs and NMIs during code patching
When a machine check or NMI occurs while multiple byte code is patched
the CPU could theoretically see an inconsistent instruction and crash.
Prevent this by temporarily disabling MCEs and returning early in the
NMI handler.
Based on discussion with Mathieu Desnoyers.
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/mce.h | 4 | ||||
-rw-r--r-- | include/asm-i386/nmi.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/mce.h | 3 | ||||
-rw-r--r-- | include/asm-x86_64/nmi.h | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h index b0a02ee34ffd..d56d89742e8f 100644 --- a/include/asm-i386/mce.h +++ b/include/asm-i386/mce.h | |||
@@ -5,3 +5,7 @@ extern void mcheck_init(struct cpuinfo_x86 *c); | |||
5 | #endif | 5 | #endif |
6 | 6 | ||
7 | extern int mce_disabled; | 7 | extern int mce_disabled; |
8 | |||
9 | extern void stop_mce(void); | ||
10 | extern void restart_mce(void); | ||
11 | |||
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h index fb1e133efd9f..ff30c98f87b0 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-i386/nmi.h | |||
@@ -57,5 +57,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz); | |||
57 | int lapic_watchdog_ok(void); | 57 | int lapic_watchdog_ok(void); |
58 | void disable_lapic_nmi_watchdog(void); | 58 | void disable_lapic_nmi_watchdog(void); |
59 | void enable_lapic_nmi_watchdog(void); | 59 | void enable_lapic_nmi_watchdog(void); |
60 | void stop_nmi(void); | ||
61 | void restart_nmi(void); | ||
60 | 62 | ||
61 | #endif /* ASM_NMI_H */ | 63 | #endif /* ASM_NMI_H */ |
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h index 556be5563e30..7bc030a1996d 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86_64/mce.h | |||
@@ -107,6 +107,9 @@ extern void do_machine_check(struct pt_regs *, long); | |||
107 | 107 | ||
108 | extern int mce_notify_user(void); | 108 | extern int mce_notify_user(void); |
109 | 109 | ||
110 | extern void stop_mce(void); | ||
111 | extern void restart_mce(void); | ||
112 | |||
110 | #endif | 113 | #endif |
111 | 114 | ||
112 | #endif | 115 | #endif |
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h index d0a7f53b1497..5fb3c0de5ccc 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86_64/nmi.h | |||
@@ -88,5 +88,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz); | |||
88 | int lapic_watchdog_ok(void); | 88 | int lapic_watchdog_ok(void); |
89 | void disable_lapic_nmi_watchdog(void); | 89 | void disable_lapic_nmi_watchdog(void); |
90 | void enable_lapic_nmi_watchdog(void); | 90 | void enable_lapic_nmi_watchdog(void); |
91 | void stop_nmi(void); | ||
92 | void restart_nmi(void); | ||
91 | 93 | ||
92 | #endif /* ASM_NMI_H */ | 94 | #endif /* ASM_NMI_H */ |