From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Borislav Petkov <bp@alien8.de>, H Peter Anvin <hpa@zytor.com>,
Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: BUG: early intel microcode update violating alignment rules
Date: Sat, 9 Aug 2014 20:19:11 -0300 [thread overview]
Message-ID: <20140809231911.GA4843@khazad-dum.debian.net> (raw)
Hello x86 maintainers,
While adding some paranoia to the Intel Microcode driver, I noticed the
early Intel microcode update driver is not enforcing a 16-byte alignment
when it attempts to send the microcode update data to the processor via
WRMSR 79H.
This 16-byte alignment requirement is stated in the Intel SDM, vol 3A,
section 9.11.6, page 9-34.
Apparently at least some of the recent processors don't need the full
16-byte alignment, as a microcode update that is NOT aligned to 16 bytes,
but which is aligned to 4 bytes seems to work fine on a Xeon X5550 and on a
2nd-gen Core i5.
I detected the problem by adding an alignment test in
apply_microcode_early(), on file arch/x86/kernel/microcode_intel_early.c:
if ((unsigned long)(mc_intel->bits) % 16)
return -1;
Which fired on the next reboot, skipping the early update on the BSP and
APs.
This will only happen when the microcode update file data inside the early
initramfs archive is not 16-byte aligned. Unfortunately, the cpio format
used in the early initramfs aligns the member file data just to 4-byte
boundaries.
Is there a way to fix this in the kernel for the BSP? We already have
several microcode updates that are >16KiB in size and they seem to be
getting bigger and bigger, so doing it on the stack is out.
Maybe there is a 64KiB scratch area that could be used just to get the BSP
microcode update done? vmalloc isn't available that early, but it can be
used to fix the issue for the APs.
--
"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
next reply other threads:[~2014-08-09 23:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-09 23:19 Henrique de Moraes Holschuh [this message]
2014-08-11 10:22 ` Borislav Petkov
2014-08-11 13:16 ` Henrique de Moraes Holschuh
2014-08-11 14:00 ` Borislav Petkov
2014-08-11 14:50 ` H. Peter Anvin
2014-08-11 18:52 ` Bill Davidsen
2014-08-11 19:15 ` Borislav Petkov
2014-08-14 13:12 ` Henrique de Moraes Holschuh
2014-08-11 14:51 ` H. Peter Anvin
2014-08-11 18:18 ` Henrique de Moraes Holschuh
2014-08-11 18:48 ` H. Peter Anvin
2014-08-31 19:45 ` early microcode: how to disable at runtime? Henrique de Moraes Holschuh
2014-08-31 19:48 ` H. Peter Anvin
2014-08-31 20:11 ` Henrique de Moraes Holschuh
2014-09-01 5:13 ` Borislav Petkov
2014-09-01 10:19 ` Henrique de Moraes Holschuh
2014-09-01 16:35 ` H. Peter Anvin
2014-09-01 17:43 ` Henrique de Moraes Holschuh
2014-09-01 18:48 ` H. Peter Anvin
2014-09-01 19:59 ` Henrique de Moraes Holschuh
2014-09-02 6:33 ` Borislav Petkov
2014-09-02 13:16 ` Henrique de Moraes Holschuh
2014-09-03 6:40 ` Borislav Petkov
2014-09-03 12:43 ` Henrique de Moraes Holschuh
2014-09-04 15:42 ` Borislav Petkov
2014-09-04 17:45 ` Henrique de Moraes Holschuh
2014-09-05 8:50 ` Borislav Petkov
2014-09-05 14:23 ` Henrique de Moraes Holschuh
2014-09-04 18:37 ` Yu, Fenghua
2014-09-05 8:52 ` Borislav Petkov
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=20140809231911.GA4843@khazad-dum.debian.net \
--to=hmh@hmh.eng.br \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--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
Powered by JetHome