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
This commit is contained in:
Ashok Raj 2022-08-29 18:10:30 +00:00 committed by Borislav Petkov
parent 8c61eafd22
commit 7fce8d6ecc
1 changed files with 3 additions and 2 deletions

View File

@ -491,7 +491,7 @@ wait_for_siblings:
*/ */
static int microcode_reload_late(void) 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("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
pr_err("You should switch to early loading, if possible.\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) if (ret == 0)
microcode_check(); 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; return ret;
} }