x86/microcode/amd: fix the return value when microcode has no update
Subsystems (2)
PATCH 1/1 x86/microcode/amd: fix the return value when microcode has no update
In commit 6f059e634dcd("x86/microcode: Clarify the late load logic"), the return value is UCODE_OK if the load is up-to-date in amd platform, which leads to load_late_locked() returning -EBADFD.
This is different from the intel platform, which will return UCODE_NFOUND and is more reasonable.
Fix the return to UCODE_NFOUND to avoid -EBADFD error.
--- arch/x86/kernel/cpu/microcode/amd.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/microcode/amd.c +2 -0
@@ -1074,6 +1074,8 @@ static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t sizif (ret !=UCODE_OK )return ret; + ret =UCODE_NFOUND ; +for_each_node_with_cpus (nid) { cpu =cpumask_first (cpumask_of_node (nid)); c = &cpu_data (cpu);
Signature · 1 line
2.49.0.901.g37484f566f-goog
Borislav Petkov
maintainerQuoted 8 lines · Annie Li
In commit 6f059e634dcd("x86/microcode: Clarify the late load logic"), the return value is
UCODE_OKif the load is up-to-date in amd platform, which leads toload_late_locked()returning-EBADFD.This is different from the intel platform, which will return
UCODE_NFOUNDand is more reasonable.Fix the return to
UCODE_NFOUNDto avoid-EBADFDerror.
... and return -ENOENT instead?
Is that better?
Or would it be even better for the switch-case to handle UCODE_OK too?
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette