Help: need to build a ramdisk with microcode to fix bug
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
According to the Arch wiki, you need to have the microcode option compiled into the kernel, not as a module. Unfortunately, Slackware compiles this as a module, so you'll likely need to rebuild your kernel with that option marked as a Y instead of M.
If that doesn't bloat the kernel too much, it would be nice if this could be picked up for Slackware.
An alternative is to hack your own BIOS that contains the new microcode: it's a bit fiddly, and requires various dodgy Windows utilities, and might be awkward or even impossible for UEFI, but it worked well for me to get round the Atom PSE erratum. I guess they invented CONFIG_MICROCODE_INTEL_EARLY to save us this pain.
7. Run LILO, reboot and pray for the system to boot again
Unfortunately, I cannot test if the microcode is applied properly, because my BIOS already has the latest available microcode in it. What I can confirm is that the initial ramdisk with the prepended microcode actually boots properly.
On stable kernel 3.10.17 the early Intel microcode update works without any change in the kernel configuration. I use the procedure described by atelszewski, and it really works. (Minor additions to step 4: iucode_tool requires the module cpuid: --not really needed now, see below
Also, I add the option --overwrite, otherwise iucode_tool can't write to /boot/ucode.cpio if this file already exists.)
Starting with 3.11 kernel added the support for AMD and the requirement CONFIG_MICROCODE=y. Unfortunately, the kernel config in Slackware-current have CONFIG_MICROCODE=m and hence CONFIG_MICROCODE_EARLY is disabled.
How does it manifest itself? Is iucode_tool complaining?
I'm running 4.1.10 without the cpuid module loaded (neither it's compiled-in) and it looks like everything is detected correctly
You are right, it works without cpuid module now. I found an explanation in the /usr/doc/iucode_tool-1.3/ChangeLog
Code:
2015-02-14, iucode_tool v1.2
[...]
* iucode_tool: use the cpuid instruction (via gcc's cpuid.h) directly
to implement --scan-system. This assumes there is only one
signature per x86/x86-64 system, which is a safe assumption at this
time. One can have processors with distinct pf flags and the same
signature in a x86/x86-64 multi-processor system, so --scan-system
will match any pf_mask. When compile-time configured with
--enable-cpuid-device (disabled by default), iucode-tool will use
the cpuid instruction directly and also scan every processor using
the kernel cpuid device. This fixes an scalability issue in systems
with many processors
BTW, I have updated the intel-microcode SlackBuild at SlackBuilds.org (it's in the approved queue as of 15 Oct 2015) so that, if you have iucode_tool installed, the microcode gets split and installed under /lib/firmware/intel-ucode.
It's important to have those files there, quote from iucode_tool man page:
Quote:
There are two microcode update kernel drivers in Linux: the early microcode update driver (which gets the microcode update data from a special uncompressed initramfs image) and the late microcode update driver, which gets microcode update data through the firmware subsystem.
The late microcode update driver should be present in the system at all times to ensure microcode updates are reapplied on resume from suspend and cpu hotplug, even when the early microcode update driver is used. Do not unload it, unless you really know better.
Updating microcode through the early driver is safer, but can only be done at boot. Using the early driver to update microcode is strongly recommended. The late microcode update driver can apply new microcode updates at any time, but it cannot safely apply any new microcode updates that would change visible processor features.
BTW, I have updated the intel-microcode SlackBuild at SlackBuilds.org (it's in the approved queue as of 15 Oct 2015) so that, if you have iucode_tool installed, the microcode gets split and installed under /lib/firmware/intel-ucode.
Thank you very much! I have one remark: strictly speaking, for version 14.1 the requirement:
Code:
3) make sure your kernel has the followings:
CONFIG_MICROCODE=y
CONFIG_MICROCODE_EARLY=y
CONFIG_MICROCODE_INTEL=y
CONFIG_MICROCODE_INTEL_EARLY=y
is not true. It suggests that the standard 14.1 kernel, which has 'CONFIG_MICROCODE=m', must be recompiled, but this is not the case. For 14.1 the standard configuration is OK.
Also, what do you think on the idea to produce also /boot/ucode.cpio (via iucode_tool --scan-system --overwrite --write-earlyfw=/boot/ucode.cpio)?
Addition:
I read about the /lib/firmware/intel-ucode. As far as I understand, this directory is needed in two situation:
1. when user/admin wants to update microcode manually via
2. when the CPU is changed physically (without a reboot).
In case of resume from S3 state it is not needed, because Documentation/x86/early-microcode.txt and Documentation/power/suspend-and-cpuhotplug.txt both claim that kernel uses the cached microcode.
In Debian, the README file tells that triggering an immediate microcode update (without a reboot) is dangerous:
In /lib/firmware/intel-ucode the files from this blacklist are renamed to 06-3c-02.initramfs, etc. The Debian NEWS files reads:
Quote:
Microcodes known to be dangerous have been renamed so that they will
not be found by the kernel. This is a reactive blacklisting: it is
unlikely to be complete at any point in time.
Thank you very much! I have one remark: strictly speaking, for version 14.1 the requirement:
Code:
3) make sure your kernel has the followings:
CONFIG_MICROCODE=y
CONFIG_MICROCODE_EARLY=y
CONFIG_MICROCODE_INTEL=y
CONFIG_MICROCODE_INTEL_EARLY=y
is not true. It suggests that the standard 14.1 kernel, which has 'CONFIG_MICROCODE=m', must be recompiled, but this is not the case. For 14.1 the standard configuration is OK.
OK, for the sake of argument let's just say you have to make sure the aforementioned configuration options are compiled-in.
I'm using config from -current, and there the options were set as =m.
Quote:
Also, what do you think on the idea to produce also /boot/ucode.cpio (via iucode_tool --scan-system --overwrite --write-earlyfw=/boot/ucode.cpio)?
Seems fine.
Quote:
Addition:
I read about the /lib/firmware/intel-ucode. As far as I understand, this directory is needed in two situation:
1. when user/admin wants to update microcode manually via
2. when the CPU is changed physically (without a reboot).
In case of resume from S3 state it is not needed, because Documentation/x86/early-microcode.txt and Documentation/power/suspend-and-cpuhotplug.txt both claim that kernel uses the cached microcode.
OK. Let's assume having the files under /lib/firmware/intel-ucode won't hurt you (see the comment below), but might be handy in some cases.
Quote:
In Debian, the README file tells that triggering an immediate microcode update (without a reboot) is dangerous:
In /lib/firmware/intel-ucode the files from this blacklist are renamed to 06-3c-02.initramfs, etc. The Debian NEWS files reads:
Quote:
Microcodes known to be dangerous have been renamed so that they will
not be found by the kernel. This is a reactive blacklisting: it is
unlikely to be complete at any point in time.
OK, so it seems that some of the ucode files might hurt you. This makes me uncomfortable, as it adds more maintenance burden to the intel-microcode.SlackBuild. I hate it I will have to investigate a little bit to see what it is all about and maybe incorporate the blacklisting in the SlackBuild, althoug at the moment I'm not a heavy user of the microcode, as my system has the latest one built-in into BIOS (so I even can't experiment).
OK, for the sake of argument let's just say you have to make sure the aforementioned configuration options are compiled-in.
I'm using config from -current, and there the options were set as =m.
Yes, people with -current and, generally, everybody who upgraded the kernel, must have these options compiled in. But people with the stock stable kernel 3.10.17 are to do nothing, for 3.10 everything works even if CONFIG_MICROCODE=m. So, I'd prepend something like "if you upgraded the stock slackware kernel" to "3) make sure your kernel has the followings:".
So, I'd prepend something like "if you upgraded the stock slackware kernel" to "3) make sure your kernel has the followings:".
I'm going to stick to my words. Today 3.10.x is the stock kernel, but in the future, 4.1.x is going to be the one We might generalize and say: "make sure CONFIG_MICROCODE_INTEL_EARLY=y (whatever the dependencies)".
Quote:
But people with the stock stable kernel 3.10.17 are to do nothing, for 3.10 everything works even if CONFIG_MICROCODE=m.
Indeed, looking at the kernel dependencies it turns out that CONFIG_MICROCODE=y is the requirement for 4.1.x but not for 3.10.x.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.