Skip to content

Commit fa94d0c

Browse files
aeglKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Yazen Ghannam <[email protected]> Cc: linux-edac <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected]
1 parent 1b88acc commit fa94d0c

File tree

2 files changed

+4
-1
lines changed
  • arch/x86

2 files changed

+4
-1
lines changed

arch/x86/include/uapi/asm/mce.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct mce {
3030
__u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */
3131
__u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
3232
__u64 ppin; /* Protected Processor Inventory Number */
33+
__u32 microcode;/* Microcode revision */
3334
};
3435

3536
#define MCE_GET_RECORD_LEN _IOR('M', 1, int)

arch/x86/kernel/cpu/mcheck/mce.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ void mce_setup(struct mce *m)
130130

131131
if (this_cpu_has(X86_FEATURE_INTEL_PPIN))
132132
rdmsrl(MSR_PPIN, m->ppin);
133+
134+
m->microcode = boot_cpu_data.microcode;
133135
}
134136

135137
DEFINE_PER_CPU(struct mce, injectm);
@@ -262,7 +264,7 @@ static void __print_mce(struct mce *m)
262264
*/
263265
pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n",
264266
m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid,
265-
cpu_data(m->extcpu).microcode);
267+
m->microcode);
266268
}
267269

268270
static void print_mce(struct mce *m)

0 commit comments

Comments
 (0)