Commit 9f3cc2a0 authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar

Documentation/microcode: Document some aspects for more clarity

Document that builtin microcode is 64-bit only. Also, improve/add
comments to places.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-doc@vger.kernel.org
Link: http://lkml.kernel.org/r/1465225850-7352-10-git-send-email-bp@alien8.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent a13004a2
...@@ -45,7 +45,10 @@ Builtin microcode ...@@ -45,7 +45,10 @@ Builtin microcode
================= =================
We can also load builtin microcode supplied through the regular firmware We can also load builtin microcode supplied through the regular firmware
builtin method CONFIG_FIRMWARE_IN_KERNEL. Here's an example: builtin method CONFIG_FIRMWARE_IN_KERNEL. Only 64-bit is currently
supported.
Here's an example:
CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin" CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin"
......
...@@ -40,9 +40,13 @@ ...@@ -40,9 +40,13 @@
#include <asm/msr.h> #include <asm/msr.h>
/* /*
* Temporary microcode blobs pointers storage. We note here the pointers to * Temporary microcode blobs pointers storage. We note here during early load
* microcode blobs we've got from whatever storage (detached initrd, builtin). * the pointers to microcode blobs we've got from whatever storage (detached
* Later on, we put those into final storage mc_saved_data.mc_saved. * initrd, builtin). Later on, we put those into final storage
* mc_saved_data.mc_saved.
*
* Important: those are offsets from the beginning of initrd or absolute
* addresses within the kernel image when built-in.
*/ */
static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT]; static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT];
...@@ -57,6 +61,7 @@ static struct ucode_blobs { ...@@ -57,6 +61,7 @@ static struct ucode_blobs {
bool valid; bool valid;
} blobs; } blobs;
/* Go through saved patches and find the one suitable for the current CPU. */
static enum ucode_state static enum ucode_state
find_microcode_patch(struct microcode_intel **saved, find_microcode_patch(struct microcode_intel **saved,
unsigned int num_saved, struct ucode_cpu_info *uci) unsigned int num_saved, struct ucode_cpu_info *uci)
...@@ -466,6 +471,7 @@ static void show_saved_mc(void) ...@@ -466,6 +471,7 @@ static void show_saved_mc(void)
static void save_mc_for_early(u8 *mc) static void save_mc_for_early(u8 *mc)
{ {
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
/* Synchronization during CPU hotplug. */
static DEFINE_MUTEX(x86_cpu_microcode_mutex); static DEFINE_MUTEX(x86_cpu_microcode_mutex);
struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
...@@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc) ...@@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc)
struct microcode_intel **mc_saved; struct microcode_intel **mc_saved;
int ret, i; int ret, i;
/*
* Hold hotplug lock so mc_saved_data is not accessed by a CPU in
* hotplug.
*/
mutex_lock(&x86_cpu_microcode_mutex); mutex_lock(&x86_cpu_microcode_mutex);
mc_saved_count_init = mc_saved_data.num_saved; mc_saved_count_init = mc_saved_data.num_saved;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment