Re: [PATCH 2/2] x86/microcode: Rework early revisions reporting

From: Ashok Raj
Date: Thu Nov 30 2023 - 13:46:44 EST


Hi

Since the late load already announces the old and new revision in core.c

Now that early loading doesn't print the 'date' for Intel, does it make
sense to remove those for late-load as well?

Feel free to squash this into any patch you have in progress if that makes
sense.

On Wed, Nov 15, 2023 at 10:02:12PM +0100, Borislav Petkov wrote:

[snip]

> diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
> index 6024feb98d29..070426b9895f 100644
> --- a/arch/x86/kernel/cpu/microcode/intel.c
> +++ b/arch/x86/kernel/cpu/microcode/intel.c
> @@ -339,16 +339,9 @@ static enum ucode_state __apply_microcode(struct ucode_cpu_info *uci,
> static enum ucode_state apply_microcode_early(struct ucode_cpu_info *uci)
> {
> struct microcode_intel *mc = uci->mc;
> - enum ucode_state ret;
> - u32 cur_rev, date;
> + u32 cur_rev;
>
> - ret = __apply_microcode(uci, mc, &cur_rev);
> - if (ret == UCODE_UPDATED) {
> - date = mc->hdr.date;
> - pr_info_once("updated early: 0x%x -> 0x%x, date = %04x-%02x-%02x\n",
> - cur_rev, mc->hdr.rev, date & 0xffff, date >> 24, (date >> 16) & 0xff);
> - }
> - return ret;
> + return __apply_microcode(uci, mc, &cur_rev);
> }


From: Ashok Raj <ashok.raj@xxxxxxxxx>
Date: Wed, 29 Nov 2023 13:56:43 -0800
Subject: [PATCH 2/2] x86/microcode/intel: Remove the redundant microcode
updated message

After successful update, core.c/late_load_stop_cpus() prints a message as
shown below.

[ 215.386472] microcode: load: updated on 128 primary CPUs with 128 siblings
[ 215.394370] microcode: revision: 0x21000170 -> 0x21000190

Remove the redundant message.

Signed-off-by: Ashok Raj <ashok.raj@xxxxxxxxx>
---
arch/x86/kernel/cpu/microcode/intel.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 070426b9895f..5d6ea875b81b 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -457,12 +457,6 @@ static enum ucode_state apply_microcode_late(int cpu)
if (ret != UCODE_UPDATED && ret != UCODE_OK)
return ret;

- if (!cpu && uci->cpu_sig.rev != cur_rev) {
- pr_info("Updated to revision 0x%x, date = %04x-%02x-%02x\n",
- uci->cpu_sig.rev, mc->hdr.date & 0xffff, mc->hdr.date >> 24,
- (mc->hdr.date >> 16) & 0xff);
- }
-
cpu_data(cpu).microcode = uci->cpu_sig.rev;
if (!cpu)
boot_cpu_data.microcode = uci->cpu_sig.rev;
--
2.39.2