Re: [PATCH 0/2] Clear AMD's microcode cache on load failure
From: Ingo Molnar
Date: Fri Mar 28 2025 - 09:51:56 EST
* boris.ostrovsky@xxxxxxxxxx <boris.ostrovsky@xxxxxxxxxx> wrote:
>
> On 3/27/25 5:33 PM, Ingo Molnar wrote:
> > * Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
> >
> > > Drop microcode cache when load operation fails to update microcode.
> > >
> > > Also make __apply_microcode_amd() return correct error.
> > >
> > > Boris Ostrovsky (2):
> > > x86/microcode/AMD: Fix __apply_microcode_amd()'s return value
> > > x86/microcode/AMD: Clean the cache if update did not load microcode
> > >
> > > arch/x86/kernel/cpu/microcode/amd.c | 9 ++++++++-
> > > 1 file changed, 8 insertions(+), 1 deletion(-)
> > Should these be Cc: stable perhaps?
>
>
> Definitely the first patch. The second one is not really a fix but rather an
> improvement.
Well, #2 seems to be fixing a real bug too:
If microcode did not get loaded there is no reason to keep it in the cache.
Moreover, if loading failed it will not be possible to load an earlier
version of microcode since failed version will always be selected from
the cache on next reload attempt.
this bug basically regresses the ability to load an earlier version of
the microcode, if a newer version's loading has failed.
It would be a pretty common usecase to attempt to load the earlier
version if the loading of a new one doesn't succeed, right?
Thanks,
Ingo