LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Aristeu Rozanski <aris@redhat.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH 2/2] NMI watchdog: disable NMIs on LVT0 in case NMI watchdog is not working
Date: Mon, 27 Oct 2008 12:42:35 -0400	[thread overview]
Message-ID: <20081027164234.927398000@napanee.usersys.redhat.com> (raw)
In-Reply-To: <20081027164233.132189000@napanee.usersys.redhat.com>

[-- Attachment #1: nmi-disable_nmi_delivery_on_lint0_if_nmi_watchdog_is_not_functional.patch --]
[-- Type: text/plain, Size: 1459 bytes --]

Currently, if the NMI watchdog fails using IOAPIC method, it'll only disable
interrupts on 8259 if the timer is passing thru it. This patch disables
NMI delivery on LINT0 if the NMI watchdog initial test fails, just for safety.

Signed-off-by: Aristeu Rozanski <aris@redhat.com>

---
 arch/x86/kernel/nmi.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

--- linus-2.6.orig/arch/x86/kernel/nmi.c	2008-10-27 11:59:49.000000000 -0400
+++ linus-2.6/arch/x86/kernel/nmi.c	2008-10-27 11:59:49.000000000 -0400
@@ -131,6 +131,11 @@ static void report_broken_nmi(int cpu, i
 	atomic_dec(&nmi_active);
 }
 
+static void __acpi_nmi_disable(void *__unused)
+{
+	apic_write(APIC_LVT0, APIC_DM_NMI | APIC_LVT_MASKED);
+}
+
 int __init check_nmi_watchdog(void)
 {
 	unsigned int *prev_nmi_count;
@@ -179,8 +184,12 @@ int __init check_nmi_watchdog(void)
 	kfree(prev_nmi_count);
 	return 0;
 error:
-	if (nmi_watchdog == NMI_IO_APIC && !timer_through_8259)
-		disable_8259A_irq(0);
+	if (nmi_watchdog == NMI_IO_APIC) {
+		if (!timer_through_8259)
+			disable_8259A_irq(0);
+		on_each_cpu(__acpi_nmi_disable, NULL, 1);
+	}
+
 #ifdef CONFIG_X86_32
 	timer_ack = 0;
 #endif
@@ -285,11 +294,6 @@ void acpi_nmi_enable(void)
 		on_each_cpu(__acpi_nmi_enable, NULL, 1);
 }
 
-static void __acpi_nmi_disable(void *__unused)
-{
-	apic_write(APIC_LVT0, APIC_DM_NMI | APIC_LVT_MASKED);
-}
-
 /*
  * Disable timer based NMIs on all CPUs:
  */

-- 
Aristeu


  parent reply	other threads:[~2008-10-27 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 16:42 [PATCH 0/2] IOAPIC NMI watchdog fixes Aristeu Rozanski
2008-10-27 16:42 ` [PATCH 1/2] NMI watchdog: add support to enable and disable IOAPIC NMI Aristeu Rozanski
2008-10-29 16:05   ` Randy Dunlap
2008-10-29 19:47     ` Maciej W. Rozycki
2008-10-29 20:39       ` Aristeu Rozanski
2008-10-30  0:50         ` Randy Dunlap
2008-10-27 16:42 ` Aristeu Rozanski [this message]
2008-10-27 16:58 ` [PATCH 0/2] IOAPIC NMI watchdog fixes Maciej W. Rozycki
2008-10-27 17:45   ` Ingo Molnar
2008-12-15 11:23   ` Aristeu Rozanski
2008-12-16 15:04     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081027164234.927398000@napanee.usersys.redhat.com \
    --to=aris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --subject='Re: [PATCH 2/2] NMI watchdog: disable NMIs on LVT0 in case NMI watchdog is not working' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).