[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y0/yOwXZGQ9q255E@a4bf019067fa.jf.intel.com>
Date: Wed, 19 Oct 2022 05:48:59 -0700
From: Ashok Raj <ashok.raj@...el.com>
To: "Huang, Kai" <kai.huang@...el.com>
CC: "tglx@...utronix.de" <tglx@...utronix.de>,
"bp@...en8.de" <bp@...en8.de>,
"thomas.lendacky@....com" <thomas.lendacky@....com>,
"Luck, Tony" <tony.luck@...el.com>,
"Van De Ven, Arjan" <arjan.van.de.ven@...el.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Pan, Jacob jun" <jacob.jun.pan@...el.com>,
"x86@...nel.org" <x86@...nel.org>, Ashok Raj <ashok.raj@...el.com>
Subject: Re: [PATCH 09/13] x86/microcode: Add a generic mechanism to declare
support for minrev
On Tue, Oct 18, 2022 at 09:03:03PM -0700, Huang, Kai wrote:
> On Fri, 2022-10-14 at 13:09 -0700, Ashok Raj wrote:
> > @@ -606,6 +606,7 @@ static ssize_t reload_store(struct device *dev,
> > enum ucode_state tmp_ret = UCODE_OK;
> > int bsp = boot_cpu_data.cpu_index;
> > unsigned long val;
> > + int minrev;
> > ssize_t ret = 0;
> >
> > ret = kstrtoul(buf, 0, &val);
> > @@ -621,8 +622,14 @@ static ssize_t reload_store(struct device *dev,
> > if (ret)
> > goto put;
> >
> > - pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
> > - pr_err("You should switch to early loading, if possible.\n");
> > + if (microcode_ops->check_minrev())
> > + minrev = microcode_ops->check_minrev();
> > +
> > + if (!minrev) {
> > + pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
> > + pr_err("You should switch to early loading, if possible.\n");
> > + }
> > +
>
> Hi Ashok,
>
> IIUC a variable in stack isn't initialized to 0 automatically. So looks if
> check_minrev() callback is NULL, you will get an uninitialized 'minrev' in the
> above if() statement check.
>
Thanks for the review Kai.
Correct, that's a miss. I originally had a weak function bound for AMD.
But later i removed and forgot to initialize the local variable.
I've already queued this for next post. Just waiting for a few more review
comments to come on.
Cheers,
Ashok
Powered by blists - more mailing lists