Re: [PATCH 2/2] x86/microcode: Add a "microcode=" command line option

From: Ashok Raj
Date: Fri Jun 09 2023 - 11:37:37 EST


On Fri, Jun 09, 2023 at 02:28:28PM +0200, Borislav Petkov wrote:
> On Wed, Jun 07, 2023 at 06:55:39PM -0700, Ashok Raj wrote:
> > When end user changes the behavior, isn't it against the design
> > specification? And if so, should that result in kernel being tainted
> > after a reload?
>
> That's a chicken bit and should not be used usually. I'm adding it just
> in case.

How about a debugfs opt-out instead? Say something like

/sys/kernel/debug/microcode/debug_control?

Since the code doesn't use this in the early loading, it appears we can
drop the cmdline entirely?

>
> > Is this reload on all threads required by all models, or only certain
> > models? I was wondering if the forced reload could be limited to only
> > affected CPUs instead of doing it on all unconditionally.
>
> Unconditionally.

Thanks, this simplifies.

Since this is quite different from what the "typical" HT behavior w.r.t ,
microcode, maybe good to document this behavior in microcode.rst.

If the user switches the expected flow, should the code "taint" if its opted out?

>
> > Shouldn't the "control" be under LATE_LOADING? Since this only controls
> > late-loading behavior?
>
> No, that's a bitfield and is going to be used for other flags, if
> needed and which are not necessarily late-loading related.

My .000002c. Maybe add such sysfs control only when we really need one,
but should not include debug use.