| 1 |
From 84749d83758af6576552046b215b9b7f37f9556b Mon Sep 17 00:00:00 2001 |
| 2 |
From: Borislav Petkov <[email protected]> |
| 3 |
Date: Sat, 21 Apr 2018 10:19:29 +0200 |
| 4 |
Subject: x86/microcode/intel: Save microcode patch unconditionally |
| 5 |
|
| 6 |
save_mc_for_early() was a no-op on !CONFIG_HOTPLUG_CPU but the |
| 7 |
generic_load_microcode() path saves the microcode patches it has found into |
| 8 |
the cache of patches which is used for late loading too. Regardless of |
| 9 |
whether CPU hotplug is used or not. |
| 10 |
|
| 11 |
Make the saving unconditional so that late loading can find the proper |
| 12 |
patch. |
| 13 |
|
| 14 |
Reported-by: Vitezslav Samel <[email protected]> |
| 15 |
Signed-off-by: Borislav Petkov <[email protected]> |
| 16 |
Signed-off-by: Thomas Gleixner <[email protected]> |
| 17 |
Tested-by: Vitezslav Samel <[email protected]> |
| 18 |
Tested-by: Ashok Raj <[email protected]> |
| 19 |
Cc: [email protected] |
| 20 |
Link: http://lkml.kernel.org/r/[email protected] |
| 21 |
Link: https://lkml.kernel.org/r/[email protected] |
| 22 |
--- |
| 23 |
arch/x86/kernel/cpu/microcode/intel.c | 2 -- |
| 24 |
1 file changed, 2 deletions(-) |
| 25 |
|
| 26 |
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c |
| 27 |
index 32b8e57..1c2cfa0 100644 |
| 28 |
--- a/arch/x86/kernel/cpu/microcode/intel.c |
| 29 |
+++ b/arch/x86/kernel/cpu/microcode/intel.c |
| 30 |
@@ -485,7 +485,6 @@ static void show_saved_mc(void) |
| 31 |
*/ |
| 32 |
static void save_mc_for_early(u8 *mc, unsigned int size) |
| 33 |
{ |
| 34 |
-#ifdef CONFIG_HOTPLUG_CPU |
| 35 |
/* Synchronization during CPU hotplug. */ |
| 36 |
static DEFINE_MUTEX(x86_cpu_microcode_mutex); |
| 37 |
|
| 38 |
@@ -495,7 +494,6 @@ static void save_mc_for_early(u8 *mc, unsigned int size) |
| 39 |
show_saved_mc(); |
| 40 |
|
| 41 |
mutex_unlock(&x86_cpu_microcode_mutex); |
| 42 |
-#endif |
| 43 |
} |
| 44 |
|
| 45 |
static bool load_builtin_intel_microcode(struct cpio_data *cp) |
| 46 |
-- |
| 47 |
cgit v1.1 |
| 48 |
|