Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 08:57:16 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Oliver Pinter <oliver.pinter@hardenedbsd.org>
Cc:        Eitan Adler <lists@eitanadler.com>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, src-committers <src-committers@freebsd.org>
Subject:   Re: svn commit: r334046 - head/tools/tools/intel-ucode-split
Message-ID:  <20180617125715.GC18322@pesky.lan>
In-Reply-To: <CAPQ4fftS_drJ_dWHfbQK_YKBjCNJ2jPJbLr-EGR_y3MdzpOr4w@mail.gmail.com>
References:  <201805221435.w4MEZXnW041963@repo.freebsd.org> <CAPQ4ffuciB50cdr3MP1H9xYzM1Y_SqFhCP6QVkaDiaYeTcHyNQ@mail.gmail.com> <de0d9337-5587-07bf-5ce4-84c855eeec41@freebsd.org> <CAPyFy2B3FgB_MwphmZMg4eqhnygVBS5HacaJXM7aGuOhy8LE9w@mail.gmail.com> <CAPQ4ffsKFKMtDX=PiQ6MONy_Sk4OAGgT%2BAbK-N__yQMA9dXHQg@mail.gmail.com> <20180613140731.GA54540@raichu> <CAF6rxgnx_2frDi%2B1g5_UmRgH_oxbVhdGfkPZdxCXTxp0fkNAxg@mail.gmail.com> <20180617123634.GB18322@pesky.lan> <CAPQ4fftS_drJ_dWHfbQK_YKBjCNJ2jPJbLr-EGR_y3MdzpOr4w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 17, 2018 at 02:50:44PM +0200, Oliver Pinter wrote:
> On Sunday, June 17, 2018, Mark Johnston <markj@freebsd.org> wrote:
> 
> > On Sat, Jun 16, 2018 at 06:25:03PM -0700, Eitan Adler wrote:
> > > On 13 June 2018 at 07:07, Mark Johnston <markj@freebsd.org> wrote:
> > > > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote:
> > > >> I'm considering to write an in kernel microcode update facility,
> > based on
> > > >> firmware(9), and in first idea it would be nice during the generation
> > of
> > > >> firmware modules.
> > > >
> > > > FWIW, I'm working on this for 12.0 and was planning to describe my
> > > > proposal on -arch in the next couple of weeks.  For my purposes at
> > > > least, firmware(9) isn't suitable.  We'd like to ensure that updates
> > are
> > > > applied before the kernel does CPU identification, and that happens
> > > > quite early during boot.  This places some constraints on the
> > > > implementation which exclude firmware(9).
> > >
> > > Naive question, knowing nothing about firmware(9), but why can't it be
> > > enhanced to work that early? It seems there might be other use-cases
> > > for very-early-boot firmware application.
> >
> > The constraint means that almost none of the standard kernel APIs (e.g.,
> > malloc()) are usable at the time that the update is to be applied.  It
> > doesn't seem practical to me to try and implement firmware(9)'s
> > abstractions under such limitations.  Further, because microcode
> > updating is an platform-specific operation, in this case it's preferable
> > to tie the implementation to that platform's code.
> 
> 
> How do you plan to put the firmware into memory? Preload it with the loader
> or compile into kernel module or with somehow early fs access from kernel?
> 
> Or instead of updating the microcode from kernel, do the whole process from
> the loader?
> This will be problematic in resume case.

The loader can be instructed to load arbitrary files into memory before
beginning execution of the kernel.  Currently, my plan is to check for a
loaded microcode file early in the MD startup code, and apply the update
if one is present.  This will be done following a resume as well.



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