mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 11:33:36 -04:00
x86/microcode/AMD: Clean the cache if update did not load microcode
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 the failed revision will always be selected from the cache on the next reload attempt. Since the failed revisions is not easily available at this point just clean the whole cache. It will be rebuilt later if needed. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20250327230503.1850368-3-boris.ostrovsky@oracle.com
This commit is contained in:
committed by
Borislav Petkov (AMD)
parent
0af2f6be1b
commit
321550859f
@@ -1171,11 +1171,18 @@ static void microcode_fini_cpu_amd(int cpu)
|
||||
uci->mc = NULL;
|
||||
}
|
||||
|
||||
static void finalize_late_load_amd(int result)
|
||||
{
|
||||
if (result)
|
||||
cleanup();
|
||||
}
|
||||
|
||||
static struct microcode_ops microcode_amd_ops = {
|
||||
.request_microcode_fw = request_microcode_amd,
|
||||
.collect_cpu_info = collect_cpu_info_amd,
|
||||
.apply_microcode = apply_microcode_amd,
|
||||
.microcode_fini_cpu = microcode_fini_cpu_amd,
|
||||
.finalize_late_load = finalize_late_load_amd,
|
||||
.nmi_safe = true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user