Skip to content

Commit d2700f4

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
x86/microcode/intel: Remove pointless mutex
There is no concurrency. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d44450c commit d2700f4

File tree

1 file changed

+2
-22
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+2
-22
lines changed

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

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -397,22 +397,6 @@ scan_microcode(void *data, size_t size, struct ucode_cpu_info *uci, bool save)
397397
return patch;
398398
}
399399

400-
/*
401-
* Save this microcode patch. It will be loaded early when a CPU is
402-
* hot-added or resumes.
403-
*/
404-
static void save_mc_for_early(struct ucode_cpu_info *uci, u8 *mc, unsigned int size)
405-
{
406-
/* Synchronization during CPU hotplug. */
407-
static DEFINE_MUTEX(x86_cpu_microcode_mutex);
408-
409-
mutex_lock(&x86_cpu_microcode_mutex);
410-
411-
save_microcode_patch(uci, mc, size);
412-
413-
mutex_unlock(&x86_cpu_microcode_mutex);
414-
}
415-
416400
static bool load_builtin_intel_microcode(struct cpio_data *cp)
417401
{
418402
unsigned int eax = 1, ebx, ecx = 0, edx;
@@ -829,12 +813,8 @@ static enum ucode_state generic_load_microcode(int cpu, struct iov_iter *iter)
829813
vfree(uci->mc);
830814
uci->mc = (struct microcode_intel *)new_mc;
831815

832-
/*
833-
* If early loading microcode is supported, save this mc into
834-
* permanent memory. So it will be loaded early when a CPU is hot added
835-
* or resumes.
836-
*/
837-
save_mc_for_early(uci, new_mc, new_mc_size);
816+
/* Save for CPU hotplug */
817+
save_microcode_patch(uci, new_mc, new_mc_size);
838818

839819
pr_debug("CPU%d found a matching microcode update with version 0x%x (current=0x%x)\n",
840820
cpu, new_rev, uci->cpu_sig.rev);

0 commit comments

Comments
 (0)