* [PATCH] x86/ucode: log blob date also for AMD
@ 2021-04-01 8:28 Jan Beulich
2021-04-01 11:22 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-04-01 8:28 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné
Like Intel, AMD also records the date in their blobs. The field was
merely misnamed as "data_code" so far; this was perhaps meant to be
"date_code". Split it into individual fields, just like we did for Intel
some time ago, and extend the message logged after a successful update.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -33,7 +33,9 @@ struct equiv_cpu_entry {
};
struct microcode_patch {
- uint32_t data_code;
+ uint16_t year;
+ uint8_t day;
+ uint8_t month;
uint32_t patch_id;
uint8_t mc_patch_data_id[2];
uint8_t mc_patch_data_len;
@@ -251,8 +253,9 @@ static int apply_microcode(const struct
return -EIO;
}
- printk(XENLOG_WARNING "microcode: CPU%u updated from revision %#x to %#x\n",
- cpu, old_rev, rev);
+ printk(XENLOG_WARNING
+ "microcode: CPU%u updated from revision %#x to %#x, date = %04x-%02x-%02x\n",
+ cpu, old_rev, rev, patch->year, patch->month, patch->day);
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/ucode: log blob date also for AMD
2021-04-01 8:28 [PATCH] x86/ucode: log blob date also for AMD Jan Beulich
@ 2021-04-01 11:22 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2021-04-01 11:22 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monné
On 01/04/2021 09:28, Jan Beulich wrote:
> Like Intel, AMD also records the date in their blobs. The field was
> merely misnamed as "data_code" so far; this was perhaps meant to be
> "date_code". Split it into individual fields, just like we did for Intel
> some time ago, and extend the message logged after a successful update.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This was on my todo list, but I'd not got around to it yet. There are
several legitimate microcode blobs with incorrect dates.
One has a date with a year earlier than its predecessor or successor,
and two have day/month transpositions. One transposition is obvious,
having a 13 in it, while the other is ambiguous and guessed based on
when the ucode was available.
I wasn't going to bother doing anything about this, but it is something
to be aware of if we get queries of wonky looking dates.
~Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-01 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 8:28 [PATCH] x86/ucode: log blob date also for AMD Jan Beulich
2021-04-01 11:22 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).