Re: [PATCH v4 6/6] x86/microcode/intel: Print when early microcode loading fails

From: Dave Hansen
Date: Tue Jan 17 2023 - 11:29:27 EST


On 1/17/23 08:12, Ashok Raj wrote:
> On Sun, Jan 15, 2023 at 08:05:14PM +0100, Borislav Petkov wrote:
>> On Mon, Jan 09, 2023 at 07:35:55AM -0800, Ashok Raj wrote:
>>> Currently when early microcode loading fails there is no way for the
>>> user to know that the update failed.
>> Of course there is - there's no early update message in dmesg.
> Sorry Boris, didn't comprehend.
>
> Without user making some additional steps to check the revision in the
> default location and the current rev reported to find the update failed.
>
> Maybe that's what you meant.

I think a better changelog might help here. The original was a bit too
absolute. There is, as Boris pointed out, a way to tell if a failure
occurred. But, that method is a bit unfriendly to our users.

--

When early microcode loading succeeds, the kernel prints a message via
print_ucode_info() that starts with 'early update:'. If loading fails,
apply_microcode_early() returns before that message is printed. This
means that users must know to go looking for that message. They can
infer a early microcode loading failure if they do not see the message.

That's not great for users. Instead of expecting them to infer this, be
more explicit about it. Instead of bailing out and returning from
apply_microcode_early(), stash the error code off and plumb it down to
print_ucode_info().

This ensures that a message of some kind is printed on all early loads:
successes *and* failures. This should make it easier for our hapless
users to figure out when a failure occurred.