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-x86_64/mce.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/asm-x86_64/mce.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); extern int mce_notify_user(void); +extern void stop_mce(void); +extern void restart_mce(void); + #endif #endif -- cgit v1.2.3