From: Ashok Raj <ashok.raj@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML Mailing List <linux-kernel@vger.kernel.org>,
X86-kernel <x86@kernel.org>, Tony Luck <tony.luck@intel.com>,
Dave Hansen <dave.hansen@intel.com>,
Arjan van de Ven <arjan.van.de.ven@intel.com>,
Andy Lutomirski <luto@kernel.org>,
"Jacon Jun Pan" <jacob.jun.pan@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
"Kai Huang" <kai.huang@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
"Ashok Raj" <ashok.raj@intel.com>
Subject: Re: [v2 03/13] x86/microcode/intel: Fix a hang if early loading microcode fails
Date: Wed, 9 Nov 2022 08:07:32 -0800 [thread overview]
Message-ID: <Y2vQRMyOndQtG/yJ@a4bf019067fa.jf.intel.com> (raw)
In-Reply-To: <Y2uODnpkSvQs/nbU@zn.tnic>
On Wed, Nov 09, 2022 at 12:25:02PM +0100, Borislav Petkov wrote:
> On Thu, Nov 03, 2022 at 05:58:51PM +0000, Ashok Raj wrote:
> > When early loading of microcode fails for any reason other than the wrong
> > family-model-stepping, Linux can get into an infinite loop retrying the
> > same failed load.
> >
> > A single retry is needed to handle any mixed stepping case.
> >
> > Assume we have a microcode that fails to load for some reason.
> > load_ucode_ap() seems to retry if the loading fails. But it searches for
>
> Seems to retry because we were supporting mixed revisions. Which we do
> not now.
The retry wasn't the problem, but hitting the same failed microcode over
and over is the problem. It is called out in the commit log.
As part of dropping mixed stepping, we can drop this retry.
Maybe the right way is to remember if the bsp failed, then there is no
point in trying to apply on the AP's.
reload_early_microcode->reload_ucode_intel()
->apply_microcode_intel()
we aren't checking if early load failed for bsp, we should save and
skip loading on all AP's.
>
> And if you say "seems" then this sounds like the problem hasn't been
> analyzed properly. If this can happen with the current code, then this
> needs to be fixed in stable. So, how do you trigger exactly?
>
> I'd like to reproduce it myself.
Certainly, take the fms+pf of the platform you are testing.
- Take a microcode file from the distribution for a different fms that didn't
belong to the one you are testing.
- You will have to fake the external header data and change it to the one
you want microcode match to work
- recompute all checksums and use that file instead of the original file.
I accidently ran into it since I had a copy of debug uCode that require
additional steps before loading.
I have a tool that I can change to give you some production microcode that
will fail in your platform. Just provide me with the fms+pf values, and I
an provide one for your test.
Let me know if you need one for testing.
>
> As to this patch: it should simply be removing the retrying instead of
> doing silly crap like
>
> bool retried = false;
>
> ...
>
> In light of how a lot has changed since last time, yes, please redo the
> patchset ontop of tip:x86/microcode, keeping in mind now that we don't
> support mixed revisions anymore.
>
> Just like dhansen said, you can split it in fixes and new features so
> that it is not too many patches at once - your call.
That makes sense, I'll send the bug fix patches separately.
Cheers,
Ashok
next prev parent reply other threads:[~2022-11-09 16:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 17:58 [v2 00/13] Make microcode late loading more robust Ashok Raj
2022-11-03 17:58 ` [v2 01/13] x86/microcode/intel: Prevent printing updated microcode rev multiple times Ashok Raj
2022-11-04 11:00 ` Borislav Petkov
2022-11-04 13:53 ` Van De Ven, Arjan
2022-11-04 15:52 ` Borislav Petkov
2022-11-04 18:28 ` Ashok Raj
2022-11-04 20:21 ` Borislav Petkov
2022-11-06 13:35 ` Borislav Petkov
2022-11-07 4:17 ` Ashok Raj
2022-11-07 16:12 ` Ashok Raj
2022-11-07 18:47 ` Borislav Petkov
2022-11-08 23:06 ` Ashok Raj
2022-11-08 23:32 ` Dave Hansen
2022-11-09 9:18 ` Borislav Petkov
2022-12-03 13:51 ` [tip: x86/microcode] x86/microcode/intel: Do not print microcode revision and processor flags tip-bot2 for Ashok Raj
2022-11-03 17:58 ` [v2 02/13] x86/microcode/intel: Print old and new rev after early microcode update Ashok Raj
2022-11-03 17:58 ` [v2 03/13] x86/microcode/intel: Fix a hang if early loading microcode fails Ashok Raj
2022-11-09 11:25 ` Borislav Petkov
2022-11-09 16:07 ` Ashok Raj [this message]
2022-11-09 23:34 ` Borislav Petkov
2022-11-03 17:58 ` [v2 04/13] x86/microcode: Fix microcode_check() compare after a new uCode update Ashok Raj
2022-11-03 17:58 ` [v2 05/13] x86/microcode: Move late-load warning to earlier where kernel taint happens Ashok Raj
2022-11-03 17:58 ` [v2 06/13] x86/ipi: Support sending NMI_VECTOR as self ipi Ashok Raj
2022-11-03 17:58 ` [v2 07/13] x86/microcode: Place siblings in NMI loop while update in progress Ashok Raj
2022-11-03 17:58 ` [v2 08/13] x86/mce: Warn of a microcode update is in progress when MCE arrives Ashok Raj
2022-11-03 17:58 ` [v2 09/13] x86/microcode/intel: Add minimum required revision to microcode header Ashok Raj
2022-11-03 17:58 ` [v2 10/13] x86/microcode: Add a generic mechanism to declare support for minrev Ashok Raj
2022-11-03 17:58 ` [v2 11/13] x86/microcode/intel: Drop wbinvd() from microcode loading Ashok Raj
2022-11-03 17:59 ` [v2 12/13] x86/microcode: Display revisions only when update is successful Ashok Raj
2022-11-03 17:59 ` [v2 13/13] x86/microcode/intel: Add ability to update microcode even if rev is unchanged Ashok Raj
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=Y2vQRMyOndQtG/yJ@a4bf019067fa.jf.intel.com \
--to=ashok.raj@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=arjan.van.de.ven@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=jacob.jun.pan@intel.com \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--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®