Updating Intel Microcode within Linux

This document describes (roughly) how to update the Intel CPUs microcode within Linux. Normally this is done in your PCs BIOS but in a lot of cases a BIOS upgrade or even a reboot may not be possible.

Using microcode_ctl

Updating the microde is possible since 2000 using the microcode_ctl written by Tigran Aivazian available from the urbanmyth website1. It parses the microcode.dat file available from the Intel download site and sends the entire file to the kernel. The microcode module searches for any updates in the file appropriate for the current CPU and applies them to the CPU. For more info on this method read the documentation accompanying the tool.

The Hotplug Way

In September 2006 Shaohua Li added hotplug support eliminating the need for special userspace tools. However this method is not so well documented which is the purpose of this document. To use this method, you need to have hotplugging up and running. See the linux-hotplug2 site on how to do this.

Hotplug Firmware Agent

If you got hotplugging up and running, you need to install an agent for the firmware. Fortunately there is a simple but effective script for this included with the kernel source code. I created a directory /etc/hotplug.d/firmware/ and copied /usr/src/linux/Documentation/firmware_class/hotplug-script to /etc/hotplug.d/firmware/intel-ucode.hotplug. You may want to adjust the path to the firmware inside this script to /lib/firmware. A "make firmware_install" uses this directory as well.

The Firmware Files

With this new method the module requests for the firmware. But instead of checking all updates ever created by Intel for a match, the module request updates for specific type of CPU. I took the liberty of splitting up the latest intel microcode file dated 2008-09-10 into the CPU specific microcode updates. If you extract the file in the directory /lib/firmware (create it first if it doesnt exist) all files should fall neatly in place, that is a subdirectory called intel-ucode will be created with the required files in it.

References

  1. http://www.urbanmyth.org/microcode/
  2. http://linux-hotplug.sourceforge.net/
  3. Intel Manual (section 8.11)