From: "tip-bot2 for Tony Luck" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Boris Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
Borislav Petkov <bp@suse.de>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: ras/core] x86/mce: Enable additional error logging on certain Intel CPUs
Date: Mon, 02 Nov 2020 11:18:08 -0000 [thread overview]
Message-ID: <160431588828.397.16468104725047768957.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201030190807.GA13884@agluck-desk2.amr.corp.intel.com>
The following commit has been merged into the ras/core branch of tip:
Commit-ID: 68299a42f84288537ee3420c431ac0115ccb90b1
Gitweb: https://git.kernel.org/tip/68299a42f84288537ee3420c431ac0115ccb90b1
Author: Tony Luck <tony.luck@intel.com>
AuthorDate: Fri, 30 Oct 2020 12:04:00 -07:00
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Mon, 02 Nov 2020 11:15:59 +01:00
x86/mce: Enable additional error logging on certain Intel CPUs
The Xeon versions of Sandy Bridge, Ivy Bridge and Haswell support an
optional additional error logging mode which is enabled by an MSR.
Previously, this mode was enabled from the mcelog(8) tool via /dev/cpu,
but userspace should not be poking at MSRs. So move the enabling into
the kernel.
[ bp: Correct the explanation why this is done. ]
Suggested-by: Boris Petkov <bp@alien8.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201030190807.GA13884@agluck-desk2.amr.corp.intel.com
---
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/kernel/cpu/mce/intel.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 972a34d..b2dd264 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -139,6 +139,7 @@
#define MSR_IA32_MCG_CAP 0x00000179
#define MSR_IA32_MCG_STATUS 0x0000017a
#define MSR_IA32_MCG_CTL 0x0000017b
+#define MSR_ERROR_CONTROL 0x0000017f
#define MSR_IA32_MCG_EXT_CTL 0x000004d0
#define MSR_OFFCORE_RSP_0 0x000001a6
diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
index abe9fe0..b47883e 100644
--- a/arch/x86/kernel/cpu/mce/intel.c
+++ b/arch/x86/kernel/cpu/mce/intel.c
@@ -509,12 +509,32 @@ static void intel_ppin_init(struct cpuinfo_x86 *c)
}
}
+/*
+ * Enable additional error logs from the integrated
+ * memory controller on processors that support this.
+ */
+static void intel_imc_init(struct cpuinfo_x86 *c)
+{
+ u64 error_control;
+
+ switch (c->x86_model) {
+ case INTEL_FAM6_SANDYBRIDGE_X:
+ case INTEL_FAM6_IVYBRIDGE_X:
+ case INTEL_FAM6_HASWELL_X:
+ rdmsrl(MSR_ERROR_CONTROL, error_control);
+ error_control |= 2;
+ wrmsrl(MSR_ERROR_CONTROL, error_control);
+ break;
+ }
+}
+
void mce_intel_feature_init(struct cpuinfo_x86 *c)
{
intel_init_thermal(c);
intel_init_cmci();
intel_init_lmce();
intel_ppin_init(c);
+ intel_imc_init(c);
}
void mce_intel_feature_clear(struct cpuinfo_x86 *c)
next prev parent reply other threads:[~2020-11-02 11:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fcb21490-84a1-8b99-b494-3a6ac2a0e16a@skynet.be>
[not found] ` <20201029100655.GA31903@zn.tnic>
[not found] ` <20201029151518.GA23990@agluck-desk2.amr.corp.intel.com>
[not found] ` <20201029194118.GC31903@zn.tnic>
[not found] ` <87ft5wo8zn.fsf@nanos.tec.linutronix.de>
[not found] ` <20201030091056.GA6532@zn.tnic>
[not found] ` <20201030190400.GA13797@agluck-desk2.amr.corp.intel.com>
2020-10-30 19:08 ` [PATCH] " Luck, Tony
2020-11-02 11:12 ` Borislav Petkov
2020-11-02 11:18 ` tip-bot2 for Tony Luck [this message]
2020-11-09 21:55 ` [tip: ras/core] " Qian Cai
2020-11-09 22:09 ` Luck, Tony
2020-11-09 22:36 ` Jim Mattson
2020-11-09 22:57 ` Luck, Tony
2020-11-09 23:24 ` [PATCH] x86/mce: Check for hypervisor before enabling additional error logging Luck, Tony
2020-11-10 6:31 ` Borislav Petkov
2020-11-10 8:50 ` Paolo Bonzini
2020-11-10 9:56 ` Borislav Petkov
2020-11-10 10:40 ` Paolo Bonzini
2020-11-10 15:50 ` Borislav Petkov
2020-11-10 16:08 ` Paolo Bonzini
2020-11-10 17:52 ` Luck, Tony
2020-11-10 20:37 ` Paolo Bonzini
2020-11-11 0:39 ` [PATCH v2] x86/mce: Use "safe" MSR functions when " Luck, Tony
2020-11-16 16:44 ` [tip: ras/core] " tip-bot2 for Tony Luck
2020-11-09 23:26 ` [tip: ras/core] x86/mce: Enable additional error logging on certain Intel CPUs Jim Mattson
2020-11-09 23:36 ` Luck, Tony
2020-11-10 9:10 ` Paolo Bonzini
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=160431588828.397.16468104725047768957.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--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
all inboxes | Powered by JetHome®