Re: [PATCH 1/6] x86/microcode: Introduce staging option to reduce late-loading latency

From: Borislav Petkov
Date: Mon Feb 17 2025 - 08:35:31 EST


On Tue, Dec 10, 2024 at 05:42:07PM -0800, Chang S. Bae wrote:
> static int load_late_locked(void)
> {
> + bool is_safe = false;
> +
> if (!setup_cpus())
> return -EBUSY;
>
> switch (microcode_ops->request_microcode_fw(0, &microcode_pdev->dev)) {
> case UCODE_NEW:
> - return load_late_stop_cpus(false);
> + break;
> case UCODE_NEW_SAFE:
> - return load_late_stop_cpus(true);
> + is_safe = true;
> + break;
> case UCODE_NFOUND:
> return -ENOENT;
> default:
> return -EBADFD;
> }
> +
> + if (microcode_ops->use_staging)
> + microcode_ops->stage_microcode();
> +
> + return load_late_stop_cpus(is_safe);
> }

Why are you even touching this function instead of doing the staging in the
beginning of load_late_stop_cpus()?

--
Regards/Gruss,
Boris.

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