aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/x86/early-microcode.txt5
-rw-r--r--arch/x86/kernel/cpu/microcode/intel.c16
2 files changed, 13 insertions, 8 deletions
diff --git a/Documentation/x86/early-microcode.txt b/Documentation/x86/early-microcode.txt
index c956d99cf1de..07749e7f3d50 100644
--- a/Documentation/x86/early-microcode.txt
+++ b/Documentation/x86/early-microcode.txt
@@ -45,7 +45,10 @@ Builtin microcode
45================= 45=================
46 46
47We can also load builtin microcode supplied through the regular firmware 47We can also load builtin microcode supplied through the regular firmware
48builtin method CONFIG_FIRMWARE_IN_KERNEL. Here's an example: 48builtin method CONFIG_FIRMWARE_IN_KERNEL. Only 64-bit is currently
49supported.
50
51Here's an example:
49 52
50CONFIG_FIRMWARE_IN_KERNEL=y 53CONFIG_FIRMWARE_IN_KERNEL=y
51CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin" 54CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin"
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 359e2034b558..8962d6acee39 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -40,9 +40,13 @@
40#include <asm/msr.h> 40#include <asm/msr.h>
41 41
42/* 42/*
43 * Temporary microcode blobs pointers storage. We note here the pointers to 43 * Temporary microcode blobs pointers storage. We note here during early load
44 * microcode blobs we've got from whatever storage (detached initrd, builtin). 44 * the pointers to microcode blobs we've got from whatever storage (detached
45 * Later on, we put those into final storage mc_saved_data.mc_saved. 45 * initrd, builtin). Later on, we put those into final storage
46 * mc_saved_data.mc_saved.
47 *
48 * Important: those are offsets from the beginning of initrd or absolute
49 * addresses within the kernel image when built-in.
46 */ 50 */
47static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT]; 51static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT];
48 52
@@ -57,6 +61,7 @@ static struct ucode_blobs {
57 bool valid; 61 bool valid;
58} blobs; 62} blobs;
59 63
64/* Go through saved patches and find the one suitable for the current CPU. */
60static enum ucode_state 65static enum ucode_state
61find_microcode_patch(struct microcode_intel **saved, 66find_microcode_patch(struct microcode_intel **saved,
62 unsigned int num_saved, struct ucode_cpu_info *uci) 67 unsigned int num_saved, struct ucode_cpu_info *uci)
@@ -466,6 +471,7 @@ static void show_saved_mc(void)
466static void save_mc_for_early(u8 *mc) 471static void save_mc_for_early(u8 *mc)
467{ 472{
468#ifdef CONFIG_HOTPLUG_CPU 473#ifdef CONFIG_HOTPLUG_CPU
474 /* Synchronization during CPU hotplug. */
469 static DEFINE_MUTEX(x86_cpu_microcode_mutex); 475 static DEFINE_MUTEX(x86_cpu_microcode_mutex);
470 476
471 struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; 477 struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
@@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc)
474 struct microcode_intel **mc_saved; 480 struct microcode_intel **mc_saved;
475 int ret, i; 481 int ret, i;
476 482
477 /*
478 * Hold hotplug lock so mc_saved_data is not accessed by a CPU in
479 * hotplug.
480 */
481 mutex_lock(&x86_cpu_microcode_mutex); 483 mutex_lock(&x86_cpu_microcode_mutex);
482 484
483 mc_saved_count_init = mc_saved_data.num_saved; 485 mc_saved_count_init = mc_saved_data.num_saved;