stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jari Ruusu <jari.ruusu@gmail.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>, Fenghua Yu <fenghua.yu@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	johannes.berg@intel.com, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: Fix built-in early-load Intel microcode alignment
Date: Mon, 13 Jan 2020 21:58:25 +0200	[thread overview]
Message-ID: <CACMCwJL8tu+GHPeRADR_12xhcYSiDv+Yxdy=yLqMxEsn=P9zFA@mail.gmail.com> (raw)
In-Reply-To: <20200113154739.GB11244@42.do-not-panic.com>

On 1/13/20, Luis Chamberlain <mcgrof@kernel.org> wrote:
> So what happens with you use the built-in firmware loader for
> the Intel microcode at this time? I am surprised this issue
> wasn't reported earlier, so thanks for picking it up, but to
> be complete such a change requires a bit more information.
>
> What exactly happens now?

Before that 16-byte alignment patch was applied, my only one
microcode built-in BLOB was "accidentally" 16-byte aligned.

After that patch was applied, new kernel System.map file was
exactly same. So, for me that patch did not change anything.

Same 16-byte alignment before and after patch:

$  grep " _fw_.*_bin" System.map
ffffffff81f55e90 r _fw_intel_ucode_06_8e_09_bin

>> Fix this by forcing all built-in firmware BLOBs to 16-byte
>> alignment.
>
> That's a huge stretch, see below.

I understand and to some degree agree.

> So I'd like to determine first if we really need this.

We do need it. Violating Intel specs is not good. It may be that
some processor models require aligned and some accept less
aligned.

> If set as a global new config option, we can use the same logic and
> allow an architecture override if the user / architecture kconfig
> configures it such:
>
> config ARCH_DEFAULT_FIRMWARE_ALIGNMENT
> 	string "Default architecture firmware aligmnent"
> 	"4" if 64BIT
> 	"3" if !64BIT
>
> config FIRMWARE_BUILTIN_ALIGN
> 	string "Built in firmware aligment requirement"
> 	default ARCH_DEFAULT_FIRMWARE_ALIGNMENT if !ARCH_CUSTOM_FIRMWARE_ALIGNMENT
> 	default ARCH_CUSTOM_FIRMWARE_ALIGNMENT_VAL if
> ARCH_CUSTOM_FIRMWARE_ALIGNMENT
> 	  Some good description goes here
>
> Or something like that.

It doesn't have to user visible config option, only default align
changed when selected set of options are enabled.

My patch was intentionally minimal, without #ifdef spaghetti.

-- 
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

  parent reply	other threads:[~2020-01-13 19:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12 13:00 Fix built-in early-load Intel microcode alignment Jari Ruusu
2020-01-12 13:03 ` Jari Ruusu
2020-01-12 14:02   ` Greg KH
2020-01-13  6:30     ` Jari Ruusu
2020-01-13  6:42       ` Greg KH
2020-01-13 15:47 ` Luis Chamberlain
2020-01-13 19:44   ` Linus Torvalds
2020-01-15  2:27     ` Luis Chamberlain
2020-01-18 20:10       ` Bjorn Andersson
2020-01-13 19:58   ` Jari Ruusu [this message]
2020-01-13 20:08     ` Borislav Petkov
2020-01-13 20:30       ` Jari Ruusu
2020-01-13 20:46         ` Borislav Petkov
2020-01-15  2:15     ` Luis Chamberlain
2020-01-15 18:46       ` Jari Ruusu
2020-01-15 18:58         ` Luis Chamberlain
2020-01-15 19:41           ` Linus Torvalds
2020-01-15 19:00         ` Andy Lutomirski
2020-01-15 19:15           ` Jari Ruusu
2020-01-15 19:49             ` Linus Torvalds
2020-01-16  6:55               ` Jari Ruusu
2020-01-16 19:16                 ` Raj, Ashok
2020-01-17  9:47                   ` Jari Ruusu
2020-02-03 20:10 ` Luis Chamberlain

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='CACMCwJL8tu+GHPeRADR_12xhcYSiDv+Yxdy=yLqMxEsn=P9zFA@mail.gmail.com' \
    --to=jari.ruusu@gmail.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).