Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2018 11:01:36 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Alexey Dokuchaev <danfe@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r338687 - in head/sys: dev/cpuctl x86/include x86/x86
Message-ID:  <20180918150135.GC93504@raichu>
In-Reply-To: <20180918081735.GA44081@FreeBSD.org>
References:  <201809141704.w8EH4aKd075044@repo.freebsd.org> <20180918081735.GA44081@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180918150135.GC93504>