From: "Jan H. Schönherr" <jschoenh@amazon.de>
To: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>
Cc: "Jan H. Schönherr" <jschoenh@amazon.de>,
linux-edac@vger.kernel.org,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Subject: [PATCH 2/6] x86/mce: Make mce=nobootlog work again
Date: Tue, 10 Dec 2019 01:07:29 +0100 [thread overview]
Message-ID: <20191210000733.17979-3-jschoenh@amazon.de> (raw)
In-Reply-To: <20191210000733.17979-1-jschoenh@amazon.de>
Since Linux 4.5 commit 8b38937b7ab5 ("x86/mce: Do not enter deferred
errors into the generic pool twice") the mce=nobootlog option has become
mostly ineffective (after being only slightly ineffective before), as
the code is taking actions on MCEs left over from boot when they have a
usable address.
Move the check for MCP_DONTLOG a bit outward to make it effective again.
Also, since Linux 4.12 commit 011d82611172 ("RAS: Add a Corrected Errors
Collector") the two branches of the remaining "if" the bottom of
machine_check_poll() do the same. Unify them.
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
---
arch/x86/kernel/cpu/mce/core.c | 25 +++++++++----------------
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index d5a8b99f7ba3..81ab25d5357a 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -760,24 +760,17 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
log_it:
error_seen = true;
- mce_read_aux(&m, i);
-
- m.severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
-
- /*
- * Don't get the IP here because it's unlikely to
- * have anything to do with the actual error location.
- */
- if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce)
- mce_log(&m);
- else if (mce_usable_address(&m)) {
+ if (!(flags & MCP_DONTLOG)) {
+ mce_read_aux(&m, i);
+ m.severity = mce_severity(&m, mca_cfg.tolerant, NULL,
+ false);
/*
- * Although we skipped logging this, we still want
- * to take action. Add to the pool so the registered
- * notifiers will see it.
+ * Don't get the IP here because it's unlikely to
+ * have anything to do with the actual error location.
*/
- if (!mce_gen_pool_add(&m))
- mce_schedule_work();
+
+ if (!mca_cfg.dont_log_ce || mce_usable_address(&m))
+ mce_log(&m);
}
/*
--
2.22.0.3.gb49bb57c8208.dirty
next prev parent reply other threads:[~2019-12-10 0:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 0:07 [PATCH 0/6] x86/mce: Various fixes and cleanups for MCE handling Jan H. Schönherr
2019-12-10 0:07 ` [PATCH 1/6] x86/mce: Take action on UCNA/Deferred errors again Jan H. Schönherr
2019-12-10 0:07 ` Jan H. Schönherr [this message]
2019-12-16 17:15 ` [PATCH 2/6] x86/mce: Make mce=nobootlog work again Borislav Petkov
2019-12-10 0:07 ` [PATCH 3/6] x86/mce: Fix possibly incorrect severity calculation on AMD Jan H. Schönherr
2019-12-16 17:26 ` Borislav Petkov
2019-12-16 17:35 ` Ghannam, Yazen
2019-12-10 0:07 ` [PATCH 4/6] x86/mce: Fix handling of optional message string Jan H. Schönherr
2019-12-16 17:37 ` Borislav Petkov
2019-12-19 17:49 ` Jan H. Schönherr
2019-12-20 10:01 ` Borislav Petkov
2019-12-10 0:07 ` [PATCH 5/6] x86/mce: Pass MCE message to mce_panic() on failed kernel recovery Jan H. Schönherr
2019-12-10 0:07 ` [PATCH 6/6] x86/mce: Remove mce_inject_log() in favor of mce_log() Jan H. Schönherr
2019-12-11 0:25 ` [PATCH 0/6] x86/mce: Various fixes and cleanups for MCE handling Luck, Tony
2019-12-12 12:25 ` Jan H. Schönherr
2019-12-16 16:52 ` Borislav Petkov
2019-12-16 21:59 ` Luck, Tony
2019-12-17 1:19 ` Ghannam, Yazen
2019-12-17 7:34 ` Borislav Petkov
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=20191210000733.17979-3-jschoenh@amazon.de \
--to=jschoenh@amazon.de \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).