summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/microcode/core.c
diff options
context:
space:
mode:
authorAshok Raj <ashok.raj@intel.com>2023-01-09 07:35:50 -0800
committerBorislav Petkov (AMD) <bp@alien8.de>2023-01-20 21:45:13 +0100
commitab31c74455c64e69342ddab21fd9426fcbfefde7 (patch)
treecb1d90a528efc24e1cccc853ef3aa052ef83f4e8 /arch/x86/kernel/cpu/microcode/core.c
parent59047d942bedc4ce88a2121a9f9e656b9532dd30 (diff)
downloadlwn-ab31c74455c64e69342ddab21fd9426fcbfefde7.tar.gz
lwn-ab31c74455c64e69342ddab21fd9426fcbfefde7.zip
x86/microcode: Add a parameter to microcode_check() to store CPU capabilities
Add a parameter to store CPU capabilities before performing a microcode update so that CPU capabilities can be compared before and after update. [ bp: Massage. ] Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230109153555.4986-2-ashok.raj@intel.com
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/core.c')
-rw-r--r--arch/x86/kernel/cpu/microcode/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 99abb318aa7f..dc5dfba7e78e 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -438,6 +438,7 @@ wait_for_siblings:
static int microcode_reload_late(void)
{
int old = boot_cpu_data.microcode, ret;
+ struct cpuinfo_x86 prev_info;
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");
@@ -447,7 +448,7 @@ static int microcode_reload_late(void)
ret = stop_machine_cpuslocked(__reload_late, NULL, cpu_online_mask);
if (ret == 0)
- microcode_check();
+ microcode_check(&prev_info);
pr_info("Reload completed, microcode revision: 0x%x -> 0x%x\n",
old, boot_cpu_data.microcode);