[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250429084317.1619909-1-jiayanli@google.com>
Date: Tue, 29 Apr 2025 08:43:16 +0000
From: Annie Li <jiayanli@...gle.com>
To: Borislav Petkov <bp@...en8.de>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>,
Nikolay Borisov <nik.borisov@...e.com>, x86@...nel.org, linux-kernel@...r.kernel.org,
Annie Li <jiayanli@...gle.com>
Subject: [PATCH] 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.
Fixes: 6f059e634dcd ("x86/microcode: Clarify the late load logic")
Signed-off-by: Annie Li <jiayanli@...gle.com>
---
arch/x86/kernel/cpu/microcode/amd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index b61028cf5c8a3..f90779dc1cac5 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -1074,6 +1074,8 @@ static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t siz
if (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);
--
2.49.0.901.g37484f566f-goog
Powered by blists - more mailing lists