All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/microcode: Print previous version of microcode after reload
@ 2022-08-29 18:10 Ashok Raj
  2022-08-29 18:17 ` Luck, Tony
  2022-09-02  6:16 ` [tip: x86/microcode] " tip-bot2 for Ashok Raj
  0 siblings, 2 replies; 3+ messages in thread
From: Ashok Raj @ 2022-08-29 18:10 UTC (permalink / raw)
  To: Borislav Petkov, Thomas Gleixner
  Cc: LKML Mailing List, X86-kernel, Dave Hansen, Andy Lutomirski,
	Ingo Molnar, Ashok Raj, Tom Lendacky, Tony Luck

It will be useful to print both old and new versions of microcode after a
reload is complete.

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
---
 arch/x86/kernel/cpu/microcode/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index ad57e0e4d674..6a41cee242f6 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -491,7 +491,7 @@ static int __reload_late(void *info)
  */
 static int microcode_reload_late(void)
 {
-	int ret;
+	int old = boot_cpu_data.microcode, ret;
 
 	pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
 	pr_err("You should switch to early loading, if possible.\n");
@@ -503,7 +503,8 @@ static int microcode_reload_late(void)
 	if (ret == 0)
 		microcode_check();
 
-	pr_info("Reload completed, microcode revision: 0x%x\n", boot_cpu_data.microcode);
+	pr_info("Reload completed, microcode revision: 0x%x -> 0x%x\n",
+		old, boot_cpu_data.microcode);
 
 	return ret;
 }
-- 
2.32.0


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

* RE: [PATCH] x86/microcode: Print previous version of microcode after reload
  2022-08-29 18:10 [PATCH] x86/microcode: Print previous version of microcode after reload Ashok Raj
@ 2022-08-29 18:17 ` Luck, Tony
  2022-09-02  6:16 ` [tip: x86/microcode] " tip-bot2 for Ashok Raj
  1 sibling, 0 replies; 3+ messages in thread
From: Luck, Tony @ 2022-08-29 18:17 UTC (permalink / raw)
  To: Raj, Ashok, Borislav Petkov, Thomas Gleixner
  Cc: LKML Mailing List, X86-kernel, Hansen, Dave, Lutomirski, Andy,
	Ingo Molnar, Tom Lendacky

> It will be useful to print both old and new versions of microcode after a
> reload is complete.

Yes, yes, yes! Many times I've had to dig deep to figure out what base microcode
was loaded by the BIOS because the early init update doesn't say what the old
version was.

Acked-by: Tony Luck <tony.luck@intel.com>

-Tony

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

* [tip: x86/microcode] x86/microcode: Print previous version of microcode after reload
  2022-08-29 18:10 [PATCH] x86/microcode: Print previous version of microcode after reload Ashok Raj
  2022-08-29 18:17 ` Luck, Tony
@ 2022-09-02  6:16 ` tip-bot2 for Ashok Raj
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Ashok Raj @ 2022-09-02  6:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Ashok Raj, Borislav Petkov, Tony Luck, x86, linux-kernel

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

Commit-ID:     7fce8d6eccbc31a561d07c79f359ad09f0424347
Gitweb:        https://git.kernel.org/tip/7fce8d6eccbc31a561d07c79f359ad09f0424347
Author:        Ashok Raj <ashok.raj@intel.com>
AuthorDate:    Mon, 29 Aug 2022 18:10:30 
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 02 Sep 2022 08:01:58 +02:00

x86/microcode: Print previous version of microcode after reload

Print both old and new versions of microcode after a reload is complete
because knowing the previous microcode version is sometimes important
from a debugging perspective.

  [ bp: Massage commit message. ]

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20220829181030.722891-1-ashok.raj@intel.com
---
 arch/x86/kernel/cpu/microcode/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index ad57e0e..6a41cee 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -491,7 +491,7 @@ wait_for_siblings:
  */
 static int microcode_reload_late(void)
 {
-	int ret;
+	int old = boot_cpu_data.microcode, ret;
 
 	pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
 	pr_err("You should switch to early loading, if possible.\n");
@@ -503,7 +503,8 @@ static int microcode_reload_late(void)
 	if (ret == 0)
 		microcode_check();
 
-	pr_info("Reload completed, microcode revision: 0x%x\n", boot_cpu_data.microcode);
+	pr_info("Reload completed, microcode revision: 0x%x -> 0x%x\n",
+		old, boot_cpu_data.microcode);
 
 	return ret;
 }

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

end of thread, other threads:[~2022-09-02  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 18:10 [PATCH] x86/microcode: Print previous version of microcode after reload Ashok Raj
2022-08-29 18:17 ` Luck, Tony
2022-09-02  6:16 ` [tip: x86/microcode] " tip-bot2 for Ashok Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.