public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <andi@firstfloor.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/microcode: Handle negative microcode revisions
Date: Thu, 25 Oct 2018 16:51:02 -0700	[thread overview]
Message-ID: <20181025235102.GK6218@tassilo.jf.intel.com> (raw)
In-Reply-To: <20181020174109.GE28301@zn.tnic>

On Sat, Oct 20, 2018 at 07:41:36PM +0200, Borislav Petkov wrote:
> Dropping stable.
> 
> On Sat, Oct 20, 2018 at 07:41:58AM -0700, Andi Kleen wrote:
> > From: Andi Kleen <ak@linux.intel.com>
> > 
> > The Intel microcode revision space is unsigned. Inside Intel there are special
> > microcodes that have the highest bit set, and they are considered to have
> > a higher revision than any microcodes that don't have this bit set.
> > 
> > The function comparing the microcode revision in the Linux driver compares
> > u32 with int, which ends up being signed extended to long on 64bit
> > systems. This results in these highest bit set microcode revision not loading
> > because their revision appears negative and smaller than the
> > existing microcode.
> > 
> > Change the comparison to unsigned. With that the loading works
> > as expected.
> > 
> > Cc: stable@vger.kernel.org # Any supported stable
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > --
> > v2: White space changes.
> > ---
> >  arch/x86/kernel/cpu/microcode/intel.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
> > index 16936a24795c..e54d402500d3 100644
> > --- a/arch/x86/kernel/cpu/microcode/intel.c
> > +++ b/arch/x86/kernel/cpu/microcode/intel.c
> > @@ -93,7 +93,8 @@ static int find_matching_signature(void *mc, unsigned int csig, int cpf)
> >  /*
> >   * Returns 1 if update has been found, 0 otherwise.
> >   */
> > -static int has_newer_microcode(void *mc, unsigned int csig, int cpf, int new_rev)
> > +static int has_newer_microcode(void *mc, unsigned int csig, int cpf,
> > +			       unsigned new_rev)
> >  {
> >  	struct microcode_header_intel *mc_hdr = mc;
> >  
> > -- 
> 
> Please incorporate all review comments before sending a new version of
> your patch.

I replaced one more microcodes with microcodes revisions if that is
what you meant.

-Andi

      reply	other threads:[~2018-10-25 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20 14:41 [PATCH v2] x86/microcode: Handle negative microcode revisions Andi Kleen
2018-10-20 17:41 ` Borislav Petkov
2018-10-25 23:51   ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181025235102.GK6218@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox