aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAristeu Rozanski <aris@redhat.com>2008-10-27 12:42:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-27 13:44:04 -0400
commit6f290b4e016d6c61511542cf6d9ebdef1965978e (patch)
tree69c731a9c87afa2d2cb2690501d148fa65d7f60e
parentf8d56f1771e4867acc461146764b4feeb5245669 (diff)
x86, NMI watchdog: add support to enable and disable IOAPIC NMI
Impact: change/improve the way /proc/sys/kernel/nmi_watchdog works This patch adds support to enable/disable IOAPIC NMI watchdog in runtime via procfs. Signed-off-by: Aristeu Rozanski <aris@redhat.com> Cc: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/nmi.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 2c97f07f1c2c..2c005fac6171 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -340,6 +340,8 @@ void stop_apic_nmi_watchdog(void *unused)
340 return; 340 return;
341 if (nmi_watchdog == NMI_LOCAL_APIC) 341 if (nmi_watchdog == NMI_LOCAL_APIC)
342 lapic_watchdog_stop(); 342 lapic_watchdog_stop();
343 else
344 __acpi_nmi_disable(NULL);
343 __get_cpu_var(wd_enabled) = 0; 345 __get_cpu_var(wd_enabled) = 0;
344 atomic_dec(&nmi_active); 346 atomic_dec(&nmi_active);
345} 347}
@@ -465,6 +467,24 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
465 467
466#ifdef CONFIG_SYSCTL 468#ifdef CONFIG_SYSCTL
467 469
470static void enable_ioapic_nmi_watchdog_single(void *unused)
471{
472 __get_cpu_var(wd_enabled) = 1;
473 atomic_inc(&nmi_active);
474 __acpi_nmi_enable(NULL);
475}
476
477static void enable_ioapic_nmi_watchdog(void)
478{
479 on_each_cpu(enable_ioapic_nmi_watchdog_single, NULL, 1);
480 touch_nmi_watchdog();
481}
482
483static void disable_ioapic_nmi_watchdog(void)
484{
485 on_each_cpu(stop_apic_nmi_watchdog, NULL, 1);
486}
487
468static int __init setup_unknown_nmi_panic(char *str) 488static int __init setup_unknown_nmi_panic(char *str)
469{ 489{
470 unknown_nmi_panic = 1; 490 unknown_nmi_panic = 1;
@@ -507,6 +527,11 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
507 enable_lapic_nmi_watchdog(); 527 enable_lapic_nmi_watchdog();
508 else 528 else
509 disable_lapic_nmi_watchdog(); 529 disable_lapic_nmi_watchdog();
530 } else if (nmi_watchdog == NMI_IO_APIC) {
531 if (nmi_watchdog_enabled)
532 enable_ioapic_nmi_watchdog();
533 else
534 disable_ioapic_nmi_watchdog();
510 } else { 535 } else {
511 printk(KERN_WARNING 536 printk(KERN_WARNING
512 "NMI watchdog doesn't know what hardware to touch\n"); 537 "NMI watchdog doesn't know what hardware to touch\n");