Upgrade the CPU microcode on Debian

When looking at your system's logs, you may notice the following advice in the Linux kernel logs:

perf_event_intel: PEBS disabled due to CPU errata, please upgrade microcode

If you are running Debian, you just have to install two packages to fix the problem: intel-microcode and iucode-tool. With these packages installed, the Linux kernel automagically upgrades the microcode during the boot sequence.

microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
platform microcode: firmware: agent loaded intel-ucode/06-2a-07 into memory
microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23
microcode: CPU0 updated to revision 0x28, date = 2012-04-24

Now that the CPU microcode is up-to-date on your computer, let's see what microcode is and why it matters.

What is microcode?

Software has bugs. Hardware has bugs too. However, it is easier to fix a software bug than a hardware design defect in a CPU because software can be updated whereas a CPU must be replaced.

Intel documents its design defects and errors as errata. Upgrading the CPU's microcode can fix some of these problems.

Microcode is a very low-level construct: it is a program that defines the control logic of the CPU. As such, microprogramming is lower-level than assembly programming. You can consider the assembly language instruction set as the CPU's API which is publicly documented whereas the microcode defines the implementation of an instruction for a specific CPU. Moreover, Intel's microcode is mostly a black box and only Intel's engineers have enough knowledge to write it.

The BIOS or EFI firmware often update the CPU microcode. But for many computers, vendors do not supply new firmware. Fortunately, the operating system can update the microcode itself. It has to apply the update at every boot because the new microcode is lost after a CPU hard reset.

For more information about Intel's microcode, you can read: