diff options
-rw-r--r-- | arch/x86/include/asm/microcode_intel.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 15 |
2 files changed, 6 insertions, 14 deletions
diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h index 603417f8dd6c..5e69154c9f07 100644 --- a/arch/x86/include/asm/microcode_intel.h +++ b/arch/x86/include/asm/microcode_intel.h | |||
@@ -70,9 +70,4 @@ static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL; | |||
70 | static inline void reload_ucode_intel(void) {} | 70 | static inline void reload_ucode_intel(void) {} |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #ifdef CONFIG_HOTPLUG_CPU | ||
74 | extern int save_mc_for_early(u8 *mc); | ||
75 | #else | ||
76 | static inline int save_mc_for_early(u8 *mc) { return 0; } | ||
77 | #endif | ||
78 | #endif /* _ASM_X86_MICROCODE_INTEL_H */ | 73 | #endif /* _ASM_X86_MICROCODE_INTEL_H */ |
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index b5759a3f0aa8..359e2034b558 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c | |||
@@ -456,8 +456,6 @@ static void show_saved_mc(void) | |||
456 | #endif | 456 | #endif |
457 | } | 457 | } |
458 | 458 | ||
459 | #ifdef CONFIG_HOTPLUG_CPU | ||
460 | static DEFINE_MUTEX(x86_cpu_microcode_mutex); | ||
461 | /* | 459 | /* |
462 | * Save this mc into mc_saved_data. So it will be loaded early when a CPU is | 460 | * Save this mc into mc_saved_data. So it will be loaded early when a CPU is |
463 | * hot added or resumes. | 461 | * hot added or resumes. |
@@ -465,14 +463,16 @@ static DEFINE_MUTEX(x86_cpu_microcode_mutex); | |||
465 | * Please make sure this mc should be a valid microcode patch before calling | 463 | * Please make sure this mc should be a valid microcode patch before calling |
466 | * this function. | 464 | * this function. |
467 | */ | 465 | */ |
468 | int save_mc_for_early(u8 *mc) | 466 | static void save_mc_for_early(u8 *mc) |
469 | { | 467 | { |
468 | #ifdef CONFIG_HOTPLUG_CPU | ||
469 | static DEFINE_MUTEX(x86_cpu_microcode_mutex); | ||
470 | |||
470 | struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; | 471 | struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; |
471 | unsigned int mc_saved_count_init; | 472 | unsigned int mc_saved_count_init; |
472 | unsigned int num_saved; | 473 | unsigned int num_saved; |
473 | struct microcode_intel **mc_saved; | 474 | struct microcode_intel **mc_saved; |
474 | int ret = 0; | 475 | int ret, i; |
475 | int i; | ||
476 | 476 | ||
477 | /* | 477 | /* |
478 | * Hold hotplug lock so mc_saved_data is not accessed by a CPU in | 478 | * Hold hotplug lock so mc_saved_data is not accessed by a CPU in |
@@ -515,11 +515,8 @@ int save_mc_for_early(u8 *mc) | |||
515 | 515 | ||
516 | out: | 516 | out: |
517 | mutex_unlock(&x86_cpu_microcode_mutex); | 517 | mutex_unlock(&x86_cpu_microcode_mutex); |
518 | |||
519 | return ret; | ||
520 | } | ||
521 | EXPORT_SYMBOL_GPL(save_mc_for_early); | ||
522 | #endif | 518 | #endif |
519 | } | ||
523 | 520 | ||
524 | static bool __init load_builtin_intel_microcode(struct cpio_data *cp) | 521 | static bool __init load_builtin_intel_microcode(struct cpio_data *cp) |
525 | { | 522 | { |