Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/MCE: Save microcode revision in machine check records

Updating microcode used to be relatively rare. Now that it has become
more common we should save the microcode version in a machine check
record to make sure that those people looking at the error have this
important information bundled with the rest of the logged information.

[ Borislav: Simplify a bit. ]

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20180301233449.24311-1-tony.luck@intel.com

authored by

Tony Luck and committed by
Thomas Gleixner
fa94d0c6 1b88accf

+4 -1
+1
arch/x86/include/uapi/asm/mce.h
··· 30 30 __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */ 31 31 __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ 32 32 __u64 ppin; /* Protected Processor Inventory Number */ 33 + __u32 microcode;/* Microcode revision */ 33 34 }; 34 35 35 36 #define MCE_GET_RECORD_LEN _IOR('M', 1, int)
+3 -1
arch/x86/kernel/cpu/mcheck/mce.c
··· 130 130 131 131 if (this_cpu_has(X86_FEATURE_INTEL_PPIN)) 132 132 rdmsrl(MSR_PPIN, m->ppin); 133 + 134 + m->microcode = boot_cpu_data.microcode; 133 135 } 134 136 135 137 DEFINE_PER_CPU(struct mce, injectm); ··· 264 262 */ 265 263 pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n", 266 264 m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid, 267 - cpu_data(m->extcpu).microcode); 265 + m->microcode); 268 266 } 269 267 270 268 static void print_mce(struct mce *m)