Skip to content

Commit 9f3cc2a

Browse files
suryasaimadhuIngo Molnar
authored andcommitted
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: Borislav 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.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent a13004a commit 9f3cc2a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Documentation/x86/early-microcode.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ Builtin microcode
4545
=================
4646

4747
We can also load builtin microcode supplied through the regular firmware
48-
builtin method CONFIG_FIRMWARE_IN_KERNEL. Here's an example:
48+
builtin method CONFIG_FIRMWARE_IN_KERNEL. Only 64-bit is currently
49+
supported.
50+
51+
Here's an example:
4952

5053
CONFIG_FIRMWARE_IN_KERNEL=y
5154
CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin"

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@
4040
#include <asm/msr.h>
4141

4242
/*
43-
* Temporary microcode blobs pointers storage. We note here the pointers to
44-
* microcode blobs we've got from whatever storage (detached initrd, builtin).
45-
* Later on, we put those into final storage mc_saved_data.mc_saved.
43+
* Temporary microcode blobs pointers storage. We note here during early load
44+
* the pointers to microcode blobs we've got from whatever storage (detached
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.
4650
*/
4751
static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT];
4852

@@ -57,6 +61,7 @@ static struct ucode_blobs {
5761
bool valid;
5862
} blobs;
5963

64+
/* Go through saved patches and find the one suitable for the current CPU. */
6065
static enum ucode_state
6166
find_microcode_patch(struct microcode_intel **saved,
6267
unsigned int num_saved, struct ucode_cpu_info *uci)
@@ -466,6 +471,7 @@ static void show_saved_mc(void)
466471
static void save_mc_for_early(u8 *mc)
467472
{
468473
#ifdef CONFIG_HOTPLUG_CPU
474+
/* Synchronization during CPU hotplug. */
469475
static DEFINE_MUTEX(x86_cpu_microcode_mutex);
470476

471477
struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
@@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc)
474480
struct microcode_intel **mc_saved;
475481
int ret, i;
476482

477-
/*
478-
* Hold hotplug lock so mc_saved_data is not accessed by a CPU in
479-
* hotplug.
480-
*/
481483
mutex_lock(&x86_cpu_microcode_mutex);
482484

483485
mc_saved_count_init = mc_saved_data.num_saved;

0 commit comments

Comments
 (0)