struct microcode_intel **mc_saved;
} mc_saved_data;
-static struct microcode_intel bsp_patch;
-
static enum ucode_state
generic_load_microcode_early(struct microcode_intel **mc_saved_p,
unsigned int mc_saved_count,
unsigned long *mc_saved_in_initrd,
unsigned long initrd_start_early,
unsigned long initrd_end_early,
- struct ucode_cpu_info *uci,
- struct microcode_intel *bsp)
+ struct ucode_cpu_info *uci)
{
enum ucode_state ret;
ret = load_microcode(mc_saved_data, mc_saved_in_initrd,
initrd_start_early, uci);
- if (ret == UCODE_OK) {
+ if (ret == UCODE_OK)
apply_microcode_early(uci, true);
- memcpy(bsp, uci->mc, sizeof(*bsp));
- }
}
void __init
u64 ramdisk_image, ramdisk_size;
unsigned long initrd_start_early, initrd_end_early;
struct ucode_cpu_info uci;
- struct microcode_intel *bsp_p;
#ifdef CONFIG_X86_32
struct boot_params *boot_params_p;
boot_params_p = (struct boot_params *)__pa_nodebug(&boot_params);
- bsp_p = (struct microcode_intel *)__pa_nodebug(&bsp_patch);
ramdisk_image = boot_params_p->hdr.ramdisk_image;
ramdisk_size = boot_params_p->hdr.ramdisk_size;
initrd_start_early = ramdisk_image;
_load_ucode_intel_bsp(
(struct mc_saved_data *)__pa_nodebug(&mc_saved_data),
(unsigned long *)__pa_nodebug(&mc_saved_in_initrd),
- initrd_start_early, initrd_end_early, &uci, bsp_p);
+ initrd_start_early, initrd_end_early, &uci);
#else
- bsp_p = &bsp_patch;
ramdisk_image = boot_params.hdr.ramdisk_image;
ramdisk_size = boot_params.hdr.ramdisk_size;
initrd_start_early = ramdisk_image + PAGE_OFFSET;
_load_ucode_intel_bsp(&mc_saved_data, mc_saved_in_initrd,
initrd_start_early, initrd_end_early,
- &uci, bsp_p);
+ &uci);
#endif
}
void reload_ucode_intel(void)
{
struct ucode_cpu_info uci;
+ enum ucode_state ret;
- if (!bsp_patch.hdr.rev)
+ if (!mc_saved_data.mc_saved_count)
return;
- uci.mc = &bsp_patch;
+ collect_cpu_info_early(&uci);
+
+ ret = generic_load_microcode_early(mc_saved_data.mc_saved,
+ mc_saved_data.mc_saved_count, &uci);
+ if (ret != UCODE_OK)
+ return;
apply_microcode_early(&uci, false);
}