From: Andi Kleen <andi@firstfloor.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Prarit Bhargava <prarit@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, arozansk@redhat.com,
dzickus@redhat.com, Thomas.Mingarelli@hp.com, ak@linux.intel.com,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH RFC] NMI Re-introduce un[set]_nmi_callback
Date: Thu, 04 Sep 2008 17:52:17 +0200 [thread overview]
Message-ID: <87y727vrgu.fsf@basil.nowhere.org> (raw)
In-Reply-To: <20080904145617.GB28095@elte.hu> (Ingo Molnar's message of "Thu, 4 Sep 2008 16:56:17 +0200")
Ingo Molnar <mingo@elte.hu> writes:
>
> i'd much rather attack this general problem from this angle:
>
> static inline unsigned char get_nmi_reason(void)
> {
> return inb(0x61);
> }
>
> that port 61H read is both arcane (on modern chipsets) and broken on
> multiple levels.
Yes it is. I did some datasheet reading recently and unfortunately
there is no really standardized better way. So the only replacement
would be to have chipset specific NMI drivers that know
the particular registers of the chipset.
It's racy and SMP unsafe to begin with, if there's any
> mixture of intentional cross-CPU or CPU self-generated NMIs mixed with
> chipset generated NMIs.
>
> One possible approach would be to get rid of it, and to perhaps register
Removing the IO port accesses by default would be a good idea
I agree. They are hardly useful for anything on modern systems.
But you still need some way to catch the chipset NMIs
and give some indication of the problem.
The way so far was to ask all the other sources (software NMIs
in memory flags, perfmon IPIs check perf ctrs, etc.) first
and if it's none of them assume it's a chipset NMI
(or NMI button NMI if the sysctl is set).
Then if there's a chipset specific NMI driver it could
also check if the chipset raised it. That would be a possible
solution for HP -- they would need to implement such a driver
for their systems with the special watchdog.
Yes that's racy but the poor hardware support doesn't unfortunately
leave much wiggling room to do better.
> a low-priority die notifier on systems where we know port 61
> reads+writes to be safe and desired. Modern systems will emit MCEs in
> most cases anyway, not NMIs.
The chipsets will still trigger NMIs (depending on their
configuration) -- e.g. on some PCI or internal errors -- they cannot
trigger MCEs directly. Fortunately it's being replaced with PCI-AER
on PCI-Express, but PCI-X which doesn't do that is still very common
and shipping.
BTW the NMI handlers are also racy, it's not safe
to call printk in a NMI handler. They really should be taught
to start using mce_log()
-Andi
--
ak@linux.intel.com
next prev parent reply other threads:[~2008-09-04 15:52 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 13:07 [PATCH RFC] NMI Re-introduce un[set]_nmi_callback Prarit Bhargava
2008-09-04 13:37 ` Peter Zijlstra
2008-09-04 14:29 ` Prarit Bhargava
2008-09-04 14:49 ` aris
2008-09-04 14:56 ` Ingo Molnar
2008-09-04 15:12 ` H. Peter Anvin
2008-09-04 15:18 ` Ingo Molnar
2008-09-04 15:52 ` Andi Kleen [this message]
2008-09-04 17:20 ` Don Zickus
2008-09-04 17:52 ` Andi Kleen
2008-09-04 18:26 ` Don Zickus
2008-09-04 18:47 ` Andi Kleen
2008-09-04 19:08 ` Vivek Goyal
2008-09-04 20:00 ` Andi Kleen
2008-09-04 20:01 ` Mingarelli, Thomas
2008-09-04 20:19 ` Andi Kleen
2008-09-04 20:21 ` Mingarelli, Thomas
2008-09-04 20:53 ` Andi Kleen
2008-09-04 21:22 ` Don Zickus
2008-09-04 20:57 ` Vivek Goyal
2008-09-04 21:05 ` Mingarelli, Thomas
2008-09-04 21:21 ` Vivek Goyal
2008-09-04 21:24 ` Don Zickus
2008-09-04 21:46 ` Vivek Goyal
2008-09-05 8:57 ` Ingo Molnar
2008-09-05 10:24 ` Ingo Molnar
2008-09-05 9:33 ` Ingo Molnar
2008-09-05 14:16 ` Vivek Goyal
2008-09-05 14:18 ` Andi Kleen
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=87y727vrgu.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=Thomas.Mingarelli@hp.com \
--cc=ak@linux.intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arozansk@redhat.com \
--cc=dzickus@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=prarit@redhat.com \
--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