Re: [Patch v3 Part2 3/9] x86/microcode/intel: Fix collect_cpu_info() to reflect current microcode

From: Borislav Petkov
Date: Tue Jan 31 2023 - 15:40:49 EST


On Tue, Jan 31, 2023 at 05:34:14PM +0000, Luck, Tony wrote:
> But those get out of step when applying ucode on one logical CPU does
> an update to other(s) (in this case the HT sibling for the same core).

They shouldn't.

I presume you're talking about late update. If so and if it finds a
patch in the cache, it'll do this:

apply_microcode_intel:

/*
* Save us the MSR write below - which is a particular expensive
* operation - when the other hyperthread has updated the microcode
* already.
*/
rev = intel_get_microcode_revision();
if (rev >= mc->hdr.rev) {
ret = UCODE_OK;
goto out;
}

and at the out: label it'll update the revision.

--
Regards/Gruss,
Boris.

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