From: Andy Lutomirski <luto@amacapital.net>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Borislav Petkov <bp@alien8.de>,
Chuck Ebbert <cebbert.lkml@gmail.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: x86, microcode: BUG: microcode update that changes x86_capability
Date: Wed, 24 Sep 2014 08:00:43 -0700 [thread overview]
Message-ID: <CALCETrU3-iNqCOT7EArtB91zAZC6ChuVN1wF6LbtdUqpoyJ+ig@mail.gmail.com> (raw)
In-Reply-To: <20140924145658.GB31678@khazad-dum.debian.net>
On Wed, Sep 24, 2014 at 7:56 AM, Henrique de Moraes Holschuh
<hmh@hmh.eng.br> wrote:
> On Tue, 23 Sep 2014, Borislav Petkov wrote:
>> On Fri, Sep 19, 2014 at 01:42:17PM -0300, Henrique de Moraes Holschuh wrote:
>> > 1. offline a "guinea pig" group of "cpus", i.e. an entire "microcode update
>> > unit" that doesn't include the BSP. This is going to be a pain, as what
>> > composes a "microcode update unit" is not set in stone, and could change in
>> > a future microarch.
>>
>> I'm pretty sure it is very dangerous to run with different microcode
>> revisions on different cores. Your plan won't fly and I have hard time
>> understanding why one would do such thing even if it did work.
>
> I don't want that plan to fly, it is too complex and I wrote as much at
> the end of that email. I won't bother with the situations where it would
> be helpful, they're not very interesting.
>
>
> On the topic of microcode revision skew in a multi-processor system:
>
> For a long time we had an Extremely Bad userspace interface that required
> userspace to trigger the microcode update once per cpu, and it fetched the
> microcode from userspace once per cpu.
>
> This made for an absurdly large time window during which we'd have
> microcode revision skew across cpus, and yet nothing blew up sky-high. If
> microcode revision skew was not generally safe, we'd have had a lot of
> trouble already.
>
> In fact, we still run the system with microcode revision skew while the
> microcode update is taking place through the regular microcode driver, as
> it is serialized one cpu at a time, and the other cpus are active and
> running.
>
> I don't know about AMD, but on Intel, the time it takes to update the
> microcode on a core is anything but negligible[1], so the microcode
> version skew window still exists, and it is not small. It is much smaller
> than it once was, but it is still there.
>
> The only way to really minimize the risk of microcode version skew is to
> limit oneself to firmware and early initramfs microcode updates.
>
>> If we're going to have to hide stuff which software might be using, I
>> don't see a way around rebooting.
>
> Nor do I.
>
> But IMHO we still need to detect and do something smart when
> x86_capability changes due to a microcode update.
>
> And I'd really prefer it to be "update x86_capability, warn the user and
> carry on" for anything that is not going to crash the kernel. Several
> distros will really want this backported to -stable, as the older kernels
> cannot do early microcode updates.
>
I'm trying to see if Intel is willing to document any additional
controls for the TSX bits in this ucode. No word yet, but I might
hear something soon.
--Andy
>
> [1] Intel processors take from 200 thousand cycles to several million
> cycles per core to sucessfully apply a microcode update. Verified
> using get_cycles() right before and right after the WRMSR 0x79.
> Variance was really high, about 10%. My limited testing matched what
> has been previously reported by Ben Hawkes.
>
> --
> "One disk to rule them all, One disk to find them. One disk to bring
> them all and in the darkness grind them. In the Land of Redmond
> where the shadows lie." -- The Silicon Valley Tarot
> Henrique Holschuh
--
Andy Lutomirski
AMA Capital Management, LLC
next prev parent reply other threads:[~2014-09-24 15:02 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 13:52 x86, microcode: BUG: microcode update that changes x86_capability Henrique de Moraes Holschuh
2014-09-18 19:14 ` Andy Lutomirski
2014-09-18 19:53 ` Chuck Ebbert
2014-09-18 19:55 ` H. Peter Anvin
2014-09-18 20:06 ` Henrique de Moraes Holschuh
2014-09-19 0:13 ` Henrique de Moraes Holschuh
2014-09-19 0:23 ` Andy Lutomirski
2014-09-19 0:28 ` H. Peter Anvin
2014-09-19 1:00 ` Andy Lutomirski
2014-09-19 8:03 ` Borislav Petkov
2014-09-19 11:00 ` Henrique de Moraes Holschuh
2014-09-19 11:29 ` Borislav Petkov
2014-09-19 12:54 ` Chuck Ebbert
2014-09-19 13:14 ` Josh Boyer
2014-09-19 13:37 ` Chuck Ebbert
2014-09-19 15:00 ` Borislav Petkov
2014-09-19 16:13 ` Andy Lutomirski
2014-09-19 16:54 ` Henrique de Moraes Holschuh
2014-09-19 16:42 ` Henrique de Moraes Holschuh
2014-09-23 20:00 ` Borislav Petkov
2014-09-24 14:56 ` Henrique de Moraes Holschuh
2014-09-24 15:00 ` Andy Lutomirski [this message]
2014-09-24 17:45 ` Henrique de Moraes Holschuh
2014-09-24 17:48 ` Andy Lutomirski
2014-09-24 18:59 ` Henrique de Moraes Holschuh
2014-09-24 19:34 ` Andy Lutomirski
2014-09-25 8:57 ` Borislav Petkov
2014-09-25 8:51 ` Borislav Petkov
2014-09-25 11:36 ` Henrique de Moraes Holschuh
2014-09-25 12:10 ` Borislav Petkov
2014-09-25 14:40 ` Henrique de Moraes Holschuh
2014-09-25 14:56 ` Borislav Petkov
2014-09-25 15:30 ` Henrique de Moraes Holschuh
2014-09-25 15:50 ` Borislav Petkov
2014-09-25 16:41 ` Henrique de Moraes Holschuh
2014-09-25 16:57 ` Borislav Petkov
2014-09-25 17:09 ` Henrique de Moraes Holschuh
2014-09-19 13:51 ` Henrique de Moraes Holschuh
2014-09-19 14:49 ` Borislav Petkov
2014-09-19 17:22 ` Henrique de Moraes Holschuh
2014-09-19 22:35 ` Henrique de Moraes Holschuh
2014-09-29 11:51 ` Henrique de Moraes Holschuh
2014-09-19 9:56 ` Henrique de Moraes Holschuh
2014-09-19 16:11 ` Henrique de Moraes Holschuh
2014-09-22 0:37 ` Andi Kleen
2014-09-22 0:51 ` H. Peter Anvin
2014-09-22 0:58 ` Andi Kleen
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=CALCETrU3-iNqCOT7EArtB91zAZC6ChuVN1wF6LbtdUqpoyJ+ig@mail.gmail.com \
--to=luto@amacapital.net \
--cc=bp@alien8.de \
--cc=cebbert.lkml@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).