From: Filippo Sironi <sironi@amazon.de>
To: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
<linux-edac@vkeg.kernel.org>
Cc: <sironi@amazon.de>, <tony.luck@intel.com>, <bp@alien8.de>,
<tglx@linutronix.de>, <mingo@redhat.com>,
<dave.hansen@linux.intel.com>, <hpa@zytor.com>
Subject: [PATCH] x86/MCE: Get microcode revision from cpu_data instead of boot_cpu_data
Date: Fri, 1 Dec 2023 11:23:27 +0000 [thread overview]
Message-ID: <20231201112327.42319-1-sironi@amazon.de> (raw)
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@amazon.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
next reply other threads:[~2023-12-01 11:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 11:23 Filippo Sironi [this message]
2023-12-01 18:58 ` Tony Luck
2023-12-01 19:00 ` Borislav Petkov
2023-12-01 19:56 ` Sironi, Filippo
2023-12-06 21:04 ` Borislav Petkov
2023-12-07 9:34 ` Sironi, Filippo
2023-12-01 18:59 ` Borislav Petkov
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=20231201112327.42319-1-sironi@amazon.de \
--to=sironi@amazon.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-edac@vkeg.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--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®