svn commit: r338687 - in head/sys: dev/cpuctl x86/include x86/x86
Mark Johnston
markj at freebsd.org
Tue Sep 18 15:01:42 UTC 2018
On Tue, Sep 18, 2018 at 08:17:35AM +0000, Alexey Dokuchaev wrote:
> On Fri, Sep 14, 2018 at 05:04:36PM +0000, Mark Johnston wrote:
> > New Revision: 338687
> > URL: https://svnweb.freebsd.org/changeset/base/338687
> >
> > Log:
> > Log a message after a successful boot-time microcode update.
>
> Unfortunately, this had pessimized things on the unsuccessful side a bit.
> (See below.)
>
> > ...
> > @@ -130,36 +148,26 @@ ucode_intel_verify(struct ucode_intel_header *hdr, siz
> > uint32_t cksum, *data, size;
> > int i;
> >
> > - if (resid < sizeof(struct ucode_intel_header)) {
> > - log_err("truncated update header");
> > + if (resid < sizeof(struct ucode_intel_header))
> > return (1);
> > - }
> > size = hdr->total_size;
> > if (size == 0)
> > size = UCODE_INTEL_DEFAULT_DATA_SIZE +
> > sizeof(struct ucode_intel_header);
> >
> > - if (hdr->header_version != 1) {
> > - log_err("unexpected header version %u", hdr->header_version);
> > + if (hdr->header_version != 1)
> > return (1);
> > - }
> > - if (size % 16 != 0) {
> > - log_err("unexpected update size %u", hdr->total_size);
> > + if (size % 16 != 0)
> > return (1);
> > - }
> > - if (resid < size) {
> > - log_err("truncated update");
> > + if (resid < size)
> > return (1);
> > - }
> >
> > cksum = 0;
> > data = (uint32_t *)hdr;
> > for (i = 0; i < size / sizeof(uint32_t); i++)
> > cksum += data[i];
> > - if (cksum != 0) {
> > - log_err("checksum failed");
> > + if (cksum != 0)
> > return (1);
> > - }
> > return (0);
>
> Looks like previous error messages were more detailed (truncated header,
> unexpected version or size, truncated update, checksum mismatch). Now
> it all falls under "microcode verification failed". Was this intentional?
It was intentional. It simplified the logging mechanism a bit, and
diagnosis of update verification can be done more easily in userland
anyway. I should have mentioned this change in the commit log.
More information about the svn-src-all
mailing list