From 8f4e956b313dcccbc7be6f10808952345e3b638c Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sun, 22 Jul 2007 11:12:32 +0200 Subject: 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 Cc: Jeremy Fitzhardinge Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-i386/mce.h | 4 ++++ include/asm-i386/nmi.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'include/asm-i386') diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h index b0a02ee34ff..d56d89742e8 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); #endif extern int mce_disabled; + +extern void stop_mce(void); +extern void restart_mce(void); + diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h index fb1e133efd9..ff30c98f87b 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-i386/nmi.h @@ -57,5 +57,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz); int lapic_watchdog_ok(void); void disable_lapic_nmi_watchdog(void); void enable_lapic_nmi_watchdog(void); +void stop_nmi(void); +void restart_nmi(void); #endif /* ASM_NMI_H */ -- cgit v1.2.3