From: Aristeu Rozanski <aris@ruivo.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] nmi watchdog: handle NMI_IO_APIC on nmi_watchdog
Date: Wed, 26 Mar 2008 14:44:27 -0400 [thread overview]
Message-ID: <20080326184427.GG25854@cathedrallabs.org> (raw)
In-Reply-To: <20080326182333.GA11187@elte.hu>
> > > stop_apic_nmi_watchdog() doesnt currently properly disable the
> > > generation of NMIs when they come from an IO-APIC, so this will need
> > > more fixes i believe. One approach would be to save the IO-APIC id and
> > > pin when the watchdog is set up, and use it later on to poke that
> > > IO-APIC register to disable NMI generation there.
> > the patch I sent has this change:
> >
> > @@ -270,6 +270,8 @@ void stop_apic_nmi_watchdog(void *unused
> > return;
> > if (nmi_watchdog == NMI_LOCAL_APIC)
> > lapic_watchdog_stop();
> > + else
> > + __acpi_nmi_disable(NULL);
> > __get_cpu_var(wd_enabled) = 0;
> > atomic_dec(&nmi_active);
> > }
> >
> > and:
> > static void __acpi_nmi_disable(void *__unused)
> > {
> > apic_write(APIC_LVT0, APIC_DM_NMI | APIC_LVT_MASKED);
> > }
> >
> > do you think this isn't enough?
>
> but this stops all NMIs, not just the IO-APIC generated ones, doesnt it?
This is the reverse of:
static void __init setup_nmi(void)
{
/*
* Dirty trick to enable the NMI watchdog ...
* We put the 8259A master into AEOI mode and
* unmask on all local APICs LVT0 as NMI.
*
* The idea to use the 8259A in AEOI mode ('8259A Virtual Wire')
* is from Maciej W. Rozycki - so we do not have to EOI from
* the NMI handler or the timer interrupt.
*/
apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
enable_NMI_through_LVT0();
apic_printk(APIC_VERBOSE, " done.\n");
}
where:
void __cpuinit enable_NMI_through_LVT0(void)
{
unsigned int v;
/* unmask and set to NMI */
v = APIC_DM_NMI;
apic_write(APIC_LVT0, v);
}
I must admit I don't really understand how the NMI watchdog thru IOAPIC
works. Couldn't find proper documentation on that. I just tried to
revert what's done when it's enabled and everything worked as expected,
including a customer who is using those development boxes with a NMI
button. First the NMI watchdog was disabled using a patch much like the
one I sent then NMI was generated by pushing the button and the box
crashed as it should (the old unknown_nmi_panic sysctl was set). So,
unless the NMI button does something different to deliver the NMI, other
NMIs should keep working.
--
Aristeu
next prev parent reply other threads:[~2008-03-26 18:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 18:05 Aristeu Rozanski
2008-03-21 11:47 ` Ingo Molnar
2008-03-26 15:24 ` Aristeu Rozanski
2008-03-26 18:23 ` Ingo Molnar
2008-03-26 18:44 ` Aristeu Rozanski [this message]
2008-10-22 21:50 ` Aristeu Rozanski
2008-10-22 22:45 ` Maciej W. Rozycki
2008-10-23 3:35 ` Aristeu Rozanski
2008-10-23 21:59 ` Maciej W. Rozycki
2008-03-14 14:45 Aristeu Rozanski
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=20080326184427.GG25854@cathedrallabs.org \
--to=aris@ruivo.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®