mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] x86/microcode/amd: fix the return value when microcode has no update
       [not found] <2.49.0.901.g37484f566f-goog>
@ 2025-04-30  5:34 ` Annie Li
  2025-04-30 15:21   ` [tip: x86/microcode] x86/microcode/AMD: Do not return error when microcode update is not necessary tip-bot2 for Annie Li
  0 siblings, 1 reply; 2+ messages in thread
From: Annie Li @ 2025-04-30  5:34 UTC (permalink / raw)
  To: Borislav Petkov, Thomas Gleixner, Ingo Molnar
  Cc: Dave Hansen, H. Peter Anvin, Nikolay Borisov, x86, linux-kernel,
	Annie Li

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.

Add UCODE_OK in switch case to avoid this error.

Fixes: 6f059e634dcd ("x86/microcode: Clarify the late load logic")
Signed-off-by: Annie Li <jiayanli@google.com>
---
Changelog since v1:
- Change the return value back to UCODE_OK and adding a switch case
  about UCODE_OK.

 arch/x86/kernel/cpu/microcode/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index b3658d11e7b69..2309321cf6a19 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -686,6 +686,8 @@ static int load_late_locked(void)
 		return load_late_stop_cpus(true);
 	case UCODE_NFOUND:
 		return -ENOENT;
+	case UCODE_OK:
+		return 0;
 	default:
 		return -EBADFD;
 	}
-- 
2.49.0.901.g37484f566f-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: x86/microcode] x86/microcode/AMD: Do not return error when microcode update is not necessary
  2025-04-30  5:34 ` [PATCH v2] x86/microcode/amd: fix the return value when microcode has no update Annie Li
@ 2025-04-30 15:21   ` tip-bot2 for Annie Li
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Annie Li @ 2025-04-30 15:21 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Annie Li, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/microcode branch of tip:

Commit-ID:     b43dc4ab097859c24e2a6993119c927cffc856aa
Gitweb:        https://git.kernel.org/tip/b43dc4ab097859c24e2a6993119c927cffc856aa
Author:        Annie Li <jiayanli@google.com>
AuthorDate:    Wed, 30 Apr 2025 05:34:24 
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 30 Apr 2025 17:10:46 +02:00

x86/microcode/AMD: Do not return error when microcode update is not necessary

After

  6f059e634dcd("x86/microcode: Clarify the late load logic"),

if the load is up-to-date, the AMD side returns UCODE_OK which leads to
load_late_locked() returning -EBADFD.

Handle UCODE_OK in the switch case to avoid this error.

  [ bp: Massage commit message. ]

Fixes: 6f059e634dcd ("x86/microcode: Clarify the late load logic")
Signed-off-by: Annie Li <jiayanli@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250430053424.77438-1-jiayanli@google.com
---
 arch/x86/kernel/cpu/microcode/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index b3658d1..2309321 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -686,6 +686,8 @@ static int load_late_locked(void)
 		return load_late_stop_cpus(true);
 	case UCODE_NFOUND:
 		return -ENOENT;
+	case UCODE_OK:
+		return 0;
 	default:
 		return -EBADFD;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-30 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2.49.0.901.g37484f566f-goog>
2025-04-30  5:34 ` [PATCH v2] x86/microcode/amd: fix the return value when microcode has no update Annie Li
2025-04-30 15:21   ` [tip: x86/microcode] x86/microcode/AMD: Do not return error when microcode update is not necessary tip-bot2 for Annie Li

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®