40
40
#include <asm/msr.h>
41
41
42
42
/*
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.
46
50
*/
47
51
static unsigned long mc_tmp_ptrs [MAX_UCODE_COUNT ];
48
52
@@ -57,6 +61,7 @@ static struct ucode_blobs {
57
61
bool valid ;
58
62
} blobs ;
59
63
64
+ /* Go through saved patches and find the one suitable for the current CPU. */
60
65
static enum ucode_state
61
66
find_microcode_patch (struct microcode_intel * * saved ,
62
67
unsigned int num_saved , struct ucode_cpu_info * uci )
@@ -466,6 +471,7 @@ static void show_saved_mc(void)
466
471
static void save_mc_for_early (u8 * mc )
467
472
{
468
473
#ifdef CONFIG_HOTPLUG_CPU
474
+ /* Synchronization during CPU hotplug. */
469
475
static DEFINE_MUTEX (x86_cpu_microcode_mutex );
470
476
471
477
struct microcode_intel * mc_saved_tmp [MAX_UCODE_COUNT ];
@@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc)
474
480
struct microcode_intel * * mc_saved ;
475
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
483
mutex_lock (& x86_cpu_microcode_mutex );
482
484
483
485
mc_saved_count_init = mc_saved_data .num_saved ;
0 commit comments