Re: [patch V3 23/30] x86/microcode: Provide new control functions

From: Thomas Gleixner
Date: Tue Sep 26 2023 - 12:11:39 EST


On Sun, Sep 24 2023 at 08:58, Borislav Petkov wrote:
> On Tue, Sep 12, 2023 at 09:58:20AM +0200, Thomas Gleixner wrote:
>> +
>> + ret = microcode_ops->apply_microcode(cpu);
>> + this_cpu_write(ucode_ctrl.result, ret);
>> + this_cpu_write(ucode_ctrl.ctrl, SCTRL_DONE);
>
> Do that update...
>
>> +
>> + /*
>> + * If the update was successful, let the siblings run the apply()
>> + * callback. If not, tell them it's done. This also covers the
>> + * case where the CPU has uniform loading at package or system
>> + * scope implemented but does not advertise it.
>> + */
>> + if (ret == UCODE_UPDATED || ret == UCODE_OK)
>> + ctrl = SCTRL_APPLY;
>> + else
>> + ctrl = SCTRL_DONE;
>
> ... here, after having checked ret.

No. That's two different things. The write above stores the information
fir the current CPU, while this conditional constructs the command for
the siblings.