From: "Sironi, Filippo" <sironi@amazon.de>
To: Tony Luck <tony.luck@intel.com>, "bp@alien8.de" <bp@alien8.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: Re: [PATCH] x86/MCE: Get microcode revision from cpu_data instead of boot_cpu_data
Date: Fri, 1 Dec 2023 19:56:59 +0000 [thread overview]
Message-ID: <5A9651E8-AB49-4B8E-9B98-65708E8E8E4E@amazon.de> (raw)
In-Reply-To: <ZWos70EKhlAl2VPb@agluck-desk3>
> On Fri, Dec 01, 2023 at 11:23:27AM +0000, Filippo Sironi wrote:
>> 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
>
> This code in intel.c:apply_microcode_late() looks like it tries to update
> boot_cpu_data:
>
>
> 466 cpu_data(cpu).microcode = uci->cpu_sig.rev;
> 467 if (!cpu)
> 468 boot_cpu_data.microcode = uci->cpu_sig.rev;
>
>
> Is that not working for some reason?
It is... I had this change in our tree for a long long while and just
realized that the issue of boot_cpu_data not being updated was addressed
with commit 370a132bb222 ("x86/microcode: Make sure
boot_cpu_data.microcode is up-to-date").
>> 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).
>
>
> But this does seem a worthwhile change to help diagnose things if late
> load is somehow only applied to some subset of CPUs.
Yes, but, as Boris points out:
>> But this does seem a worthwhile change to help diagnose things if late
>> load is somehow only applied to some subset of CPUs.
>
> We already do that, see load_late_stop_cpus().
Boris, I just took a quick look and I might be missing something. If cores
fail to load the microcode or timeout, we taint the kernel, print an error
message, and then bubble up an error to userspace via:
load_late_stop_cpus
load_late_locked
reload_store
Right?
We would take servers that fail out of production; however, for others it might
be interesting to have the correct information. The patch - with a reworked
commit message - might still be useful to a few.
Filippo
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 parent reply other threads:[~2023-12-01 19:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231201112327.42319-1-sironi@amazon.de>
[not found] ` <ZWos70EKhlAl2VPb@agluck-desk3>
2023-12-01 19:56 ` Sironi, Filippo [this message]
2023-12-06 21:04 ` [PATCH] x86/MCE: Get microcode revision from cpu_data instead of boot_cpu_data Borislav Petkov
2023-12-07 9:34 ` Sironi, Filippo
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=5A9651E8-AB49-4B8E-9B98-65708E8E8E4E@amazon.de \
--to=sironi@amazon.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).