aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2020-01-09 14:14:35 -0800
committerAndi Kleen <ak@linux.intel.com>2020-01-09 14:55:50 -0800
commit078d593b8b0c7d44afdd439aacfad6682913038f (patch)
treee6c8d3b9ef6216677709fc2bc81841c005325d70
parent4f0e9c1831f7096bd4788aa4164b227310d29ac4 (diff)
downloadmcelog-078d593b8b0c7d44afdd439aacfad6682913038f.tar.gz
mcelog: Decode and print stepping from cpuidv168
There are serveral cases where the same family/model is used for different generations of CPUs. E.g. Skylake server uses family 0x6 model 0x55 with stepping 0x4, while Cascadelake also uses 0x6/0x55 with stepping 0x6 or 0x7. Add code to decode and print the stepping. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--mcelog.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/mcelog.c b/mcelog.c
index c615325..34e957e 100644
--- a/mcelog.c
+++ b/mcelog.c
@@ -182,7 +182,7 @@ struct cpuid1 {
unsigned res2 : 4;
};
-static void parse_cpuid(u32 cpuid, u32 *family, u32 *model)
+static void parse_cpuid(u32 cpuid, u32 *family, u32 *model, u32 *stepping)
{
union {
struct cpuid1 c;
@@ -197,6 +197,7 @@ static void parse_cpuid(u32 cpuid, u32 *family, u32 *model)
*model = c.c.model;
if (*family == 6 || *family == 0xf)
*model += c.c.ext_model << 4;
+ *stepping = c.c.stepping;
}
static u32 unparse_cpuid(unsigned family, unsigned model)
@@ -364,9 +365,9 @@ static char *cpuvendor_name(u32 cpuvendor)
static enum cputype setup_cpuid(u32 cpuvendor, u32 cpuid)
{
- u32 family, model;
+ u32 family, model, stepping;
- parse_cpuid(cpuid, &family, &model);
+ parse_cpuid(cpuid, &family, &model, &stepping);
switch (cpuvendor) {
case X86_VENDOR_INTEL:
@@ -465,12 +466,13 @@ static void dump_mce(struct mce *m, unsigned recordlen)
n += Wprintf("MICROCODE %x\n", m->microcode);
if (recordlen > offsetof(struct mce, cpuid) && m->cpuid) {
- u32 fam, mod;
- parse_cpuid(m->cpuid, &fam, &mod);
- Wprintf("CPUID Vendor %s Family %u Model %u\n",
+ u32 fam, mod, step;
+ parse_cpuid(m->cpuid, &fam, &mod, &step);
+ Wprintf("CPUID Vendor %s Family %u Model %u Step %u\n",
cpuvendor_name(m->cpuvendor),
fam,
- mod);
+ mod,
+ step);
}
if (cputype != CPU_SANDY_BRIDGE_EP && cputype != CPU_IVY_BRIDGE_EPEX &&
cputype != CPU_HASWELL_EPEX && cputype != CPU_BROADWELL &&