Re: [PATCH] x86/microcode: Remove useless code after early microcode support added

From: Borislav Petkov
Date: Tue Apr 02 2019 - 11:35:32 EST


On Mon, Apr 01, 2019 at 04:46:52PM +0800, Zhenzhong Duan wrote:
> After early microcode update was added, microcode couldn't be configured

No, early loading doesn't have anything to do with it - the driver was
made built-in only.

> as a module, microcode update happens at early bootup and cpu hotplug
> stage. This made the microcode update code in module loading stage
> useless.
>
> This patch

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

> remove the useless code.

Well, not useless.

1. Apply your patch, boot kernel without an initrd so that it doesn't
apply early microcode.

2. Load late microcode:

# echo 1 > /sys/devices/system/cpu/microcode/reload
[ 66.430052] microcode: CPU0: new patch_level=0x05000029
[ 66.430352] x86/CPU: CPU features have changed after loading microcode, but might not take effect.
[ 66.430620] microcode: Reload completed, microcode revision: 0x5000029

3.
# grep microcode /proc/cpuinfo
microcode : 0x5000029
microcode : 0x5000028 <--- !!!

Whoops. CPU1 didn't get updated.

So I'd suggest leaving this code alone and concentrating on fixing real
bugs. Unless it is causing other issues.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.