1 From: Kurt Garloff <garloff@suse.de>
2 Subject: [PATCH] X86: sysctl to allow panic on IOCK NMI error
5 This patch introduces a sysctl /proc/sys/kernel/panic_on_io_nmi.,
6 which defaults to 0 (off).
7 When enabled, the kernel panics when the kernel receives an NMI
10 The IO error triggered NMI indicates a serious system condition,
11 which could result in IO data corruption. Rather than contiuing,
12 panicing and dumping might be a better choice, so one can figure
13 out what's causing the IO error.
14 This could be especially important to companies running IO intensive
15 applications where corruption must be avoided, e.g. a banks databases.
18 Signed-off-by: Roberto Angelino <robertangelino@gmail.com>
21 Automatically created from "patches.suse/panic-on-io-nmi.diff" by xen-port-patches.py
23 Index: head-2008-11-25/arch/x86/kernel/traps_32-xen.c
24 ===================================================================
25 --- head-2008-11-25.orig/arch/x86/kernel/traps_32-xen.c 2008-11-25 12:57:05.000000000 +0100
26 +++ head-2008-11-25/arch/x86/kernel/traps_32-xen.c 2008-11-25 13:13:12.000000000 +0100
27 @@ -83,6 +83,7 @@ gate_desc idt_table[256]
30 int panic_on_unrecovered_nmi;
32 int kstack_depth_to_print = 24;
33 static unsigned int code_bytes = 64;
34 static int ignore_nmis;
35 @@ -670,6 +671,9 @@ io_check_error(unsigned char reason, str
36 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
39 + if (panic_on_io_nmi)
40 + panic("NMI IOCK error: Not continuing");
42 /* Re-enable the IOCK line, wait for a few seconds */
43 clear_io_check_error(reason);
45 Index: head-2008-11-25/arch/x86/kernel/traps_64-xen.c
46 ===================================================================
47 --- head-2008-11-25.orig/arch/x86/kernel/traps_64-xen.c 2008-11-25 12:57:05.000000000 +0100
48 +++ head-2008-11-25/arch/x86/kernel/traps_64-xen.c 2008-11-25 13:13:12.000000000 +0100
50 #include <mach_traps.h>
52 int panic_on_unrecovered_nmi;
54 int kstack_depth_to_print = 12;
55 static unsigned int code_bytes = 64;
56 static int ignore_nmis;
57 @@ -772,6 +773,9 @@ io_check_error(unsigned char reason, str
58 printk("NMI: IOCK error (debug interrupt?)\n");
61 + if (panic_on_io_nmi)
62 + panic("NMI IOCK error: Not continuing");
64 /* Re-enable the IOCK line, wait for a few seconds */
65 clear_io_check_error(reason);