Re: [patch V3 07/30] x86/microcode/intel: Simplify early loading

From: Borislav Petkov
Date: Tue Sep 19 2023 - 10:32:55 EST


On Tue, Sep 12, 2023 at 09:57:54AM +0200, Thomas Gleixner wrote:
> @@ -361,89 +356,75 @@ static bool load_builtin_intel_microcode
> return false;
> }
>
> -int __init save_microcode_in_initrd_intel(void)
> +static __init struct microcode_intel *get_ucode_from_cpio(struct ucode_cpu_info *uci)

This is not only cpio but the builtin crap too. Just call it
load_microcode_blobs() or so.

...

> -static struct microcode_intel *__load_ucode_intel(struct ucode_cpu_info *uci)
> +static int __init save_microcode_from_cpio(void)
> {
> - struct cpio_data cp;
> -
> - /* try built-in microcode first */
> - if (!load_builtin_intel_microcode(&cp))
> - cp = find_microcode_in_initrd(ucode_path);
> -
> - if (!(cp.data && cp.size))
> - return NULL;
> + struct microcode_intel *mc;
>
> - intel_cpu_collect_info(uci);
> + if (!ucode_early_pa)
> + return 0;
>
> - return scan_microcode(cp.data, cp.size, uci, false);
> + mc = __va((void *)ucode_early_pa);
> + save_microcode_patch(mc);
> + return 0;
> }
> +early_initcall(save_microcode_from_cpio);
>
> +/* Load microcode on BSP from CPIO */

Yeah, no need to say "from CPIO" everywhere. We load it from somewhere,
it can be cpio but it can be builtin too.

But I can fix up too when applying.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette