[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231201112327.42319-1-sironi@amazon.de>
Date: Fri, 1 Dec 2023 11:23:27 +0000
From: Filippo Sironi <sironi@...zon.de>
To: <linux-kernel@...r.kernel.org>, <x86@...nel.org>,
<linux-edac@...g.kernel.org>
CC: <sironi@...zon.de>, <tony.luck@...el.com>, <bp@...en8.de>,
<tglx@...utronix.de>, <mingo@...hat.com>,
<dave.hansen@...ux.intel.com>, <hpa@...or.com>
Subject: [PATCH] x86/MCE: Get microcode revision from cpu_data instead of boot_cpu_data
Commit fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check
records") extended MCE entries to report the microcode revision taken
from boot_cpu_data. Unfortunately, boot_cpu_data isn't updated on late
microcode loading, thus making MCE entries slightly incorrect. Use
cpu_data instead, which is updated on late microcode loading. This also
fixes the corner case in which the microcode revision isn't coherent
across CPUs (which may happen on late microcode loading failure).
Signed-off-by: Filippo Sironi <sironi@...zon.de>
---
arch/x86/kernel/cpu/mce/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 7b397370b4d6..e1b033298db0 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -127,7 +127,7 @@ void mce_setup(struct mce *m)
m->apicid = cpu_data(m->extcpu).topo.initial_apicid;
m->mcgcap = __rdmsr(MSR_IA32_MCG_CAP);
m->ppin = cpu_data(m->extcpu).ppin;
- m->microcode = boot_cpu_data.microcode;
+ m->microcode = cpu_data(m->extcpu).microcode;
}
DEFINE_PER_CPU(struct mce, injectm);
--
2.33.0
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Powered by blists - more mailing lists